hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3573300fa1ec1048c864b01f3873f9fb56b66e67 | 3,479 | py | Python | tensorflow_hub/tools/make_nearest_neighbour_index/index_builder_test.py | hrishikeshmane/hub | d6ee95376e80ce8e1df9a1f1057402c7ca98d4fa | [
"Apache-2.0"
] | 2 | 2020-06-20T14:10:42.000Z | 2020-10-12T07:10:30.000Z | tensorflow_hub/tools/make_nearest_neighbour_index/index_builder_test.py | hrishikeshmane/hub | d6ee95376e80ce8e1df9a1f1057402c7ca98d4fa | [
"Apache-2.0"
] | null | null | null | tensorflow_hub/tools/make_nearest_neighbour_index/index_builder_test.py | hrishikeshmane/hub | d6ee95376e80ce8e1df9a1f1057402c7ca98d4fa | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 35.141414 | 80 | 0.707675 | # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 0 | 0 | 0 | 1,252 | 0 | 75 | 0 | 42 | 91 |
3d2d90568041790a6144f4d9a48b3656bb48869c | 8,133 | py | Python | NvTK/Explainer/Featuremap.py | JiaqiLiZju/NvTK | 6b887670a03d63c1747d9854ecbbac13cc06461c | [
"BSD-3-Clause"
] | null | null | null | NvTK/Explainer/Featuremap.py | JiaqiLiZju/NvTK | 6b887670a03d63c1747d9854ecbbac13cc06461c | [
"BSD-3-Clause"
] | null | null | null | NvTK/Explainer/Featuremap.py | JiaqiLiZju/NvTK | 6b887670a03d63c1747d9854ecbbac13cc06461c | [
"BSD-3-Clause"
] | null | null | null | """Feature map based model interpretation methods in NvTK.
"""
import torch
import logging
import numpy as np
from .Motif import normalize_pwm
__all__ = ["get_activate_W", "get_fmap", "get_activate_W_from_fmap",
"get_activate_sequence_from_fmap", "save_activate_seqlets"]
def _get_W_from_conv(model, motif_width=... | 29.900735 | 130 | 0.606541 | """Feature map based model interpretation methods in NvTK.
"""
import torch
import logging
import numpy as np
from .Motif import normalize_pwm
__all__ = ["get_activate_W", "get_fmap", "get_activate_W_from_fmap",
"get_activate_sequence_from_fmap", "save_activate_seqlets"]
def _get_W_from_conv(model, motif_width=... | 0 | 0 | 0 | 314 | 0 | 292 | 0 | 0 | 45 |
13b0e9356e2e6ce5eefe154755e759bf2f849f53 | 5,335 | py | Python | tests/test_kernels/test_call.py | probabilistic-numerics/probnum | 93c26c935282b48cca4c4db72616f1e4ebad2266 | [
"MIT"
] | 226 | 2019-11-01T09:44:09.000Z | 2022-03-30T23:17:17.000Z | tests/test_kernels/test_call.py | probabilistic-numerics/probnum | 93c26c935282b48cca4c4db72616f1e4ebad2266 | [
"MIT"
] | 590 | 2019-11-21T08:32:30.000Z | 2022-03-31T12:37:37.000Z | tests/test_kernels/test_call.py | probabilistic-numerics/probnum | 93c26c935282b48cca4c4db72616f1e4ebad2266 | [
"MIT"
] | 39 | 2020-01-13T16:29:45.000Z | 2022-03-28T16:16:54.000Z | """Test cases for `Kernel.__call__`."""
from typing import Union
import numpy as np
D_IN = None
def test_type(call_result: Union[np.ndarray, np.floating]):
"""Test whether the type of the output of ``Kernel.__call__`` is a NumPy type, i.e.
an ``np.ndarray`` or a ``np.floating``."""
assert isinsta... | 27.358974 | 88 | 0.596064 | """Test cases for `Kernel.__call__`."""
from typing import Callable, Optional, Tuple, Union
import numpy as np
import pytest
import probnum as pn
from probnum.typing import ShapeType
from ._utils import _shape_param_to_id_str
D_IN = None
@pytest.fixture(
params=[
pytest.param(
(x0_shape, ... | 0 | 3,947 | 0 | 0 | 0 | 0 | 0 | 54 | 251 |
81ccb770ef1bc8e3c8aa79b5d198c1743290e0ad | 9,012 | py | Python | code/train_model_combined.py | gnunesm/CalibNet | 7ffbcbbdbeea56b24cb3c1a865443932164b1d99 | [
"MIT"
] | null | null | null | code/train_model_combined.py | gnunesm/CalibNet | 7ffbcbbdbeea56b24cb3c1a865443932164b1d99 | [
"MIT"
] | null | null | null | code/train_model_combined.py | gnunesm/CalibNet | 7ffbcbbdbeea56b24cb3c1a865443932164b1d99 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import scipy.misc as smc
import config_res as config
from common import all_transformer as at3
from common import global_agg_net
from common.Lie_functions import exponential_map_single
import nw_loader_color as ldr
import model_utils
_BETA_CONST = 1.0
_ALPHA_CONST = 1.0
IM... | 49.516484 | 348 | 0.721815 | import numpy as np
import tensorflow as tf
import scipy.misc as smc
import config_res as config
from common.cnn_utils_res import *
from common import resnet_rgb_model as model
from common import resnet_depth_model as model_depth
from common import all_transformer as at3
from common import global_agg_net
from common.L... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 67 | 67 |
65666f87d811e962fadfb3ef6672c780bd4f32ea | 1,045 | py | Python | Day14/higher_lower.py | MHKomeili/100DaysofCode | a5799011a43f777ddc5ac9e649aa27291313b62b | [
"MIT"
] | null | null | null | Day14/higher_lower.py | MHKomeili/100DaysofCode | a5799011a43f777ddc5ac9e649aa27291313b62b | [
"MIT"
] | null | null | null | Day14/higher_lower.py | MHKomeili/100DaysofCode | a5799011a43f777ddc5ac9e649aa27291313b62b | [
"MIT"
] | null | null | null |
game() | 22.717391 | 90 | 0.583732 | import random
from art import logo, vs
from utils import clear
from game_data import data
def pick_randomly():
item_dict = random.choice(data)
return item_dict
def display(itemA, itemB):
print(f"Compare A: {itemA['name']}, {itemA['description']}, from {itemA['country']}.")
print(vs)
print(f"Agai... | 0 | 0 | 0 | 0 | 0 | 849 | 0 | 2 | 185 |
910ceef698c8d92898c9fe96e28cd1560e616425 | 105 | py | Python | sklearn_extra/__init__.py | pcerda/scikit-learn-extra | 0e954932e3316f80a9eed7e17d39a48d1fb9fa81 | [
"BSD-3-Clause"
] | null | null | null | sklearn_extra/__init__.py | pcerda/scikit-learn-extra | 0e954932e3316f80a9eed7e17d39a48d1fb9fa81 | [
"BSD-3-Clause"
] | null | null | null | sklearn_extra/__init__.py | pcerda/scikit-learn-extra | 0e954932e3316f80a9eed7e17d39a48d1fb9fa81 | [
"BSD-3-Clause"
] | null | null | null |
from ._version import __version__
__all__ = ["__version__"]
| 17.5 | 42 | 0.771429 | from . import kernel_approximation # noqa
from ._version import __version__
__all__ = ["__version__"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 30 |
2fe79f421d44e3c5caf75726652fb8ec9c7fcbc6 | 420 | py | Python | flow/multiagent_envs/loop/loop_accel.py | SHITIANYU-hue/flow | 6fb5697868517fea7098a81b78c1be8e925f09f7 | [
"MIT"
] | 805 | 2018-08-16T22:30:51.000Z | 2022-03-31T09:25:50.000Z | flow/multiagent_envs/loop/loop_accel.py | SHITIANYU-hue/flow | 6fb5697868517fea7098a81b78c1be8e925f09f7 | [
"MIT"
] | 879 | 2018-08-22T17:37:06.000Z | 2022-03-29T01:06:11.000Z | flow/multiagent_envs/loop/loop_accel.py | SHITIANYU-hue/flow | 6fb5697868517fea7098a81b78c1be8e925f09f7 | [
"MIT"
] | 325 | 2018-08-22T06:48:00.000Z | 2022-03-21T15:09:04.000Z | """Pending deprecation file.
To view the actual content, go to: flow/envs/multiagent/ring/accel.py
"""
| 28 | 73 | 0.761905 | """Pending deprecation file.
To view the actual content, go to: flow/envs/multiagent/ring/accel.py
"""
from flow.utils.flow_warnings import deprecated
from flow.envs.multiagent.ring.accel import AdversarialAccelEnv as MAAEnv
@deprecated('flow.multiagent_envs.loop.loop_accel',
'flow.envs.multiagent.ring.a... | 0 | 170 | 0 | 0 | 0 | 0 | 0 | 78 | 67 |
538d1d546ddf32f57af4675331067e74f1f46287 | 8,757 | py | Python | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/captcha.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/captcha.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/captcha.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | 1 | 2020-06-25T03:12:58.000Z | 2020-06-25T03:12:58.000Z | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 33.810811 | 296 | 0.645997 | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 8,226 | 0 | 0 | 0 | 0 | 0 | 105 | 82 |
f57c8d37c19623baf30de4a9aab66c72384b6843 | 435 | py | Python | typeidea/typeidea/utils.py | birdywings/typeidea | d7ce276a7a823b4a9d50bf57edc07e002aa08863 | [
"MIT"
] | 1 | 2018-08-28T06:26:18.000Z | 2018-08-28T06:26:18.000Z | typeidea/typeidea/utils.py | birdywings/typeidea | d7ce276a7a823b4a9d50bf57edc07e002aa08863 | [
"MIT"
] | 2 | 2020-03-10T10:21:22.000Z | 2021-06-10T20:52:02.000Z | typeidea/typeidea/utils.py | birdywings/typeidea | d7ce276a7a823b4a9d50bf57edc07e002aa08863 | [
"MIT"
] | null | null | null | # coding:utf-8
| 24.166667 | 49 | 0.567816 | # coding:utf-8
from django.core.cache import cache
def cache_it(func):
def wrapper(self, *args, **kwargs):
key = repr((func.__name__, args, kwargs))
if cache.get(key):
print('hit cache')
result = cache.get(key)
return result
print('hit database')
... | 0 | 0 | 0 | 0 | 0 | 359 | 0 | 14 | 46 |
851abbca960d50bb4b8332f02ca591c7f0ba31ca | 2,926 | py | Python | saas/backend/biz/resource_creator_action.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | saas/backend/biz/resource_creator_action.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | saas/backend/biz/resource_creator_action.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making -(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Licens... | 42.405797 | 115 | 0.714627 | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 465 | 0 | 0 | 1,759 | 0 | 0 | 0 | 144 | 158 |
c60186aa8bce4af69485668bc0a9942218841afb | 2,912 | py | Python | test04.py | OskarBreach/advent-of-code-2018 | 10887873d988df699e7ebe83d39511b3303ccf38 | [
"MIT"
] | null | null | null | test04.py | OskarBreach/advent-of-code-2018 | 10887873d988df699e7ebe83d39511b3303ccf38 | [
"MIT"
] | null | null | null | test04.py | OskarBreach/advent-of-code-2018 | 10887873d988df699e7ebe83d39511b3303ccf38 | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 42.202899 | 109 | 0.598214 | import unittest
import random
from day04 import Guard, get_guard_patterns,get_guard_most_asleep, guard_most_frequently_asleep
class GuardAsleepTests(unittest.TestCase):
def setUp(self):
self.records = ["[1518-11-01 00:00] Guard #10 begins shift",
"[1518-11-01 00:05] falls asleep",
... | 0 | 0 | 0 | 2,712 | 0 | 0 | 0 | 66 | 67 |
b51f9ca3008a6a0b5b790ef2446f3809e260f56e | 84 | gyp | Python | shmnode/binding.gyp | MakarenaLabs/Shared-Memory-NodeJS-Demo-Server | 345c7c4866d16290333994ebf7d00800a9c2c156 | [
"MIT"
] | 6 | 2021-09-15T14:28:44.000Z | 2022-02-04T05:33:23.000Z | shmnode/binding.gyp | MakarenaLabs/Shared-Memory-NodeJS-Demo-Server | 345c7c4866d16290333994ebf7d00800a9c2c156 | [
"MIT"
] | null | null | null | shmnode/binding.gyp | MakarenaLabs/Shared-Memory-NodeJS-Demo-Server | 345c7c4866d16290333994ebf7d00800a9c2c156 | [
"MIT"
] | 1 | 2021-06-04T06:37:48.000Z | 2021-06-04T06:37:48.000Z | {
"targets": [
{
"target_name": "shmnode",
"sources": ["shm.cpp"]
}
]
}
| 9.333333 | 28 | 0.452381 | {
"targets": [
{
"target_name": "shmnode",
"sources": ["shm.cpp"]
}
]
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de7eca04602d2d054043fb59d43ab0e24ade8158 | 672 | py | Python | examples/cloud-discovery/hazelcast_cloud_discovery_example.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 98 | 2015-12-08T14:26:27.000Z | 2022-03-23T17:44:11.000Z | examples/cloud-discovery/hazelcast_cloud_discovery_example.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 396 | 2016-02-23T11:07:55.000Z | 2022-03-31T14:26:34.000Z | examples/cloud-discovery/hazelcast_cloud_discovery_example.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 62 | 2015-12-09T11:20:53.000Z | 2022-01-28T01:30:54.000Z | import hazelcast
client = hazelcast.HazelcastClient(
# Set up cluster name for authentication
cluster_name="YOUR_CLUSTER_NAME",
# Set the token of your cloud cluster
cloud_discovery_token="YOUR_CLUSTER_DISCOVERY_TOKEN",
# If you have enabled encryption for your cluster, also configure TLS/SSL for t... | 29.217391 | 93 | 0.72619 | import hazelcast
client = hazelcast.HazelcastClient(
# Set up cluster name for authentication
cluster_name="YOUR_CLUSTER_NAME",
# Set the token of your cloud cluster
cloud_discovery_token="YOUR_CLUSTER_DISCOVERY_TOKEN",
# If you have enabled encryption for your cluster, also configure TLS/SSL for t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f123833462f290fa235ac9ab1673714086d036ca | 1,159 | py | Python | model_template/models.py | sauravmandal255/EmotionDetect | f5551a7b154e29a5b3baf7540ec4909030ec6966 | [
"Apache-2.0"
] | null | null | null | model_template/models.py | sauravmandal255/EmotionDetect | f5551a7b154e29a5b3baf7540ec4909030ec6966 | [
"Apache-2.0"
] | 2 | 2020-10-02T09:56:13.000Z | 2020-10-02T10:16:58.000Z | model_template/models.py | sauravmandal255/EmotionDetect | f5551a7b154e29a5b3baf7540ec4909030ec6966 | [
"Apache-2.0"
] | 5 | 2020-10-02T09:39:38.000Z | 2020-10-19T18:34:19.000Z | # importing libraries
from keras.layers import Dense, Dropout, Flatten, MaxPooling2D
from keras.models import Model
# define model
# importing MobileNet_v2 for higher accuracy
from keras.applications import MobileNetV2
mobile = MobileNetV2(input_shape=(224,224,3),include_top=False,weights='imagenet')
#print(mobile.su... | 30.5 | 91 | 0.739431 | # importing libraries
from keras.layers import Dense , Dropout ,Flatten , MaxPooling2D
from keras.models import Model
# define model
# importing MobileNet_v2 for higher accuracy
from keras.applications import MobileNetV2
mobile = MobileNetV2(input_shape=(224,224,3),include_top=False,weights='imagenet')
#print(mobile.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 |
d61347979766726507e4443ffc6dc5cc36b0c3e2 | 1,881 | py | Python | visualiser/facades/ociTenancy.py | antoniogomezr/oci-designer-tookit | 0f8756bf778cbbc923df2020ea11cf384e855590 | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | visualiser/facades/ociTenancy.py | antoniogomezr/oci-designer-tookit | 0f8756bf778cbbc923df2020ea11cf384e855590 | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | visualiser/facades/ociTenancy.py | antoniogomezr/oci-designer-tookit | 0f8756bf778cbbc923df2020ea11cf384e855590 | [
"UPL-1.0",
"Apache-2.0"
] | 1 | 2022-01-05T19:58:10.000Z | 2022-01-05T19:58:10.000Z | #!/usr/bin/python
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = ["And... | 35.490566 | 139 | 0.636364 | #!/usr/bin/python
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = ["And... | 0 | 0 | 0 | 1,190 | 0 | 0 | 0 | 29 | 68 |
78e1e77e0b12c7d0cbe4e329c294e1cbed66ae28 | 445 | py | Python | crush.py | alaz/hackerrank | 5669360baeb009fcd66161af4bc6c15b56aaa69e | [
"Unlicense"
] | null | null | null | crush.py | alaz/hackerrank | 5669360baeb009fcd66161af4bc6c15b56aaa69e | [
"Unlicense"
] | null | null | null | crush.py | alaz/hackerrank | 5669360baeb009fcd66161af4bc6c15b56aaa69e | [
"Unlicense"
] | null | null | null | #!/bin/python3
# https://www.hackerrank.com/challenges/crush
if __name__ == "__main__":
n, m = input().strip().split(' ')
n, m = [int(n), int(m)]
arr = [0] * (n+1)
for a0 in range(m):
a, b, k = input().strip().split(' ')
a, b, k = [int(a), int(b), int(k)]
arr[a-1] += k
... | 19.347826 | 45 | 0.442697 | #!/bin/python3
# https://www.hackerrank.com/challenges/crush
import sys
if __name__ == "__main__":
n, m = input().strip().split(' ')
n, m = [int(n), int(m)]
arr = [0] * (n+1)
for a0 in range(m):
a, b, k = input().strip().split(' ')
a, b, k = [int(a), int(b), int(k)]
arr[a-1] +... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 23 |
ff8fa67bdf27070f23d87be4ecbca010299a49be | 553 | py | Python | examples/globals.py | quynhanh-ngx/pytago | de976ad8d85702ae665e97978bc4a75d282c857f | [
"MIT"
] | 206 | 2021-06-24T16:16:13.000Z | 2022-03-31T07:44:17.000Z | examples/globals.py | quynhanh-ngx/pytago | de976ad8d85702ae665e97978bc4a75d282c857f | [
"MIT"
] | 13 | 2021-06-24T17:51:36.000Z | 2022-02-23T10:07:17.000Z | examples/globals.py | quynhanh-ngx/pytago | de976ad8d85702ae665e97978bc4a75d282c857f | [
"MIT"
] | 14 | 2021-06-26T02:19:45.000Z | 2022-03-30T03:02:49.000Z | SITE = "https://www.google.com/"
NAME = ["Michael", "Wayne", "Phelps"]
KEYS = {1: 2, 3: 4}
AGE = 1000
BIRTH_YEAR = 2050
if __name__ == '__main__':
main()
| 17.83871 | 66 | 0.616637 | SITE = "https://www.google.com/"
NAME = ["Michael", "Wayne", "Phelps"]
KEYS = {1: 2, 3: 4}
AGE = 1000
BIRTH_YEAR = 2050
def main():
global AGE
print(SITE)
print(NAME)
print(BIRTH_YEAR)
print(KEYS)
print(AGE)
AGE = 20 # This should use the variable from the global scope
other_1()
p... | 0 | 0 | 0 | 0 | 0 | 322 | 0 | 0 | 69 |
4b93f120a848c1c50fad55efc489430019f891af | 1,077 | py | Python | data/vision_data_aug/gaussian_augment.py | jihuacao/Putil | b753fc94bea4cbda00f483681c55f0e9f54adef2 | [
"Apache-2.0"
] | 1 | 2018-12-09T06:09:29.000Z | 2018-12-09T06:09:29.000Z | data/vision_data_aug/gaussian_augment.py | jihuacao/Putil | b753fc94bea4cbda00f483681c55f0e9f54adef2 | [
"Apache-2.0"
] | null | null | null | data/vision_data_aug/gaussian_augment.py | jihuacao/Putil | b753fc94bea4cbda00f483681c55f0e9f54adef2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Putil
import base.logger as plog
GaussianAugmentLogger = plog.PutilLogConfig('gaussian_augment').logger()
GaussianAugmentLogger.setLevel(plog.DEBUG)
#In[]:
#import numpy as np
#
#a = np.zeros(shape=[1, 1, 10, 1, 10, 1])
#np.squeeze(a).shape | 22.4375 | 72 | 0.547818 | # coding=utf-8
import numpy as np
import time
# Putil
import data.augment as paug
import base.logger as plog
GaussianAugmentLogger = plog.PutilLogConfig('gaussian_augment').logger()
GaussianAugmentLogger.setLevel(plog.DEBUG)
class GaussianAugment(paug.Augment):
'''
config:
mu: []
sigma: []
... | 0 | 0 | 0 | 733 | 0 | 0 | 0 | -7 | 89 |
a7912021911ee6d3a42095a6cc977843839e4d72 | 7,078 | py | Python | lightly/openapi_generated/swagger_client/models/configuration_entry.py | umami-ware/lightly | 5d70b34df7f784af249f9e9a6bfd6256756a877f | [
"MIT"
] | 1,515 | 2020-10-05T13:04:17.000Z | 2022-03-31T16:14:55.000Z | lightly/openapi_generated/swagger_client/models/configuration_entry.py | umami-ware/lightly | 5d70b34df7f784af249f9e9a6bfd6256756a877f | [
"MIT"
] | 628 | 2020-10-14T11:38:51.000Z | 2022-03-31T14:40:54.000Z | lightly/openapi_generated/swagger_client/models/configuration_entry.py | umami-ware/lightly | 5d70b34df7f784af249f9e9a6bfd6256756a877f | [
"MIT"
] | 108 | 2020-10-17T08:31:06.000Z | 2022-03-20T16:44:22.000Z | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version: 1.0.0
Contact: support@lightly... | 33.386792 | 220 | 0.62221 | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version: 1.0.0
Contact: support@lightly... | 0 | 3,342 | 0 | 3,181 | 0 | 0 | 0 | 28 | 128 |
bbac98a6b73b2c4a22483008b742a23918419eb1 | 1,405 | py | Python | post-analysis/pos_ner_vocab_on_dataset.py | nefujiangping/paper-HG | 8c448da2d00f1166d2f9992bb06f5b5f140058c6 | [
"Apache-2.0"
] | null | null | null | post-analysis/pos_ner_vocab_on_dataset.py | nefujiangping/paper-HG | 8c448da2d00f1166d2f9992bb06f5b5f140058c6 | [
"Apache-2.0"
] | null | null | null | post-analysis/pos_ner_vocab_on_dataset.py | nefujiangping/paper-HG | 8c448da2d00f1166d2f9992bb06f5b5f140058c6 | [
"Apache-2.0"
] | null | null | null | import glob
import collections
import os
in_path = '/media/jayson/software/WS/preprocessed/preprocessed/*'
vocab_root = '/media/jayson/study/graduation project/paper/experimens/moldes-May'
pos_vocab_counter = collections.Counter()
ner_vocab_counter = collections.Counter()
file_list = glob.glob(in_path)
for idx, fil... | 35.125 | 81 | 0.724555 | import glob
import collections
import os
def file_content(file_name):
lines = []
with open(file_name, 'r') as file:
for line in file:
lines.append(line)
lines = [line.strip() for line in lines]
return lines
in_path = '/media/jayson/software/WS/preprocessed/preprocessed/*'
vocab_root = '/media/jayson/study/g... | 0 | 0 | 0 | 0 | 0 | 153 | 0 | 0 | 23 |
d9a6901c16c6c0280a71425e237d5deb0d9285ef | 1,754 | py | Python | examples/adwords/v201509/basic_operations/remove_ad_group.py | fosterwei/adwords-keyword-planner-API-googleads-python-lib | b80b8b3741a55f1d00c5974bc58f92540663c6f6 | [
"Apache-2.0"
] | 1 | 2020-05-23T11:32:32.000Z | 2020-05-23T11:32:32.000Z | examples/adwords/v201509/basic_operations/remove_ad_group.py | fosterwei/adwords-keyword-planner-API-googleads-python-lib | b80b8b3741a55f1d00c5974bc58f92540663c6f6 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201509/basic_operations/remove_ad_group.py | fosterwei/adwords-keyword-planner-API-googleads-python-lib | b80b8b3741a55f1d00c5974bc58f92540663c6f6 | [
"Apache-2.0"
] | 2 | 2018-04-20T02:16:33.000Z | 2020-11-12T20:58:54.000Z | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 29.728814 | 77 | 0.721209 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 0 | 0 | 0 | 0 | 0 | 521 | 0 | 0 | 23 |
d15289806104fe58d05efb6643f580bfa9ee6b7e | 3,186 | py | Python | FinalExam/mit_campus.py | purelind/MITx-6.00.1x | 9286777ee4d40062a7e27ffb1cf0233c8aa85df8 | [
"MIT"
] | null | null | null | FinalExam/mit_campus.py | purelind/MITx-6.00.1x | 9286777ee4d40062a7e27ffb1cf0233c8aa85df8 | [
"MIT"
] | null | null | null | FinalExam/mit_campus.py | purelind/MITx-6.00.1x | 9286777ee4d40062a7e27ffb1cf0233c8aa85df8 | [
"MIT"
] | null | null | null |
c = MITCampus(Location(1,2))
print(c.add_tent(Location(-1,2))) #should return True
print(c.add_tent(Location(-1,2))) #should return True
print(c.add_tent(Location(-1,2))) #should return False
print(c.add_tent(Location(-1,2))) #should return False
print(c.get_tents()) #should return ['<0,0>', '<1,2>', '<2,3>']
| 33.893617 | 82 | 0.602009 | class Location(object):
def __init__(self, x, y):
self.x = x
self.y = y
def move(self, deltaX, deltaY):
return Location(self.x + deltaX, self.y + deltaY)
def getX(self):
return self.x
def getY(self):
return self.y
def dist_from(self, other):
xDist ... | 0 | 0 | 0 | 2,803 | 0 | 0 | 0 | 0 | 68 |
67269cb3369e12d140f209a6bf92e53ce73e7a00 | 17,290 | py | Python | src/thermostat/data/dataset_utils.py | MNasert/thermostat-1 | 983a1121687e0abfb70f874a6d36b1597d8012a4 | [
"Apache-2.0"
] | null | null | null | src/thermostat/data/dataset_utils.py | MNasert/thermostat-1 | 983a1121687e0abfb70f874a6d36b1597d8012a4 | [
"Apache-2.0"
] | null | null | null | src/thermostat/data/dataset_utils.py | MNasert/thermostat-1 | 983a1121687e0abfb70f874a6d36b1597d8012a4 | [
"Apache-2.0"
] | null | null | null | import os
# new change
from sys import platform
# new change
from datasets import Dataset, load_dataset
from thermostat.data import thermostat_configs
def list_configs():
""" Returns the list of names of all available configs in the Thermostat HF dataset"""
return [config.name for config in thermostat_... | 45.862069 | 120 | 0.640544 | import numpy as np
import os
# new change
from sys import platform
# new change
from datasets import Dataset, load_dataset
from itertools import groupby
from overrides import overrides
from sklearn.metrics import classification_report
from tqdm import tqdm
from transformers import AutoTokenizer
from typing import Dict... | 0 | 5,892 | 0 | 7,563 | 0 | 0 | 0 | 197 | 335 |
62ae4c652dc96c3201fd60914c5b8fb00395de1d | 438 | py | Python | tests/test_utils.py | yaming116/uiautomator2 | 3df7203e19f96134b14d05c15eb7a4c40dbdaef7 | [
"MIT"
] | 2 | 2019-12-06T06:42:08.000Z | 2019-12-19T02:52:10.000Z | tests/test_utils.py | anyhe2008/uiautomator2 | 321490b4f962fe1f299e9a87df35c9cfb9098f5e | [
"MIT"
] | null | null | null | tests/test_utils.py | anyhe2008/uiautomator2 | 321490b4f962fe1f299e9a87df35c9cfb9098f5e | [
"MIT"
] | 1 | 2020-06-05T16:59:21.000Z | 2020-06-05T16:59:21.000Z | # coding: utf-8
# | 31.285714 | 91 | 0.547945 | # coding: utf-8
#
from uiautomator2 import utils
def test_list2cmdline():
testdata = [
[("echo", "hello"), "echo hello"],
[("echo", "hello&world"), "echo 'hello&world'"],
[("What's", "your", "name?"), """'What'"'"'s' your 'name?'"""]
]
for args, expect in testdata:
cmdline ... | 0 | 0 | 0 | 0 | 0 | 366 | 0 | 9 | 46 |
98fb798bbc21e71c3c86978d4b41b047a4944e2d | 2,276 | py | Python | vc-real-time-voice-changer/RealTime.py | alierfanianomidvar/voice-changer | adb6987f432fb0efac6aa1265773741907b7fe6b | [
"MIT"
] | null | null | null | vc-real-time-voice-changer/RealTime.py | alierfanianomidvar/voice-changer | adb6987f432fb0efac6aa1265773741907b7fe6b | [
"MIT"
] | null | null | null | vc-real-time-voice-changer/RealTime.py | alierfanianomidvar/voice-changer | adb6987f432fb0efac6aa1265773741907b7fe6b | [
"MIT"
] | null | null | null | import pyaudio
import numpy as np
import wave
import time
CHUNK = 2048
RATE = 32000
FORMAT = pyaudio.paInt16
CHANNEL = 1
SHIFT = 50
""" recording """
audio = pyaudio.PyAudio()
stream = audio.open(format=FORMAT, channels=CHANNEL, rate=RATE, input=True, output=True, frames_per_buffer=CHUNK)
print("start... | 34.484848 | 134 | 0.666081 | import pyaudio
import numpy as np
import wave
import time
CHUNK = 2048
RATE = 32000
FORMAT = pyaudio.paInt16
CHANNEL = 1
SHIFT = 50
""" recording """
audio = pyaudio.PyAudio()
stream = audio.open(format=FORMAT, channels=CHANNEL, rate=RATE, input=True, output=True, frames_per_buffer=CHUNK)
print("start... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
229952e6c867c0f7bd3a28294d68436588ae5901 | 4,339 | py | Python | research/controllers/bpc_sysid.py | MinRegret/TigerControl | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 31 | 2019-11-08T06:01:54.000Z | 2021-11-20T04:50:43.000Z | research/controllers/bpc_sysid.py | johnhallman/ctsb | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 32 | 2019-06-27T15:05:04.000Z | 2019-08-07T04:23:47.000Z | research/controllers/bpc_sysid.py | MinRegret/tigercontrol | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 3 | 2020-09-30T17:06:50.000Z | 2021-04-12T22:39:34.000Z | import jax.random as random
| 36.158333 | 116 | 0.583545 | import matplotlib.pyplot as plt
import jax
import jax.numpy as np
import numpy as onp
import jax.random as random
import tigercontrol
from tigercontrol.utils.random import set_key, generate_key
from tigercontrol.environments import Environment
from tigercontrol.controllers import Controller
from jax import grad,jit
fr... | 0 | 0 | 0 | 3,958 | 0 | 0 | 0 | 100 | 244 |
dc7da909ae3ec185cb3465412df3ab4eeb4c60e8 | 1,025 | py | Python | vsts/vsts/project_analysis/v4_0/models/__init__.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/project_analysis/v4_0/models/__init__.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/project_analysis/v4_0/models/__init__.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.590909 | 94 | 0.594146 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b8690f6517c43adf620f57ac5263bc71b9cfc82a | 7,324 | py | Python | examples/crm/crm_opt.py | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | examples/crm/crm_opt.py | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | examples/crm/crm_opt.py | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | # A demonstration of a simple optimization problem in TACS: minimize the
# mass of the CRM model subject to a global stress aggregate constraint
# enforcing that the maximum stress at any quadrature point is less than
# a specified upper bound.
from __future__ import print_function
# Import necessary libraries
from... | 34.224299 | 78 | 0.635855 | # A demonstration of a simple optimization problem in TACS: minimize the
# mass of the CRM model subject to a global stress aggregate constraint
# enforcing that the maximum stress at any quadrature point is less than
# a specified upper bound.
from __future__ import print_function
# Import necessary libraries
impo... | 0 | 0 | 0 | 6,377 | 0 | 0 | 0 | 32 | 67 |
793a3435ad271681ef7393b64d49014f446d9a50 | 13,152 | py | Python | mlflow/store/file_store.py | kmr0877/mlflow | 04a5fee5df5ea3eaeeb4ce98b0a58425983c8bb0 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:42:17.000Z | 2022-03-13T21:42:17.000Z | mlflow/store/file_store.py | RoyMachineLearning/mlflow | 78a97fc3a11908e71142cc3803b2b0d7b41d83e0 | [
"Apache-2.0"
] | null | null | null | mlflow/store/file_store.py | RoyMachineLearning/mlflow | 78a97fc3a11908e71142cc3803b2b0d7b41d83e0 | [
"Apache-2.0"
] | 1 | 2018-11-30T17:56:47.000Z | 2018-11-30T17:56:47.000Z |
_TRACKING_DIR_ENV_VAR = "MLFLOW_TRACKING_DIR"
| 45.508651 | 100 | 0.67313 | import os
import uuid
from mlflow.entities.experiment import Experiment
from mlflow.entities.metric import Metric
from mlflow.entities.param import Param
from mlflow.entities.run import Run
from mlflow.entities.run_data import RunData
from mlflow.entities.run_info import RunInfo
from mlflow.entities.run_status impor... | 0 | 1,123 | 0 | 11,136 | 0 | 74 | 0 | 433 | 337 |
14f0ab6c7d2a2c3a3eba643a5442c0cd16897d94 | 3,126 | py | Python | src/models/NamedEntityRecognitionBertModel.py | kryvokhyzha/bert-for-ukranian-ner | 48da40f09cb216ad51a97c303998157858fbe8bc | [
"MIT"
] | null | null | null | src/models/NamedEntityRecognitionBertModel.py | kryvokhyzha/bert-for-ukranian-ner | 48da40f09cb216ad51a97c303998157858fbe8bc | [
"MIT"
] | null | null | null | src/models/NamedEntityRecognitionBertModel.py | kryvokhyzha/bert-for-ukranian-ner | 48da40f09cb216ad51a97c303998157858fbe8bc | [
"MIT"
] | null | null | null | import torch.nn as nn
| 32.5625 | 90 | 0.574536 | from typing import Dict
import torch
import torch.nn as nn
from transformers import AutoConfig, AutoModel
class NamedEntityRecognitionBertModel(nn.Module):
def __init__(
self,
pretrained_model_name: str,
output_dim: int,
lstm_dim: int = 256,
lstm_num_layers: int = 2,
... | 0 | 0 | 0 | 2,995 | 0 | 0 | 0 | 18 | 90 |
a6644745c859767b0ae53add78546e769634ce55 | 16,527 | py | Python | google/cloud/dataproc_v1/types/shared.py | anilreddypuresoftware/python-dataproc | cdf4aec2446f325b062fef74c6c0bef70f47ab71 | [
"Apache-2.0"
] | null | null | null | google/cloud/dataproc_v1/types/shared.py | anilreddypuresoftware/python-dataproc | cdf4aec2446f325b062fef74c6c0bef70f47ab71 | [
"Apache-2.0"
] | null | null | null | google/cloud/dataproc_v1/types/shared.py | anilreddypuresoftware/python-dataproc | cdf4aec2446f325b062fef74c6c0bef70f47ab71 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.080645 | 116 | 0.65747 | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 0 | 0 | 15,070 | 0 | 0 | 0 | 0 | 299 |
7eb1d84e057baabeeab3acf8c78fef30d938ea81 | 2,288 | py | Python | logs/logger.py | eliranmaman/WP-Exploiter | 5162e20dcbb33fa1bc31cbbf4333a606aaa31615 | [
"MIT"
] | 8 | 2020-11-27T14:40:00.000Z | 2022-03-23T09:37:56.000Z | logs/logger.py | eliranmaman/WP-Exploiter | 5162e20dcbb33fa1bc31cbbf4333a606aaa31615 | [
"MIT"
] | null | null | null | logs/logger.py | eliranmaman/WP-Exploiter | 5162e20dcbb33fa1bc31cbbf4333a606aaa31615 | [
"MIT"
] | 5 | 2020-11-29T13:03:23.000Z | 2022-03-23T09:38:01.000Z | """
This Package responsible for the logs in the WP-exploiter.
"""
try:
except BaseException as e:
print("Import Error: ", e)
| 30.506667 | 97 | 0.59222 | """
This Package responsible for the logs in the WP-exploiter.
"""
try:
import enum
import asyncio
from datetime import datetime
except BaseException as e:
print("Import Error: ", e)
class LoggerMode(enum.Enum):
"""
:DEVELOP: Will output all the logs to the screen also.
:DEBUG: Will outpu... | 0 | 0 | 0 | 2,040 | 0 | 0 | 0 | -9 | 124 |
705f292fc8360585c04efdd11e18c1693e6d1be2 | 3,157 | py | Python | app/controllers/user.py | Axtell-io/Axtell | 2f660450ca2eb70cc0520ad970c9aabdc65a3bb7 | [
"MIT"
] | 15 | 2018-04-20T14:56:59.000Z | 2021-03-31T20:16:29.000Z | app/controllers/user.py | Axtell/Axtell | 2f660450ca2eb70cc0520ad970c9aabdc65a3bb7 | [
"MIT"
] | 148 | 2018-04-17T01:47:44.000Z | 2020-05-14T13:24:03.000Z | app/controllers/user.py | Axtell-io/Axtell | 2f660450ca2eb70cc0520ad970c9aabdc65a3bb7 | [
"MIT"
] | 7 | 2018-06-01T11:15:18.000Z | 2020-08-14T04:24:50.000Z | from flask import g
from app.helpers.render import render_json, render_error
from app.models.User import User
from app.instances import db
def get_my_profile():
"""
Returns the logged in user's profile or a JSON with `unauthorized: true`
"""
if isinstance(g.user, User):
return render_json(g.u... | 28.7 | 118 | 0.687995 | from config import user_list
from flask import g
from app.helpers.render import render_json, render_error
from app.models.User import User
from app.instances import db
def get_my_profile():
"""
Returns the logged in user's profile or a JSON with `unauthorized: true`
"""
if isinstance(g.user, User):
... | 0 | 0 | 0 | 0 | 0 | 924 | 0 | 7 | 68 |
5e140da0ba97c3e08bd5f09d7f306ad891d4c321 | 1,823 | py | Python | migrations/versions/77219ff4194a_.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | null | null | null | migrations/versions/77219ff4194a_.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | null | null | null | migrations/versions/77219ff4194a_.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | 2 | 2020-07-16T22:02:13.000Z | 2020-11-22T21:16:28.000Z | """empty message
Revision ID: 77219ff4194a
Revises: d0605c00c98e
Create Date: 2019-11-18 18:22:03.915031
"""
# revision identifiers, used by Alembic.
revision = "77219ff4194a"
down_revision = "d0605c00c98e"
branch_labels = None
depends_on = None
| 25.319444 | 79 | 0.625891 | """empty message
Revision ID: 77219ff4194a
Revises: d0605c00c98e
Create Date: 2019-11-18 18:22:03.915031
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "77219ff4194a"
down_revision = "d0605c00c98e"
branch_labels = None... | 0 | 0 | 0 | 0 | 0 | 1,436 | 0 | 24 | 112 |
f82919fd46b1e7410eb5db11012df992afdf08c9 | 463 | py | Python | Unit 6 Lists and Dictionary/Lesson27 Dictionary Functions.py | ItsMrTurtle/PythonChris | 4513dea336e68f48fabf480ad87bc538a323c2cd | [
"MIT"
] | null | null | null | Unit 6 Lists and Dictionary/Lesson27 Dictionary Functions.py | ItsMrTurtle/PythonChris | 4513dea336e68f48fabf480ad87bc538a323c2cd | [
"MIT"
] | null | null | null | Unit 6 Lists and Dictionary/Lesson27 Dictionary Functions.py | ItsMrTurtle/PythonChris | 4513dea336e68f48fabf480ad87bc538a323c2cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun May 10 22:59:10 2020
@author: Christopher Cheng
"""
# The value is the function mapped
areas = {"sq": square, "ci": circle, "eqtri": equal_tri}
# When accessing the dictionary keys, you can pass a parameter if it's a function
n = 2
print(areas["sq"](n))
print(areas["ci"](... | 19.291667 | 82 | 0.632829 | # -*- coding: utf-8 -*-
"""
Created on Sun May 10 22:59:10 2020
@author: Christopher Cheng
"""
def square(x):
return x*x
def circle(r):
return 3.14*r*r
def equal_tri (s):
return (s*s)*(3**0.5)/4
# The value is the function mapped
areas = {"sq": square, "ci": circle, "eqtri": equal_tri}
# When accessi... | 0 | 0 | 0 | 0 | 0 | 46 | 0 | 0 | 69 |
bf70a2f46f36414b602c4aa94a044b1a0722e51e | 1,234 | py | Python | FastXML/fastxml/fastxml/weights.py | anonymouslorem/library_identification_vulnerability_report | 3eb1916b25bcf885640ed19954377edf45f7498a | [
"MIT"
] | 1 | 2022-01-05T02:27:43.000Z | 2022-01-05T02:27:43.000Z | FastXML/fastxml/fastxml/weights.py | anonymouslorem/library_identification_vulnerability_report | 3eb1916b25bcf885640ed19954377edf45f7498a | [
"MIT"
] | null | null | null | FastXML/fastxml/fastxml/weights.py | anonymouslorem/library_identification_vulnerability_report | 3eb1916b25bcf885640ed19954377edf45f7498a | [
"MIT"
] | null | null | null | from __future__ import division
from builtins import range
import numpy as np
def propensity(y, A=0.55, B=1.5):
"""
Computes propensity scores based on ys
"""
N, Nl, ml = metrics(y)
C = (np.log(N) - 1) * (B + 1) ** A
weights = []
for i in range(ml):
weights.append(1 + C ... | 24.196078 | 62 | 0.529173 | from __future__ import division
from builtins import range
from past.utils import old_div
from collections import Counter
import numpy as np
def metrics(y):
Nl = Counter(yi for ys in y for yi in ys)
N = len(y)
return N, Nl, max(Nl) + 1
def uniform(y):
N, Nl, ml = metrics(y)
return np.... | 0 | 0 | 0 | 0 | 0 | 671 | 0 | 19 | 146 |
c8a7e8091e275c74b74923416fd46e074f166524 | 8,093 | py | Python | lib/bes/vfs/vfs_cli_args.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/vfs/vfs_cli_args.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/vfs/vfs_cli_args.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
| 52.551948 | 96 | 0.602867 | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import os
from os import path
from bes.key_value.key_value_list import key_value_list
from bes.common.check import check
from bes.system.log import log
from .vfs_cli_command import vfs_cli_command
from .vfs_list_options import... | 0 | 0 | 0 | 7,729 | 0 | 0 | 0 | 90 | 180 |
b7a2a12b79393a04ce7507597c1b70b004542d82 | 1,584 | py | Python | nasws/dataset/image_dataloader.py | kcyu2014/nas-landmarkreg | a00c3619bf4042e446e1919087f0b09fe9fa3a65 | [
"MIT"
] | 8 | 2021-04-13T01:52:11.000Z | 2022-03-30T03:53:12.000Z | nasws/dataset/image_dataloader.py | kcyu2014/nas-landmarkreg | a00c3619bf4042e446e1919087f0b09fe9fa3a65 | [
"MIT"
] | 4 | 2021-05-29T01:41:00.000Z | 2021-08-24T09:40:43.000Z | nasws/dataset/image_dataloader.py | kcyu2014/nas-landmarkreg | a00c3619bf4042e446e1919087f0b09fe9fa3a65 | [
"MIT"
] | null | null | null | from argparse import Namespace
DEFAULT_ARGS=Namespace(
dataset='cifar10',
data='data',
cutout=None,
cutout_length=None,
train_portion=0.9,
batch_size=256,
evaluate_batch_size=256,
)
| 35.2 | 118 | 0.704545 | from argparse import Namespace
from torchvision.datasets import CIFAR10
import numpy as np
import torch
import utils
DEFAULT_ARGS=Namespace(
dataset='cifar10',
data='data',
cutout=None,
cutout_length=None,
train_portion=0.9,
batch_size=256,
evaluate_batch_size=256,
)
def load_dataset(ar... | 0 | 0 | 0 | 0 | 0 | 1,262 | 0 | -2 | 112 |
e05b6cd6f8a86f6d715a3067acf15d84fdec1425 | 14,960 | py | Python | test/test_multiinvest.py | AlOussama/PyPSA | 41c5666a132c4e637fc07e6872f3947acfa2166d | [
"MIT"
] | null | null | null | test/test_multiinvest.py | AlOussama/PyPSA | 41c5666a132c4e637fc07e6872f3947acfa2166d | [
"MIT"
] | null | null | null | test/test_multiinvest.py | AlOussama/PyPSA | 41c5666a132c4e637fc07e6872f3947acfa2166d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 10:21:16 2021
@author: fabian
"""
| 32.663755 | 88 | 0.658356 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 10:21:16 2021
@author: fabian
"""
import pypsa
import pytest
import os
import pandas as pd
from numpy.testing import assert_array_almost_equal as equal
from pandas import IndexSlice as idx
from pypsa.descriptors import get_activity_mask
@pytest... | 0 | 2,462 | 0 | 0 | 0 | 11,586 | 0 | 49 | 730 |
ddb1f1e2c0ff6106c5c69d841334a429fafe352a | 1,600 | py | Python | examples/favourite-music-example.py | nonkung51/IntentParser | 37d125dc2a1627c055ab5313fde96369462e034f | [
"Apache-2.0"
] | 8 | 2017-05-11T11:30:21.000Z | 2021-02-17T22:27:22.000Z | examples/favourite-music-example.py | nonkung51/IntentParser | 37d125dc2a1627c055ab5313fde96369462e034f | [
"Apache-2.0"
] | 1 | 2017-10-19T07:56:36.000Z | 2017-10-19T07:56:36.000Z | examples/favourite-music-example.py | nonkung51/IntentParser | 37d125dc2a1627c055ab5313fde96369462e034f | [
"Apache-2.0"
] | 7 | 2017-05-11T15:49:02.000Z | 2020-09-19T08:20:12.000Z | import intentparser as ip
__author__ = 'Nonthakon Jitchiranant'
<<<<<<< HEAD
intent = intentparser.intentParser({
'description' : {
"type" : 'FavMusicIntent',
"args" : [(1, "musics_types")],
"keyword" : [
(0, "musics_keyword"),
... | 32 | 103 | 0.473125 | import intentparser as ip
__author__ = 'Nonthakon Jitchiranant'
<<<<<<< HEAD
intent = intentparser.intentParser({
'description' : {
"type" : 'FavMusicIntent',
"args" : [(1, "musics_types")],
"keyword" : [
(0, "musics_keyword"),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b2508bce449d0f7386f79e8e038e5eb5c9777194 | 677 | py | Python | client/exe_package.py | ApolloNano/nano-dpow | 14d414ad2d12cdfee8e90fb4873ba639dc5e90fe | [
"MIT"
] | 2 | 2021-05-20T10:32:14.000Z | 2021-07-13T07:18:03.000Z | client/exe_package.py | ApolloNano/nano-dpow | 14d414ad2d12cdfee8e90fb4873ba639dc5e90fe | [
"MIT"
] | null | null | null | client/exe_package.py | ApolloNano/nano-dpow | 14d414ad2d12cdfee8e90fb4873ba639dc5e90fe | [
"MIT"
] | 1 | 2021-12-24T01:56:22.000Z | 2021-12-24T01:56:22.000Z | from cx_Freeze import setup, Executable
import os
additional_packages = []
additional_mods = []
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) # directory where this file is in
DIST_DIR = os.path.join(PROJECT_DIR, 'release\\bin') # directory where all the final builds will be found
BUILD_DIR = os.... | 39.823529 | 114 | 0.701625 | from cx_Freeze import setup, Executable
import os
additional_packages = []
additional_mods = []
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) # directory where this file is in
DIST_DIR = os.path.join(PROJECT_DIR, 'release\\bin') # directory where all the final builds will be found
BUILD_DIR = os.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d8e1ce0406fd80c88b840adcf0b8b12832e9306 | 25,513 | py | Python | plugins/pcr/plugins/portunedata/luck_desc.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | plugins/pcr/plugins/portunedata/luck_desc.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | plugins/pcr/plugins/portunedata/luck_desc.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | luck_desc = [
{
"charaid": ["1", "2"],
"_name": "",
"type": [
{
"good-luck": 10,
"content": ""
},
{
"good-luck": 8,
"content": ""
},
{
"good-luck": 7,
... | 24.484645 | 56 | 0.265982 | luck_desc = [
{
"charaid": ["1", "2"],
"_name": "凯露",
"type": [
{
"good-luck": 10,
"content": "仅限今天而已!别想多了!!"
},
{
"good-luck": 8,
"content": "宜抽卡﹁十连五彩不是梦﹂"
},
{
... | 9,092 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d938e3733133331253646f81cfe360473ca97f6f | 1,615 | py | Python | GRU_train.py | ErrorOverflow/JRJ_baseline | b666a126560a06cf4b1c10947896f917bf5cb17d | [
"MIT"
] | null | null | null | GRU_train.py | ErrorOverflow/JRJ_baseline | b666a126560a06cf4b1c10947896f917bf5cb17d | [
"MIT"
] | null | null | null | GRU_train.py | ErrorOverflow/JRJ_baseline | b666a126560a06cf4b1c10947896f917bf5cb17d | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from Dataset import BikeDataSet
if __name__ == '__main__':
device = torch.device('cuda:1')
dataset = BikeDataSet()
dataloader = DataLoader(dataset, num_workers=1, batch_size=64)
trainer = Trainer(device)
... | 29.363636 | 103 | 0.627864 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import pandas as pd
from torch.utils.data import DataLoader
from sklearn.preprocessing import StandardScaler
from models import GRU, rmse_loss
from Dataset import BikeDataSet
class Trainer():
def __init__(self, device, lrate=0.... | 0 | 0 | 0 | 514 | 0 | 0 | 0 | 47 | 111 |
02072db99e88bdfa7f2da50953cff83f7c70c418 | 14,903 | py | Python | tardis_minimal_model.py | jamesgillanders/tardisanalysis | b5c27784d3d1db224c629a9d8418a0d126d2f1c8 | [
"BSD-3-Clause"
] | 5 | 2015-08-25T15:00:37.000Z | 2021-06-24T16:53:30.000Z | tardis_minimal_model.py | jamesgillanders/tardisanalysis | b5c27784d3d1db224c629a9d8418a0d126d2f1c8 | [
"BSD-3-Clause"
] | 26 | 2015-08-25T10:32:48.000Z | 2021-04-26T10:59:11.000Z | tardis_minimal_model.py | jamesgillanders/tardisanalysis | b5c27784d3d1db224c629a9d8418a0d126d2f1c8 | [
"BSD-3-Clause"
] | 15 | 2015-08-25T10:19:54.000Z | 2021-05-22T12:10:42.000Z | # -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
#
# File Name : tardis_minimal_model.py
#
# Purpose :
#
# Creation Date : 18-02-2016
#
# Last Modified : Tue 02 Aug 2016 15:09:26 CEST
#
# Created By :
#
# _._._._._._._._._._._._._._._._._._._._._.
"""This module provides an interface object which holds the essential
i... | 41.512535 | 98 | 0.625512 | # -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
#
# File Name : tardis_minimal_model.py
#
# Purpose :
#
# Creation Date : 18-02-2016
#
# Last Modified : Tue 02 Aug 2016 15:09:26 CEST
#
# Created By :
#
# _._._._._._._._._._._._._._._._._._._._._.
"""This module provides an interface object which holds the essential
i... | 0 | 0 | 0 | 7,499 | 0 | 775 | 0 | 17 | 153 |
3ff3edecc70482cdfe0528872279d2c71838e579 | 9,047 | py | Python | core/game.py | VitoGentile/gestaspy | 65af899bcce1b2dc167b517e6d4eca4f599e940d | [
"MIT-0"
] | null | null | null | core/game.py | VitoGentile/gestaspy | 65af899bcce1b2dc167b517e6d4eca4f599e940d | [
"MIT-0"
] | 3 | 2021-06-09T07:40:21.000Z | 2021-06-10T07:47:53.000Z | core/game.py | VitoGentile/gestaspy | 65af899bcce1b2dc167b517e6d4eca4f599e940d | [
"MIT-0"
] | null | null | null | import glob
import os
CRACK_PATHS = glob.glob(os.path.join(resource_path(), "assets", "cracks", "*.png"))
PUNCH_PATH = resource_path(os.path.join("assets", "punch.png"))
CRACK_SOUNDS = glob.glob(os.path.join(resource_path(), "assets", "audio", "*.wav"))
| 35.900794 | 116 | 0.619432 | import copy
import glob
import mss
import os
import pygame
import random
import sys
from PIL import Image, ImageOps
from threading import Timer
from core.device_manager import HandJointsFrame
from core.kinect_manager import KinectManager
def resource_path(relative_path=""):
try:
base_path = sys._MEIPASS
... | 0 | 0 | 0 | 8,005 | 0 | 497 | 0 | 18 | 268 |
1bc3ac1de46b848dcbb329993e3f6741c567b36a | 1,559 | py | Python | users/views.py | sakshipatil16/Knowledge-sharing-platform | b6638a5eee33dd149fabf1c655ace4a4226decfb | [
"bzip2-1.0.6"
] | 1 | 2021-05-09T08:18:49.000Z | 2021-05-09T08:18:49.000Z | users/views.py | sakshipatil16/Knowledge-sharing-platform | b6638a5eee33dd149fabf1c655ace4a4226decfb | [
"bzip2-1.0.6"
] | 9 | 2021-03-19T01:11:35.000Z | 2022-03-12T00:20:13.000Z | users/views.py | sakshipatil16/Ease-Sharing | b6638a5eee33dd149fabf1c655ace4a4226decfb | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render
# Create your views here.
# Create your views here.
| 33.891304 | 112 | 0.640795 | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .forms import UserRegisterForm,UserUpdateForm,ProfileUpdateForm
# Create your views here.
def register(request... | 0 | 764 | 0 | 0 | 0 | 447 | 0 | 121 | 134 |
07852aa44513bd0e88975ef54120974c83e3ccc6 | 4,389 | py | Python | bauble/plugins.py | Bauble/bauble.api | 183c97fda076ea870e21e70ecf89a2a94a7f5722 | [
"BSD-3-Clause"
] | null | null | null | bauble/plugins.py | Bauble/bauble.api | 183c97fda076ea870e21e70ecf89a2a94a7f5722 | [
"BSD-3-Clause"
] | 1 | 2015-02-05T13:15:00.000Z | 2015-02-05T13:15:00.000Z | bauble/plugins.py | Bauble/bauble.api | 183c97fda076ea870e21e70ecf89a2a94a7f5722 | [
"BSD-3-Clause"
] | null | null | null |
import bauble.db as db
| 31.12766 | 93 | 0.568467 | from datetime import datetime, date
import json
import urllib
from bottle import request, response
import bauble.db as db
from bauble.model import Model, SystemModel
class ArgsPlugin(object):
"""
Plugin to add an args property to every request that contains the url_args for the route.
"""
name = 'arg... | 0 | 189 | 0 | 3,911 | 0 | 0 | 0 | 33 | 226 |
fceccd5547efa28f5062a25c096da56c380ece02 | 870 | py | Python | clusterpy/core/data/spatialLag.py | CentroGeo/clusterpy_python3 | 5c2600b048836e54495dc5997a250af72f72f6e7 | [
"BSD-3-Clause"
] | 48 | 2015-03-23T14:11:40.000Z | 2022-03-25T01:55:32.000Z | clusterpy/core/data/spatialLag.py | CentroGeo/clusterpy_python3 | 5c2600b048836e54495dc5997a250af72f72f6e7 | [
"BSD-3-Clause"
] | 8 | 2015-02-22T17:49:38.000Z | 2020-11-20T18:03:32.000Z | clusterpy/core/data/spatialLag.py | CentroGeo/clusterpy_python3 | 5c2600b048836e54495dc5997a250af72f72f6e7 | [
"BSD-3-Clause"
] | 27 | 2016-03-06T23:53:19.000Z | 2021-11-21T19:36:20.000Z | # encoding: latin1
"""spatial lag of a variable
"""
__author__ = "Juan C. Duque, Alejandro Betancourt"
__credits__ = "Copyright (c) 2010-11 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
__all__ = ['spatialLag']
import numpy
def... | 24.857143 | 58 | 0.654023 | # encoding: latin1
"""spatial lag of a variable
"""
__author__ = "Juan C. Duque, Alejandro Betancourt"
__credits__ = "Copyright (c) 2010-11 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
__all__ = ['spatialLag']
import numpy
def... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
231f6aa566919c06850651c755c3b8c14c876a0c | 38,747 | py | Python | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | import tkinter as tk
font_style = "Calibri"
font_size = 25
# Function for rounding eigenvalues
# Class for main window
# Class for invariants
# Class for strand inputs
# Class for color inputs
# Class for signature inputs
# Class for Casson Gordon inputs
# Executing everything
if __name__ == "__main__"... | 36.901905 | 83 | 0.596666 | import tkinter as tk
from tkinter import ttk
from matplotlib.pyplot import close
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,
NavigationToolbar2Tk)
from matplotlib.mathtext import math_to_image
from io import BytesIO
from PIL import ImageTk, Image
from sympy im... | 0 | 0 | 0 | 33,820 | 0 | 427 | 0 | 186 | 613 |
baa6cb07164a988cd08cd1fa1980dc76ea0e13b8 | 1,600 | py | Python | selenium/main.py | AhmadHamze/puppeteer-typingspeed | 61b80f30fd68ade1d62429102089c071ccfdbd36 | [
"Unlicense"
] | 1 | 2022-01-17T17:06:52.000Z | 2022-01-17T17:06:52.000Z | selenium/main.py | AhmadHamze/Puppeteer-vs-Selenium | 61b80f30fd68ade1d62429102089c071ccfdbd36 | [
"Unlicense"
] | null | null | null | selenium/main.py | AhmadHamze/Puppeteer-vs-Selenium | 61b80f30fd68ade1d62429102089c071ccfdbd36 | [
"Unlicense"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.chrome.options import Options
import re
impo... | 30.769231 | 88 | 0.705625 | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.chrome.options import Options
import re
impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed4395ec3cda55cf8f0ca11685abba932655d510 | 1,054 | py | Python | vislice.py | vitorozman/Vislice | 50fdead9426ec7edc73ccbec6caf4a661b5ecc05 | [
"MIT"
] | null | null | null | vislice.py | vitorozman/Vislice | 50fdead9426ec7edc73ccbec6caf4a661b5ecc05 | [
"MIT"
] | null | null | null | vislice.py | vitorozman/Vislice | 50fdead9426ec7edc73ccbec6caf4a661b5ecc05 | [
"MIT"
] | null | null | null | import bottle
import model
ID_IGRE_COOKIE_NAME = 'id_igre'
COOKIE_SECRET = 'my_very_special - secret key'
vislice = model.Vislice()
vislice.preberi_iz_datoteke()
bottle.run(reloader=True, debug=True)
| 22.425532 | 87 | 0.712524 | import bottle
import model
ID_IGRE_COOKIE_NAME = 'id_igre'
COOKIE_SECRET = 'my_very_special - secret key'
vislice = model.Vislice()
vislice.preberi_iz_datoteke()
@bottle.get('/')
def index():
return bottle.template('datoteke/views/index.tpl')
@bottle.post('/nova_igra/')
def nova_igra():
id_nove_igre = vis... | 0 | 753 | 0 | 0 | 0 | 0 | 0 | 0 | 92 |
780c93a71a426f40ae8aa874ef516f957142eff9 | 2,159 | py | Python | loggerBot/common/utils.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | loggerBot/common/utils.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | loggerBot/common/utils.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null |
def parse_irc_msg(s):
"""Breaks a message from an IRC server into its tags, prefix, command, and arguments.
"""
if not s:
raise IRCBadMessage("Empty IRC line.")
tags = {}
if s.startswith("@"):
s = s[1:]
tags_str, s = s.split(" ", 1)
tags = deconstruct_irc_tags(tags_... | 30.842857 | 141 | 0.621584 | import base64
import datetime
import re
import os
def print_with_time(*args):
print('[' + datetime.datetime.now().strftime("%H:%M:%S") + ']', *args)
def str_2_base64(data, encoding="utf-8"):
return str(base64.b64encode(data.encode(encoding)), encoding)
def base64_2_str(data, encoding="utf-8"):
return str... | 0 | 0 | 0 | 0 | 0 | 1,134 | 0 | -38 | 317 |
cf5855e0d2fa26f19fdee1623e58f9bf7fc17c12 | 5,662 | py | Python | run_whole.py | ilbsm/protein_stretching | 11dc9e2971111dea1185d43c7d0b978831331653 | [
"MIT"
] | null | null | null | run_whole.py | ilbsm/protein_stretching | 11dc9e2971111dea1185d43c7d0b978831331653 | [
"MIT"
] | null | null | null | run_whole.py | ilbsm/protein_stretching | 11dc9e2971111dea1185d43c7d0b978831331653 | [
"MIT"
] | null | null | null | from simulation_data import data_partial
directory = '/Users/pawel/PycharmProjects/Rozciaganie/data/'
proteins = {'5wyr': 248, 'trmd-no-knot': 240, 'trmd': 240, 'tm1570': 193, 'fuzja': 432}
missing = {'5wyr': 14, 'trmd-no-knot': 14, 'trmd': 14, 'tm1570': 14, 'fuzja': 28}
means = {('trmd', 'exp'): [45, 52, 87],
... | 40.156028 | 137 | 0.517838 | from stretchme import Structure
from simulation_data import data_partial
from os import remove, replace
import sys
import numpy as np
directory = '/Users/pawel/PycharmProjects/Rozciaganie/data/'
def run_whole(name, type, residues, missing, init_means=None, method='stretch-adjusted', state='unknotted'):
name_type... | 0 | 0 | 0 | 0 | 0 | 3,524 | 0 | 5 | 134 |
8ab9d4eb4db36144d29cb23f1bbfde4f0a19987f | 387 | py | Python | oidc/migrations/0002_auto_20200813_0817.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 4 | 2020-10-08T07:36:22.000Z | 2022-02-04T12:31:31.000Z | oidc/migrations/0002_auto_20200813_0817.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 1 | 2021-04-10T08:32:42.000Z | 2021-04-10T08:32:42.000Z | oidc/migrations/0002_auto_20200813_0817.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 7 | 2021-02-10T16:04:29.000Z | 2022-03-16T08:04:48.000Z | # Generated by Django 3.1 on 2020-08-13 08:17
| 20.368421 | 52 | 0.612403 | # Generated by Django 3.1 on 2020-08-13 08:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('oidc', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='presentationconfigurations',
old_name='verified_e... | 0 | 0 | 0 | 283 | 0 | 0 | 0 | 11 | 46 |
910608d884d58c0e1fb8126f7a9c953af61de66a | 7,422 | py | Python | tests/sqswatcher/plugins/test_slurm.py | agobeaux/aws-parallelcluster-node | 69c7cfdc00bcec923e313b7094ccc93cf73043ba | [
"Apache-2.0"
] | null | null | null | tests/sqswatcher/plugins/test_slurm.py | agobeaux/aws-parallelcluster-node | 69c7cfdc00bcec923e313b7094ccc93cf73043ba | [
"Apache-2.0"
] | null | null | null | tests/sqswatcher/plugins/test_slurm.py | agobeaux/aws-parallelcluster-node | 69c7cfdc00bcec923e313b7094ccc93cf73043ba | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 48.509804 | 119 | 0.594314 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 0 | 6,282 | 0 | 0 | 0 | 0 | 0 | 94 | 155 |
f0974d0eface887a465b1275e0fa0106bf840f7f | 6,933 | py | Python | vector.py | KarlXiao/LinearAlgebraLib | 4ed501e0919346c38a337c820a86bf6d5466b343 | [
"MIT"
] | 2 | 2017-08-30T03:10:38.000Z | 2017-11-02T03:42:40.000Z | vector.py | KarlXiao/LinearAlgebraLib | 4ed501e0919346c38a337c820a86bf6d5466b343 | [
"MIT"
] | null | null | null | vector.py | KarlXiao/LinearAlgebraLib | 4ed501e0919346c38a337c820a86bf6d5466b343 | [
"MIT"
] | null | null | null | from decimal import getcontext
getcontext().prec = 30
if __name__ == '__main__':
v1 = Vector([8.218, -9.341])
v2 = Vector([-1.129, 2.111])
print('Add:', v1 + v2)
v3 = Vector([7.119, 8.215])
v4 = Vector([-8.223, 0.878])
print('Minus:', v3 - v4)
v5 = Vector([1.671, -1.012, -.318])
a = ... | 35.372449 | 131 | 0.586759 | import math
from decimal import Decimal, getcontext
getcontext().prec = 30
class Vector(object):
def __init__(self, coordinates):
try:
if not coordinates:
raise ValueError
self.coordinates = tuple([Decimal(x) for x in coordinates])
self.dimension = len(... | 0 | 0 | 0 | 5,371 | 0 | 0 | 0 | -1 | 45 |
9b28579ed2f019eeaf832804362e7505d12f0adf | 854 | py | Python | latex_typesetter.py | RavidHausmann/Rabbits_Lab | 633ac4150f8760ddaac4c1f519ecd2973458a7dc | [
"MIT"
] | null | null | null | latex_typesetter.py | RavidHausmann/Rabbits_Lab | 633ac4150f8760ddaac4c1f519ecd2973458a7dc | [
"MIT"
] | null | null | null | latex_typesetter.py | RavidHausmann/Rabbits_Lab | 633ac4150f8760ddaac4c1f519ecd2973458a7dc | [
"MIT"
] | null | null | null | BinaryOperators = {'/' : lambda a, b: '\\frac{' + a + '}{' + b + '}'}
UnaryOperators = {'sqrt' : lambda a: '\\sqrt{'+ a + '}'}
read(set('2 / 4 * 3'))
| 23.722222 | 71 | 0.460187 | BinaryOperators = {'/' : lambda a, b: '\\frac{' + a + '}{' + b + '}'}
UnaryOperators = {'sqrt' : lambda a: '\\sqrt{'+ a + '}'}
def set(equation):
Output = []
terms = equation.split(" ")
i = 0
while i < len(terms):
term = terms[i]
if term == '*':
Output.append('\\cdot')
... | 0 | 0 | 0 | 0 | 0 | 655 | 0 | 0 | 46 |
dc66153262451fdaf6fe9ef15eb90b279d3d4604 | 7,918 | py | Python | lp/parser.py | wr1/lamprop | b1f290f38ae55a3d45e54906cae609e2d0c32374 | [
"BSD-2-Clause"
] | null | null | null | lp/parser.py | wr1/lamprop | b1f290f38ae55a3d45e54906cae609e2d0c32374 | [
"BSD-2-Clause"
] | null | null | null | lp/parser.py | wr1/lamprop | b1f290f38ae55a3d45e54906cae609e2d0c32374 | [
"BSD-2-Clause"
] | null | null | null | # file: parser.py
# vim:fileencoding=utf-8:ft=python
# Copyright 2014-2021 R.F. Smith <rsmith@xs4all.nl>. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause
# Created: 2014-02-21 21:35:41 +0100
# Last modified: 2022-01-21T17:09:55+0100
"""Parser for lamprop files."""
import copy
import logging
from .core im... | 31.545817 | 81 | 0.58045 | # file: parser.py
# vim:fileencoding=utf-8:ft=python
# Copyright © 2014-2021 R.F. Smith <rsmith@xs4all.nl>. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause
# Created: 2014-02-21 21:35:41 +0100
# Last modified: 2022-01-21T17:09:55+0100
"""Parser for lamprop files."""
import copy
import logging
from .core i... | 14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d7180703973db004d564143ff5d94f48e6036b75 | 9,183 | py | Python | romp/base.py | jjandnn/ROMP | 653a0c9de13c7e242bc304147ae6559d1c6ff283 | [
"MIT"
] | 2 | 2022-03-28T07:22:01.000Z | 2022-03-28T07:22:05.000Z | romp/base.py | qumengxue/ROMP | 1b1c37322f7096da5f544b11a1e1c1c13bf6a259 | [
"MIT"
] | 6 | 2022-02-11T01:07:39.000Z | 2022-02-11T06:20:45.000Z | romp/base.py | qumengxue/ROMP | 1b1c37322f7096da5f544b11a1e1c1c13bf6a259 | [
"MIT"
] | null | null | null | import torch.nn as nn
from config import args
if args().model_precision=='fp16':
| 54.337278 | 173 | 0.677339 | import sys, os, cv2
import numpy as np
import time, datetime
import logging
import copy, random, itertools
from prettytable import PrettyTable
import pickle
import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import Dataset, DataLoader, ConcatDataset
import config... | 0 | 0 | 0 | 8,089 | 0 | 0 | 0 | 523 | 490 |
3dd94b5ebcd6b6a3092792d00b4e83a04197f14d | 531 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler003_largest_prime_factor.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler003_largest_prime_factor.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler003_largest_prime_factor.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | #!/usr/bin/env python
"""
Solution to Project Euler Problem 3
http://projecteuler.net/
by Apalala <apalala@gmail.com>
(cc) Attribution-ShareAlike
http://creativecommons.org/licenses/by-sa/3.0/
Find the largest prime factor of the given number
"""
TARGET = 600851475143
if __name__ == "__main__":
test()
... | 15.617647 | 49 | 0.715631 | #!/usr/bin/env python
"""
Solution to Project Euler Problem 3
http://projecteuler.net/
by Apalala <apalala@gmail.com>
(cc) Attribution-ShareAlike
http://creativecommons.org/licenses/by-sa/3.0/
Find the largest prime factor of the given number
"""
from factorization import factors
TARGET = 600851475143
def larges... | 0 | 0 | 0 | 0 | 0 | 101 | 0 | 12 | 91 |
e337add0b89fbcf50b511f777109fc7d8bd70129 | 636 | py | Python | drivers/fan.py | DanielCasner/farmtomation | 9838f6e56c4839d47fd9d32fe245a08ec42762b9 | [
"MIT"
] | 1 | 2018-02-15T20:24:34.000Z | 2018-02-15T20:24:34.000Z | drivers/fan.py | DanielCasner/coop | 9838f6e56c4839d47fd9d32fe245a08ec42762b9 | [
"MIT"
] | null | null | null | drivers/fan.py | DanielCasner/coop | 9838f6e56c4839d47fd9d32fe245a08ec42762b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Classes for PWMing fans
"""
__author__ = "<Daniel Casner <www.danielcasner.org>"
def DiscreteFan(object):
"A simple fan controller with discrete PWM speeds"
def __init__(self, pi, gpio, speeds=(0, 4095), phase=0):
"Setup the fan"
self.pi = pi
self.gpio = gpio... | 26.5 | 82 | 0.63522 | #!/usr/bin/env python3
"""
Classes for PWMing fans
"""
__author__ = "<Daniel Casner <www.danielcasner.org>"
def DiscreteFan(object):
"A simple fan controller with discrete PWM speeds"
def __init__(self, pi, gpio, speeds=(0, 4095), phase=0):
"Setup the fan"
self.pi = pi
self.gpio = gpio... | 0 | 0 | 0 | 0 | 0 | 45 | 0 | 0 | 27 |
778193a56cc7e639a2c9502e12273c8bd90719b2 | 4,157 | py | Python | DS_ETL/bin/py2/FileCompressor.py | joonwoo8395/joonwoo | b84a7881a87424bd1557bf83c7a71da295b83ecb | [
"MIT"
] | null | null | null | DS_ETL/bin/py2/FileCompressor.py | joonwoo8395/joonwoo | b84a7881a87424bd1557bf83c7a71da295b83ecb | [
"MIT"
] | null | null | null | DS_ETL/bin/py2/FileCompressor.py | joonwoo8395/joonwoo | b84a7881a87424bd1557bf83c7a71da295b83ecb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import signal
import Mobigen.Common.Log as Log; Log.Init()
SHUTDOWN = False
signal.signal(signal.SIGTERM, handler)
signal.signal(signal.SIGINT , handler)
signal.signal(signal.SIGHUP , handler)
signal.signal(signal.SIGPIPE, handler)
if __name__ == "__main__"... | 23.094444 | 98 | 0.689439 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
import glob
import time
import zipfile
import signal
import ConfigParser
import Mobigen.Common.Log as Log; Log.Init()
SHUTDOWN = False
def handler(signum, frame) :
global SHUTDOWN
SHUTDOWN = True
__LOG__.Trace("Catch Signal = %s" % sign... | 0 | 0 | 0 | 3,212 | 0 | 265 | 0 | -53 | 202 |
57c4d78210d0c2ac7ffe253ae4cea4e033feb535 | 1,150 | py | Python | setup.py | yamins81/simffa | 755e3fb3f8a09781b1d6011e5cc5472e84a29f85 | [
"MIT"
] | 1 | 2018-05-07T16:38:33.000Z | 2018-05-07T16:38:33.000Z | setup.py | yamins81/simffa | 755e3fb3f8a09781b1d6011e5cc5472e84a29f85 | [
"MIT"
] | null | null | null | setup.py | yamins81/simffa | 755e3fb3f8a09781b1d6011e5cc5472e84a29f85 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" distribute- and pip-enabled setup.py for simffa """
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
setup(
name='simffa',
version='dev',
include_package_data=True,
install_requires=parse_requirements('re... | 23.469388 | 77 | 0.611304 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" distribute- and pip-enabled setup.py for simffa """
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
def parse_requirements(file_name):
requirements = []
for line in open(file_name, 'r').read().split('\n'):... | 0 | 0 | 0 | 0 | 0 | 654 | 0 | -12 | 69 |
29a7ce83d2bac71884d75e3f9fdf3674225abe4a | 840 | py | Python | graph_from_hist.py | r-kapoor/dig-network | 1e17132140d28cc1e302d4749833700c86927c9b | [
"MIT"
] | null | null | null | graph_from_hist.py | r-kapoor/dig-network | 1e17132140d28cc1e302d4749833700c86927c9b | [
"MIT"
] | null | null | null | graph_from_hist.py | r-kapoor/dig-network | 1e17132140d28cc1e302d4749833700c86927c9b | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import matplotlib
matplotlib.use('Agg')
from string import ascii_lowercase
histogram = None
for char in ['a', 'b', 'c', 'd']:
for c in ascii_lowercase:
filename = "hist"+char+c
print("Reading:", filename)
with open(filename, "rb") as fp:
hist = ... | 25.454545 | 55 | 0.577381 | import networkx as nx
import codecs
import json
import pickle
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from string import ascii_lowercase
histogram = None
for char in ['a', 'b', 'c', 'd']:
for c in ascii_lowercase:
filename = "hist"+char+c
print("R... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 88 |
dd8e4d2deca8bfa823a5795d012383e5ddc56a2d | 528 | py | Python | api_studentdb/studentdb/api/urls.py | ydang5/week-10-assignment | f04e13541d271db1c90561def79b98162856b54d | [
"BSD-3-Clause"
] | null | null | null | api_studentdb/studentdb/api/urls.py | ydang5/week-10-assignment | f04e13541d271db1c90561def79b98162856b54d | [
"BSD-3-Clause"
] | null | null | null | api_studentdb/studentdb/api/urls.py | ydang5/week-10-assignment | f04e13541d271db1c90561def79b98162856b54d | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from api import views
urlpatterns = [
path('studentdb',views.StudentDbDetail.as_view()),
path('add',views.AddStudentAPIView.as_view()),
path('studentdetail/<student_number>',views.GetStudentAPIView.as_view()),
pa... | 37.714286 | 80 | 0.785985 | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from api import views
urlpatterns = [
path('studentdb',views.StudentDbDetail.as_view()),
path('add',views.AddStudentAPIView.as_view()),
path('studentdetail/<student_number>',views.GetStudentAPIView.as_view()),
pa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c5f0b3d3fb2e5251ef2db0a04f75b3a072d2e2d4 | 766 | py | Python | api/migrations/0002_auto_20201218_0343.py | AmbiteamProject/spleeter-web | e93c5a719a23d7f22e8390ddba7b368b45fef415 | [
"MIT"
] | 202 | 2020-05-10T02:50:11.000Z | 2022-03-25T00:34:01.000Z | api/migrations/0002_auto_20201218_0343.py | AmbiteamProject/spleeter-web | e93c5a719a23d7f22e8390ddba7b368b45fef415 | [
"MIT"
] | 76 | 2020-06-12T10:28:30.000Z | 2022-03-25T20:10:01.000Z | api/migrations/0002_auto_20201218_0343.py | AmbiteamProject/spleeter-web | e93c5a719a23d7f22e8390ddba7b368b45fef415 | [
"MIT"
] | 57 | 2020-05-18T01:20:50.000Z | 2022-03-21T10:34:23.000Z | # Generated by Django 3.1.2 on 2020-12-18 03:43
| 26.413793 | 72 | 0.578329 | # Generated by Django 3.1.2 on 2020-12-18 03:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='dynamicmix',
name='celery_id',
... | 0 | 0 | 0 | 652 | 0 | 0 | 0 | 19 | 46 |
5d7bfde9ce3b4a8f0f86e809709fffd08d3b7096 | 2,561 | py | Python | loadbalancer/userdao.py | angelbarrera92/simple-python-load-balancer | d17c3a9ef7fb9b2400e9a547143ec9a240699d5e | [
"MIT"
] | 1 | 2020-04-10T19:22:27.000Z | 2020-04-10T19:22:27.000Z | loadbalancer/userdao.py | angelbarrera92/simple-python-load-balancer | d17c3a9ef7fb9b2400e9a547143ec9a240699d5e | [
"MIT"
] | null | null | null | loadbalancer/userdao.py | angelbarrera92/simple-python-load-balancer | d17c3a9ef7fb9b2400e9a547143ec9a240699d5e | [
"MIT"
] | null | null | null | import constants
from pymongo import MongoClient
mongo = MongoClient(constants.MONGO_URI)
mongodb = mongo[constants.MONGO_DATABASE]
mongocollection = mongodb[constants.MONGO_USERS_COLLECTION]
users = list()
| 27.244681 | 93 | 0.63647 | import hashlib
import uuid
import appserversdao
import constants
from pymongo import MongoClient
mongo = MongoClient(constants.MONGO_URI)
mongodb = mongo[constants.MONGO_DATABASE]
mongocollection = mongodb[constants.MONGO_USERS_COLLECTION]
users = list()
class User(object):
def __init__(self, email, password):
... | 0 | 546 | 0 | 473 | 0 | 1,142 | 0 | -18 | 204 |
bd1d74e5ac367e134c8e0a19a4b10cfe4ee5fb88 | 15,704 | py | Python | main.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | 7 | 2020-11-10T07:33:40.000Z | 2021-06-23T07:25:43.000Z | main.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | null | null | null | main.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | 5 | 2020-07-12T00:10:59.000Z | 2021-06-22T09:13:13.000Z | # sys.path.append(os.path.join(os.path.dirname(__file__)) #TODO: Is this a good idea? Dunno! It works!
# print(os.path.join(os.path.dirname(__file__)))
import markov_pilot.environment.properties as prp
from markov_pilot.wrappers.varySetpointsWrapper import VarySetpointsWrapper
from markov_pilot.agents.train import pe... | 59.037594 | 219 | 0.707972 | import sys, os
# sys.path.append(os.path.join(os.path.dirname(__file__)) #TODO: Is this a good idea? Dunno! It works!
# print(os.path.join(os.path.dirname(__file__)))
import argparse
import markov_pilot.environment.properties as prp
from markov_pilot.environment.environment import NoFGJsbSimEnv_multi, J... | 0 | 0 | 0 | 0 | 0 | 11,808 | 0 | 556 | 285 |
47df491f83f28f38edee27fab4f1ed8807524b53 | 1,917 | py | Python | parser.py | nikitinivan/appfollow | 1e75edb295c4f32e351ba19c40324b49a2e77521 | [
"MIT"
] | null | null | null | parser.py | nikitinivan/appfollow | 1e75edb295c4f32e351ba19c40324b49a2e77521 | [
"MIT"
] | null | null | null | parser.py | nikitinivan/appfollow | 1e75edb295c4f32e351ba19c40324b49a2e77521 | [
"MIT"
] | null | null | null | from selenium import webdriver
import time
import os
from urllib.parse import urlparse, parse_qs
from pprint import pprint
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# EXECUTABLE PATH FOR PHANTOMJS(HEADLESS BROWSER)
EXE_PHANTOM = os.path.join(BASE_DIR, 'webdrivers/phantomjs')
def get_params(url):
"""... | 30.919355 | 123 | 0.665623 | from selenium import webdriver
import time
import os
from urllib.parse import urlparse, parse_qs
from pprint import pprint
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# EXECUTABLE PATH FOR PHANTOMJS(HEADLESS BROWSER)
EXE_PHANTOM = os.path.join(BASE_DIR, 'webdrivers/phantomjs')
def get_params(url):
"""... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5eb6e5430bf7c878c9fc0a7769b0a39566ff41fd | 3,464 | py | Python | biswebpython/modules/temporalImageDistanceMatrix.py | leej3/bisweb | 0c08a9cd78d228542a64527d2ad74c1f6f7d0a2b | [
"Apache-2.0"
] | 66 | 2018-04-28T22:09:00.000Z | 2022-03-07T00:28:14.000Z | biswebpython/modules/temporalImageDistanceMatrix.py | leej3/bisweb | 0c08a9cd78d228542a64527d2ad74c1f6f7d0a2b | [
"Apache-2.0"
] | 28 | 2018-08-17T13:57:46.000Z | 2021-11-24T13:20:35.000Z | biswebpython/modules/temporalImageDistanceMatrix.py | leej3/bisweb | 0c08a9cd78d228542a64527d2ad74c1f6f7d0a2b | [
"Apache-2.0"
] | 24 | 2018-05-09T20:14:00.000Z | 2022-03-21T12:54:22.000Z | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... | 39.363636 | 163 | 0.536952 | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... | 0 | 0 | 0 | 2,450 | 0 | 0 | 0 | 0 | 23 |
e61816c99ecd0efba02759f7715f26354c387b46 | 3,516 | py | Python | insight.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | null | null | null | insight.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | null | null | null | insight.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
DIV = '\n'+ '='*64 + '\n'
start_time = time.time()
# Iterate over all conversation threads
# Generates insight data on a single conversation thread
# Execute one at a time in order
#summarize()
#conversation_separator()
insight()
| 23.918367 | 89 | 0.6843 | #!/usr/bin/env python
from yaml import load, dump
from collections import OrderedDict
import time, os
from visualize import visualize
DIV = '\n'+ '='*64 + '\n'
start_time = time.time()
def usage():
pass
# Iterate over all conversation threads
def summarize():
print 'Opening file... ',
file = open('messages_... | 0 | 0 | 0 | 0 | 0 | 3,051 | 0 | 34 | 158 |
e5cf5ca35acc0abfa9f35ba1ae17d75cf0109e56 | 11,719 | py | Python | rasa_sdk/forms.py | maggo/rasa-sdk | 7dcb531739a9cf105e2a7d2bb003f4b39ef6481e | [
"Apache-2.0"
] | null | null | null | rasa_sdk/forms.py | maggo/rasa-sdk | 7dcb531739a9cf105e2a7d2bb003f4b39ef6481e | [
"Apache-2.0"
] | null | null | null | rasa_sdk/forms.py | maggo/rasa-sdk | 7dcb531739a9cf105e2a7d2bb003f4b39ef6481e | [
"Apache-2.0"
] | null | null | null | import logging
import typing
logger = logging.getLogger(__name__)
if typing.TYPE_CHECKING: # pragma: no cover
# this slot is used to store information needed
# to do the form handling
REQUESTED_SLOT = "requested_slot"
LOOP_INTERRUPTED_KEY = "is_interrupted"
ACTION_VALIDATE_SLOT_MAPPINGS = "action_validate_slot_ma... | 34.569322 | 87 | 0.609182 | import logging
import typing
import warnings
from typing import Dict, Text, Any, List, Optional
from abc import ABC
from rasa_sdk import utils
from rasa_sdk.events import SlotSet, EventType
from rasa_sdk.interfaces import Action
logger = logging.getLogger(__name__)
if typing.TYPE_CHECKING: # pragma: no cover
fr... | 0 | 402 | 8,551 | 2,059 | 0 | 0 | 0 | 120 | 257 |
c0243c34b356b22e1a615ce6e61857e2ede8fc51 | 4,544 | py | Python | tracking.py | sidharthramesh98/MessySchmidt | c530db6bb0a86c73629d84b8433f1cce072c5911 | [
"Apache-2.0"
] | null | null | null | tracking.py | sidharthramesh98/MessySchmidt | c530db6bb0a86c73629d84b8433f1cce072c5911 | [
"Apache-2.0"
] | null | null | null | tracking.py | sidharthramesh98/MessySchmidt | c530db6bb0a86c73629d84b8433f1cce072c5911 | [
"Apache-2.0"
] | 1 | 2018-07-25T08:35:24.000Z | 2018-07-25T08:35:24.000Z | import cv2
import numpy as np
from utils import detector_utils
import tensorflow as tf
import sys
import cv2
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
detection_graph, sess = detector_utils.load_inference_graph()
sess = tf.Session(graph=detection_graph)
width = 680
height = 440
flago = Fals... | 29.128205 | 165 | 0.614217 | import cv2
import numpy as np
from utils import detector_utils
import tensorflow as tf
import sys
import cv2
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
detection_graph, sess = detector_utils.load_inference_graph()
sess = tf.Session(graph=detection_graph)
width = 680
height = 440
flago = Fals... | 0 | 0 | 0 | 0 | 0 | 566 | 0 | 0 | 27 |
094a71665014ad4baca4f3460ff494a0c260518d | 402 | py | Python | Week 4 - Python for Data Science/Pandas_Describing Data_exercise.py | baranitharan2020/PGDDS | 72aa4bd450ec2f0bc531bc6400ccd5dd4fdd55be | [
"CC0-1.0"
] | null | null | null | Week 4 - Python for Data Science/Pandas_Describing Data_exercise.py | baranitharan2020/PGDDS | 72aa4bd450ec2f0bc531bc6400ccd5dd4fdd55be | [
"CC0-1.0"
] | null | null | null | Week 4 - Python for Data Science/Pandas_Describing Data_exercise.py | baranitharan2020/PGDDS | 72aa4bd450ec2f0bc531bc6400ccd5dd4fdd55be | [
"CC0-1.0"
] | null | null | null | import pandas as pd
# The file is stored at the following path:
# 'https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv'
df = pd.read_csv('https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv')
df.set_index(['Office','Department'],inplace=True)
# Provide ... | 36.545455 | 104 | 0.78607 | import numpy as np
import pandas as pd
# The file is stored at the following path:
# 'https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv'
df = pd.read_csv('https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv')
df.set_index(['Office','Department'],inpla... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
a6f7e698dc12612444a097def6e75ece0525c3fd | 929 | py | Python | test/TestDashboards.py | box/wavectl | 629ca9b25da55a41f391d259bffd8ea3a57eb618 | [
"Apache-2.0"
] | 18 | 2018-06-08T16:42:57.000Z | 2021-07-30T06:37:46.000Z | test/TestDashboards.py | box/wavectl | 629ca9b25da55a41f391d259bffd8ea3a57eb618 | [
"Apache-2.0"
] | 20 | 2018-06-09T06:02:34.000Z | 2019-12-02T18:49:42.000Z | test/TestDashboards.py | box/wavectl | 629ca9b25da55a41f391d259bffd8ea3a57eb618 | [
"Apache-2.0"
] | 12 | 2018-06-08T16:42:59.000Z | 2022-03-01T09:50:34.000Z | #!/usr/bin/env python
# Alert state used for tests.
from __future__ import absolute_import
from __future__ import print_function
| 28.151515 | 71 | 0.696448 | #!/usr/bin/env python
# Alert state used for tests.
from __future__ import absolute_import
from __future__ import print_function
import json
import TestRsrcs
class Dashboard(TestRsrcs.Rsrc):
""" A class that encompasses some dashboard data used for tests """
kubeBoxPkiNameMatchString = "SomeNameToBeMache... | 0 | 511 | 0 | 232 | 0 | 0 | 0 | -15 | 68 |
a6e4db0049f4d267eb8df5f62f486ab858c2c6f6 | 5,914 | py | Python | train_normal_vae.py | altosaar/gamma-variational-autoencoder | 879690e197ba6644157b65273db685cbe48392fb | [
"MIT"
] | 10 | 2018-05-09T13:27:49.000Z | 2021-08-13T02:15:02.000Z | train_normal_vae.py | altosaar/gamma-variational-autoencoder | 879690e197ba6644157b65273db685cbe48392fb | [
"MIT"
] | null | null | null | train_normal_vae.py | altosaar/gamma-variational-autoencoder | 879690e197ba6644157b65273db685cbe48392fb | [
"MIT"
] | 2 | 2018-07-05T21:15:55.000Z | 2020-06-20T06:13:57.000Z | import pathlib
import time
import mxnet as mx
import h5py
import numpy as np
from mxnet import gluon
if __name__ == '__main__':
np.random.seed(24232)
mx.random.seed(2423232)
USE_GPU = False
LATENT_SIZE = 100
BATCH_SIZE = 64
PRINT_EVERY = 1000
MAX_ITERATIONS = 1000000
OUT_DIR = pathlib.Path(path... | 32.494505 | 87 | 0.630876 | import pathlib
import time
import scipy.misc
from mxnet import nd
import mxnet as mx
import h5py
import numpy as np
from mxnet import gluon
class DeepLatentGaussianModel(gluon.HybridBlock):
def __init__(self):
super().__init__()
with self.name_scope():
self.log_prior = GaussianLogProb()
# genera... | 0 | 0 | 0 | 3,319 | 0 | 544 | 0 | -5 | 234 |
7eccb5155ea4744da74a788b3ba2208b9d9a7627 | 6,600 | py | Python | dsn/s_expr/clef_address.py | expressionsofchange/nerf1 | 13ec152be5831eb5db4a8385afcd55435f2ada49 | [
"MIT"
] | 5 | 2018-05-17T16:57:12.000Z | 2021-09-14T00:53:48.000Z | dsn/s_expr/clef_address.py | expressionsofchange/nerf1 | 13ec152be5831eb5db4a8385afcd55435f2ada49 | [
"MIT"
] | null | null | null | dsn/s_expr/clef_address.py | expressionsofchange/nerf1 | 13ec152be5831eb5db4a8385afcd55435f2ada49 | [
"MIT"
] | null | null | null | """
This module contains machinery to annotate Notes with a "global address", the path of that note in a with respect to
some global root score.
Note: the annotated Notes are defined here with considerable amount of duplication with clef.py, most notably in the
fact that we define a separate subclass for each note cla... | 36.263736 | 119 | 0.688182 | """
This module contains machinery to annotate Notes with a "global address", the path of that note in a with respect to
some global root score.
Note: the annotated Notes are defined here with considerable amount of duplication with clef.py, most notably in the
fact that we define a separate subclass for each note cla... | 0 | 0 | 0 | 3,145 | 0 | 0 | 0 | 45 | 183 |
e55637961b72ac2b2918945e4ac9403b5f28ae9c | 545 | py | Python | jutils/image/gifer.py | jaymody/jutils | 165d47f0cf1a2a91a952d361ad8d494a7868fd35 | [
"MIT"
] | null | null | null | jutils/image/gifer.py | jaymody/jutils | 165d47f0cf1a2a91a952d361ad8d494a7868fd35 | [
"MIT"
] | null | null | null | jutils/image/gifer.py | jaymody/jutils | 165d47f0cf1a2a91a952d361ad8d494a7868fd35 | [
"MIT"
] | null | null | null | # Imports
import re
import os
import glob
import imageio
def gifer(glob_pattern, out_fpath):
"""Converts a series of images into a gif in order of numerical numbers in their name"""
try:
paths = glob.glob(glob_pattern)
paths = list(sorted(paths, \
key=lambda x: int(re.sub('[^0-9]','... | 28.684211 | 92 | 0.640367 | # Imports
import re
import os
import glob
import imageio
def gifer(glob_pattern, out_fpath):
"""Converts a series of images into a gif in order of numerical numbers in their name"""
try:
paths = glob.glob(glob_pattern)
paths = list(sorted(paths, \
key=lambda x: int(re.sub('[^0-9]','... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4152dab8df03f0403541578a786a284c7e00000a | 2,045 | py | Python | python/cendalytics/tfidf/core/dmo/inversion_library_loader.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/tfidf/core/dmo/inversion_library_loader.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/tfidf/core/dmo/inversion_library_loader.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
| 25.246914 | 80 | 0.539853 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import time
import pandas as pd
from pandas import DataFrame
from base import BaseObject
from base import FileIO
class InversionLibraryLoader(BaseObject):
""" Load Inversion Library """
__df_inversion = None
__header_row = ["Id",
... | 0 | 0 | 0 | 1,848 | 0 | 0 | 0 | -9 | 158 |
2844cf610671e8110c55ad133824c9e511e119c8 | 26,633 | py | Python | manage.py | andrewimeson/hyperglass | da30c4ca68f10830708b75984f37728c06664f83 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-06-18T07:25:42.000Z | 2019-06-18T07:25:42.000Z | manage.py | fulopa7/hyperglass | da30c4ca68f10830708b75984f37728c06664f83 | [
"BSD-3-Clause-Clear"
] | null | null | null | manage.py | fulopa7/hyperglass | da30c4ca68f10830708b75984f37728c06664f83 | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python3
# Standard Imports
import os
import shutil
# Module Imports
import json
# Initialize shutil copy function
cp = shutil.copyfile
# Define working directory
working_directory = os.path.dirname(os.path.abspath(__file__))
def construct_test(test_query, location, test_target):
"""Constructs J... | 39.05132 | 134 | 0.616491 | #!/usr/bin/env python3
# Standard Imports
import os
import grp
import pwd
import sys
import glob
import random
import shutil
import string
# Module Imports
import click
import json
from passlib.hash import pbkdf2_sha256
import requests
# Initialize shutil copy function
cp = shutil.copyfile
# Define working director... | 162 | 25,601 | 0 | 0 | 0 | 0 | 0 | -57 | 474 |
714b4a2f2e9af1dd9a57e6cccb54c315267d07b3 | 4,734 | py | Python | h2o-py/tests/testdir_jira/pyunit_pubdev_6339.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2020-09-23T14:23:55.000Z | 2020-09-23T19:26:30.000Z | h2o-py/tests/testdir_jira/pyunit_pubdev_6339.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2021-06-02T02:24:03.000Z | 2021-11-15T17:51:49.000Z | h2o-py/tests/testdir_jira/pyunit_pubdev_6339.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | import sys
sys.path.insert(1,"../../")
import math
from tests import pyunit_utils
def calculate_chunk_size(file_path, num_cols, cores, cloud_size):
"""
Return size of a chunk calculated for optimal data handling in h2o java backend.
:param file_path: path to dataset
:par... | 45.085714 | 158 | 0.666878 | import sys
sys.path.insert(1,"../../")
import h2o
import math
import os
from tests import pyunit_utils
def pubdev_6339():
cluster = h2o.cluster()
# number of nodes
cloud_size = cluster.cloud_size
# number of CPUs
cores = sum(node["num_cpus"] for node in cluster.nodes)
# path to file
... | 0 | 0 | 0 | 0 | 0 | 1,353 | 0 | -23 | 67 |
e6877b289de9f4cbafe2aaad04ce72e6187d0440 | 12,687 | py | Python | haptics_v2_I2C/code/drv.py | MissCrispenCakes/On-body-haptics | 80aeb115cdbd87d602a6092e9030fd754b1a8733 | [
"MIT"
] | 2 | 2020-02-17T14:34:59.000Z | 2022-01-21T12:59:38.000Z | haptics_v2_I2C/code/drv.py | MissCrispenCakes/On-body-haptics | 80aeb115cdbd87d602a6092e9030fd754b1a8733 | [
"MIT"
] | null | null | null | haptics_v2_I2C/code/drv.py | MissCrispenCakes/On-body-haptics | 80aeb115cdbd87d602a6092e9030fd754b1a8733 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_drv2605`
====================================================
CircuitPython module for the DRV2605 haptic feedback motor driver. See
examples/simpletest.py for a demo of the usage.
* Author(s... | 34.289189 | 108 | 0.639158 | # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_drv2605`
====================================================
CircuitPython module for the DRV2605 haptic feedback motor driver. See
examples/simpletest.py for a demo of the usage.
* Author(s... | 0 | 3,322 | 0 | 7,047 | 0 | 0 | 0 | 31 | 125 |
2aaaeb2bae03cff3ed739a05926117b3d845d87c | 370 | py | Python | links.py | raymond-devries/skagit60-scraping | bea9c41c7bb650abe77ae6c1bfa9f755f1e65846 | [
"MIT"
] | null | null | null | links.py | raymond-devries/skagit60-scraping | bea9c41c7bb650abe77ae6c1bfa9f755f1e65846 | [
"MIT"
] | null | null | null | links.py | raymond-devries/skagit60-scraping | bea9c41c7bb650abe77ae6c1bfa9f755f1e65846 | [
"MIT"
] | null | null | null | import pandas as pd
if __name__ == '__main__':
website = 'https://www.peakbagger.com/'
links = pd.read_csv('raw_data/links.csv')
links['full_link'] = website + links['link']
full_links = links[['Mountain', 'full_link']]
full_links = full_links.rename(columns={'full_link': 'link'})
full_links.t... | 33.636364 | 65 | 0.681081 | import pandas as pd
if __name__ == '__main__':
website = 'https://www.peakbagger.com/'
links = pd.read_csv('raw_data/links.csv')
links['full_link'] = website + links['link']
full_links = links[['Mountain', 'full_link']]
full_links = full_links.rename(columns={'full_link': 'link'})
full_links.t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77d41cb9debb2c88384d245d7612811bf818a866 | 3,971 | py | Python | pypro/settings.py | felipeapellegrini/curso-django | 9a552ae3cb6c100055814cc8530c8c9b531c95dd | [
"MIT"
] | null | null | null | pypro/settings.py | felipeapellegrini/curso-django | 9a552ae3cb6c100055814cc8530c8c9b531c95dd | [
"MIT"
] | 9 | 2021-08-14T14:38:23.000Z | 2021-08-17T03:11:53.000Z | pypro/settings.py | felipeapellegrini/curso-django | 9a552ae3cb6c100055814cc8530c8c9b531c95dd | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from decouple import config, Csv
import dj_database_url
from functools import partial
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', cast=bool)
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
AUTH_USER_MODEL = 'bas... | 28.364286 | 91 | 0.714933 | import os
from pathlib import Path
from decouple import config, Csv
import dj_database_url
from functools import partial
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', cast=bool)
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
AUTH_USER_MODEL = 'bas... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ca7e988ca9f110a9aa431e72730d28b2a4942fb1 | 934 | py | Python | combine_keys.py | dankov/windows-keylogger | 625a1ef0aa008a367f05fbc65958fafa87122b85 | [
"Unlicense"
] | 1 | 2018-03-09T15:57:57.000Z | 2018-03-09T15:57:57.000Z | combine_keys.py | dankov/windows-keylogger | 625a1ef0aa008a367f05fbc65958fafa87122b85 | [
"Unlicense"
] | null | null | null | combine_keys.py | dankov/windows-keylogger | 625a1ef0aa008a367f05fbc65958fafa87122b85 | [
"Unlicense"
] | null | null | null | from __future__ import print_function
import fileinput
import sys
keys_down = []
i = 0
for line in fileinput.input():
i += 1
split_line = line.rstrip().split(' ')
if len(split_line) != 2:
print('Unrecognized format on line ' + str(i), file=sys.stderr)
continue
action = split_line... | 30.129032 | 98 | 0.563169 | from __future__ import print_function
import fileinput
import sys
keys_down = []
i = 0
for line in fileinput.input():
i += 1
split_line = line.rstrip().split(' ')
if len(split_line) != 2:
print('Unrecognized format on line ' + str(i), file=sys.stderr)
continue
action = split_line... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25227770d47c780541652a63d93c49110ceaf9d6 | 1,624 | py | Python | articles/migrations/0003_initial_pages.py | losolio/website | 5b983e9dfaf604212aab87c51d8904ffc29527a3 | [
"MIT"
] | 10 | 2015-12-18T16:41:33.000Z | 2018-11-11T08:36:46.000Z | articles/migrations/0003_initial_pages.py | losolio/website | 5b983e9dfaf604212aab87c51d8904ffc29527a3 | [
"MIT"
] | 96 | 2015-07-14T22:45:56.000Z | 2017-07-25T19:59:48.000Z | articles/migrations/0003_initial_pages.py | losolio/website | 5b983e9dfaf604212aab87c51d8904ffc29527a3 | [
"MIT"
] | 9 | 2015-07-28T14:38:43.000Z | 2019-01-04T17:38:42.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 27.066667 | 80 | 0.658251 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_pages(apps, schema_editor):
Page = apps.get_model("wagtailcore", "Page")
SeriesListPage = apps.get_model("articles", "SeriesListPage")
ArticleListPage = apps.get_model("articles", "ArticleL... | 0 | 0 | 0 | 210 | 0 | 1,260 | 0 | 19 | 69 |
f373d9e39b7c68b7583c76a11336122d800a3114 | 2,142 | py | Python | misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 0515fe325ccf49c7914ea8aa1404cdee6dfe2648 | [
"MIT"
] | 39 | 2015-09-20T06:33:54.000Z | 2021-12-21T06:59:53.000Z | misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 0515fe325ccf49c7914ea8aa1404cdee6dfe2648 | [
"MIT"
] | 23 | 2015-09-23T12:00:43.000Z | 2020-05-27T15:42:11.000Z | misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 0515fe325ccf49c7914ea8aa1404cdee6dfe2648 | [
"MIT"
] | 19 | 2015-10-16T21:40:12.000Z | 2020-11-10T07:58:00.000Z | #!/usr/bin/env python
import sys, getopt
import glob, os
# sample the first 10**7 reads
help_message = 'usage example: python read_phyler.py -r 1 -i /project/home/original_reads/ -o /project/home/phyler/'
if __name__ == "__main__":
try:
opts, args = getopt.getopt(sys.argv[1:],'hr:i:o:',["inputdir="])
except:
p... | 34 | 304 | 0.653595 | #!/usr/bin/env python
import sys, getopt
import glob,os
# sample the first 10**7 reads
def get_fasta(fp,fo):
f = open(fp)
g = open(fo,'w')
lastlinechar = ''
writenext = False
read_count = 0
for line in f:
if (line[0] == '@') and (lastlinechar != '+'):
g.write('>'+line[1:])
writenext = True
read_count... | 0 | 0 | 0 | 0 | 0 | 372 | 0 | -1 | 22 |
be7e43fdc0aad4d4987f801c80b41cf68e61832d | 2,278 | py | Python | tests/components/neato/test_init.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | 2 | 2020-08-08T21:55:12.000Z | 2021-04-17T10:59:49.000Z | tests/components/neato/test_init.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | tests/components/neato/test_init.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | """Tests for the Neato init file."""
from homeassistant.components.neato.const import CONF_VENDOR
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
USERNAME = "myUsername"
PASSWORD = "myPassword"
VENDOR_NEATO = "neato"
VENDOR_VORWERK = "vorwerk"
VENDOR_INVALID = "invalid"
VALID_CONFIG = {
CONF_USERNAM... | 32.084507 | 88 | 0.763828 | """Tests for the Neato init file."""
import pytest
from unittest.mock import patch
from homeassistant.components.neato.const import NEATO_DOMAIN, CONF_VENDOR
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
USE... | 0 | 143 | 1,375 | 0 | 0 | 0 | 0 | 67 | 181 |
80b912349ac11ba8537195cdab5d1879397d8dee | 15,119 | py | Python | diceseq/utils/bias_utils.py | huangyh09/diceseq | 86c0a598d85ca60816189d58d6b4b1a4541a8755 | [
"Apache-2.0"
] | 2 | 2016-09-11T20:55:09.000Z | 2019-06-05T15:55:54.000Z | diceseq/utils/bias_utils.py | huangyh09/diceseq | 86c0a598d85ca60816189d58d6b4b1a4541a8755 | [
"Apache-2.0"
] | 5 | 2015-11-05T07:31:57.000Z | 2021-12-10T09:00:54.000Z | diceseq/utils/bias_utils.py | huangyh09/diceseq | 86c0a598d85ca60816189d58d6b4b1a4541a8755 | [
"Apache-2.0"
] | 1 | 2016-06-07T14:49:47.000Z | 2016-06-07T14:49:47.000Z | # This module is to estimate the sequence or position biases. It provides
# ways to access and save the bias parameters.
| 43.950581 | 108 | 0.522587 | # This module is to estimate the sequence or position biases. It provides
# ways to access and save the bias parameters.
import pysam
import numpy as np
import matplotlib.pyplot as plt
def norm_pdf(x, mu, sigma):
return 1 / (sigma*np.sqrt(2*np.pi)) * np.exp(-1/2*((x-mu)/sigma)**2)
class FastaFile:
"""docstri... | 0 | 0 | 0 | 14,785 | 0 | 79 | 0 | -2 | 136 |
dce85f0ee9a29c2bcce281aba7816c15c67235a0 | 310 | py | Python | ch06_timer.py | jeffreycoen/prog_mb | 739e9869b51dc861a57da697d49406b1394ade6d | [
"MIT"
] | 13 | 2017-12-05T16:28:14.000Z | 2022-02-21T22:05:00.000Z | ch06_timer.py | jeffreycoen/prog_mb | 739e9869b51dc861a57da697d49406b1394ade6d | [
"MIT"
] | null | null | null | ch06_timer.py | jeffreycoen/prog_mb | 739e9869b51dc861a57da697d49406b1394ade6d | [
"MIT"
] | 5 | 2018-03-23T20:14:18.000Z | 2021-03-15T06:37:58.000Z |
SET, RUN, ALARM = range(3)
state = SET
while True:
if state == SET:
handle_set_state()
elif state == RUN:
handle_run_state()
elif state == ALARM:
handle_alarm_state() | 17.222222 | 28 | 0.635484 | from microbit import *
SET, RUN, ALARM = range(3)
state = SET
def handle_set_state():
def handle_run_state():
def handle_alarm_state():
while True:
if state == SET:
handle_set_state()
elif state == RUN:
handle_run_state()
elif state == ALARM:
handle_alarm_state() | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 1 | 96 |
5487aa7a87ffb31dd6644be5389af666ff0e48f2 | 6,798 | py | Python | src/Input.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 33 | 2015-01-02T08:14:39.000Z | 2021-12-08T16:13:12.000Z | src/Input.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 2 | 2018-03-03T09:18:58.000Z | 2020-06-29T08:25:20.000Z | src/Input.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 17 | 2015-11-22T03:42:59.000Z | 2021-11-18T13:05:05.000Z | # -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Snchez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list o... | 38.845714 | 194 | 0.644013 | # -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Sánchez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list ... | 2 | 0 | 0 | 5,145 | 0 | 0 | 0 | -33 | 112 |
f44633353d58737608b47b708734fd303d9bd3db | 10,998 | py | Python | test/test_polytaxis.py | Rendaw/polytaxis-python | f2b2d62f6fbe7549ef0f737ede5bf65a260f299c | [
"BSD-2-Clause"
] | null | null | null | test/test_polytaxis.py | Rendaw/polytaxis-python | f2b2d62f6fbe7549ef0f737ede5bf65a260f299c | [
"BSD-2-Clause"
] | 1 | 2015-07-17T00:19:00.000Z | 2015-07-17T00:32:32.000Z | test/test_polytaxis.py | Rendaw/polytaxis-python | f2b2d62f6fbe7549ef0f737ede5bf65a260f299c | [
"BSD-2-Clause"
] | null | null | null |
normal_tags = {'a': set(['a'])}
raw_unsized_notags = (
b'polytaxis00u\n'
b'<<<<\n'
b'wug'
)
raw_unsized_normal = (
b'polytaxis00u\n'
b'a=a\n'
b'<<<<\n'
b'wug'
)
raw_sized_minimized_notags = (
b'polytaxis00 0000000000\n'
b'wug'
)
raw_sized_notags = (
b'polytaxis00 0000000512... | 26.759124 | 76 | 0.518822 | import unittest
import io
import os
import collections
import polytaxis
normal_tags = {'a': set(['a'])}
raw_unsized_notags = (
b'polytaxis00u\n'
b'<<<<\n'
b'wug'
)
raw_unsized_normal = (
b'polytaxis00u\n'
b'a=a\n'
b'<<<<\n'
b'wug'
)
raw_sized_minimized_notags = (
b'polytaxis00 0000... | 0 | 0 | 0 | 9,955 | 0 | 194 | 0 | -38 | 272 |
8dcd37bb6d5a541f465e86e550f4110e352cf88b | 7,984 | py | Python | mainframe.py | bcorfman/raven-checkers | 8de758acfd42bb151cfc7311130b27e42ccd098d | [
"MIT"
] | 25 | 2016-03-30T18:03:17.000Z | 2021-11-09T12:07:00.000Z | mainframe.py | bcorfman/raven-checkers | 8de758acfd42bb151cfc7311130b27e42ccd098d | [
"MIT"
] | 3 | 2016-11-27T07:59:44.000Z | 2018-06-05T01:15:35.000Z | mainframe.py | bcorfman/raven-checkers | 8de758acfd42bb151cfc7311130b27e42ccd098d | [
"MIT"
] | 13 | 2016-02-21T19:57:57.000Z | 2021-03-01T10:31:14.000Z | from multiprocessing import freeze_support
if __name__ == '__main__':
freeze_support()
start()
| 42.021053 | 112 | 0.596192 | import os
from Tkinter import IntVar, Menu, Tk
import Tkinter as tk
from tkMessageBox import askyesnocancel
from multiprocessing import freeze_support
from globalconst import RAVEN_ICON, VERSION, TITLE, BLACK, get_preferences_from_file, write_preferences_to_file
from aboutbox import AboutBox
from setupboard impo... | 0 | 0 | 0 | 7,308 | 0 | 101 | 0 | 180 | 280 |
14a2b5374540915ca3b90707995f417ab188c692 | 2,242 | py | Python | data/train/python/14a2b5374540915ca3b90707995f417ab188c692main.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/14a2b5374540915ca3b90707995f417ab188c692main.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/14a2b5374540915ca3b90707995f417ab188c692main.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | import sys
import time
if __name__ == "__main__":
window, screen = init_game()
start_time = time.time()
mainloop(screen, start_time)
sys.exit(0)
| 30.297297 | 73 | 0.683318 | import pygame
import sys
import time
from intro_controller import IntroController
from settings import RESOLUTION
from spacebar_controller import SpacebarController, LONGPRESS, SHORTPRESS
from game_controller import ControllerResignException
from gameplay_controller import GameplayController
from outro_controller impo... | 0 | 0 | 0 | 653 | 0 | 1,039 | 0 | 161 | 224 |
78f6cf1986f4440b85c57219746f1e704897cec0 | 4,053 | py | Python | CrySPY/interface/select_code.py | nbsato/CrySPY | 663a7d714144e76bfae751dffedcf781d3976c4e | [
"MIT"
] | null | null | null | CrySPY/interface/select_code.py | nbsato/CrySPY | 663a7d714144e76bfae751dffedcf781d3976c4e | [
"MIT"
] | null | null | null | CrySPY/interface/select_code.py | nbsato/CrySPY | 663a7d714144e76bfae751dffedcf781d3976c4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 35.867257 | 115 | 0.675302 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from VASP import calc_files_vasp, ctrl_job_vasp, collect_vasp
from QE import calc_files_qe, ctrl_job_qe, collect_qe
from soiap import calc_files_soiap, ctrl_job_soiap, collect_soiap
from ..IO import read_input as rin
def check_calc_files():
if rin.calc_code == 'VASP'... | 0 | 0 | 0 | 0 | 0 | 3,597 | 0 | 129 | 273 |
0f15b459143cf0f7a6b7b0fe5249f3dddaaa906a | 21,265 | py | Python | biothings_explorer/utils/simple_semmed.py | luluricketts/biothings_explorer | ae2009ff285f96a08e0145f242846ca613b5069c | [
"Apache-2.0"
] | 21 | 2017-07-22T10:08:03.000Z | 2022-01-11T08:53:14.000Z | biothings_explorer/utils/simple_semmed.py | luluricketts/biothings_explorer | ae2009ff285f96a08e0145f242846ca613b5069c | [
"Apache-2.0"
] | 127 | 2017-07-22T10:19:45.000Z | 2021-11-04T01:23:43.000Z | biothings_explorer/utils/simple_semmed.py | luluricketts/biothings_explorer | ae2009ff285f96a08e0145f242846ca613b5069c | [
"Apache-2.0"
] | 18 | 2017-04-27T17:02:06.000Z | 2021-07-25T18:13:56.000Z | semmed = {
"AnatomicalEntity": {
"affected_by": [
"ChemicalSubstance",
"BiologicalProcess",
"Disease",
"Gene",
"CellularComponent"
],
"affects": [
"Disease",
"BiologicalProcess"
],
"causes": [... | 24.555427 | 38 | 0.408747 | semmed = {
"AnatomicalEntity": {
"affected_by": [
"ChemicalSubstance",
"BiologicalProcess",
"Disease",
"Gene",
"CellularComponent"
],
"affects": [
"Disease",
"BiologicalProcess"
],
"causes": [... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
92f2f0df370ff6ad3c19574c1c849f73c1ae1bfc | 1,015 | py | Python | like/migrations/0001_initial.py | engineer237/Project-Track-Api | 505f95d886144bbafd00797b25bd1c8940529e3f | [
"MIT"
] | null | null | null | like/migrations/0001_initial.py | engineer237/Project-Track-Api | 505f95d886144bbafd00797b25bd1c8940529e3f | [
"MIT"
] | null | null | null | like/migrations/0001_initial.py | engineer237/Project-Track-Api | 505f95d886144bbafd00797b25bd1c8940529e3f | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-04-12 14:56
| 36.25 | 152 | 0.64335 | # Generated by Django 4.0.3 on 2022-04-12 14:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('projects', '0001_initial'),
migrations.swappable_dependency(set... | 0 | 0 | 0 | 835 | 0 | 0 | 0 | 41 | 90 |
1d8643819b6fd2cc7279940e0eb8e114425632a1 | 465 | py | Python | mayan/apps/ocr/runtime.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/ocr/runtime.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 7 | 2020-06-06T00:01:04.000Z | 2022-01-13T01:47:17.000Z | mayan/apps/ocr/runtime.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
from django.utils.module_loading import import_string
from .settings import setting_ocr_backend, setting_ocr_backend_arguments
ocr_backend = import_string(
... | 22.142857 | 77 | 0.787097 | from __future__ import unicode_literals
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
from django.utils.module_loading import import_string
from .settings import setting_ocr_backend, setting_ocr_backend_arguments
ocr_backend = import_string(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fcd9cb1e9903412012ebf931f3e03af6a0150244 | 5,501 | py | Python | scarlett_os/scripts/cli.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 5 | 2016-11-08T21:01:00.000Z | 2018-05-07T11:02:43.000Z | scarlett_os/scripts/cli.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 854 | 2016-09-21T13:06:32.000Z | 2022-02-10T13:21:47.000Z | scarlett_os/scripts/cli.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 2 | 2016-12-02T15:12:41.000Z | 2017-02-25T08:21:56.000Z | # -*- coding: utf-8 -*-
"""
Main click group for CLI
"""
# from pkg_resources import iter_entry_points
# from scarlett_os.compat import configparser
# def configure_logging(verbosity):
# log_level = max(10, 30 - 10 * verbosity)
# logging.basicConfig(stream=sys.stderr, level=log_level)
# def read_config(cf... | 27.923858 | 123 | 0.644792 | # -*- coding: utf-8 -*-
"""
Main click group for CLI
"""
import logging
import os
import sys
import click
from click_plugins import with_plugins
# from pkg_resources import iter_entry_points
import scarlett_os
from scarlett_os.common.configure.ruamel_config import ConfigManager
# from scarlett_os.compat import con... | 0 | 1,777 | 0 | 0 | 0 | 0 | 0 | 22 | 249 |
c1150513fa39ea51f040e89dddcfa3368bd9d78f | 2,361 | py | Python | Module02/guess_my_primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Yilin-Y | 25a096cd5ebb848de727b989a85bd08e5e5e5652 | [
"MIT"
] | null | null | null | Module02/guess_my_primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Yilin-Y | 25a096cd5ebb848de727b989a85bd08e5e5e5652 | [
"MIT"
] | null | null | null | Module02/guess_my_primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Yilin-Y | 25a096cd5ebb848de727b989a85bd08e5e5e5652 | [
"MIT"
] | null | null | null | # Yilin Wang
# pre_lecture assignment
# BMES T580
import random
print('**********************************')
print(' GUESS_THAT_PRIMER GAME ')
print('**********************************')
print()
DNA = ['A','G','C','T'] # DNA base
# set the initial sequence as a empty string
# the base will be added into this empty... | 38.704918 | 130 | 0.668784 | # Yilin Wang
# pre_lecture assignment
# BMES T580
import random
import math
print('**********************************')
print(' GUESS_THAT_PRIMER GAME ')
print('**********************************')
print()
DNA = ['A','G','C','T'] # DNA base
# set the initial sequence as a empty string
# the base will be added int... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |