hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f702ff27609b10993b2ffa9f4f5f3c2f75bb82b0 | 1,270 | py | Python | pyvisdk/do/host_file_system_volume.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_file_system_volume.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/host_file_system_volume.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostFileSystemVolume(vim, *args, **kwargs):
'''Detailed information about a file syst... | 35.277778 | 124 | 0.649606 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
| true | true |
f702ffed102d32e3915d2369681024fbb76b53f6 | 1,994 | py | Python | backend/builder/build_db_node_mode.py | blast-eu-com/blast.eu.com | 90f14c694c0cc523949b553623a631bc0b202bd0 | [
"Apache-2.0"
] | null | null | null | backend/builder/build_db_node_mode.py | blast-eu-com/blast.eu.com | 90f14c694c0cc523949b553623a631bc0b202bd0 | [
"Apache-2.0"
] | null | null | null | backend/builder/build_db_node_mode.py | blast-eu-com/blast.eu.com | 90f14c694c0cc523949b553623a631bc0b202bd0 | [
"Apache-2.0"
] | null | null | null | #!../bin/python3
# -*- coding:utf-8 -*-
"""
Copyright 2021 Jerome DE LUCCHI
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 ... | 30.212121 | 174 | 0.664493 |
import os
import sys
import json
from env import _SERVER_DIR
sys.path.insert(0, _SERVER_DIR)
from api import db
__DATAMODEL_DIR = os.path.join(os.path.abspath('..'), 'datamodel')
__DATAMODEL_NODE_MODE_FILE = os.path.join(__DATAMODEL_DIR, 'node_mode.template.mapping')
__ES_ADDR = db.ES_PROTOCOL + """://""" + str(db.... | true | true |
f703000bbea298bd87b433179d83258c0772e508 | 756 | py | Python | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/__init__.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | 2 | 2016-04-03T06:30:45.000Z | 2017-05-22T08:36:54.000Z | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/__init__.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | null | null | null | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/__init__.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | 1 | 2021-11-04T22:07:43.000Z | 2021-11-04T22:07:43.000Z | # ext/declarative/__init__.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .api import declarative_base, synonym_for, comparable_using, \
... | 39.789474 | 73 | 0.744709 |
from .api import declarative_base, synonym_for, comparable_using, \
instrument_declarative, ConcreteBase, AbstractConcreteBase, \
DeclarativeMeta, DeferredReflection, has_inherited_table,\
declared_attr, as_declarative
__all__ = ['declarative_base', 'synonym_for', 'has_inherited_table',
... | true | true |
f70300779170cca42d3422649546d22ba7c9f52f | 1,594 | py | Python | eelbrain/_stats/tests/test_spm.py | reddigari/Eelbrain | 6c02b99955d4b5dc7e3054042c182e1a4629b13c | [
"BSD-3-Clause"
] | null | null | null | eelbrain/_stats/tests/test_spm.py | reddigari/Eelbrain | 6c02b99955d4b5dc7e3054042c182e1a4629b13c | [
"BSD-3-Clause"
] | null | null | null | eelbrain/_stats/tests/test_spm.py | reddigari/Eelbrain | 6c02b99955d4b5dc7e3054042c182e1a4629b13c | [
"BSD-3-Clause"
] | null | null | null | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
import pickle
from nose.tools import eq_
import numpy as np
from numpy.testing import assert_array_equal
from eelbrain import datasets
from eelbrain._stats.spm import LM, LMGroup
def test_lm():
ds = datasets.get_uts()
model = ds.eval("A*B*Y")
coeff... | 30.075472 | 89 | 0.598494 |
import pickle
from nose.tools import eq_
import numpy as np
from numpy.testing import assert_array_equal
from eelbrain import datasets
from eelbrain._stats.spm import LM, LMGroup
def test_lm():
ds = datasets.get_uts()
model = ds.eval("A*B*Y")
coeffs = ds['uts'].ols(model)
lm = LM('uts', 'A*B*Y', ds... | true | true |
f70301afabd0286d6dde0df8be28927b57a173c6 | 1,728 | py | Python | armada/exceptions/lint_exceptions.py | sktelecom-oslab/armada | ebc71ff8eca7ecf0560493d5cdafc14e34c783c9 | [
"Apache-2.0"
] | null | null | null | armada/exceptions/lint_exceptions.py | sktelecom-oslab/armada | ebc71ff8eca7ecf0560493d5cdafc14e34c783c9 | [
"Apache-2.0"
] | null | null | null | armada/exceptions/lint_exceptions.py | sktelecom-oslab/armada | ebc71ff8eca7ecf0560493d5cdafc14e34c783c9 | [
"Apache-2.0"
] | 2 | 2018-05-28T13:00:42.000Z | 2021-09-02T07:28:59.000Z | # Copyright 2017 The Armada Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 27.870968 | 74 | 0.735532 |
from armada.exceptions import base_exception
class LintException(base_exception.ArmadaBaseException):
message = 'An unknown linting error occurred.'
class InvalidManifestException(LintException):
message = 'Armada manifest invalid.'
class InvalidChartNameException(LintException):
mess... | true | true |
f70301cabf33a749c00bb53322ef295333499300 | 4,467 | py | Python | code-tf2/encoders/message_gcns/gcn_basis.py | manas96/RelationPrediction | 06be62a55554971d1b523dc555f4c8616c21c664 | [
"MIT"
] | null | null | null | code-tf2/encoders/message_gcns/gcn_basis.py | manas96/RelationPrediction | 06be62a55554971d1b523dc555f4c8616c21c664 | [
"MIT"
] | null | null | null | code-tf2/encoders/message_gcns/gcn_basis.py | manas96/RelationPrediction | 06be62a55554971d1b523dc555f4c8616c21c664 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from common.shared_functions import dot_or_lookup, glorot_variance, make_tf_variable, make_tf_bias
from encoders.message_gcns.message_gcn import MessageGcn
class BasisGcn(MessageGcn):
def parse_settings(self):
self.dropout_keep_probability = float(self.settings... | 47.021053 | 122 | 0.74681 | import numpy as np
import tensorflow as tf
from common.shared_functions import dot_or_lookup, glorot_variance, make_tf_variable, make_tf_bias
from encoders.message_gcns.message_gcn import MessageGcn
class BasisGcn(MessageGcn):
def parse_settings(self):
self.dropout_keep_probability = float(self.settings... | true | true |
f70303ae169cee1d118069e7b9e0609229c086e8 | 3,699 | py | Python | cli.py | bormiopoli/mix_blockchain_network | bfa9a2b5f6d954883ffb6c3542989bfc272c5c20 | [
"MIT"
] | 1 | 2021-03-11T16:57:42.000Z | 2021-03-11T16:57:42.000Z | cli.py | bormiopoli/mix_blockchain_network | bfa9a2b5f6d954883ffb6c3542989bfc272c5c20 | [
"MIT"
] | null | null | null | cli.py | bormiopoli/mix_blockchain_network | bfa9a2b5f6d954883ffb6c3542989bfc272c5c20 | [
"MIT"
] | null | null | null | import hashlib
import datetime
import json
import uuid
from hashlib import sha256
from sys import version_info as pyVersion
from binascii import hexlify, unhexlify
from wallet import *
from func.send_message import send_message
from func.send_coin import send_coin
from func.node_connection import *
from lib... | 29.592 | 290 | 0.656394 | import hashlib
import datetime
import json
import uuid
from hashlib import sha256
from sys import version_info as pyVersion
from binascii import hexlify, unhexlify
from wallet import *
from func.send_message import send_message
from func.send_coin import send_coin
from func.node_connection import *
from lib... | true | true |
f70303d3f564d36a16f59efccc0cc2b001f36690 | 5,839 | py | Python | utils/flow.py | Leo-xxx/Deep-Flow-Guided-Video-Inpainting | fe58b6d0eaa3f9d59e9aca197d166b677a6a6c6a | [
"MIT"
] | 2,072 | 2019-05-10T01:39:24.000Z | 2022-03-31T05:44:34.000Z | utils/flow.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | 94 | 2019-05-31T08:54:32.000Z | 2022-03-11T23:53:00.000Z | utils/flow.py | RexBarker/Deep-Flow | 6310007009d2bfe150f1e4b29c7588f720c4bba2 | [
"MIT"
] | 412 | 2019-05-10T05:47:48.000Z | 2022-03-21T07:19:01.000Z | import numpy as np
import cv2
def make_colorwheel():
'''
Generates a color wheel for optical flow visualization as presented in:
Baker et al. "A Database and Evaluation Methodology for Optical Flow" (ICCV, 2007)
URL: http://vision.middlebury.edu/flow/flowEval-iccv07.pdf
According to the C... | 31.224599 | 90 | 0.554033 | import numpy as np
import cv2
def make_colorwheel():
RY = 15
YG = 6
GC = 4
CB = 11
BM = 13
MR = 6
ncols = RY + YG + GC + CB + BM + MR
colorwheel = np.zeros((ncols, 3))
col = 0
colorwheel[0:RY, 0] = 255
colorwheel[0:RY, 1] = np.floor(255 * np.arange(0, RY) / RY)
... | true | true |
f70309b3062804015197c248bb55f8798addb560 | 9,360 | py | Python | pytorch/torch/distributed/launch.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | pytorch/torch/distributed/launch.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | 1 | 2019-07-22T09:48:46.000Z | 2019-07-22T09:48:46.000Z | pytorch/torch/distributed/launch.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | r"""
`torch.distributed.launch` is a module that spawns up multiple distributed
training processes on each of the training nodes.
The utility can be used for single-node distributed training, in which one or
more processes per node will be spawned. The utility can be used for either
CPU training or GPU training. If th... | 39.661017 | 93 | 0.65 |
import sys
import subprocess
import os
from argparse import ArgumentParser, REMAINDER
def parse_args():
parser = ArgumentParser(description="PyTorch distributed training launch "
"helper utilty that will spawn up "
"multiple distrib... | true | true |
f7030a2548771cfe1fc406bf93ce331585a26470 | 1,615 | py | Python | runtime/bamboo-pipeline/test/eri_imp_test_use/tests/control/test_retry_subprocess.py | DomineCore/bamboo-engine | fb4583e70f9e1e87d9d48c2393db8d8104306f37 | [
"MIT"
] | 1 | 2022-01-06T15:44:43.000Z | 2022-01-06T15:44:43.000Z | runtime/bamboo-pipeline/test/eri_imp_test_use/tests/control/test_retry_subprocess.py | DomineCore/bamboo-engine | fb4583e70f9e1e87d9d48c2393db8d8104306f37 | [
"MIT"
] | null | null | null | runtime/bamboo-pipeline/test/eri_imp_test_use/tests/control/test_retry_subprocess.py | DomineCore/bamboo-engine | fb4583e70f9e1e87d9d48c2393db8d8104306f37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from bamboo_engine.builder import * # noqa
from bamboo_engine.engine import Engine
from pipeline.eri.runtime import BambooDjangoRuntime
from ..utils import * # noqa
def test_retry_subprocess():
subproc_start = EmptyStartEvent()
subproc_act = ServiceActivity(component_code="debug_no... | 29.907407 | 97 | 0.713313 |
from bamboo_engine.builder import *
from bamboo_engine.engine import Engine
from pipeline.eri.runtime import BambooDjangoRuntime
from ..utils import *
def test_retry_subprocess():
subproc_start = EmptyStartEvent()
subproc_act = ServiceActivity(component_code="debug_node")
subproc_end = EmptyEndEven... | true | true |
f7030a2f06200602ce7f131372fa021f6a707ddc | 2,066 | py | Python | pylearn2/cross_validation/blocks.py | BouchardLab/pylearn2 | 4cab785b870d22cd9e85a5f536d4cac234b6bf60 | [
"BSD-3-Clause"
] | 3 | 2018-04-05T21:24:54.000Z | 2021-09-14T01:48:36.000Z | pylearn2/cross_validation/blocks.py | BouchardLab/pylearn2 | 4cab785b870d22cd9e85a5f536d4cac234b6bf60 | [
"BSD-3-Clause"
] | null | null | null | pylearn2/cross_validation/blocks.py | BouchardLab/pylearn2 | 4cab785b870d22cd9e85a5f536d4cac234b6bf60 | [
"BSD-3-Clause"
] | 2 | 2018-02-18T14:46:57.000Z | 2019-05-03T11:51:45.000Z | """
Cross-validation with blocks.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
__maintainer__ = "Steven Kearnes"
from theano.compat.six.moves import xrange
from pylearn2.blocks import StackedBlocks
class StackedBlocksCV(object):
"""
Mul... | 27.918919 | 74 | 0.601162 |
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
__maintainer__ = "Steven Kearnes"
from theano.compat.six.moves import xrange
from pylearn2.blocks import StackedBlocks
class StackedBlocksCV(object):
def __init__(self, layers):
stacked_block... | true | true |
f7030bd71130c2a93c0694be9d3f5c477bbc3082 | 560 | py | Python | boilerplate/leads/migrations/0005_auto_20190512_1153.py | imciflam/electronic-document-management-system | f4db6be1e93204a3d09f0ebc09b7ba8bbdd90f77 | [
"MIT"
] | 1 | 2019-08-11T21:23:59.000Z | 2019-08-11T21:23:59.000Z | boilerplate/leads/migrations/0005_auto_20190512_1153.py | imciflam/electronic-document-management-system | f4db6be1e93204a3d09f0ebc09b7ba8bbdd90f77 | [
"MIT"
] | 5 | 2020-06-05T21:28:14.000Z | 2021-06-10T18:21:18.000Z | boilerplate/leads/migrations/0005_auto_20190512_1153.py | imciflam/electronic-document-management-system | f4db6be1e93204a3d09f0ebc09b7ba8bbdd90f77 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-12 08:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leads', '0004_lead_documentstagecode'),
]
operations = [
migrations.AlterField(
model_name='lead',
name='email',
... | 23.333333 | 63 | 0.578571 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('leads', '0004_lead_documentstagecode'),
]
operations = [
migrations.AlterField(
model_name='lead',
name='email',
field=models.CharField(blank=True, max... | true | true |
f7030c00749497a837fcb1e598f6a89804856653 | 46,146 | py | Python | chia/wallet/wallet_node.py | loueradun/silicoin-blockchain | a199dd86ffb84f214ccd6192ad42d150badc05e1 | [
"Apache-2.0"
] | null | null | null | chia/wallet/wallet_node.py | loueradun/silicoin-blockchain | a199dd86ffb84f214ccd6192ad42d150badc05e1 | [
"Apache-2.0"
] | 4 | 2021-11-16T08:18:39.000Z | 2022-03-29T08:12:41.000Z | chia/wallet/wallet_node.py | Devh4ox4d/silishitcoin | 4372d06aa4a54220f2bde29c8081410503679a82 | [
"Apache-2.0"
] | null | null | null | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from blspy import PrivateKey
from chia.consensus.block_record import BlockRecord
from chia.consensus.blockchain_interface import BlockchainI... | 45.241176 | 118 | 0.616543 | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from blspy import PrivateKey
from chia.consensus.block_record import BlockRecord
from chia.consensus.blockchain_interface import BlockchainI... | true | true |
f7030ca21baff3a44a1489d617f958c1a15717d5 | 1,175 | py | Python | src/phiqnet/bin/train_resnet50_mos_fpn_attention_imageaug_koniq_small_finetune.py | junyongyou/lagt_vqa | 11aeda111ec4d97980db1e60f7b66b481266d1f3 | [
"MIT"
] | 9 | 2021-11-01T06:06:33.000Z | 2022-02-07T12:21:18.000Z | src/phiqnet/bin/train_resnet50_mos_fpn_attention_imageaug_koniq_small_finetune.py | junyongyou/lagt_vqa | 11aeda111ec4d97980db1e60f7b66b481266d1f3 | [
"MIT"
] | null | null | null | src/phiqnet/bin/train_resnet50_mos_fpn_attention_imageaug_koniq_small_finetune.py | junyongyou/lagt_vqa | 11aeda111ec4d97980db1e60f7b66b481266d1f3 | [
"MIT"
] | 1 | 2022-03-06T07:38:32.000Z | 2022-03-06T07:38:32.000Z | from phiqnet.train.train import train_main
if __name__ == '__main__':
args = {}
args['multi_gpu'] = 0
args['gpu'] = 0
args['result_folder'] = r'..\databases\experiments\koniq_small'
args['n_quality_levels'] = 1
args['train_folders'] = [#r'..\databases\train\koniq_normal',
... | 32.638889 | 114 | 0.591489 | from phiqnet.train.train import train_main
if __name__ == '__main__':
args = {}
args['multi_gpu'] = 0
args['gpu'] = 0
args['result_folder'] = r'..\databases\experiments\koniq_small'
args['n_quality_levels'] = 1
args['train_folders'] = [
r'..\databases\train\koniq_... | true | true |
f7030d07bc7c0ce56ea130285e2eff935e0bf461 | 30 | py | Python | anchor/__init__.py | forest-snow/anchor-topic | ad947f2ff6aefc28394531fa74ba3e94e5a01fc2 | [
"MIT"
] | 13 | 2019-02-14T15:55:55.000Z | 2022-03-03T01:01:28.000Z | anchor/__init__.py | gkaramanolakis/anchor-topic | e1637fa3965bfe14d8a5241b070c675bcdf4df18 | [
"MIT"
] | 1 | 2020-11-12T22:49:16.000Z | 2020-11-12T22:49:16.000Z | anchor/__init__.py | gkaramanolakis/anchor-topic | e1637fa3965bfe14d8a5241b070c675bcdf4df18 | [
"MIT"
] | 2 | 2019-02-14T15:26:56.000Z | 2021-08-21T02:37:53.000Z | import anchor
name = 'anchor' | 10 | 15 | 0.733333 | import anchor
name = 'anchor' | true | true |
f7030d0c7cff4eb5186658c4505f06314d86506a | 964 | py | Python | web_app/__init__.py | medamer/twitoff-class-practice | c02bcd81d420233b8db12daf168353a7660f0030 | [
"MIT"
] | null | null | null | web_app/__init__.py | medamer/twitoff-class-practice | c02bcd81d420233b8db12daf168353a7660f0030 | [
"MIT"
] | null | null | null | web_app/__init__.py | medamer/twitoff-class-practice | c02bcd81d420233b8db12daf168353a7660f0030 | [
"MIT"
] | null | null | null | # web_app/__init__.py
from flask import Flask
from web_app.models import db, migrate
from web_app.routes.home_routes import home_routes
from web_app.routes.book_routes import book_routes
DATABASE_URI = "sqlite:///twitoff_class.db" # using relative filepath
#DATABASE_URI = "sqlite:////Users/Username/Desktop/your-repo... | 34.428571 | 187 | 0.756224 |
from flask import Flask
from web_app.models import db, migrate
from web_app.routes.home_routes import home_routes
from web_app.routes.book_routes import book_routes
DATABASE_URI = "sqlite:///twitoff_class.db"
ATIONS"] = False
db.init_app(app)
migrate.init_app(app, db)
app.register_blueprint(home_route... | true | true |
f7030d1fc7c80f90ced33769b5b823d7d16ebf1a | 2,958 | py | Python | app/api/users.py | s-titoo/bloggger | 9d25e4421ffdcf2c616d7948746bc544ee77b3bc | [
"MIT"
] | null | null | null | app/api/users.py | s-titoo/bloggger | 9d25e4421ffdcf2c616d7948746bc544ee77b3bc | [
"MIT"
] | 16 | 2020-12-31T20:02:12.000Z | 2021-01-03T08:32:56.000Z | app/api/users.py | s-titoo/bloggger | 9d25e4421ffdcf2c616d7948746bc544ee77b3bc | [
"MIT"
] | null | null | null | from flask import jsonify, request, url_for, abort
from app import db
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.models import User
@bp.route('/users/<int:id>', methods=['GET'])
@token_auth.login_required
def get_user(id):
return jsonify(User.query.ge... | 38.921053 | 79 | 0.671738 | from flask import jsonify, request, url_for, abort
from app import db
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.models import User
@bp.route('/users/<int:id>', methods=['GET'])
@token_auth.login_required
def get_user(id):
return jsonify(User.query.ge... | true | true |
f7030d57b6f7f41fc5ad8fdacb642095d4dd9445 | 3,242 | py | Python | src/py/breakpoint_splitter.py | marbl/VALET | d3a433690b70288f42e47d096dfcd5370ddf04ce | [
"MIT"
] | 12 | 2016-01-29T10:58:52.000Z | 2020-11-02T00:39:15.000Z | src/py/breakpoint_splitter.py | marbl/VALET | d3a433690b70288f42e47d096dfcd5370ddf04ce | [
"MIT"
] | 9 | 2016-01-29T12:04:00.000Z | 2021-12-06T12:30:12.000Z | src/py/breakpoint_splitter.py | marbl/VALET | d3a433690b70288f42e47d096dfcd5370ddf04ce | [
"MIT"
] | 5 | 2017-07-20T21:47:47.000Z | 2022-01-24T09:07:04.000Z | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
import os
import sys
class ReadsSplitter:
def __init__(self):
self.options = None
self.files_to_split = []
self.getOptions()
def go(self):
for fn in self.files_to_split:
... | 27.474576 | 82 | 0.537631 |
from __future__ import print_function
from optparse import OptionParser
import os
import sys
class ReadsSplitter:
def __init__(self):
self.options = None
self.files_to_split = []
self.getOptions()
def go(self):
for fn in self.files_to_split:
self.splitFile(fn)
... | true | true |
f7030ff12b6ef50e1672d30b3059987601d2c469 | 6,435 | py | Python | qualcoder/GUI/information.py | qwertygc/QualCoder | 2a4820f4de7a2ddf1a629336c74e534c20bdb5d9 | [
"MIT"
] | null | null | null | qualcoder/GUI/information.py | qwertygc/QualCoder | 2a4820f4de7a2ddf1a629336c74e534c20bdb5d9 | [
"MIT"
] | null | null | null | qualcoder/GUI/information.py | qwertygc/QualCoder | 2a4820f4de7a2ddf1a629336c74e534c20bdb5d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Copyright (c) 2019 Colin Curtain
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, mer... | 45.316901 | 119 | 0.724476 |
from PyQt5 import QtWidgets, QtCore
import os
import sys
import logging
import traceback
from GUI.ui_dialog_information import Ui_Dialog_information
path = os.path.abspath(os.path.dirname(__file__))
logger = logging.getLogger(__name__)
def exception_handler(exception_type, value, tb_obj):
tb = '\n'.join(trace... | true | true |
f7030ff8aada85e06d45e7775f87f399f8143230 | 4,774 | py | Python | sdk/lusid/models/resource_list_of_portfolio.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_portfolio.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_portfolio.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2342
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class ResourceListOfPortfolio(object):
"""NOTE: Thi... | 26.230769 | 92 | 0.55886 |
import pprint
import re
import six
class ResourceListOfPortfolio(object):
openapi_types = {
'values': 'list[Portfolio]',
'href': 'str',
'links': 'list[Link]'
}
attribute_map = {
'values': 'values',
'href': 'href',
'links': 'links'
}
required... | true | true |
f703111c2592fb6a5ff0565da71ea5e703eed890 | 2,449 | py | Python | env/lib/python3.5/site-packages/cartopy/tests/crs/test_utm.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/cartopy/tests/crs/test_utm.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/cartopy/tests/crs/test_utm.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | # (C) British Crown Copyright 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | 34.013889 | 74 | 0.687219 |
from __future__ import (absolute_import, division, print_function)
import numpy as np
from numpy.testing import assert_almost_equal
import pytest
import cartopy.crs as ccrs
def check_proj4_params(crs, other_args):
expected = other_args | {'proj=utm', 'no_defs', 'units=m'}
pro4_params = set(... | true | true |
f70311ade7985cc89c566ef969d4f9af213d0e28 | 35,786 | py | Python | vnpy/app/cta_backtester/ui/widget.py | IcyCC/vnpy | 04f6ec013daddde2df36590625e0533e260b4bc1 | [
"MIT"
] | 2 | 2020-04-20T15:02:11.000Z | 2022-01-21T03:29:01.000Z | vnpy/app/cta_backtester/ui/widget.py | IcyCC/vnpy | 04f6ec013daddde2df36590625e0533e260b4bc1 | [
"MIT"
] | null | null | null | vnpy/app/cta_backtester/ui/widget.py | IcyCC/vnpy | 04f6ec013daddde2df36590625e0533e260b4bc1 | [
"MIT"
] | 5 | 2019-10-26T06:03:26.000Z | 2020-02-28T13:31:42.000Z | import numpy as np
import pyqtgraph as pg
from datetime import datetime, timedelta
from vnpy.trader.constant import Interval, Direction, Offset
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtCore, QtWidgets, QtGui
from vnpy.trader.ui.widget import BaseMonitor, BaseCell, DirectionCell, EnumCell
... | 31.118261 | 91 | 0.592494 | import numpy as np
import pyqtgraph as pg
from datetime import datetime, timedelta
from vnpy.trader.constant import Interval, Direction, Offset
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import QtCore, QtWidgets, QtGui
from vnpy.trader.ui.widget import BaseMonitor, BaseCell, DirectionCell, EnumCell
... | true | true |
f70311ba62056f0a9cdf1f81dd1ad123f6427c5a | 1,992 | py | Python | 677.map-sum-pairs.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | 677.map-sum-pairs.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | 677.map-sum-pairs.py | y1zhou/leetcode | 4c24952b0fa228027f81fdd28fad0e6e662193d2 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=677 lang=python3
#
# [677] Map Sum Pairs
# https://leetcode.com/problems/map-sum-pairs/
# This problem is about the trie data structure. Each node keeps track of the sum of its children.
# A new key overrides the original values.
#
import unittest
from typing import Dict
# @lc code=s... | 26.918919 | 99 | 0.553213 |
import unittest
from typing import Dict
class Node:
def __init__(self, val: int = 0):
self.value = val
self.children: Dict[str, Node] = {}
class MapSum:
def __init__(self) -> None:
self.root_node = Node()
self.keys: Dict[str, int] = {}
def insert(se... | true | true |
f70311d0ab6c7fe8c230f261fb16c43b3d1544f1 | 4,658 | py | Python | sdk/python/pulumi_azure_nextgen/security/v20170801preview/get_security_contact.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/security/v20170801preview/get_security_contact.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/security/v20170801preview/get_security_contact.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 33.035461 | 154 | 0.644912 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetSecurityContactResult',
'AwaitableGetSecurityContactResult',
'get_security_contact',
]
@pulumi.output_type
class GetSecurityContactResult:
... | true | true |
f70311fcd044270860c9185e5d92b8e64abc2b05 | 11,544 | py | Python | src/localimport/__init__.py | NiklasRosenstein/python-localimport | a51722387cf03fa4c5ff859cc17419a25e280e35 | [
"MIT"
] | 5 | 2015-04-11T19:34:12.000Z | 2016-07-27T20:08:38.000Z | src/localimport/__init__.py | nrosenstein-stuff/py-localimport | a51722387cf03fa4c5ff859cc17419a25e280e35 | [
"MIT"
] | 15 | 2015-07-03T11:31:08.000Z | 2016-01-22T16:20:40.000Z | src/localimport/__init__.py | nrosenstein-stuff/py-localimport | a51722387cf03fa4c5ff859cc17419a25e280e35 | [
"MIT"
] | null | null | null |
__author__ = 'Niklas Rosenstein <rosensteinniklas@gmail.com>'
__version__ = '1.7.6'
import copy
import glob
import os
import pkgutil
import sys
import traceback
import typing as t
import zipfile
if t.TYPE_CHECKING:
from sys import _MetaPathFinder
def is_local(filename: str, pathlist: t.List[str]) -> bool:
''' ... | 33.754386 | 110 | 0.649948 |
__author__ = 'Niklas Rosenstein <rosensteinniklas@gmail.com>'
__version__ = '1.7.6'
import copy
import glob
import os
import pkgutil
import sys
import traceback
import typing as t
import zipfile
if t.TYPE_CHECKING:
from sys import _MetaPathFinder
def is_local(filename: str, pathlist: t.List[str]) -> bool:
fil... | true | true |
f7031222207e58ab6b118aabf23323dbda72761a | 1,391 | py | Python | svhn/evaluate_calibration.py | mvaldenegro/paper-subensembles-image-classification | cc3a6567b1de82b9bfb1612ad8d0e73cdd7ae09b | [
"BSD-3-Clause"
] | 5 | 2020-06-04T19:54:29.000Z | 2021-12-13T06:19:48.000Z | svhn/evaluate_calibration.py | mvaldenegro/paper-subensembles-image-classification | cc3a6567b1de82b9bfb1612ad8d0e73cdd7ae09b | [
"BSD-3-Clause"
] | null | null | null | svhn/evaluate_calibration.py | mvaldenegro/paper-subensembles-image-classification | cc3a6567b1de82b9bfb1612ad8d0e73cdd7ae09b | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import h5py
import pandas as pd
from svhn_io import load_svhn
from keras_uncertainty.utils import classifier_calibration_curve, classifier_calibration_error
EPSILON = 1e-10
def load_hdf5_data(filename):
inp = h5py.File(filename, "r")
preds = inp["preds"][...]
inp.close()
return p... | 33.119048 | 104 | 0.716751 | import numpy as np
import h5py
import pandas as pd
from svhn_io import load_svhn
from keras_uncertainty.utils import classifier_calibration_curve, classifier_calibration_error
EPSILON = 1e-10
def load_hdf5_data(filename):
inp = h5py.File(filename, "r")
preds = inp["preds"][...]
inp.close()
return p... | true | true |
f70312775afc4e4d6e8b475e09fdec40312d7ceb | 846 | py | Python | test/test_tracks.py | dpitch40/rockawayplayer | 534b5dc5ca709b6f46696d55e18631d4ffaed903 | [
"MIT"
] | null | null | null | test/test_tracks.py | dpitch40/rockawayplayer | 534b5dc5ca709b6f46696d55e18631d4ffaed903 | [
"MIT"
] | null | null | null | test/test_tracks.py | dpitch40/rockawayplayer | 534b5dc5ca709b6f46696d55e18631d4ffaed903 | [
"MIT"
] | null | null | null | from unittest import TestCase
from rockaway.models import Track
class TestTrackBasics(TestCase):
def test_track_create_no_args(self):
track = Track()
self.assertFalse(track.hasDbEntry())
self.assertFalse(track.hasFile())
def test_track_create(self):
args = {"Title": "Rockaw... | 30.214286 | 89 | 0.601655 | from unittest import TestCase
from rockaway.models import Track
class TestTrackBasics(TestCase):
def test_track_create_no_args(self):
track = Track()
self.assertFalse(track.hasDbEntry())
self.assertFalse(track.hasFile())
def test_track_create(self):
args = {"Title": "Rockaw... | true | true |
f70312c9886f2d7f39781658427518a8d2976831 | 24,253 | py | Python | numba/targets/npyimpl.py | tolysz/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | numba/targets/npyimpl.py | tolysz/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | 1 | 2019-02-11T13:46:30.000Z | 2019-02-11T13:46:30.000Z | numba/targets/npyimpl.py | asodeur/numba | d7953a18dbf5ea231dc16e967ce8e9b754578ea6 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | """
Implementation of functions in the Numpy package.
"""
import math
import sys
import itertools
from collections import namedtuple
from llvmlite.llvmpy import core as lc
import numpy as np
import operator
from . import builtins, callconv, ufunc_db, arrayobj
from .imputils import Registry, impl_ret_new_ref, force... | 40.153974 | 92 | 0.641364 |
import math
import sys
import itertools
from collections import namedtuple
from llvmlite.llvmpy import core as lc
import numpy as np
import operator
from . import builtins, callconv, ufunc_db, arrayobj
from .imputils import Registry, impl_ret_new_ref, force_error_model
from .. import typing, types, cgutils, numpy_... | true | true |
f703131bb20bf6a376a2a9e06ef04e947ce3981c | 1,321 | py | Python | setup.py | anobi/django-oauth-api | 95bf9b500dab326553a5a8a17d5c6da1a34f6ac4 | [
"BSD-2-Clause"
] | null | null | null | setup.py | anobi/django-oauth-api | 95bf9b500dab326553a5a8a17d5c6da1a34f6ac4 | [
"BSD-2-Clause"
] | null | null | null | setup.py | anobi/django-oauth-api | 95bf9b500dab326553a5a8a17d5c6da1a34f6ac4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import re
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ ... | 27.520833 | 74 | 0.623013 |
from setuptools import setup, find_packages
import os
import re
def get_version(package):
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
version = get_version('oauth_api')
setup(
name="django-oauth-api",
version... | true | true |
f70313ad1800d1fbedaa2338bc9ced0d636179d5 | 537 | py | Python | events/admin.py | the-mandarine/mypanamsquad | b34c1c6169a3b7496e171b9536472a1ede0bdc84 | [
"Beerware"
] | null | null | null | events/admin.py | the-mandarine/mypanamsquad | b34c1c6169a3b7496e171b9536472a1ede0bdc84 | [
"Beerware"
] | null | null | null | events/admin.py | the-mandarine/mypanamsquad | b34c1c6169a3b7496e171b9536472a1ede0bdc84 | [
"Beerware"
] | null | null | null | from django.contrib import admin
from events.models import Place, Event, Attendance
# Register your models here.
class EventAdmin(admin.ModelAdmin):
filter_horizontal = ('expected_members', )
class AttendanceAdmin(admin.ModelAdmin):
list_display = ('event__name', 'member', 'attendance', 'proxy_to', 'accepted'... | 29.833333 | 83 | 0.746741 | from django.contrib import admin
from events.models import Place, Event, Attendance
class EventAdmin(admin.ModelAdmin):
filter_horizontal = ('expected_members', )
class AttendanceAdmin(admin.ModelAdmin):
list_display = ('event__name', 'member', 'attendance', 'proxy_to', 'accepted',)
list_filter = ('event... | true | true |
f703143bb336a96fa5c3b2d5b48b35b68a8fb16a | 969 | py | Python | test_factorial_example.py | gaoshanyu/web_ui_test_sample | 8a6cc9b54b5f728af7ef0725dea42d759bd115d0 | [
"MIT"
] | null | null | null | test_factorial_example.py | gaoshanyu/web_ui_test_sample | 8a6cc9b54b5f728af7ef0725dea42d759bd115d0 | [
"MIT"
] | null | null | null | test_factorial_example.py | gaoshanyu/web_ui_test_sample | 8a6cc9b54b5f728af7ef0725dea42d759bd115d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Created at 03/09/2020
__author__ = 'raniys'
import math
import pytest
from factorial_example import factorial_function
@pytest.mark.sample
def test_factorial_functionality():
print("Inside test_factorial_functionality")
assert factorial_function(0) == 1
assert factorial_func... | 23.634146 | 59 | 0.716202 |
__author__ = 'raniys'
import math
import pytest
from factorial_example import factorial_function
@pytest.mark.sample
def test_factorial_functionality():
print("Inside test_factorial_functionality")
assert factorial_function(0) == 1
assert factorial_function(4) == 24
@pytest.mark.sample
def test_s... | true | true |
f70314d2b61bace541c7746ae96937b488fdab30 | 1,434 | py | Python | FlaskAPI/PullLoLDataAssets.py | ItsViridae/LoLApiWrapper | f84c2bbb8f3e2e42e7b0e17c137c561727f045a3 | [
"MIT"
] | null | null | null | FlaskAPI/PullLoLDataAssets.py | ItsViridae/LoLApiWrapper | f84c2bbb8f3e2e42e7b0e17c137c561727f045a3 | [
"MIT"
] | 3 | 2021-10-06T18:40:51.000Z | 2022-02-27T06:30:39.000Z | FlaskAPI/PullLoLDataAssets.py | ItsViridae/LoLApiWrapper | f84c2bbb8f3e2e42e7b0e17c137c561727f045a3 | [
"MIT"
] | null | null | null | import requests
import json
# Get Current Patch
def getCurrentVersion():
versionResponse = requests.get("https://ddragon.leagueoflegends.com/api/versions.json")
version_patch_RawData = versionResponse.json()
currentVersion = version_patch_RawData[0]
print(currentVersion)
return currentVersion
#cham... | 33.348837 | 106 | 0.739191 | import requests
import json
def getCurrentVersion():
versionResponse = requests.get("https://ddragon.leagueoflegends.com/api/versions.json")
version_patch_RawData = versionResponse.json()
currentVersion = version_patch_RawData[0]
print(currentVersion)
return currentVersion
def GetDDragonData_Cham... | true | true |
f7031633e36d301952c1bcfad443c0b4e0b34d97 | 2,839 | py | Python | neuro_scripts/manual_rigid_body/manual_rigid_body.py | NicoleEic/projects | 028a4bb4b49539fc98b442f0a2f9434e95c94561 | [
"MIT"
] | 9 | 2019-09-10T19:41:29.000Z | 2022-03-03T21:29:11.000Z | neuro_scripts/manual_rigid_body/manual_rigid_body.py | NicoleEic/projects | 028a4bb4b49539fc98b442f0a2f9434e95c94561 | [
"MIT"
] | null | null | null | neuro_scripts/manual_rigid_body/manual_rigid_body.py | NicoleEic/projects | 028a4bb4b49539fc98b442f0a2f9434e95c94561 | [
"MIT"
] | 4 | 2019-09-10T19:41:37.000Z | 2020-11-26T13:51:55.000Z | import numpy as np
import nibabel as nib
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from my_functions.matrix_stuff import *
def manual_rigid_body(fname = 'example_brain.nii.gz',
outmat = 'transformation.mat',
outimg = 'example_... | 39.985915 | 118 | 0.641071 | import numpy as np
import nibabel as nib
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../')
from my_functions.matrix_stuff import *
def manual_rigid_body(fname = 'example_brain.nii.gz',
outmat = 'transformation.mat',
outimg = 'example_... | true | true |
f7031875b5b2ac17eb7490db6305e5cad29a4261 | 2,636 | py | Python | model/contact.py | agakax/qa-courses-python-training | d523d5543c947ed449cd2d1109cac2eeac390f7b | [
"Apache-2.0"
] | null | null | null | model/contact.py | agakax/qa-courses-python-training | d523d5543c947ed449cd2d1109cac2eeac390f7b | [
"Apache-2.0"
] | null | null | null | model/contact.py | agakax/qa-courses-python-training | d523d5543c947ed449cd2d1109cac2eeac390f7b | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None,
photo_path=None, photo_delete=False, title=None, company=None, address=None,
telephones_all=None, telephone_home=None,
telephone_mobile=No... | 42.516129 | 113 | 0.658194 | from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None,
photo_path=None, photo_delete=False, title=None, company=None, address=None,
telephones_all=None, telephone_home=None,
telephone_mobile=No... | true | true |
f703195775c624f40961822a40021754ea2a5f14 | 1,037 | py | Python | api/insights/insights/infrastructure/mysql/orm/mapper_base.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | api/insights/insights/infrastructure/mysql/orm/mapper_base.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | api/insights/insights/infrastructure/mysql/orm/mapper_base.py | manisharmagarg/qymatix | 0dc240970359429ae5105db79f9aebf1a99ba6fd | [
"Apache-2.0"
] | null | null | null | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .base import Base
class MapperBase():
user = os.getenv("MYSQL_USER")
key = os.getenv("MYSQL_KEY")
host = os.getenv("MYSQL_HOST")
port = os.getenv("MYSQL_PORT")
def __init__(self, database):
self.... | 23.568182 | 63 | 0.518804 | import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .base import Base
class MapperBase():
user = os.getenv("MYSQL_USER")
key = os.getenv("MYSQL_KEY")
host = os.getenv("MYSQL_HOST")
port = os.getenv("MYSQL_PORT")
def __init__(self, database):
self.... | true | true |
f7031a7684f35f0454e3dca92a763da2ae157341 | 1,774 | py | Python | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | 2 | 2021-06-06T09:45:33.000Z | 2021-06-07T20:00:33.000Z | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | null | null | null | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | 2 | 2021-06-03T01:40:28.000Z | 2021-06-07T06:56:18.000Z | import numpy as np
import matplotlib.pyplot as plt
import argparse
def extract_name(word: str):
return word.split('=')[-1]
def extract_info(filename: str):
filename_splitted = filename.split('_')
assert len(filename_splitted) == 7
p = float(extract_name(filename_splitted[1]))
iterations = int(ex... | 31.678571 | 118 | 0.678692 | import numpy as np
import matplotlib.pyplot as plt
import argparse
def extract_name(word: str):
return word.split('=')[-1]
def extract_info(filename: str):
filename_splitted = filename.split('_')
assert len(filename_splitted) == 7
p = float(extract_name(filename_splitted[1]))
iterations = int(ex... | true | true |
f7031adca49813ee2cc217720e95574a56a10092 | 12,014 | py | Python | src/pretix/control/forms/organizer.py | inwwin/pretix | c3bfb57d3e46577f54c1a32c7a8b61df570c272e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/control/forms/organizer.py | inwwin/pretix | c3bfb57d3e46577f54c1a32c7a8b61df570c272e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/control/forms/organizer.py | inwwin/pretix | c3bfb57d3e46577f54c1a32c7a8b61df570c272e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from decimal import Decimal
from urllib.parse import urlparse
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _, pgettext_lazy
f... | 35.128655 | 120 | 0.601049 | from decimal import Decimal
from urllib.parse import urlparse
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _, pgettext_lazy
f... | true | true |
f7031ae29ebda06156f8cc75f97ef136dd445efa | 2,109 | py | Python | setup.py | alphamodel/yagmail | e9efc4a68eee00f76929e72c55fb00dda0c1a57f | [
"MIT"
] | null | null | null | setup.py | alphamodel/yagmail | e9efc4a68eee00f76929e72c55fb00dda0c1a57f | [
"MIT"
] | null | null | null | setup.py | alphamodel/yagmail | e9efc4a68eee00f76929e72c55fb00dda0c1a57f | [
"MIT"
] | null | null | null | from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
LONG_DESCRIPTION = f.read()
MAJOR_VERSION = '0'
MINOR_VERSION = '11'
MICRO_VERSION = '214'
VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION)
setup(name='yagmail',
version=VERSION,
des... | 37.660714 | 73 | 0.593646 | from setuptools import setup
from setuptools import find_packages
with open('README.rst') as f:
LONG_DESCRIPTION = f.read()
MAJOR_VERSION = '0'
MINOR_VERSION = '11'
MICRO_VERSION = '214'
VERSION = "{}.{}.{}".format(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION)
setup(name='yagmail',
version=VERSION,
des... | true | true |
f7031c33be2f4d13a9a63447e0ba6d1507b76692 | 1,334 | py | Python | examples/csrf-protection/app.py | TheNcar/starlette-wtf | f96ab6f33a7ffcb576663f996dbb401ab44f3d78 | [
"MIT"
] | 48 | 2020-02-03T14:16:34.000Z | 2022-02-24T08:27:06.000Z | examples/csrf-protection/app.py | TheNcar/starlette-wtf | f96ab6f33a7ffcb576663f996dbb401ab44f3d78 | [
"MIT"
] | 10 | 2020-04-20T21:20:02.000Z | 2022-01-29T16:58:44.000Z | examples/csrf-protection/app.py | TheNcar/starlette-wtf | f96ab6f33a7ffcb576663f996dbb401ab44f3d78 | [
"MIT"
] | 5 | 2020-04-23T12:39:32.000Z | 2022-03-20T08:14:19.000Z | from jinja2 import Template
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.sessions import SessionMiddleware
from starlette.responses import PlainTextResponse, HTMLResponse
from starlette_wtf import StarletteForm, CSRFProtectMiddleware, csrf_protect
fr... | 26.156863 | 76 | 0.689655 | from jinja2 import Template
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.sessions import SessionMiddleware
from starlette.responses import PlainTextResponse, HTMLResponse
from starlette_wtf import StarletteForm, CSRFProtectMiddleware, csrf_protect
fr... | true | true |
f7031cafd7d51d240c36a866bfbb5dc4718e84d1 | 1,341 | py | Python | youtube_contest.py | all0ws/cryze-peple | efd2bd2bcfc9c22bac78234e9dc191a17ca9e19d | [
"CC0-1.0"
] | null | null | null | youtube_contest.py | all0ws/cryze-peple | efd2bd2bcfc9c22bac78234e9dc191a17ca9e19d | [
"CC0-1.0"
] | null | null | null | youtube_contest.py | all0ws/cryze-peple | efd2bd2bcfc9c22bac78234e9dc191a17ca9e19d | [
"CC0-1.0"
] | null | null | null | #подключение библиотек
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel,QVBoxLayout,QHBoxLayout, QMessageBox, QRadioButton
#создание приложения и главного окна
app=QApplication([])
main_win =QWidget()
main_win.setWindowTitle('Конкурс от Crazy People')
question =QLabel(... | 26.82 | 121 | 0.780015 |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel,QVBoxLayout,QHBoxLayout, QMessageBox, QRadioButton
app=QApplication([])
main_win =QWidget()
main_win.setWindowTitle('Конкурс от Crazy People')
question =QLabel("В каком году канал получил золотую кнопку от YouTube?")
b... | true | true |
f7031d0fdca75854293606c9e859fc97fd60f20a | 2,764 | py | Python | Autoplay/action_scripts/collection_scripts/ouch_script.py | Randy-Hodges/BTD6-Autoplay | 6d2ac9685b5f55848decc285918f8ede465c3a63 | [
"MIT"
] | null | null | null | Autoplay/action_scripts/collection_scripts/ouch_script.py | Randy-Hodges/BTD6-Autoplay | 6d2ac9685b5f55848decc285918f8ede465c3a63 | [
"MIT"
] | null | null | null | Autoplay/action_scripts/collection_scripts/ouch_script.py | Randy-Hodges/BTD6-Autoplay | 6d2ac9685b5f55848decc285918f8ede465c3a63 | [
"MIT"
] | null | null | null | from action_class import Action
place = 'place'
upgrade = 'upgrade'
target = 'target'
top = 'upgrade 1'
middle = 'upgrade 2'
bottom = 'upgrade 3'
ouch_script = [
Action(place, name='sub1', action='sub', position=(708, 540)), # Sub
Action(place, name='sub2', action='sub', position=(984, 545)), # Sub2
Acti... | 37.351351 | 84 | 0.641823 | from action_class import Action
place = 'place'
upgrade = 'upgrade'
target = 'target'
top = 'upgrade 1'
middle = 'upgrade 2'
bottom = 'upgrade 3'
ouch_script = [
Action(place, name='sub1', action='sub', position=(708, 540)),
Action(place, name='sub2', action='sub', position=(984, 545)),
Action('start',... | true | true |
f7031df14237fdbfb39aadf27251e92115266ab0 | 737 | py | Python | Leccion 8 Listas y diccionarios anidados/listAndDicts.py | Meluiscruz/Notas-de-Curso-Intermedio-de-Python | 1def9edffd63f7283d133c393a80e61abb12b25d | [
"MIT"
] | 1 | 2021-06-06T01:40:16.000Z | 2021-06-06T01:40:16.000Z | Leccion 8 Listas y diccionarios anidados/listAndDicts.py | Meluiscruz/Notas-de-Curso-Intermedio-de-Python | 1def9edffd63f7283d133c393a80e61abb12b25d | [
"MIT"
] | null | null | null | Leccion 8 Listas y diccionarios anidados/listAndDicts.py | Meluiscruz/Notas-de-Curso-Intermedio-de-Python | 1def9edffd63f7283d133c393a80e61abb12b25d | [
"MIT"
] | null | null | null | def run():
my_list = [1, "Hello", True, 4.5]
my_dict = {"firstname":"Facundo", "lastname":"Garcia"}
superList = [
{"firstname":"Facundo", "lastname":"Garcia"},
{"firstname":"Miguel", "lastname":"Torres"},
{"firstname":"José", "lastname":"Rodelo"},
{"firstname":"Susana", "las... | 27.296296 | 58 | 0.506106 | def run():
my_list = [1, "Hello", True, 4.5]
my_dict = {"firstname":"Facundo", "lastname":"Garcia"}
superList = [
{"firstname":"Facundo", "lastname":"Garcia"},
{"firstname":"Miguel", "lastname":"Torres"},
{"firstname":"José", "lastname":"Rodelo"},
{"firstname":"Susana", "las... | true | true |
f7031e134039488bf08fe651cc6d095e677304a2 | 5,279 | py | Python | code/faciesplot.py | elephantscale/facies | ea78a4917ebb5dbbe478b9fc27200c67b6e5576f | [
"MIT"
] | null | null | null | code/faciesplot.py | elephantscale/facies | ea78a4917ebb5dbbe478b9fc27200c67b6e5576f | [
"MIT"
] | 3 | 2019-12-05T20:26:52.000Z | 2019-12-05T20:30:13.000Z | code/faciesplot.py | elephantscale/facies | ea78a4917ebb5dbbe478b9fc27200c67b6e5576f | [
"MIT"
] | 3 | 2019-12-09T04:36:47.000Z | 2019-12-09T15:26:04.000Z | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
#Key:
# 1=sandstone 2=c_siltstone 3=f_siltstone
# 4=marine_silt_shale 5=mudstone 6=wackestone 7=dolomite
# 8=packstone 9=bafflestone
facies_labels = ['SS', 'CSiS', 'FSiS',... | 37.978417 | 112 | 0.603523 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locatable
facies_labels = ['SS', 'CSiS', 'FSiS', 'SiSh', 'MS',
'WS', 'D','PS', 'BS']
facies_colors = ['#F4D03F', '#F5B041','#DC7633','#6E2C00', '#1B4F72','#2E86C1'... | true | true |
f70320a4c6f7f1a47efc6a6cec4230e45d3d82d5 | 5,597 | py | Python | imagepy/tools/Transform/scale_tol.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Transform/scale_tol.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | imagepy/tools/Transform/scale_tol.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | import wx
import numpy as np
from imagepy.core.engine import Tool, Filter
import scipy.ndimage as nimg
class ScaleTool(Tool):
def __init__(self, plg):
self.plg = plg
self.para = plg.para
self.moving = False
def snap(self, x, y, lim):
plg = self.plg
if abs(x-plg.... | 39.13986 | 93 | 0.516348 | import wx
import numpy as np
from imagepy.core.engine import Tool, Filter
import scipy.ndimage as nimg
class ScaleTool(Tool):
def __init__(self, plg):
self.plg = plg
self.para = plg.para
self.moving = False
def snap(self, x, y, lim):
plg = self.plg
if abs(x-plg.... | true | true |
f7032136be940769cd29b8db7635b5bf9b375e79 | 10,735 | py | Python | py_std_logic_1164/std_logic.py | krcb197/py_std_logic_1164 | 66ae8b644db4d96b222132e92768d52ee1b98f7b | [
"MIT"
] | null | null | null | py_std_logic_1164/std_logic.py | krcb197/py_std_logic_1164 | 66ae8b644db4d96b222132e92768d52ee1b98f7b | [
"MIT"
] | null | null | null | py_std_logic_1164/std_logic.py | krcb197/py_std_logic_1164 | 66ae8b644db4d96b222132e92768d52ee1b98f7b | [
"MIT"
] | null | null | null |
class std_logic():
"""
class to represent a digital bit allowing for the same 9 values of a bit supported by IEEE 1164.
====== ===============
Value Interpreatation
------ ---------------
U Unitialized
X Unknown
0 Strong 0
1 ... | 39.036364 | 118 | 0.382301 |
class std_logic():
def __init__(self,initialvalue='U'):
self._value = 'U'
self.set(value=initialvalue)
def __str__(self):
return self._value
def __repr__(self):
base_repr = super().__repr__()
return base_repr[:-2] + ':%s>'%self._value
def __eq__(self, other)... | true | true |
f7032158e00462f1a6bfc96d5858e3f893dcb171 | 8,515 | py | Python | seisidd/tomo_plans.py | KedoKudo/jupyter-ht-hedm | b447202fb9800e7b2916b38470db1b9a83357130 | [
"MIT"
] | null | null | null | seisidd/tomo_plans.py | KedoKudo/jupyter-ht-hedm | b447202fb9800e7b2916b38470db1b9a83357130 | [
"MIT"
] | null | null | null | seisidd/tomo_plans.py | KedoKudo/jupyter-ht-hedm | b447202fb9800e7b2916b38470db1b9a83357130 | [
"MIT"
] | 1 | 2019-07-16T22:13:02.000Z | 2019-07-16T22:13:02.000Z | #!/usr/bin/env python
"""
Predefined bluesky scan plans
"""
import numpy as np
import bluesky.plans as bp
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from .utility import load_config
#@bpp.run_decorator()
def collect_white_field(experiment, cfg_tomo, at... | 37.676991 | 107 | 0.640752 |
import numpy as np
import bluesky.plans as bp
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from .utility import load_config
def collect_white_field(experiment, cfg_tomo, atfront=True):
det = experiment.det
tomostage = experiment.tomostage
... | true | true |
f70321ab9d1e17a3074d6de10d8dd3f2b2a4c4d5 | 502 | py | Python | server/__init__.py | Programmer-RD-AI/Chat-App | b9ff5f2d5f59cc37d4ef7040b9d59ae7c1ace9e2 | [
"Apache-2.0"
] | null | null | null | server/__init__.py | Programmer-RD-AI/Chat-App | b9ff5f2d5f59cc37d4ef7040b9d59ae7c1ace9e2 | [
"Apache-2.0"
] | 5 | 2021-09-16T17:42:31.000Z | 2021-10-30T13:57:12.000Z | server/__init__.py | Programmer-RD-AI/Chat-App | b9ff5f2d5f59cc37d4ef7040b9d59ae7c1ace9e2 | [
"Apache-2.0"
] | null | null | null | from pymongo import *
from flask import *
from flask_restful import *
import datetime
mongodb_url = "mongodb://Ranuga:ranuga2008@cluster0-shard-00-00.6n3dg.mongodb.net:27017,cluster0-shard-00-01.6n3dg.mongodb.net:27017,cluster0-shard-00-02.6n3dg.mongodb.net:27017/myFirstDatabase?ssl=true&replicaSet=atlas-uo9rgq-shard... | 38.615385 | 280 | 0.806773 | from pymongo import *
from flask import *
from flask_restful import *
import datetime
mongodb_url = "mongodb://Ranuga:ranuga2008@cluster0-shard-00-00.6n3dg.mongodb.net:27017,cluster0-shard-00-01.6n3dg.mongodb.net:27017,cluster0-shard-00-02.6n3dg.mongodb.net:27017/myFirstDatabase?ssl=true&replicaSet=atlas-uo9rgq-shard... | true | true |
f70321d163f2bb54c285dd61fcf2d529daa5b17b | 6,435 | py | Python | tuun/probo/models/gp_stan_transfer.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 33 | 2020-08-30T16:22:35.000Z | 2022-02-26T13:48:32.000Z | tuun/probo/models/gp_stan_transfer.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2021-01-18T19:46:43.000Z | 2021-03-24T09:59:14.000Z | tuun/probo/models/gp_stan_transfer.py | petuum/tuun | 8eec472dbf0e5e695449b0fa2d98985469fd5b30 | [
"Apache-2.0"
] | 2 | 2020-08-25T17:02:15.000Z | 2021-04-21T16:40:44.000Z | """
Classes for GP models with Stan that perform transfer optimization.
"""
from argparse import Namespace
import numpy as np
import copy
from .gp_stan import StanGp
from .regression.transfer_regression import TransferRegression
from ..util.misc_util import dict_to_namespace
class StanTransferGp(StanGp):
"""
... | 31.856436 | 92 | 0.601399 |
from argparse import Namespace
import numpy as np
import copy
from .gp_stan import StanGp
from .regression.transfer_regression import TransferRegression
from ..util.misc_util import dict_to_namespace
class StanTransferGp(StanGp):
def __init__(self, params=None, data=None, verbose=None):
self.set_params(... | true | true |
f703223b3ac044df519437e64abc05bc1bd9973c | 5,865 | py | Python | sdk/python/pulumi_azure_native/authorization/latest/get_management_lock_at_resource_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/latest/get_management_lock_at_resource_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/latest/get_management_lock_at_resource_level.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.628378 | 283 | 0.650298 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetManagementLockAtResourceLevelResult',
'AwaitableGetManagementLockAtResourceLevelResult',
'get_management_lock_at_resou... | true | true |
f703224172490713b6ea5921d8e35e234816b5d6 | 8,418 | py | Python | mvn/utils/op.py | K4S4B4/learnable-triangulation-pytorch | 94f5121919785bf7c89dd973521a21c01104dbd5 | [
"MIT"
] | null | null | null | mvn/utils/op.py | K4S4B4/learnable-triangulation-pytorch | 94f5121919785bf7c89dd973521a21c01104dbd5 | [
"MIT"
] | null | null | null | mvn/utils/op.py | K4S4B4/learnable-triangulation-pytorch | 94f5121919785bf7c89dd973521a21c01104dbd5 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mvn.utils.img import to_numpy, to_torch
from mvn.utils import multiview
def integrate_tensor_2d(heatmaps, softmax=True):
"""Applies softmax to heatmaps and integrates them to get their's "center of masses"
Args:
... | 42.730964 | 162 | 0.68698 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mvn.utils.img import to_numpy, to_torch
from mvn.utils import multiview
def integrate_tensor_2d(heatmaps, softmax=True):
batch_size, n_heatmaps, h, w = heatmaps.shape
heatmaps = heatmaps.reshape((batch_size, n_heatma... | true | true |
f703225523b2675260fc0159bf5fae1de004c8d2 | 2,319 | py | Python | src/sas2sqlite3/adapters.py | ericgj/sas2sqlite | f404dc862886f5a052bfc2dc492b4d0ec0773b31 | [
"MIT"
] | null | null | null | src/sas2sqlite3/adapters.py | ericgj/sas2sqlite | f404dc862886f5a052bfc2dc492b4d0ec0773b31 | [
"MIT"
] | null | null | null | src/sas2sqlite3/adapters.py | ericgj/sas2sqlite | f404dc862886f5a052bfc2dc492b4d0ec0773b31 | [
"MIT"
] | null | null | null | from calendar import timegm
from datetime import date, datetime, time
import sqlite3
from typing import Callable
import julian # type: ignore
def store_time(time_type: str, time_format: str = "") -> None:
if time_type == "seconds":
sqlite3.register_adapter(time, time_to_seconds)
elif time_type == "t... | 29.35443 | 77 | 0.692109 | from calendar import timegm
from datetime import date, datetime, time
import sqlite3
from typing import Callable
import julian
def store_time(time_type: str, time_format: str = "") -> None:
if time_type == "seconds":
sqlite3.register_adapter(time, time_to_seconds)
elif time_type == "text":
... | true | true |
f7032289beb6682222976cb9462e8cd05bc9a850 | 506 | py | Python | origamid/main.py | Cloud-CV/origami-daemon | c4179352c8f8ed86193d1a04d340661a9f24ff6d | [
"BSD-3-Clause"
] | 4 | 2018-06-16T20:07:33.000Z | 2019-02-14T06:35:18.000Z | origamid/main.py | Cloud-CV/origami-daemon | c4179352c8f8ed86193d1a04d340661a9f24ff6d | [
"BSD-3-Clause"
] | 20 | 2018-06-13T13:35:50.000Z | 2019-06-01T22:12:53.000Z | origamid/main.py | Cloud-CV/origami-daemon | c4179352c8f8ed86193d1a04d340661a9f24ff6d | [
"BSD-3-Clause"
] | 7 | 2018-09-05T10:37:30.000Z | 2021-10-04T03:46:18.000Z | import click
import logging
from .constants import WELCOME_TEXT
from .api import run_server
from .logger import OrigamiLogger
logger = OrigamiLogger(
file_log_level=logging.DEBUG, console_log_level=logging.DEBUG)
@click.group(invoke_without_command=True)
@click.pass_context
def main(ctx):
"""
Origami da... | 21.083333 | 71 | 0.764822 | import click
import logging
from .constants import WELCOME_TEXT
from .api import run_server
from .logger import OrigamiLogger
logger = OrigamiLogger(
file_log_level=logging.DEBUG, console_log_level=logging.DEBUG)
@click.group(invoke_without_command=True)
@click.pass_context
def main(ctx):
if not ctx.invoked... | true | true |
f7032363fc14f699405a1f015afdc99f3377b608 | 11,524 | py | Python | python/day18.py | simmsb/advent-of-code-2021 | 6ba2a2a9a2ccf6f0ae0328eb1b1add00a655590a | [
"MIT"
] | null | null | null | python/day18.py | simmsb/advent-of-code-2021 | 6ba2a2a9a2ccf6f0ae0328eb1b1add00a655590a | [
"MIT"
] | null | null | null | python/day18.py | simmsb/advent-of-code-2021 | 6ba2a2a9a2ccf6f0ae0328eb1b1add00a655590a | [
"MIT"
] | null | null | null | from __future__ import annotations
import itertools
import math
from dataclasses import dataclass
from typing import Any
@dataclass
class TreeZipper:
inner: Any
path: list[int]
def up(self):
if self.path:
return TreeZipper(self.inner, self.path[:-1]), self.path[-1]
return Non... | 28.245098 | 102 | 0.345106 | from __future__ import annotations
import itertools
import math
from dataclasses import dataclass
from typing import Any
@dataclass
class TreeZipper:
inner: Any
path: list[int]
def up(self):
if self.path:
return TreeZipper(self.inner, self.path[:-1]), self.path[-1]
return Non... | true | true |
f703237c7b21dfe2701fe1fbdb4022c1eba0e043 | 4,805 | py | Python | tests/unit/test_protocols.py | ebi-ait/ingest-archiver | de0676fc3f750bc5abd3d42f140a142c3b972910 | [
"Apache-2.0"
] | 1 | 2020-09-15T10:29:18.000Z | 2020-09-15T10:29:18.000Z | tests/unit/test_protocols.py | ebi-ait/ingest-archiver | de0676fc3f750bc5abd3d42f140a142c3b972910 | [
"Apache-2.0"
] | 28 | 2020-01-17T15:37:21.000Z | 2022-02-21T15:18:46.000Z | tests/unit/test_protocols.py | ebi-ait/ingest-archiver | de0676fc3f750bc5abd3d42f140a142c3b972910 | [
"Apache-2.0"
] | 4 | 2020-05-31T11:49:56.000Z | 2020-11-01T06:05:12.000Z | import json
from unittest import TestCase
from unittest.mock import Mock
from utils import protocols
from api.ontology import OntologyAPI
from utils.protocols import ONTOLOGY_3PRIME_PARENT, ONTOLOGY_5PRIME_PARENT, ONTOLOGY_CITESEQ
class TestProtocols(TestCase):
def setUp(self) -> None:
self.ontology_api =... | 29.478528 | 115 | 0.57565 | import json
from unittest import TestCase
from unittest.mock import Mock
from utils import protocols
from api.ontology import OntologyAPI
from utils.protocols import ONTOLOGY_3PRIME_PARENT, ONTOLOGY_5PRIME_PARENT, ONTOLOGY_CITESEQ
class TestProtocols(TestCase):
def setUp(self) -> None:
self.ontology_api =... | true | true |
f703239ebe11327a7f5a7741cddd1a6aaacbbe07 | 711 | py | Python | homepage/summarizer.py | prats1997/Euphorum | 16bfee9c71ea5b1332c6263233c79a633ddfdd83 | [
"MIT"
] | 1 | 2020-03-01T17:39:04.000Z | 2020-03-01T17:39:04.000Z | homepage/summarizer.py | prats1997/Euphorum | 16bfee9c71ea5b1332c6263233c79a633ddfdd83 | [
"MIT"
] | null | null | null | homepage/summarizer.py | prats1997/Euphorum | 16bfee9c71ea5b1332c6263233c79a633ddfdd83 | [
"MIT"
] | null | null | null | from sumy.parsers.plaintext import PlaintextParser #We're choosing a plaintext parser here, other parsers available for HTML etc.
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer #We're choosing Lexrank, other algorithms are also built in
def get_summary(text):
# ... | 35.55 | 129 | 0.759494 | from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer #We're choosing Lexrank, other algorithms are also built in
def get_summary(text):
arser.from_string(text,Tokenizer("English"))
summarizer = LexRankSummarizer(... | true | true |
f703249eb0707d1f33a73eb8c4811cfac1b4bc40 | 863 | py | Python | load_and_process.py | ctiger34/BASIC-EMOTION-DETECTION | 1c2be519c70408159ea6e1093d5f139c99ea6e27 | [
"MIT"
] | 18 | 2019-10-08T10:15:27.000Z | 2022-02-21T06:36:57.000Z | load_and_process.py | ctiger34/BASIC-EMOTION-DETECTION | 1c2be519c70408159ea6e1093d5f139c99ea6e27 | [
"MIT"
] | 3 | 2020-04-17T20:43:58.000Z | 2022-02-10T00:21:01.000Z | load_and_process.py | ctiger34/BASIC-EMOTION-DETECTION | 1c2be519c70408159ea6e1093d5f139c99ea6e27 | [
"MIT"
] | 8 | 2020-03-07T10:17:11.000Z | 2021-07-05T05:22:04.000Z | import pandas as pd
import cv2
import numpy as np
dataset_path = 'fer2013/fer2013/fer2013.csv'
image_size=(48,48)
def load_fer2013():
data = pd.read_csv(dataset_path)
pixels = data['pixels'].tolist()
width, height = 48, 48
faces = []
for pixel_sequence in pixels:
f... | 28.766667 | 70 | 0.589803 | import pandas as pd
import cv2
import numpy as np
dataset_path = 'fer2013/fer2013/fer2013.csv'
image_size=(48,48)
def load_fer2013():
data = pd.read_csv(dataset_path)
pixels = data['pixels'].tolist()
width, height = 48, 48
faces = []
for pixel_sequence in pixels:
f... | true | true |
f70326ca696e1c05be0940e1d778d0eb50c76934 | 10,074 | py | Python | spreadsheet.py | rohanuttamsingh/ScoutingSheetInitializer | acf1c01617796450fd58f29fbb0e67ae2a977002 | [
"MIT"
] | null | null | null | spreadsheet.py | rohanuttamsingh/ScoutingSheetInitializer | acf1c01617796450fd58f29fbb0e67ae2a977002 | [
"MIT"
] | null | null | null | spreadsheet.py | rohanuttamsingh/ScoutingSheetInitializer | acf1c01617796450fd58f29fbb0e67ae2a977002 | [
"MIT"
] | null | null | null | import json
from time import sleep
import gspread
import requests
from gspread_formatting import *
from oauth2client.service_account import ServiceAccountCredentials
class Spreadsheet:
# comment out all but one of these depending on which spreadsheet being used
# URL = 'https://docs.google.com/spreadsheets/... | 43.8 | 160 | 0.655847 | import json
from time import sleep
import gspread
import requests
from gspread_formatting import *
from oauth2client.service_account import ServiceAccountCredentials
class Spreadsheet:
pe)
client = gspread.authorize(creds)
sheet = client.open_by_url(URL)
key_worksheet = sheet.wo... | true | true |
f7032731d7e241881607e9839492fa621aefb0c9 | 10,129 | py | Python | app/fedcv/medical_chest_xray_image_clf/data/chexpert/data_loader.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | app/fedcv/medical_chest_xray_image_clf/data/chexpert/data_loader.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | app/fedcv/medical_chest_xray_image_clf/data/chexpert/data_loader.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | import logging
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
import torchvision.transforms as transforms
from torch.utils.data.distributed import DistributedSampler
from .dataset import CheXpert
def _get_mean_and_std(dataset: Dataset):
"""Compute the mean and std of ... | 30.601208 | 118 | 0.654852 | import logging
import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
import torchvision.transforms as transforms
from torch.utils.data.distributed import DistributedSampler
from .dataset import CheXpert
def _get_mean_and_std(dataset: Dataset):
data_loader = DataLoader(datase... | true | true |
f70327b5c57e7952effeec7cc8716fd76dd00bd0 | 22,049 | py | Python | paramak/reactor.py | openmcworkshop/paramak | c41dc4c2e68183869556544ee7a72deb1d16a8dc | [
"MIT"
] | 1 | 2020-11-25T10:46:32.000Z | 2020-11-25T10:46:32.000Z | paramak/reactor.py | openmcworkshop/paramak | c41dc4c2e68183869556544ee7a72deb1d16a8dc | [
"MIT"
] | null | null | null | paramak/reactor.py | openmcworkshop/paramak | c41dc4c2e68183869556544ee7a72deb1d16a8dc | [
"MIT"
] | null | null | null |
import json
from collections import Iterable
from pathlib import Path
import cadquery as cq
import matplotlib.pyplot as plt
import plotly.graph_objects as go
from cadquery import exporters
import paramak
from paramak.neutronics_utils import (add_stl_to_moab_core,
define_moab_cor... | 35.448553 | 80 | 0.612318 |
import json
from collections import Iterable
from pathlib import Path
import cadquery as cq
import matplotlib.pyplot as plt
import plotly.graph_objects as go
from cadquery import exporters
import paramak
from paramak.neutronics_utils import (add_stl_to_moab_core,
define_moab_cor... | true | true |
f70327c1e525eeac2a08ebfff0787c591e507497 | 2,327 | py | Python | ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/resources/stacks/HDP/2.0.7/services/HIVE/package/scripts/hive_service.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); yo... | 40.824561 | 247 | 0.728406 |
from resource_management import *
def hive_service(
name,
action='start'):
import params
if name == 'metastore':
pid_file = format("{hive_pid_dir}/{hive_metastore_pid}")
cmd = format(
"env HADOOP_HOME={hadoop_home} JAVA_HOME={java64_home} {start_metastore_path} {hive_log_dir}/hive.out {h... | true | true |
f70327e26d7f220656e09d04aed22ba77da630b5 | 23,857 | py | Python | pwnlib/log.py | Magic-King/pwntools | 4e7355202df6d83edc2d388b9a936c3c38ea1e8a | [
"MIT"
] | 10 | 2021-02-04T15:09:22.000Z | 2021-03-02T19:50:58.000Z | pwnlib/log.py | Magic-King/pwntools | 4e7355202df6d83edc2d388b9a936c3c38ea1e8a | [
"MIT"
] | null | null | null | pwnlib/log.py | Magic-King/pwntools | 4e7355202df6d83edc2d388b9a936c3c38ea1e8a | [
"MIT"
] | 2 | 2015-05-28T09:13:23.000Z | 2016-08-31T06:43:30.000Z | """
Logging module for printing status during an exploit, and internally
within ``pwntools``.
Exploit Developers
------------------
By using the standard ``from pwn import *``, an object named ``log`` will
be inserted into the global namespace. You can use this to print out
status messages during exploitation.
For e... | 34.726346 | 92 | 0.635746 | from __future__ import absolute_import
from __future__ import division
import logging
import os
import random
import re
import six
import sys
import threading
import time
from pwnlib import term
from pwnlib.config import register_config
from pwnlib.context import Thread
from pwnlib.context import context
from pwnlib.... | true | true |
f703287577524da6d03be806c4b05b4d0149cfad | 2,602 | py | Python | src/tools.py | JoaoCarabetta/brasilio-package | 5004a87e6d98b7f07b31d358ef44346b3570c27b | [
"MIT"
] | null | null | null | src/tools.py | JoaoCarabetta/brasilio-package | 5004a87e6d98b7f07b31d358ef44346b3570c27b | [
"MIT"
] | 4 | 2018-06-22T23:15:47.000Z | 2018-06-25T04:59:10.000Z | src/tools.py | JoaoCarabetta/brasilio-package | 5004a87e6d98b7f07b31d358ef44346b3570c27b | [
"MIT"
] | 1 | 2018-06-22T23:04:51.000Z | 2018-06-22T23:04:51.000Z | import rows
import os
from timeit import default_timer
import json
output_path = '../package/data/'
class Brasilio(object):
def __init__(self, output_path='../package/data/', verbose=False):
self.verbose = verbose
self.output_path = output_path
self.timer = default_timer
def _... | 27.978495 | 95 | 0.568793 | import rows
import os
from timeit import default_timer
import json
output_path = '../package/data/'
class Brasilio(object):
def __init__(self, output_path='../package/data/', verbose=False):
self.verbose = verbose
self.output_path = output_path
self.timer = default_timer
def _... | true | true |
f70328c20a055ff6504e882b8c3d6f98fe0c019f | 1,301 | py | Python | scripts/git-precommit-hook.py | AWSNB/relay | 3d7b69204fdfc34e1020f2b072961061b91a691a | [
"BSL-1.0"
] | null | null | null | scripts/git-precommit-hook.py | AWSNB/relay | 3d7b69204fdfc34e1020f2b072961061b91a691a | [
"BSL-1.0"
] | null | null | null | scripts/git-precommit-hook.py | AWSNB/relay | 3d7b69204fdfc34e1020f2b072961061b91a691a | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/env python3
import os
import pathlib
import sys
import subprocess
def has_cargo_fmt():
"""Runs a quick check to see if cargo fmt is installed."""
try:
c = subprocess.run(["cargo", "fmt", "--", "--help"], capture_output=True)
except OSError:
return False
else:
return ... | 25.019231 | 85 | 0.590315 |
import os
import pathlib
import sys
import subprocess
def has_cargo_fmt():
try:
c = subprocess.run(["cargo", "fmt", "--", "--help"], capture_output=True)
except OSError:
return False
else:
return c.returncode == 0
def get_modified_files():
c = subprocess.run(
["git",... | true | true |
f7032a385a92af39ff4e03fa94030ff64c7a226d | 1,146 | py | Python | check_mpi.py | jjmaldonis/mpi-parallelization | 4cc2ab1e6929352073cafb83b1cb0ea990acff15 | [
"MIT"
] | 16 | 2017-06-07T07:14:58.000Z | 2021-11-15T06:35:58.000Z | check_mpi.py | jjmaldonis/mpi-parallelization | 4cc2ab1e6929352073cafb83b1cb0ea990acff15 | [
"MIT"
] | 1 | 2021-03-21T07:06:24.000Z | 2021-03-21T15:33:24.000Z | check_mpi.py | jjmaldonis/mpi-parallelization | 4cc2ab1e6929352073cafb83b1cb0ea990acff15 | [
"MIT"
] | 1 | 2020-09-14T04:29:31.000Z | 2020-09-14T04:29:31.000Z | import os
import distutils.spawn
import mpi4py
from mpi4py import MPI
def check_mpi():
mpiexec_path, _ = os.path.split(distutils.spawn.find_executable("mpiexec"))
for executable, path in mpi4py.get_config().items():
if executable not in ['mpicc', 'mpicxx', 'mpif77', 'mpif90', 'mpifort']:
co... | 57.3 | 277 | 0.719023 | import os
import distutils.spawn
import mpi4py
from mpi4py import MPI
def check_mpi():
mpiexec_path, _ = os.path.split(distutils.spawn.find_executable("mpiexec"))
for executable, path in mpi4py.get_config().items():
if executable not in ['mpicc', 'mpicxx', 'mpif77', 'mpif90', 'mpifort']:
co... | true | true |
f7032b5bb12dc99e7462909296f8c4084c40396f | 903 | py | Python | streaming_helpers.py | jaycosaur/spynet | 535841bcea761463d27f7f3eb745ffe186d9f763 | [
"MIT"
] | 2 | 2020-08-13T05:51:15.000Z | 2020-09-14T08:08:59.000Z | streaming_helpers.py | jaycosaur/distributed-vision-networking | 9534202b5f0748dc181d6716ba96abd73aa9727d | [
"MIT"
] | 5 | 2021-03-10T12:50:12.000Z | 2022-02-27T02:18:33.000Z | streaming_helpers.py | jaycosaur/spynet | 535841bcea761463d27f7f3eb745ffe186d9f763 | [
"MIT"
] | null | null | null | import queue
import time
import numpy as np
class CameraInformation:
def __init__(self, cam_id: str):
self._frame_queue: queue.Queue = queue.Queue(maxsize=1)
self._frame_shape = None
self._last_frame_time = None
self.is_online = True
self.node_id = cam_id
def write_fra... | 27.363636 | 63 | 0.594684 | import queue
import time
import numpy as np
class CameraInformation:
def __init__(self, cam_id: str):
self._frame_queue: queue.Queue = queue.Queue(maxsize=1)
self._frame_shape = None
self._last_frame_time = None
self.is_online = True
self.node_id = cam_id
def write_fra... | true | true |
f7032cb6248d072f5e1d20fee17d63cd87896599 | 1,733 | py | Python | nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import Generate5tt
def test_Generate5tt_inputs():
input_map = dict(
algorithm=dict(
argstr='%s',
mandatory=True,
position=-3,
),
args=dict(argstr='... | 27.951613 | 67 | 0.524524 |
from __future__ import unicode_literals
from ..utils import Generate5tt
def test_Generate5tt_inputs():
input_map = dict(
algorithm=dict(
argstr='%s',
mandatory=True,
position=-3,
),
args=dict(argstr='%s', ),
bval_scale=dict(argstr='-bvalue_scali... | true | true |
f7032cee21098d6fc2a0ddeeff88cf6cdfc6fbf1 | 958 | py | Python | setup.py | SaladDais/Impasse | 3f8971ac533c59a3dce7802ecf673daeeec4e0fd | [
"BSD-3-Clause"
] | 2 | 2021-07-07T08:22:46.000Z | 2021-12-27T23:51:44.000Z | setup.py | SaladDais/Impasse | 3f8971ac533c59a3dce7802ecf673daeeec4e0fd | [
"BSD-3-Clause"
] | 6 | 2021-07-06T05:47:00.000Z | 2021-07-11T15:04:14.000Z | setup.py | SaladDais/Impasse | 3f8971ac533c59a3dce7802ecf673daeeec4e0fd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(
name='impasse',
# Version chosen for parity with Assimp since we need ABI compatibility
version='5.0.6',
license='BSD',
description='Alternate Python bindings for the... | 26.611111 | 87 | 0.638831 |
from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(
name='impasse',
version='5.0.6',
license='BSD',
description='Alternate Python bindings for the Open Asset Import Library (ASSIMP)',
long_description=readme(),
long_description_co... | true | true |
f7032dda39d019d042d83b0dcb8d9588c22ca8d2 | 7,060 | py | Python | tests/extension/thread_/stream_graph_substream/thread_stream_graph_substream.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/stream_graph_substream/thread_stream_graph_substream.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/stream_graph_substream/thread_stream_graph_substream.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... | 28.015873 | 87 | 0.583711 | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import veriloggen.thread as vthread
import veriloggen.type... | true | true |
f7032de78fdbf6c462f5e261e42160b48beac9e7 | 5,556 | py | Python | tests/test_numbits.py | WEBZCC/coveragepy | e4f0f9ee71a1ade66b51ec53d0061f462e3838cb | [
"Apache-2.0"
] | 2,254 | 2015-01-05T01:28:03.000Z | 2022-03-29T10:37:10.000Z | tests/test_numbits.py | mgorny/coveragepy | 73ca4596fc8eed9c76714e7a5c80dd61d71fe1b1 | [
"Apache-2.0"
] | 707 | 2015-02-07T01:32:02.000Z | 2022-03-31T18:00:14.000Z | tests/test_numbits.py | sitedata/coveragepy | e4f0f9ee71a1ade66b51ec53d0061f462e3838cb | [
"Apache-2.0"
] | 439 | 2015-01-16T15:06:08.000Z | 2022-03-30T06:19:12.000Z | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for coverage.numbits"""
import json
import sqlite3
from hypothesis import example, given, settings
from hypothesis.strategies import sets, integers
from... | 34.08589 | 97 | 0.633369 |
import json
import sqlite3
from hypothesis import example, given, settings
from hypothesis.strategies import sets, integers
from coverage import env
from coverage.numbits import (
nums_to_numbits, numbits_to_nums, numbits_union, numbits_intersection,
numbits_any_intersection, num_in_numbits, register_sqli... | true | true |
f7032e464938cec9d9e23b8417b9949012af2160 | 29,619 | py | Python | selfdrive/controls/controlsd.py | sky84ky/forEQ | ecad25c3e8a7fda378e867d067d49eb06ecd2092 | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | sky84ky/forEQ | ecad25c3e8a7fda378e867d067d49eb06ecd2092 | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | sky84ky/forEQ | ecad25c3e8a7fda378e867d067d49eb06ecd2092 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import math
from cereal import car, log
from common.numpy_fast import clip, interp
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblocking
import cereal.mess... | 42.252496 | 175 | 0.710389 |
import os
import math
from cereal import car, log
from common.numpy_fast import clip, interp
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblocking
import cereal.messaging as messaging
fro... | true | true |
f70332380c19749fdaaa89b3db41948706f18fba | 228 | py | Python | main.py | ConnorDoesDev/cozmo | dc2e4574d056b6e61e1e7042c3b32d7e0d00f055 | [
"CC0-1.0"
] | null | null | null | main.py | ConnorDoesDev/cozmo | dc2e4574d056b6e61e1e7042c3b32d7e0d00f055 | [
"CC0-1.0"
] | null | null | null | main.py | ConnorDoesDev/cozmo | dc2e4574d056b6e61e1e7042c3b32d7e0d00f055 | [
"CC0-1.0"
] | null | null | null | import cozmo
name = input("What is your name? ")
def cozmo_program(robot: cozmo.robot.Robot):
robot.say_text(
f"Hi! My name is Cozmo. How are you, {name}?").wait_for_completed()
cozmo.run_program(cozmo_program)
| 19 | 75 | 0.697368 | import cozmo
name = input("What is your name? ")
def cozmo_program(robot: cozmo.robot.Robot):
robot.say_text(
f"Hi! My name is Cozmo. How are you, {name}?").wait_for_completed()
cozmo.run_program(cozmo_program)
| true | true |
f7033349b9962b4cac2915283c209a909c7aede1 | 2,212 | py | Python | tests/test_buffer.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 40 | 2016-02-18T18:01:23.000Z | 2022-03-31T10:34:33.000Z | tests/test_buffer.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 56 | 2016-02-10T16:51:07.000Z | 2020-02-07T05:28:49.000Z | tests/test_buffer.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 12 | 2016-03-29T17:29:28.000Z | 2021-10-30T14:36:39.000Z | # Copyright (c) 2016 Uber Technologies, Inc.
#
# 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, publ... | 29.891892 | 79 | 0.726944 |
from __future__ import absolute_import, unicode_literals, print_function
import pytest
from thriftrw._buffer import ReadBuffer
from thriftrw._buffer import WriteBuffer
from thriftrw.errors import EndOfInputError
def test_empty_write_buffer():
buff = WriteBuffer(10)
assert buff.length == ... | true | true |
f703347dfba74e588f8315118b141a54de310acd | 44,993 | py | Python | tests/integration/test_packagewagl.py | joestasks/eo-datasets | 6df2fffb5a773a8c65980a8c75d22fd5bb937edc | [
"Apache-2.0"
] | null | null | null | tests/integration/test_packagewagl.py | joestasks/eo-datasets | 6df2fffb5a773a8c65980a8c75d22fd5bb937edc | [
"Apache-2.0"
] | null | null | null | tests/integration/test_packagewagl.py | joestasks/eo-datasets | 6df2fffb5a773a8c65980a8c75d22fd5bb937edc | [
"Apache-2.0"
] | 1 | 2021-05-21T03:05:54.000Z | 2021-05-21T03:05:54.000Z | from binascii import crc32
from contextlib import contextmanager
from datetime import datetime, timedelta, timezone
from pathlib import Path
from osgeo import gdal
import pytest
import rasterio
from click.testing import CliRunner
from rasterio import DatasetReader
from rasterio.enums import Compression
from rio_cogeo ... | 43.096743 | 110 | 0.510613 | from binascii import crc32
from contextlib import contextmanager
from datetime import datetime, timedelta, timezone
from pathlib import Path
from osgeo import gdal
import pytest
import rasterio
from click.testing import CliRunner
from rasterio import DatasetReader
from rasterio.enums import Compression
from rio_cogeo ... | true | true |
f70335d255da69b8ffa2473040f343fc73572ee4 | 1,551 | py | Python | alleco/spiders/ross_t.py | crocojim18/alleco | 29d8eb5b814e48e28a794b1bb5a3db1da47b101c | [
"Apache-2.0"
] | 1 | 2020-12-12T00:33:01.000Z | 2020-12-12T00:33:01.000Z | alleco/spiders/ross_t.py | crocojim18/alleco | 29d8eb5b814e48e28a794b1bb5a3db1da47b101c | [
"Apache-2.0"
] | null | null | null | alleco/spiders/ross_t.py | crocojim18/alleco | 29d8eb5b814e48e28a794b1bb5a3db1da47b101c | [
"Apache-2.0"
] | null | null | null | import scrapy, re
from alleco.objects.official import Official
class ross_t(scrapy.Spider):
name = "ross_t"
muniName = "ROSS"
muniType = "TOWNSHIP"
complete = True
def start_requests(self):
urls = ['https://www.ross.pa.us/245/Board-of-Commissioners',
'https://www.ross.pa.us/225/Other-Elected-Offic... | 31.02 | 102 | 0.600258 | import scrapy, re
from alleco.objects.official import Official
class ross_t(scrapy.Spider):
name = "ross_t"
muniName = "ROSS"
muniType = "TOWNSHIP"
complete = True
def start_requests(self):
urls = ['https://www.ross.pa.us/245/Board-of-Commissioners',
'https://www.ross.pa.us/225/Other-Elected-Offic... | true | true |
f703360b45b569aefa99c691fa9c466399212414 | 1,345 | py | Python | PythonInterview/DesigPattern/BehaviorPattern/State.py | xtawfnhdx/PythonInterview | 515675ffd86eb1ad3bfa631fd3c88fddcf411e98 | [
"Apache-2.0"
] | null | null | null | PythonInterview/DesigPattern/BehaviorPattern/State.py | xtawfnhdx/PythonInterview | 515675ffd86eb1ad3bfa631fd3c88fddcf411e98 | [
"Apache-2.0"
] | null | null | null | PythonInterview/DesigPattern/BehaviorPattern/State.py | xtawfnhdx/PythonInterview | 515675ffd86eb1ad3bfa631fd3c88fddcf411e98 | [
"Apache-2.0"
] | null | null | null | """
状态模式
"""
from __future__ import annotations
from abc import ABC, abstractmethod
class Context:
# 状态(状态模式的判断)
_state: State = None
def __init__(self, state: State) -> None:
self.transition_to(state)
def transition_to(self, state: State) -> None:
# 根据不同状态,切换上下文
self._state ... | 19.492754 | 52 | 0.615613 | from __future__ import annotations
from abc import ABC, abstractmethod
class Context:
_state: State = None
def __init__(self, state: State) -> None:
self.transition_to(state)
def transition_to(self, state: State) -> None:
self._state = state
self._state.context = se... | true | true |
f70336bae759c307733aa144b61511bf821e100a | 5,125 | py | Python | src/solutions/common/bizz/customer_signups.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/bizz/customer_signups.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/solutions/common/bizz/customer_signups.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | 55.706522 | 117 | 0.674732 |
import json
from mcfw.rpc import arguments, returns
from rogerthat.models import Message
from rogerthat.models.properties.forms import FormResult
from rogerthat.rpc import users
from rogerthat.service.api import messaging
from rogerthat.to.messaging.forms import TextBlockFormTO, TextBlockTO, FormTO
fr... | true | true |
f70336d4d611fb85c2969f6bdbbb5dbe9b44613a | 2,648 | py | Python | data_processing/draw_value_map.py | liiliiliil/ride-hailing-platform-with-simulator | c9eae7f718c9e10c7ba4955e5093d4fb21d16d25 | [
"MIT"
] | 3 | 2020-04-29T05:42:14.000Z | 2021-07-13T17:54:13.000Z | data_processing/draw_value_map.py | liiliiliil/ride-hailing-platform-with-simulator | c9eae7f718c9e10c7ba4955e5093d4fb21d16d25 | [
"MIT"
] | null | null | null | data_processing/draw_value_map.py | liiliiliil/ride-hailing-platform-with-simulator | c9eae7f718c9e10c7ba4955e5093d4fb21d16d25 | [
"MIT"
] | null | null | null | import os
import time
import pickle
import math
import numpy as np
import linecache
import matplotlib.pyplot as plt
# from matplotlib.pyplot import MultipleLocator
import grid
data_path = 'E:/dataset/didi/processed'
save_path = 'E:/dataset/didi/processed/order_20161101_sampled_value_map_fig'
data_file_name = 'process... | 31.52381 | 109 | 0.737915 | import os
import time
import pickle
import math
import numpy as np
import linecache
import matplotlib.pyplot as plt
import grid
data_path = 'E:/dataset/didi/processed'
save_path = 'E:/dataset/didi/processed/order_20161101_sampled_value_map_fig'
data_file_name = 'processed_data'
value_map_file_name = 'value_map'
... | true | true |
f7033767526f4de70d6ab0249e98b75127d3a2b1 | 185 | py | Python | Miscellaneous/Big Chess.py | Joon7891/Competitive-Programming | d860b7ad932cd5a6fb91fdc8c53101da57f4a408 | [
"MIT"
] | 2 | 2021-04-13T00:19:56.000Z | 2021-04-13T01:19:45.000Z | Miscellaneous/Big Chess.py | Joon7891/Competitive-Programming | d860b7ad932cd5a6fb91fdc8c53101da57f4a408 | [
"MIT"
] | null | null | null | Miscellaneous/Big Chess.py | Joon7891/Competitive-Programming | d860b7ad932cd5a6fb91fdc8c53101da57f4a408 | [
"MIT"
] | 1 | 2020-08-26T12:36:08.000Z | 2020-08-26T12:36:08.000Z | w = int(input())
h = int(input())
for i in range(h):
output = str()
for j in range(w):
if (i + j) % 2 == 0:
output += '0'
else:
output += '1'
print(output) | 15.416667 | 24 | 0.464865 | w = int(input())
h = int(input())
for i in range(h):
output = str()
for j in range(w):
if (i + j) % 2 == 0:
output += '0'
else:
output += '1'
print(output) | true | true |
f70338de0edbbe39a2087fe87b86ac520180bef2 | 1,652 | py | Python | bridges/text.py | BridgesUNCC/bridges-python | bf1f9697a45bf6d7748f22dbbcbff4c20cfb2229 | [
"MIT"
] | 1 | 2020-09-21T15:13:27.000Z | 2020-09-21T15:13:27.000Z | bridges/text.py | BridgesUNCC/bridges-python | bf1f9697a45bf6d7748f22dbbcbff4c20cfb2229 | [
"MIT"
] | 57 | 2019-07-02T21:30:28.000Z | 2021-11-05T23:27:50.000Z | bridges/text.py | BridgesUNCC/bridges-python | bf1f9697a45bf6d7748f22dbbcbff4c20cfb2229 | [
"MIT"
] | 3 | 2020-03-24T16:15:20.000Z | 2021-04-14T20:44:43.000Z | from bridges.symbol import *
class Text(Symbol):
def __init__(self, label = None):
super(Text, self).__init__()
if label is not None:
self._text = label
else:
self._text = ""
self.stroke_width = 1.0
self._font_size = None
self._anchor_ali... | 23.942029 | 74 | 0.61138 | from bridges.symbol import *
class Text(Symbol):
def __init__(self, label = None):
super(Text, self).__init__()
if label is not None:
self._text = label
else:
self._text = ""
self.stroke_width = 1.0
self._font_size = None
self._anchor_ali... | true | true |
f70338e59ee89ab97f79697d0e146ad9d944ad81 | 21,739 | py | Python | hgraph/decoder.py | Amir-Mehrpanah/hgraph2graph | 6d37153afe09f7684381ce56e8366675e22833e9 | [
"MIT"
] | 182 | 2019-11-15T15:59:31.000Z | 2022-03-31T09:17:40.000Z | hgraph/decoder.py | Amir-Mehrpanah/hgraph2graph | 6d37153afe09f7684381ce56e8366675e22833e9 | [
"MIT"
] | 30 | 2020-03-03T16:35:52.000Z | 2021-12-16T04:06:57.000Z | hgraph/decoder.py | Amir-Mehrpanah/hgraph2graph | 6d37153afe09f7684381ce56e8366675e22833e9 | [
"MIT"
] | 60 | 2019-11-15T05:06:11.000Z | 2022-03-31T16:43:12.000Z | import torch
import torch.nn as nn
import rdkit.Chem as Chem
import torch.nn.functional as F
from hgraph.nnutils import *
from hgraph.encoder import IncHierMPNEncoder
from hgraph.mol_graph import MolGraph
from hgraph.inc_graph import IncTree, IncGraph
class HTuple():
def __init__(self, node=None, mess=None, vmask=... | 50.67366 | 161 | 0.613874 | import torch
import torch.nn as nn
import rdkit.Chem as Chem
import torch.nn.functional as F
from hgraph.nnutils import *
from hgraph.encoder import IncHierMPNEncoder
from hgraph.mol_graph import MolGraph
from hgraph.inc_graph import IncTree, IncGraph
class HTuple():
def __init__(self, node=None, mess=None, vmask=... | true | true |
f70338ff7323a5c76ee61cfe7dd8a5e65737c22d | 13,064 | py | Python | ml/rl/test/test_normalization.py | johncliu/Horizon | cfa7a873ada5de3bb01e78e2f237d9849b8270b2 | [
"BSD-3-Clause"
] | null | null | null | ml/rl/test/test_normalization.py | johncliu/Horizon | cfa7a873ada5de3bb01e78e2f237d9849b8270b2 | [
"BSD-3-Clause"
] | 1 | 2021-08-25T16:13:32.000Z | 2021-08-25T16:13:32.000Z | ml/rl/test/test_normalization.py | johncliu/Horizon | cfa7a873ada5de3bb01e78e2f237d9849b8270b2 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import unittest
import numpy as np
import numpy.testing as npt
import six
from caffe2.python import core, workspace
from ml.rl.caffe_utils import C2
from ml.rl.preprocessing import identify_types, normalization
from ml.rl.p... | 40.44582 | 88 | 0.568739 |
import unittest
import numpy as np
import numpy.testing as npt
import six
from caffe2.python import core, workspace
from ml.rl.caffe_utils import C2
from ml.rl.preprocessing import identify_types, normalization
from ml.rl.preprocessing.identify_types import BOXCOX, CONTINUOUS, ENUM
from ml.rl.preprocessing.normaliz... | true | true |
f703395293ac6a585fa8603d6f52a53ad6dfb7f8 | 214 | py | Python | speech_to_text.py | wizelab8/SmartMirror | bad186d4eceb6b6adfdcef90e7d93abfc04d9d61 | [
"MIT"
] | null | null | null | speech_to_text.py | wizelab8/SmartMirror | bad186d4eceb6b6adfdcef90e7d93abfc04d9d61 | [
"MIT"
] | null | null | null | speech_to_text.py | wizelab8/SmartMirror | bad186d4eceb6b6adfdcef90e7d93abfc04d9d61 | [
"MIT"
] | null | null | null | import speech_recognition as sr
r=sr.Recognizer()
with sr.Microphone() as source:
print("Say Something")
sudio=r.listen(source)
print("Time over")
try:
print("Text: "+r.recognize_google(audio))
except:
pass
| 17.833333 | 42 | 0.733645 | import speech_recognition as sr
r=sr.Recognizer()
with sr.Microphone() as source:
print("Say Something")
sudio=r.listen(source)
print("Time over")
try:
print("Text: "+r.recognize_google(audio))
except:
pass
| true | true |
f7033a70f3105413b45ff36d1978c4ae3751b697 | 110 | py | Python | Scrolls/spin_box.py | hemidvsmusayev/Tkinter-learn | 3d35d7fedbda92a47450b84e3896e701e95de8cf | [
"MIT"
] | 1 | 2020-08-27T12:31:12.000Z | 2020-08-27T12:31:12.000Z | Scrolls/spin_box.py | hemidvsmusayev/Tkinter-learn | 3d35d7fedbda92a47450b84e3896e701e95de8cf | [
"MIT"
] | null | null | null | Scrolls/spin_box.py | hemidvsmusayev/Tkinter-learn | 3d35d7fedbda92a47450b84e3896e701e95de8cf | [
"MIT"
] | null | null | null | import tkinter
from tkinter import *
win = Tk()
sb = Spinbox(win, from_=0, to=10)
sb.pack()
win.mainloop()
| 11 | 33 | 0.672727 | import tkinter
from tkinter import *
win = Tk()
sb = Spinbox(win, from_=0, to=10)
sb.pack()
win.mainloop()
| true | true |
f7033ca4dec08844ca82210c2422ba759e6b77a2 | 1,026 | py | Python | visual_dynamics/envs/servoing_env.py | alexlee-gk/visual_dynamics | 90227bb0d0aebb1989117b5c25ca311655ca7cc7 | [
"MIT"
] | 30 | 2017-04-05T12:55:09.000Z | 2022-03-14T14:31:31.000Z | visual_dynamics/envs/servoing_env.py | alexlee-gk/visual_dynamics | 90227bb0d0aebb1989117b5c25ca311655ca7cc7 | [
"MIT"
] | 1 | 2017-06-19T02:39:03.000Z | 2017-06-19T02:39:03.000Z | visual_dynamics/envs/servoing_env.py | alexlee-gk/visual_dynamics | 90227bb0d0aebb1989117b5c25ca311655ca7cc7 | [
"MIT"
] | 13 | 2017-04-05T12:55:09.000Z | 2021-03-16T01:59:12.000Z | import citysim3d.envs
from visual_dynamics.envs import Env
class ServoingEnv(citysim3d.envs.SimpleQuadPanda3dServoingEnv, Env):
def _get_config(self):
config = super(ServoingEnv, self)._get_config()
config.update({'env': self.env,
'max_time_steps': self.max_time_steps,
... | 35.37931 | 95 | 0.650097 | import citysim3d.envs
from visual_dynamics.envs import Env
class ServoingEnv(citysim3d.envs.SimpleQuadPanda3dServoingEnv, Env):
def _get_config(self):
config = super(ServoingEnv, self)._get_config()
config.update({'env': self.env,
'max_time_steps': self.max_time_steps,
... | true | true |
f7033cd7e4893924e98add48a902ed4e0b88f83b | 99 | py | Python | mmgen/core/runners/__init__.py | HXWAndCL/mmgeneration | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | [
"Apache-2.0"
] | 1 | 2021-05-27T13:04:41.000Z | 2021-05-27T13:04:41.000Z | mmgen/core/runners/__init__.py | HXWAndCL/mmgeneration | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | [
"Apache-2.0"
] | null | null | null | mmgen/core/runners/__init__.py | HXWAndCL/mmgeneration | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | [
"Apache-2.0"
] | null | null | null | from .dynamic_iterbased_runner import DynamicIterBasedRunner
__all__ = ['DynamicIterBasedRunner']
| 24.75 | 60 | 0.858586 | from .dynamic_iterbased_runner import DynamicIterBasedRunner
__all__ = ['DynamicIterBasedRunner']
| true | true |
f7033d3f1df341c0c9e8478d54d75955524ba2a4 | 3,159 | py | Python | transports/africas_talking/api.py | uw-ictd/mwbase | 6a46b5c5459a6bb6e1ba84ea74f689da8efe9687 | [
"Apache-2.0"
] | 1 | 2021-07-17T00:18:06.000Z | 2021-07-17T00:18:06.000Z | transports/africas_talking/api.py | akettel/mwbase | 873b4fe8038f16feba5273990b0eb2109f8f05c6 | [
"Apache-2.0"
] | 4 | 2017-08-31T17:09:53.000Z | 2018-11-28T06:01:00.000Z | transports/africas_talking/api.py | akettel/mwbase | 873b4fe8038f16feba5273990b0eb2109f8f05c6 | [
"Apache-2.0"
] | 2 | 2018-09-17T22:06:16.000Z | 2021-07-17T00:18:09.000Z | #Django Imports
from django.conf import settings
#Python Imports
import requests, os
#Local Imports
from .at_utils import AfricasTalkingException
#Import Afica's Talking Settings
AFRICAS_TALKING_SETTINGS = getattr(settings,'AFRICAS_TALKING',{})
API_KEY = AFRICAS_TALKING_SETTINGS.get('API_KEY',None)
USERNAME = AFRI... | 31.277228 | 89 | 0.703704 |
from django.conf import settings
import requests, os
from .at_utils import AfricasTalkingException
AFRICAS_TALKING_SETTINGS = getattr(settings,'AFRICAS_TALKING',{})
API_KEY = AFRICAS_TALKING_SETTINGS.get('API_KEY',None)
USERNAME = AFRICAS_TALKING_SETTINGS.get('USERNAME',None)
SHORTCODE = AFRICAS_TALKING_SETTI... | true | true |
f7033d4e31ab8da3329a0d30ffb3e92dfaa3387b | 1,455 | py | Python | third-party/paxos/.waf3-2.0.18-96675f149f50dab16c9e2e6aaf5e787b/waflib/processor.py | shenweihai1/rolis-eurosys2022 | 59b3fd58144496a9b13415e30b41617b34924323 | [
"MIT"
] | 1 | 2022-02-13T13:01:25.000Z | 2022-02-13T13:01:25.000Z | third-party/paxos/.waf3-2.0.18-96675f149f50dab16c9e2e6aaf5e787b/waflib/processor.py | shenweihai1/rolis-eurosys2022 | 59b3fd58144496a9b13415e30b41617b34924323 | [
"MIT"
] | null | null | null | third-party/paxos/.waf3-2.0.18-96675f149f50dab16c9e2e6aaf5e787b/waflib/processor.py | shenweihai1/rolis-eurosys2022 | 59b3fd58144496a9b13415e30b41617b34924323 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,sys,traceback,base64,signal
try:
import cPickle
except ImportError:
import pickle as cPickle
try:
import subprocess32 as subprocess
except ImportError:
import subprocess
try:
TimeoutEx... | 25.086207 | 78 | 0.740893 |
k,base64,signal
try:
import cPickle
except ImportError:
import pickle as cPickle
try:
import subprocess32 as subprocess
except ImportError:
import subprocess
try:
TimeoutExpired=subprocess.TimeoutExpired
except AttributeError:
class TimeoutExpired(Exception):
pass
def run():
txt=sys.stdin.readline().strip()
... | true | true |
f7033da129b07b9ecaa7a700cbea4abdb55903f6 | 9,717 | py | Python | IPython/utils/PyColorize.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | 1 | 2017-02-09T20:01:11.000Z | 2017-02-09T20:01:11.000Z | IPython/utils/PyColorize.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/utils/PyColorize.py | flexlee/ipython | 7528fbd76073c90262b9ac127de57c4c59b23a5c | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Class and program to colorize python source code for ANSI terminals.
Based on an HTML code highlighter by Jurgen Hermann found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
Modifications by Fernando Perez (fperez@colorado.edu).
Information on the original HTML highligh... | 31.244373 | 79 | 0.594731 |
from __future__ import print_function
from __future__ import unicode_literals
__all__ = ['ANSICodeColors','Parser']
_scheme_default = 'Linux'
import StringIO
import keyword
import os
import optparse
import sys
import token
import tokenize
try:
generate_tokens = tokenize.generate_tokens
except AttributeError... | true | true |
f7033de84a70c8e86392ecb3d7d2137d33cc8e79 | 1,685 | py | Python | duckbot/util/logger.py | NicholasMarasco/duckbot | 4aec17ddb426094229d0ea006520d82a1fc8a057 | [
"MIT"
] | 4 | 2018-06-15T18:29:15.000Z | 2019-09-12T00:24:57.000Z | duckbot/util/logger.py | NicholasMarasco/duckbot | 4aec17ddb426094229d0ea006520d82a1fc8a057 | [
"MIT"
] | 40 | 2018-04-26T18:43:52.000Z | 2021-06-01T21:55:32.000Z | duckbot/util/logger.py | NicholasMarasco/duckbot | 4aec17ddb426094229d0ea006520d82a1fc8a057 | [
"MIT"
] | null | null | null | # Last Updated: 2.2
from datetime import datetime
from util.diagMessage import DiagMessage
# Logger class
# Buffers and writes messages to a file
class Logger:
BUFFER_MAX = 10
DEFAULT_FN = "../log.txt"
# Constructor for logger class
# Params: fn - file name to use or leave default
# log -... | 30.636364 | 74 | 0.554896 |
from datetime import datetime
from util.diagMessage import DiagMessage
class Logger:
BUFFER_MAX = 10
DEFAULT_FN = "../log.txt"
def __init__(self, fn = DEFAULT_FN, log = True):
self.keep_log = log
self.fn = fn
self.log_buffer = []
if self.keep_log... | true | true |
f7033f127c32c6571eaa25db4bd8797b56f614e4 | 5,418 | py | Python | thimbles/metadata.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | thimbles/metadata.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | thimbles/metadata.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | # Standard Library
from copy import deepcopy
# 3rd Party
# Internal
# ########################################################################### #
class MetaData (dict):
"""
A class for holding information about an object
"""
def __init__ (self,*args,**kwargs):
super(MetaData,self).__... | 30.268156 | 89 | 0.486342 |
from copy import deepcopy
pass
return obs_time
def guess_airmass(self, headers):
if headers == None:
headers = self.header_list()
airmass = None
for hdr in headers:
try:
airmass = hdr["airmass"]
break
... | true | true |
f7033f4a9423ceac627bb81964971329e2cecd25 | 1,373 | py | Python | cfg/dfaccto/event.py | lw0/dfaccto_lib | 9162fbe0649db2d8735b7d62b92367488f4d716e | [
"MIT"
] | null | null | null | cfg/dfaccto/event.py | lw0/dfaccto_lib | 9162fbe0649db2d8735b7d62b92367488f4d716e | [
"MIT"
] | null | null | null | cfg/dfaccto/event.py | lw0/dfaccto_lib | 9162fbe0649db2d8735b7d62b92367488f4d716e | [
"MIT"
] | null | null | null | Inc('dfaccto/util.py', abs=True)
class _Event(ModuleContext):
def __init__(self):
ModuleContext.__init__(self)
self._setup_packages()
def _setup_packages(self):
self.pkg = Pkg('dfaccto_event',
x_templates={self.File('generic/package.vhd.tpl'): self.File('pkg/dfaccto_event.vhd')})
with se... | 32.690476 | 99 | 0.658412 | Inc('dfaccto/util.py', abs=True)
class _Event(ModuleContext):
def __init__(self):
ModuleContext.__init__(self)
self._setup_packages()
def _setup_packages(self):
self.pkg = Pkg('dfaccto_event',
x_templates={self.File('generic/package.vhd.tpl'): self.File('pkg/dfaccto_event.vhd')})
with se... | true | true |
f7033f7131f37c959b46efa3f188e5997f2d6feb | 13,433 | py | Python | core/smplx/lbs_.py | boycehbz/DMMR | 18fcee7ce584fdccfa08bcda883d9b4fcb962c04 | [
"MIT"
] | 37 | 2021-12-15T03:13:38.000Z | 2022-03-31T23:01:25.000Z | core/smplx/lbs_.py | boycehbz/DMMR | 18fcee7ce584fdccfa08bcda883d9b4fcb962c04 | [
"MIT"
] | 4 | 2021-12-21T19:19:25.000Z | 2022-03-27T07:50:43.000Z | core/smplx/lbs_.py | boycehbz/DMMR | 18fcee7ce584fdccfa08bcda883d9b4fcb962c04 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is
# holder of all proprietary rights on this computer program.
# You can only use this computer program if you have closed
# a license agreement with MPG or you get the right to use the computer
# program from someone who is... | 36.207547 | 79 | 0.633812 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import torch
import torch.nn.functional as F
from .utils import rot_mat_to_euler
def find_dynamic_lmk_idx_and_bcoords(vertices, pose, dynamic_lmk_faces_idx,
... | true | true |
f7033f9a0566aab4239b64a1fc7d18e9989750b5 | 8,310 | py | Python | foxbmsflashtool/stm32flasher.py | foxBMS/foxBMS-flashtool | 1919f9742158938367d723ff25d0dc98cb13cfae | [
"CC-BY-4.0"
] | null | null | null | foxbmsflashtool/stm32flasher.py | foxBMS/foxBMS-flashtool | 1919f9742158938367d723ff25d0dc98cb13cfae | [
"CC-BY-4.0"
] | null | null | null | foxbmsflashtool/stm32flasher.py | foxBMS/foxBMS-flashtool | 1919f9742158938367d723ff25d0dc98cb13cfae | [
"CC-BY-4.0"
] | 3 | 2017-08-30T05:07:16.000Z | 2021-06-15T08:13:56.000Z | """
foxBMS Software License
Copyright 2010-2016, Fraunhofer-Gesellschaft zur Foerderung
der angewandten Forschung e.V.
All rights reserved.
BSD 3-Clause License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions ... | 38.472222 | 114 | 0.644404 |
import stm32interface
import argparse
import sys
import logging
class STM32Flasher(stm32interface.STM32Interface):
def __init__(self, port = None, file = None, baudrate=115200,
address = 0x08000000, goaddress = -1, bytes = 256,**kwargs):
stm32interface.STM32Interface.__init__(se... | true | true |
f7033fb7efae86dad225efa7b01c333e805ff430 | 3,804 | py | Python | covsirphy/loading/db_owid.py | ardhanii/covid19-sir | 87881963c49a2fc5b6235c8b21269d216acaa941 | [
"Apache-2.0"
] | 97 | 2020-05-15T15:20:15.000Z | 2022-03-18T02:55:54.000Z | covsirphy/loading/db_owid.py | ardhanii/covid19-sir | 87881963c49a2fc5b6235c8b21269d216acaa941 | [
"Apache-2.0"
] | 970 | 2020-06-01T13:48:34.000Z | 2022-03-29T08:20:49.000Z | covsirphy/loading/db_owid.py | ardhani31/Covid19-SIRV-v3 | 59d95156b375c41259c46ce4e656b86903f92ec2 | [
"Apache-2.0"
] | 36 | 2020-05-15T15:36:43.000Z | 2022-02-25T17:59:08.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import country_converter as coco
import pandas as pd
from covsirphy.util.term import Term
from covsirphy.loading.db_base import _RemoteDatabase
class _OWID(_RemoteDatabase):
"""
Access "Our World In Data".
https://github.com/owid/covid-19-data/tree/master/pub... | 40.468085 | 113 | 0.608307 |
import country_converter as coco
import pandas as pd
from covsirphy.util.term import Term
from covsirphy.loading.db_base import _RemoteDatabase
class _OWID(_RemoteDatabase):
URL_V = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/"
URL_V_REC = f"{URL_V}vaccination... | true | true |
f7033ff4f37a0b03e3ac28f1687f598056116852 | 1,262 | py | Python | cli/print_command.py | nicogno/biodynamo | f875994d4ea9aa07f938283719d5db83e450bfb8 | [
"Apache-2.0"
] | null | null | null | cli/print_command.py | nicogno/biodynamo | f875994d4ea9aa07f938283719d5db83e450bfb8 | [
"Apache-2.0"
] | null | null | null | cli/print_command.py | nicogno/biodynamo | f875994d4ea9aa07f938283719d5db83e450bfb8 | [
"Apache-2.0"
] | null | null | null | # -----------------------------------------------------------------------------
#
# Copyright (C) 2021 CERN & Newcastle University for the benefit of the
# BioDynaMo collaboration. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | 30.047619 | 79 | 0.568146 |
class Print:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
@staticmethod
def success(message):
print(Print... | true | true |
f70342d9e8c689b06d4e580e179acf489a73a9f6 | 86,371 | py | Python | flexget/tests/test_series.py | vxcamiloxv/Flexget | f18e53b59b768515d8e67464b8cc41bddfc00c33 | [
"MIT"
] | null | null | null | flexget/tests/test_series.py | vxcamiloxv/Flexget | f18e53b59b768515d8e67464b8cc41bddfc00c33 | [
"MIT"
] | null | null | null | flexget/tests/test_series.py | vxcamiloxv/Flexget | f18e53b59b768515d8e67464b8cc41bddfc00c33 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from io import StringIO
import pytest
from jinja2 import Template
from flexget.entry import Entry
from flexget.logger import capture_output
from flexget.manager import ge... | 35.764389 | 119 | 0.56974 | from __future__ import unicode_literals, division, absolute_import
from builtins import *
from io import StringIO
import pytest
from jinja2 import Template
from flexget.entry import Entry
from flexget.logger import capture_output
from flexget.manager import get_parser, Session
from flexget.task import TaskAbort
fr... | true | true |
f70343e6e7ddd0d8985779f9174451404e9e56fc | 1,162 | py | Python | test/moduletest/CloudTestModule.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 6 | 2018-08-10T17:11:10.000Z | 2020-04-29T07:05:36.000Z | test/moduletest/CloudTestModule.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 58 | 2018-08-13T08:36:08.000Z | 2021-07-07T08:32:52.000Z | test/moduletest/CloudTestModule.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 7 | 2018-08-10T12:53:18.000Z | 2021-11-08T05:15:42.000Z | #!/usr/bin/env python
"""
Copyright 2017 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | 34.176471 | 100 | 0.729776 |
import mock
def create(*args, **kwargs):
attrs = {"client.get_suite.return_value": True, "get_campaign_id.side_effect": [True, KeyError],
"get_campaigns.return_value": True, "update_testcase.return_value": True,
"upload_results.side_effect": [True, False]}
mock_module = mock.MagicM... | true | true |
f703448814e4eb2abf9bb8db939e2be59c31a6c8 | 8,765 | py | Python | tools/deletebyquery/deletebyquery.py | tloubrieu-jpl/incubator-sdap-nexus | 5bf903f04f12eb27f25ea2aa738c617ca404a87b | [
"Apache-2.0"
] | 1 | 2019-11-25T18:49:26.000Z | 2019-11-25T18:49:26.000Z | tools/deletebyquery/deletebyquery.py | ifenty/incubator-sdap-nexus | 3059c66f53d3f3d24c74d557c7632bdcc7f1eeec | [
"Apache-2.0"
] | null | null | null | tools/deletebyquery/deletebyquery.py | ifenty/incubator-sdap-nexus | 3059c66f53d3f3d24c74d557c7632bdcc7f1eeec | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 34.644269 | 129 | 0.625214 |
import argparse
import json
import logging
import uuid
from random import sample
import cassandra.concurrent
from cassandra.cluster import Cluster
from cassandra.policies import RoundRobinPolicy, TokenAwarePolicy
from solrcloudpy import SolrConnection, SearchOptions
from six.moves import input
solr_c... | true | true |
f7034515e7982807c4d1cc43fd9bae671c33fcd0 | 1,080 | py | Python | parse_ssdeep_output.py | tanner-g/file_attribution_script | cd9a9494c899fbaca6eac4f334b2fce98daf7d38 | [
"MIT"
] | null | null | null | parse_ssdeep_output.py | tanner-g/file_attribution_script | cd9a9494c899fbaca6eac4f334b2fce98daf7d38 | [
"MIT"
] | null | null | null | parse_ssdeep_output.py | tanner-g/file_attribution_script | cd9a9494c899fbaca6eac4f334b2fce98daf7d38 | [
"MIT"
] | null | null | null | from decimal import *
# Purpose: read in SSDEEP output and print findings.
# Author: Tanner G.
def main():
file = open("ssdeep_comparison", "r")
# read past first line of output
file.readline()
filea_data = file.readline()
fileb_data = file.readline()
file.close()
totalCount = 0
similarities = 0
index = 0
... | 25.116279 | 73 | 0.636111 | from decimal import *
def main():
file = open("ssdeep_comparison", "r")
file.readline()
filea_data = file.readline()
fileb_data = file.readline()
file.close()
totalCount = 0
similarities = 0
index = 0
max_len = len(filea_data)
while index < max_len:
totalCount +=1
if filea_data[index] == "," or f... | true | true |
f703451d94b6fa098060ce938c6c71ce7ce1964f | 1,738 | py | Python | redis-cache.py | voidabhi/python-scripts | a6d06bd3ccf4ec24df521a3cf305d22176f68a18 | [
"MIT"
] | 2 | 2015-06-01T18:33:38.000Z | 2018-11-21T19:40:37.000Z | redis-cache.py | voidabhi/python-scripts | a6d06bd3ccf4ec24df521a3cf305d22176f68a18 | [
"MIT"
] | 102 | 2015-01-20T17:26:52.000Z | 2017-12-28T17:32:51.000Z | redis-cache.py | voidabhi/python-scripts | a6d06bd3ccf4ec24df521a3cf305d22176f68a18 | [
"MIT"
] | 3 | 2020-03-02T06:54:18.000Z | 2021-01-07T16:36:35.000Z | #!/usr/bin/env python
import cPickle
from functools import wraps
def redis_lru(capacity=5000, slice=slice(None)):
def decorator(func):
cache_keys = "lru:keys:%s" % (func.__name__,)
cache_vals = "lru:vals:%s" % (func.__name__,)
cache_hits = "lru:hits:%s" % (func.__name__,)
cache_miss = "lru:miss:%s" % (func.__... | 25.558824 | 80 | 0.644419 |
import cPickle
from functools import wraps
def redis_lru(capacity=5000, slice=slice(None)):
def decorator(func):
cache_keys = "lru:keys:%s" % (func.__name__,)
cache_vals = "lru:vals:%s" % (func.__name__,)
cache_hits = "lru:hits:%s" % (func.__name__,)
cache_miss = "lru:miss:%s" % (func.__name__,)
lvars =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.