hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0b0fd9d074507e24e7d46f98410700595e9699 | 1,089 | py | Python | msdm/domains/tiger.py | markkho/msdm | f2e07cdf1a16f7a0564a4822caed89a758e14bf1 | [
"MIT"
] | 15 | 2020-09-09T14:08:10.000Z | 2022-02-24T14:19:39.000Z | msdm/domains/tiger.py | markkho/msdm | f2e07cdf1a16f7a0564a4822caed89a758e14bf1 | [
"MIT"
] | 28 | 2020-09-13T22:12:03.000Z | 2022-02-20T18:42:56.000Z | msdm/domains/tiger.py | markkho/msdm | f2e07cdf1a16f7a0564a4822caed89a758e14bf1 | [
"MIT"
] | 3 | 2021-07-21T15:05:01.000Z | 2022-02-07T04:01:55.000Z | from msdm.core.problemclasses.pomdp import TabularPOMDP
from msdm.core.distributions import DictDistribution
class Tiger(TabularPOMDP):
def __init__(self, coherence, discount_rate):
self.coherence = coherence
self.discount_rate = discount_rate
def next_state_dist(self, s, a):
if a == 'l... | 28.657895 | 58 | 0.59596 | from msdm.core.problemclasses.pomdp import TabularPOMDP
from msdm.core.distributions import DictDistribution
class Tiger(TabularPOMDP):
def __init__(self, coherence, discount_rate):
self.coherence = coherence
self.discount_rate = discount_rate
def next_state_dist(self, s, a):
if a == 'l... | true | true |
1c0b125830cd64b364b7ab55f7e004cd62894951 | 2,965 | py | Python | huaweicloud-sdk-waf/huaweicloudsdkwaf/v1/model/policy_action.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-waf/huaweicloudsdkwaf/v1/model/policy_action.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-waf/huaweicloudsdkwaf/v1/model/policy_action.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class PolicyAction:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is at... | 25.782609 | 79 | 0.539629 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class PolicyAction:
sensitive_list = []
openapi_types = {
'category': 'str'
}
attribute_map = {
'category': 'category'
}
def __init__(self, category=None):
... | true | true |
1c0b125a425957ec92c25a03f3ea29650a55ff33 | 277 | py | Python | initialize.py | brant-ruan/IDF4APEV | b5ca7be867a8720ae8eccefb6c9f49c3d53e6888 | [
"MIT"
] | 2 | 2019-12-24T13:56:44.000Z | 2020-05-21T23:23:16.000Z | initialize.py | brant-ruan/IDF4APEV | b5ca7be867a8720ae8eccefb6c9f49c3d53e6888 | [
"MIT"
] | 1 | 2020-01-05T16:30:07.000Z | 2020-01-19T14:19:55.000Z | initialize.py | brant-ruan/IDF4APEV | b5ca7be867a8720ae8eccefb6c9f49c3d53e6888 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@File : initialize.py
@Time : 2019-04-20 15:28
@Author : Bonan Ruan
@Desc : to do some initializations before idf works
"""
from utils import consts
from utils import utils
utils.debug("IDF initialized successfully.")
| 18.466667 | 54 | 0.67509 |
from utils import consts
from utils import utils
utils.debug("IDF initialized successfully.")
| true | true |
1c0b1295a7dd68b80b6b49cda6aa4e618640f925 | 154 | py | Python | api/groups/urls.py | antonybholmes/edbw-django-app | 2268fa7f983347742ee55145269ef1222776a838 | [
"MIT"
] | null | null | null | api/groups/urls.py | antonybholmes/edbw-django-app | 2268fa7f983347742ee55145269ef1222776a838 | [
"MIT"
] | null | null | null | api/groups/urls.py | antonybholmes/edbw-django-app | 2268fa7f983347742ee55145269ef1222776a838 | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf.urls import url
from api.groups import views
urlpatterns = [
path('', views.groups, name='groups'),
]
| 17.111111 | 42 | 0.720779 | from django.urls import path
from django.conf.urls import url
from api.groups import views
urlpatterns = [
path('', views.groups, name='groups'),
]
| true | true |
1c0b12cd4947798b6332d915f104f2069346bfe8 | 20,904 | py | Python | kitsune/bundles.py | abhro/kitsune | 7550cedd94690b1118c25617ac147a456fa3a1af | [
"BSD-3-Clause"
] | null | null | null | kitsune/bundles.py | abhro/kitsune | 7550cedd94690b1118c25617ac147a456fa3a1af | [
"BSD-3-Clause"
] | null | null | null | kitsune/bundles.py | abhro/kitsune | 7550cedd94690b1118c25617ac147a456fa3a1af | [
"BSD-3-Clause"
] | null | null | null | # Bundles for JS/CSS Minification
PIPELINE_CSS = {
'common': {
'source_filenames': (
'normalize-css/normalize.css',
'sumo/less/main.less',
'sumo/less/search.less',
'mozilla-tabzilla/css/tabzilla.css',
),
'output_filename': 'build/common-min.cs... | 32.110599 | 77 | 0.519613 |
PIPELINE_CSS = {
'common': {
'source_filenames': (
'normalize-css/normalize.css',
'sumo/less/main.less',
'sumo/less/search.less',
'mozilla-tabzilla/css/tabzilla.css',
),
'output_filename': 'build/common-min.css'
},
'community': {
... | true | true |
1c0b134348f49234dd5b63c1daedc7754e1ee31d | 8,825 | py | Python | fuzzers/015-clbnffmux/top.py | unixb0y/prjxray | 569a44d8beadb7cf6548f7437e46fb456bacdd90 | [
"ISC"
] | 1 | 2020-10-31T19:32:41.000Z | 2020-10-31T19:32:41.000Z | fuzzers/015-clbnffmux/top.py | unixb0y/prjxray | 569a44d8beadb7cf6548f7437e46fb456bacdd90 | [
"ISC"
] | null | null | null | fuzzers/015-clbnffmux/top.py | unixb0y/prjxray | 569a44d8beadb7cf6548f7437e46fb456bacdd90 | [
"ISC"
] | 1 | 2021-05-07T11:53:23.000Z | 2021-05-07T11:53:23.000Z | import random
random.seed(0)
import os
import re
def slice_xy():
'''Return (X1, X2), (Y1, Y2) from XRAY_ROI, exclusive end (for xrange)'''
# SLICE_X12Y100:SLICE_X27Y149
# Note XRAY_ROI_GRID_* is something else
m = re.match(
r'SLICE_X([0-9]*)Y([0-9]*):SLICE_X([0-9]*)Y([0-9]*)',
os.geten... | 25.359195 | 95 | 0.471955 | import random
random.seed(0)
import os
import re
def slice_xy():
m = re.match(
r'SLICE_X([0-9]*)Y([0-9]*):SLICE_X([0-9]*)Y([0-9]*)',
os.getenv('XRAY_ROI'))
ms = [int(m.group(i + 1)) for i in range(4)]
return ((ms[0], ms[2] + 1), (ms[1], ms[3] + 1))
CLBN = 400
SLICEX, SLICEY = sli... | true | true |
1c0b1472c27eea038c33a1fbf5057fa370b0d268 | 10,395 | py | Python | nova/tests/unit/scheduler/filters/test_core_filters.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/scheduler/filters/test_core_filters.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/scheduler/filters/test_core_filters.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/L... | 12.584746 | 88 | 0.608369 | begin_unit
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/L... | false | true |
1c0b1560641a32d66fab3b1db92b412afd6f35d0 | 1,087 | py | Python | exercises/08_gashlycrumb/solution3.py | cvk1988/biosystems-analytics-2020 | 68ef2146b3b1b38406f1452ba90c469068a663b2 | [
"MIT"
] | 1 | 2021-05-19T19:07:56.000Z | 2021-05-19T19:07:56.000Z | exercises/08_gashlycrumb/solution3.py | cvk1988/biosystems-analytics-2020 | 68ef2146b3b1b38406f1452ba90c469068a663b2 | [
"MIT"
] | 1 | 2020-02-11T20:15:59.000Z | 2020-02-11T20:15:59.000Z | exercises/08_gashlycrumb/solution3.py | cvk1988/biosystems-analytics-2020 | 68ef2146b3b1b38406f1452ba90c469068a663b2 | [
"MIT"
] | 24 | 2020-01-15T17:34:40.000Z | 2021-08-23T05:57:24.000Z | #!/usr/bin/env python3
"""Lookup tables"""
import argparse
import sys
# --------------------------------------------------
def get_args():
"""get command-line arguments"""
parser = argparse.ArgumentParser(
description='Gashlycrumb',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
... | 23.630435 | 73 | 0.464581 |
import argparse
import sys
def get_args():
parser = argparse.ArgumentParser(
description='Gashlycrumb',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('letter', help='Letter', metavar='str', type=str)
parser.add_argument('-f',
'--fil... | true | true |
1c0b156f6d11fbc832fea1d9ae51f026f605a494 | 2,288 | py | Python | tools/subset_val.py | lirhea/pythia | 6bcf9f64f9f42a45e17dd6681fea6ff16819b817 | [
"BSD-3-Clause"
] | 8 | 2019-04-01T01:35:45.000Z | 2021-01-05T08:54:36.000Z | tools/subset_val.py | crazyrex/pythia | e942e94fae8ef3fe5d93f4bb3d25daf6b9e0eaa2 | [
"BSD-3-Clause"
] | 1 | 2019-07-28T11:29:07.000Z | 2019-07-29T03:03:19.000Z | tools/subset_val.py | crazyrex/pythia | e942e94fae8ef3fe5d93f4bb3d25daf6b9e0eaa2 | [
"BSD-3-Clause"
] | 3 | 2019-09-10T00:45:22.000Z | 2020-10-03T02:44:23.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import json
import random
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argu... | 27.238095 | 79 | 0.625 |
import json
import random
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--ques_file", type=str, )
pass
if __name__ == '__main__':
val_json_file = "v2_OpenEnded_mscoco_val2014_questions.json"
minival_json_file = "v2_OpenEnded_mscoco_minival2014_questi... | true | true |
1c0b15bb70a3ebe782decc7d7669628fda31e75e | 4,452 | py | Python | assignments/assignment2/.ipynb_checkpoints/gradient_check-checkpoint.py | vandedok/dlcourse_ai | b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f | [
"MIT"
] | null | null | null | assignments/assignment2/.ipynb_checkpoints/gradient_check-checkpoint.py | vandedok/dlcourse_ai | b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f | [
"MIT"
] | null | null | null | assignments/assignment2/.ipynb_checkpoints/gradient_check-checkpoint.py | vandedok/dlcourse_ai | b5ef97029980d3e9b5f75e3cf0b43762fc53ca2f | [
"MIT"
] | null | null | null | import numpy as np
def check_gradient(f, x, delta=1e-5, tol=1e-4):
"""
Checks the implementation of analytical gradient by comparing
it to numerical gradient using two-point formula
Arguments:
f: function that receives x and computes value and gradient
x: np array, initial point where gra... | 30.285714 | 131 | 0.639263 | import numpy as np
def check_gradient(f, x, delta=1e-5, tol=1e-4):
print("point 1")
assert isinstance(x, np.ndarray)
assert x.dtype == np.float
fx, analytic_grad = f(x)
analytic_grad = analytic_grad.copy()
print("point 2")
assert analytic_grad.shape == x.shape
it = np.nditer(x, ... | true | true |
1c0b16bd1da082cf8a49ae4fdd7a6522aa958fb8 | 2,135 | py | Python | docs/conf.py | paudetseis/PlateFlex | 665022fc1983d10616881bd6895a05171bf15348 | [
"MIT"
] | 19 | 2019-10-01T04:42:51.000Z | 2021-09-08T21:51:20.000Z | docs/conf.py | MoSobh/PlateFlex | 665022fc1983d10616881bd6895a05171bf15348 | [
"MIT"
] | 7 | 2019-11-07T18:26:12.000Z | 2022-02-03T18:58:21.000Z | docs/conf.py | MoSobh/PlateFlex | 665022fc1983d10616881bd6895a05171bf15348 | [
"MIT"
] | 13 | 2019-10-01T04:43:00.000Z | 2022-03-31T15:36:05.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 36.186441 | 79 | 0.679157 |
project = 'plateflex'
copyright = '2019, Pascal Audet'
author = 'Pascal Audet'
from plateflex import __version__ as release
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
autodoc_member_order = 'bysource'
html_logo = '../plateflex/examples/picture/logo_plateflex_small.png'
templates_path = ['_tem... | true | true |
1c0b16d95050fc27f6a8e4df230ceddc4ab14d07 | 301 | py | Python | flamyngo/app.py | materialsvirtuallab/flamyngo | 067ec0f962cc2d328ccc2c2b37cf72de9b1b1379 | [
"BSD-3-Clause"
] | 10 | 2016-03-03T04:06:59.000Z | 2022-02-08T06:48:50.000Z | flamyngo/app.py | materialsvirtuallab/flamyngo | 067ec0f962cc2d328ccc2c2b37cf72de9b1b1379 | [
"BSD-3-Clause"
] | 43 | 2018-07-17T14:30:57.000Z | 2022-03-31T13:14:08.000Z | flamyngo/app.py | materialsvirtuallab/flamyngo | 067ec0f962cc2d328ccc2c2b37cf72de9b1b1379 | [
"BSD-3-Clause"
] | 8 | 2016-02-22T04:29:04.000Z | 2020-10-14T00:30:41.000Z | import os
from monty.serialization import loadfn
from flask import Flask
SETTINGS = loadfn(os.environ["FLAMYNGO"])
if SETTINGS.get("template_folder"):
app = Flask(__name__, template_folder=os.path.abspath(
SETTINGS["template_folder"]))
else:
app = Flask(__name__)
from . import views
| 25.083333 | 58 | 0.740864 | import os
from monty.serialization import loadfn
from flask import Flask
SETTINGS = loadfn(os.environ["FLAMYNGO"])
if SETTINGS.get("template_folder"):
app = Flask(__name__, template_folder=os.path.abspath(
SETTINGS["template_folder"]))
else:
app = Flask(__name__)
from . import views
| true | true |
1c0b1754d22508977cce45ad1dc1b5441ab7e26f | 1,637 | py | Python | examples/fsm-model/fsm_demo/monitor.py | collins-research/FuzzM | 5a7ad514a8f5292a2f933a2a6008b709677eb458 | [
"BSD-3-Clause"
] | 11 | 2018-05-03T15:46:39.000Z | 2021-10-07T06:52:59.000Z | examples/fsm-model/fsm_demo/monitor.py | TheBeaNerd/FuzzM | 57f5bb3701ae29869fd917b685be89441ed02725 | [
"BSD-3-Clause"
] | 1 | 2020-09-15T18:16:24.000Z | 2020-09-15T18:27:42.000Z | examples/fsm-model/fsm_demo/monitor.py | TheBeaNerd/FuzzM | 57f5bb3701ae29869fd917b685be89441ed02725 | [
"BSD-3-Clause"
] | 4 | 2019-12-18T00:07:46.000Z | 2021-01-02T07:25:30.000Z | #!/usr/bin/python3
"""Top-level monitor script for FSM Demo"""
import subprocess
import sys
import psutil
import os
from threading import Thread
from time import sleep
PROCESS_NAME = 'fsm'
PROCESS_COMMAND = './run.sh'
###############################################################################
class MonitorThrea... | 24.073529 | 79 | 0.477703 |
import subprocess
import sys
import psutil
import os
from threading import Thread
from time import sleep
PROCESS_NAME = 'fsm'
PROCESS_COMMAND = './run.sh'
class MonitorThread(Thread):
def __init__(self):
Thread.__init__(self)
self.running = True
def find_process(self):
found = False... | true | true |
1c0b17a251af87c43afa663346c711a0d8a445c3 | 22,896 | py | Python | pauxy/estimators/mixed.py | pauxy-qmc/pauxy | 1da80284284769b59361c73cfa3c2d914c74a73f | [
"Apache-2.0"
] | 16 | 2020-08-05T17:17:17.000Z | 2022-03-18T04:06:18.000Z | pauxy/estimators/mixed.py | pauxy-qmc/pauxy | 1da80284284769b59361c73cfa3c2d914c74a73f | [
"Apache-2.0"
] | 4 | 2020-05-17T21:28:20.000Z | 2021-04-22T18:05:50.000Z | pauxy/estimators/mixed.py | pauxy-qmc/pauxy | 1da80284284769b59361c73cfa3c2d914c74a73f | [
"Apache-2.0"
] | 5 | 2020-05-18T01:03:18.000Z | 2021-04-13T15:36:29.000Z | import h5py
import numpy
try:
from mpi4py import MPI
mpi_sum = MPI.SUM
except ImportError:
mpi_sum = None
import scipy.linalg
import time
from pauxy.estimators.utils import H5EstimatorHelper
from pauxy.estimators.ci import get_hmatel
from pauxy.estimators.thermal import particle_number, one_rdm_from_G
try:
... | 39.340206 | 137 | 0.540837 | import h5py
import numpy
try:
from mpi4py import MPI
mpi_sum = MPI.SUM
except ImportError:
mpi_sum = None
import scipy.linalg
import time
from pauxy.estimators.utils import H5EstimatorHelper
from pauxy.estimators.ci import get_hmatel
from pauxy.estimators.thermal import particle_number, one_rdm_from_G
try:
... | true | true |
1c0b18d6027175fce26fd7adbb589763b83f60f6 | 70,686 | py | Python | ocs_ci/ocs/cluster.py | am-agrawa/ocs-ci | 3627d17d30d0baf809c6ffef11131783c177253b | [
"MIT"
] | null | null | null | ocs_ci/ocs/cluster.py | am-agrawa/ocs-ci | 3627d17d30d0baf809c6ffef11131783c177253b | [
"MIT"
] | null | null | null | ocs_ci/ocs/cluster.py | am-agrawa/ocs-ci | 3627d17d30d0baf809c6ffef11131783c177253b | [
"MIT"
] | null | null | null | """
A module for all rook functionalities and abstractions.
This module has rook related classes, support for functionalities to work with
rook cluster. This works with assumptions that an OCP cluster is already
functional and proper configurations are made for interaction.
"""
import base64
import logging
import ran... | 34.21394 | 106 | 0.627974 |
import base64
import logging
import random
import re
import threading
import yaml
import time
from semantic_version import Version
import ocs_ci.ocs.resources.pod as pod
from ocs_ci.ocs.exceptions import (
UnexpectedBehaviour,
PoolSizeWrong,
PoolCompressionWrong,
CommandFailed,
)
from ocs_ci.ocs.resou... | true | true |
1c0b19a5e634b7044520efeb2dd617c0de136551 | 5,730 | py | Python | src/create_frt_pairs_file_new_test_classes.py | minhnd3796/facenet | 2951cf3ef8065a238876ba6c18d34f40cc389b13 | [
"MIT"
] | null | null | null | src/create_frt_pairs_file_new_test_classes.py | minhnd3796/facenet | 2951cf3ef8065a238876ba6c18d34f40cc389b13 | [
"MIT"
] | null | null | null | src/create_frt_pairs_file_new_test_classes.py | minhnd3796/facenet | 2951cf3ef8065a238876ba6c18d34f40cc389b13 | [
"MIT"
] | null | null | null | import os
import random
import numpy as np
data_dir = '/ditmemay/raid/fti/vision.minhnd/datasets/frt/cropped_face'
test_class_indices = np.array([172, 2045, 1656, 1702, 2476, 65, 2079, 548, 2874, 558, 1753, 2270], dtype=np.int32)
second_test_class_indices = np.array([172, 2045, 1656, 1702, 2476, 65, 2079, 548, 2874, 5... | 51.160714 | 178 | 0.728796 | import os
import random
import numpy as np
data_dir = '/ditmemay/raid/fti/vision.minhnd/datasets/frt/cropped_face'
test_class_indices = np.array([172, 2045, 1656, 1702, 2476, 65, 2079, 548, 2874, 558, 1753, 2270], dtype=np.int32)
second_test_class_indices = np.array([172, 2045, 1656, 1702, 2476, 65, 2079, 548, 2874, 5... | true | true |
1c0b19e09fb88c787021042b4ffcbd76faad1ad0 | 45,591 | py | Python | alidns-20150109/python/alibabacloud_alidns20150109/client.py | atptro/alibabacloud-sdk | 65d4a000e4f4059b58ca1bc3d032853aedef4f3f | [
"Apache-2.0"
] | null | null | null | alidns-20150109/python/alibabacloud_alidns20150109/client.py | atptro/alibabacloud-sdk | 65d4a000e4f4059b58ca1bc3d032853aedef4f3f | [
"Apache-2.0"
] | null | null | null | alidns-20150109/python/alibabacloud_alidns20150109/client.py | atptro/alibabacloud-sdk | 65d4a000e4f4059b58ca1bc3d032853aedef4f3f | [
"Apache-2.0"
] | null | null | null | # This file is auto-generated, don't edit it. Thanks.
from alibabacloud_tea_rpc.client import Client as RPCClient
from alibabacloud_alidns20150109 import models as alidns_20150109_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
from alibabaclo... | 44.565982 | 228 | 0.740563 | from alibabacloud_tea_rpc.client import Client as RPCClient
from alibabacloud_alidns20150109 import models as alidns_20150109_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_tea_util.client import Client as UtilClient
from alibabacloud_endpoint_util.client import Client as EndpointUtilC... | true | true |
1c0b1a0472dc43e6d4befb8c2978df15f8afada7 | 416 | py | Python | lesson6/1-multipage/multipage.py | lucasca95/harvard_flask_python_course | 76ac51ae6f6b5f5e7460c9c9c40d0c1be52779e1 | [
"Apache-2.0"
] | null | null | null | lesson6/1-multipage/multipage.py | lucasca95/harvard_flask_python_course | 76ac51ae6f6b5f5e7460c9c9c40d0c1be52779e1 | [
"Apache-2.0"
] | null | null | null | lesson6/1-multipage/multipage.py | lucasca95/harvard_flask_python_course | 76ac51ae6f6b5f5e7460c9c9c40d0c1be52779e1 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
app.config['ENV'] = 'development'
app.config['DEBUG'] = True
@app.route('/')
def first():
return render_template('first.html')
@app.route('/second')
def second():
return render_template('second.html')
@app.route('/third')
def third():
retur... | 19.809524 | 41 | 0.675481 | from flask import Flask, render_template
app = Flask(__name__)
app.config['ENV'] = 'development'
app.config['DEBUG'] = True
@app.route('/')
def first():
return render_template('first.html')
@app.route('/second')
def second():
return render_template('second.html')
@app.route('/third')
def third():
retur... | true | true |
1c0b1a210b96fbb559f0ca47b842cdec6f85f2ad | 3,702 | py | Python | messageboard/api.py | veerandev/demo | 150de4b34def50403f2bcd6893c68cf09be8ae42 | [
"MIT"
] | null | null | null | messageboard/api.py | veerandev/demo | 150de4b34def50403f2bcd6893c68cf09be8ae42 | [
"MIT"
] | null | null | null | messageboard/api.py | veerandev/demo | 150de4b34def50403f2bcd6893c68cf09be8ae42 | [
"MIT"
] | null | null | null | '''
Created on Apr 06, 2016
@author: Hisham
'''
import json
from decimal import Decimal
from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from django.core import serializers
from django.http import HttpResponse
from tastypie.authorization import Authorization
from tastypie.resou... | 38.5625 | 100 | 0.594543 | import json
from decimal import Decimal
from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from django.core import serializers
from django.http import HttpResponse
from tastypie.authorization import Authorization
from tastypie.resources import ModelResource
from tastypie.utils imp... | true | true |
1c0b1c10b4933504539502aea905d75388c2d0c6 | 2,087 | py | Python | api/tests/integration/tests/basic/load_dearom_save.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | api/tests/integration/tests/basic/load_dearom_save.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | api/tests/integration/tests/basic/load_dearom_save.py | f1nzer/Indigo | 59efbd0be0b42f449f706c3a3c8d094e483e5ef4 | [
"Apache-2.0"
] | null | null | null | import errno
import os
import sys
sys.path.append("../../common")
from env_indigo import *
indigo = Indigo()
indigo.setOption("treat-x-as-pseudoatom", "1")
mol_db_names = [
(
joinPathPy(
"../../../../../data/molecules/basic/tetrahedral-all.cml", __file__
),
indigo... | 30.691176 | 80 | 0.587446 | import errno
import os
import sys
sys.path.append("../../common")
from env_indigo import *
indigo = Indigo()
indigo.setOption("treat-x-as-pseudoatom", "1")
mol_db_names = [
(
joinPathPy(
"../../../../../data/molecules/basic/tetrahedral-all.cml", __file__
),
indigo... | true | true |
1c0b1c9931c61e187a68163d88e3dc650f1f14a5 | 7,939 | py | Python | satstac/sentinel/main.py | samsammurphy/sat-stac-sentinel | 2ffbcc8e47cec32809e9661995c6e157b034fb26 | [
"MIT"
] | 1 | 2020-03-02T09:43:32.000Z | 2020-03-02T09:43:32.000Z | satstac/sentinel/main.py | samsammurphy/sat-stac-sentinel | 2ffbcc8e47cec32809e9661995c6e157b034fb26 | [
"MIT"
] | null | null | null | satstac/sentinel/main.py | samsammurphy/sat-stac-sentinel | 2ffbcc8e47cec32809e9661995c6e157b034fb26 | [
"MIT"
] | null | null | null | import boto3
import gzip
import json
import logging
import requests
import sys
import numpy as np
import os.path as op
from shapely.geometry import MultiPoint, Point
from shapely import geometry
from datetime import datetime, timedelta
from dateutil.parser import parse
from pyproj import Proj, transform as reproj
fr... | 36.75463 | 115 | 0.577655 | import boto3
import gzip
import json
import logging
import requests
import sys
import numpy as np
import os.path as op
from shapely.geometry import MultiPoint, Point
from shapely import geometry
from datetime import datetime, timedelta
from dateutil.parser import parse
from pyproj import Proj, transform as reproj
fr... | true | true |
1c0b1cef6f82db67f9877ac24c37ccc4847ae066 | 1,301 | py | Python | anyutils/extensions/qrcode.py | fjboy/any-utils | 30b3a91c22e6eb93a64a130db6c0a6ca0802343c | [
"MIT"
] | null | null | null | anyutils/extensions/qrcode.py | fjboy/any-utils | 30b3a91c22e6eb93a64a130db6c0a6ca0802343c | [
"MIT"
] | null | null | null | anyutils/extensions/qrcode.py | fjboy/any-utils | 30b3a91c22e6eb93a64a130db6c0a6ca0802343c | [
"MIT"
] | null | null | null | from anycode import qrcode
from anycode.common import cliparser
from anycode.common import log
LOG = log.getLogger(__name__)
DEFAULT_BORDER = 0
class QrcodeParse(cliparser.CliBase):
NAME = 'qrcode-parse'
ARGUMENTS = [
cliparser.Argument('string', help='the string to create qrcode'),
cliparse... | 28.282609 | 78 | 0.604151 | from anycode import qrcode
from anycode.common import cliparser
from anycode.common import log
LOG = log.getLogger(__name__)
DEFAULT_BORDER = 0
class QrcodeParse(cliparser.CliBase):
NAME = 'qrcode-parse'
ARGUMENTS = [
cliparser.Argument('string', help='the string to create qrcode'),
cliparse... | true | true |
1c0b1d4a1fc60aebb24190390d3076361b19c817 | 313 | py | Python | fidetia/config/docs.py | Nirchains/fide | 095da135f7685b1ecf7b38d92eaf834ee68be559 | [
"MIT"
] | null | null | null | fidetia/config/docs.py | Nirchains/fide | 095da135f7685b1ecf7b38d92eaf834ee68be559 | [
"MIT"
] | null | null | null | fidetia/config/docs.py | Nirchains/fide | 095da135f7685b1ecf7b38d92eaf834ee68be559 | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/fidetia"
# docs_base_url = "https://[org_name].github.io/fidetia"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Fidetia"
| 26.083333 | 68 | 0.722045 |
def get_context(context):
context.brand_html = "Fidetia"
| true | true |
1c0b1d70eb3ae81c5d9e65bd6fa3b84579e880f7 | 4,331 | py | Python | sdk/python/pulumi_vsphere/get_compute_cluster.py | pulumi/pulumi-vsphere | a4536cd49860323bd57cbf2a127c5b57c9f9b60c | [
"ECL-2.0",
"Apache-2.0"
] | 38 | 2018-09-17T18:56:29.000Z | 2022-03-26T03:07:20.000Z | sdk/python/pulumi_vsphere/get_compute_cluster.py | pulumi/pulumi-vsphere | a4536cd49860323bd57cbf2a127c5b57c9f9b60c | [
"ECL-2.0",
"Apache-2.0"
] | 75 | 2018-09-17T13:18:24.000Z | 2022-03-31T21:32:30.000Z | sdk/python/pulumi_vsphere/get_compute_cluster.py | pulumi/pulumi-vsphere | a4536cd49860323bd57cbf2a127c5b57c9f9b60c | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-10-05T10:30:01.000Z | 2020-09-30T11:16:59.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 35.793388 | 144 | 0.677211 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
__all__ = [
'GetComputeClusterResult',
'AwaitableGetComputeClusterResult',
'get_compute_cluster',
]
@pulumi.output_type
class GetComputeClusterResult:
def ... | true | true |
1c0b1edcb46f872e8713048ed9cc16bdf4ecb0c3 | 711 | py | Python | setup.py | deepak-kamath/dtfilter | 9a9e0facc6c9ac595bbce865882a20e77685d289 | [
"MIT"
] | null | null | null | setup.py | deepak-kamath/dtfilter | 9a9e0facc6c9ac595bbce865882a20e77685d289 | [
"MIT"
] | null | null | null | setup.py | deepak-kamath/dtfilter | 9a9e0facc6c9ac595bbce865882a20e77685d289 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Education',
'Operating System :: Microsoft :: Windows :: Windows 10',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3'
]
setup(
name=... | 29.625 | 86 | 0.661041 | from setuptools import setup, find_packages
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Education',
'Operating System :: Microsoft :: Windows :: Windows 10',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3'
]
setup(
name=... | true | true |
1c0b1f46d320fb8244e0f38af5fddd958cd2d9dd | 340 | py | Python | projects/ide/sublime/src/Bolt/structs/flat.py | boltjs/bolt | c2666c876b34b1a61486a432eef3141ca8d1e411 | [
"BSD-3-Clause"
] | 11 | 2015-09-29T19:19:34.000Z | 2020-11-20T09:14:46.000Z | projects/ide/sublime/src/Bolt/structs/flat.py | boltjs/bolt | c2666c876b34b1a61486a432eef3141ca8d1e411 | [
"BSD-3-Clause"
] | null | null | null | projects/ide/sublime/src/Bolt/structs/flat.py | boltjs/bolt | c2666c876b34b1a61486a432eef3141ca8d1e411 | [
"BSD-3-Clause"
] | null | null | null | import re
from structs.nest import *
def nu(base):
def dep(filename):
return re.sub("(?P<directory>.*)/(?P<filename>.*?)\.js$", "\g<filename>", filename)
def pattern(word):
return '*.' + word + '.js'
def path(d):
return base + '/' + d + '.js'
return Nest(base, p... | 18.888889 | 95 | 0.517647 | import re
from structs.nest import *
def nu(base):
def dep(filename):
return re.sub("(?P<directory>.*)/(?P<filename>.*?)\.js$", "\g<filename>", filename)
def pattern(word):
return '*.' + word + '.js'
def path(d):
return base + '/' + d + '.js'
return Nest(base, p... | true | true |
1c0b2052ba499526a1d8f3a4ac0f380e9dd641e0 | 6,119 | py | Python | lib/view/wttr.py | harunpehlivan/wttr.in | eb562660c996592e4a8f00dba3513abe30bf7186 | [
"Apache-2.0"
] | 17,965 | 2016-01-17T21:05:34.000Z | 2022-03-31T22:42:23.000Z | lib/view/wttr.py | mmjo/wttr.in | c192f6e0a5f5ed9b45cf55d896288c08f39ee287 | [
"Apache-2.0"
] | 569 | 2016-02-18T13:19:49.000Z | 2022-03-28T17:15:32.000Z | lib/view/wttr.py | mmjo/wttr.in | c192f6e0a5f5ed9b45cf55d896288c08f39ee287 | [
"Apache-2.0"
] | 1,067 | 2016-02-16T15:18:33.000Z | 2022-03-28T15:15:13.000Z | # vim: set encoding=utf-8
# pylint: disable=wrong-import-position
"""
Main view (wttr.in) implementation.
The module is a wrapper for the modified Wego program.
"""
import sys
import re
from gevent.subprocess import Popen, PIPE
sys.path.insert(0, "..")
from translations import get_message, SUPPORTED_LANGS
from glob... | 31.869792 | 93 | 0.586207 |
import sys
import re
from gevent.subprocess import Popen, PIPE
sys.path.insert(0, "..")
from translations import get_message, SUPPORTED_LANGS
from globals import WEGO, NOT_FOUND_LOCATION, DEFAULT_LOCATION, ANSI2HTML, \
error, remove_ansi
def get_wetter(parsed_query):
location = parsed_que... | true | true |
1c0b20994b1d7942979641e71cd9eafa9bf608fa | 3,721 | py | Python | ezaad/migrations/0001_initial.py | hankei6km/django-ezaad | ab7ce633a31f03287bbe9657371217eee0014372 | [
"MIT"
] | null | null | null | ezaad/migrations/0001_initial.py | hankei6km/django-ezaad | ab7ce633a31f03287bbe9657371217eee0014372 | [
"MIT"
] | null | null | null | ezaad/migrations/0001_initial.py | hankei6km/django-ezaad | ab7ce633a31f03287bbe9657371217eee0014372 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-26 02:50
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('a... | 75.938776 | 329 | 0.685031 |
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
import django_extensions.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
... | true | true |
1c0b2360734aa50338fb6699072efac60204ee01 | 701 | py | Python | Python/HeapSort/heapsort.py | 19-2-SKKU-OSS/L1 | 80fa89324e87d4a6116355d5e73e14cfa58e9b52 | [
"CC-BY-3.0",
"Apache-2.0"
] | null | null | null | Python/HeapSort/heapsort.py | 19-2-SKKU-OSS/L1 | 80fa89324e87d4a6116355d5e73e14cfa58e9b52 | [
"CC-BY-3.0",
"Apache-2.0"
] | 44 | 2019-12-03T09:53:22.000Z | 2019-12-13T14:47:32.000Z | Python/HeapSort/heapsort.py | 19-2-SKKU-OSS/L1 | 80fa89324e87d4a6116355d5e73e14cfa58e9b52 | [
"CC-BY-3.0",
"Apache-2.0"
] | 1 | 2020-12-03T02:53:21.000Z | 2020-12-03T02:53:21.000Z | def downheap(i, size):
while 2*i <= size:
k = 2*i
if k < size and array[k] < array[k+1]:
k += 1
if array[i] >= array[k]:
break
array[i], array[k] = array[k], array[i]
i = k
def create_heap(array):
hsize = len(array) - 1
for i in reversed(range... | 22.612903 | 56 | 0.49786 | def downheap(i, size):
while 2*i <= size:
k = 2*i
if k < size and array[k] < array[k+1]:
k += 1
if array[i] >= array[k]:
break
array[i], array[k] = array[k], array[i]
i = k
def create_heap(array):
hsize = len(array) - 1
for i in reversed(range... | true | true |
1c0b23e2bea253555aa61c6871e1137ff866853c | 11,461 | py | Python | luminoth/models/fasterrcnn/rpn_test.py | jsdussanc/luminoth | 7637c52cc01d2826a231fef43746aa10951f99f0 | [
"BSD-3-Clause"
] | 2,584 | 2017-08-16T20:31:52.000Z | 2022-03-16T07:53:54.000Z | luminoth/models/fasterrcnn/rpn_test.py | dun933/Tabulo | dc1c1203a40e1ecf2aaca9647f3008ab72b41438 | [
"BSD-3-Clause"
] | 197 | 2017-08-17T14:49:18.000Z | 2022-02-10T01:50:50.000Z | luminoth/models/fasterrcnn/rpn_test.py | dun933/Tabulo | dc1c1203a40e1ecf2aaca9647f3008ab72b41438 | [
"BSD-3-Clause"
] | 462 | 2017-08-16T22:00:23.000Z | 2022-03-08T19:14:00.000Z | import numpy as np
import tensorflow as tf
from easydict import EasyDict
from luminoth.models.fasterrcnn.rpn import RPN
from luminoth.utils.anchors import generate_anchors_reference
from luminoth.utils.test import generate_gt_boxes, generate_anchors
class RPNTest(tf.test.TestCase):
def setUp(self):
supe... | 37.090615 | 79 | 0.568537 | import numpy as np
import tensorflow as tf
from easydict import EasyDict
from luminoth.models.fasterrcnn.rpn import RPN
from luminoth.utils.anchors import generate_anchors_reference
from luminoth.utils.test import generate_gt_boxes, generate_anchors
class RPNTest(tf.test.TestCase):
def setUp(self):
supe... | true | true |
1c0b251d0046e468f89c1511ffe62c061bd9b0df | 929 | py | Python | arcproject/scripts/load_data_bulk/sitefix.py | ucd-cws/arcproject-wq-processing | 8bc4df31420f1a37f66e40f1867bf4082c4871c0 | [
"MIT"
] | 2 | 2018-07-11T19:45:59.000Z | 2018-07-11T19:47:00.000Z | arcproject/scripts/load_data_bulk/sitefix.py | ucd-cws/arcproject-wq-processing | 8bc4df31420f1a37f66e40f1867bf4082c4871c0 | [
"MIT"
] | 55 | 2016-08-09T00:35:22.000Z | 2017-04-22T05:21:22.000Z | arcproject/scripts/load_data_bulk/sitefix.py | ucd-cws/arcproject-wq-processing | 8bc4df31420f1a37f66e40f1867bf4082c4871c0 | [
"MIT"
] | 1 | 2021-11-12T20:22:44.000Z | 2021-11-12T20:22:44.000Z | """
Appears to change the site tags of certain files that were named in known nonstandard ways
"""
from arcproject.scripts import swap_site_recs
import os
import csv
class Remap():
current = None
new = None
note = None
def main():
csv_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sites_ren... | 21.113636 | 91 | 0.654467 |
from arcproject.scripts import swap_site_recs
import os
import csv
class Remap():
current = None
new = None
note = None
def main():
csv_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sites_renamed.csv')
remaps = []
f = open(csv_path)
csv_f = csv.reader(f)
header = next(csv_f, None) fo... | true | true |
1c0b27d87c608fc48388b6a64dbb923ec582efcd | 28,492 | py | Python | data_utils/audio.py | SamChen/DeepSpeech2_Pytorch_TransferLearning | 8c2cf0437f4facd3f5fc282f33b359873d3c5541 | [
"Apache-2.0"
] | 6 | 2020-05-18T22:38:58.000Z | 2021-05-24T18:09:27.000Z | data_utils/audio.py | SamChen/DeepSpeech2_Pytorch_TransferLearning | 8c2cf0437f4facd3f5fc282f33b359873d3c5541 | [
"Apache-2.0"
] | null | null | null | data_utils/audio.py | SamChen/DeepSpeech2_Pytorch_TransferLearning | 8c2cf0437f4facd3f5fc282f33b359873d3c5541 | [
"Apache-2.0"
] | 1 | 2020-07-15T09:34:01.000Z | 2020-07-15T09:34:01.000Z | """Contains the audio segment class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import io
import struct
import re
import soundfile
import resampy
from scipy import signal
import random
import copy
class AudioSegment(object):
... | 41.533528 | 80 | 0.595044 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import io
import struct
import re
import soundfile
import resampy
from scipy import signal
import random
import copy
class AudioSegment(object):
def __init__(self, samples, sample_rate... | true | true |
1c0b27db79f9e5488e86d746fd8a43fd470ec180 | 5,408 | py | Python | model/transformer.py | Kguo-cs/TDOR | c538ccb99e6b981c5d09bfc451c2a207449a3f64 | [
"MIT"
] | null | null | null | model/transformer.py | Kguo-cs/TDOR | c538ccb99e6b981c5d09bfc451c2a207449a3f64 | [
"MIT"
] | null | null | null | model/transformer.py | Kguo-cs/TDOR | c538ccb99e6b981c5d09bfc451c2a207449a3f64 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import math, copy, time
def clones(module, N):
"Produce N identical layers."
return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])
class Encoder(nn.Module):
"Core encoder is a stack of N layers"
def __init__(self, layer, N)... | 36.053333 | 109 | 0.629438 | import torch
import torch.nn as nn
import torch.nn.functional as F
import math, copy, time
def clones(module, N):
return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])
class Encoder(nn.Module):
def __init__(self, layer, N):
super(Encoder, self).__init__()
self.layers = clones(layer... | true | true |
1c0b288a97d6e580145ffc59e17b9fa2bc005b74 | 1,908 | py | Python | Entrusted Toolkit/ensureFolderName.py | box-community/admin-toolkit | 65b633f14525fe136e2798b6622f9f48f11bfd9c | [
"MIT"
] | 2 | 2020-12-22T16:23:06.000Z | 2021-04-08T05:27:06.000Z | Entrusted Toolkit/ensureFolderName.py | box-community/tool-python-admin-kit | 65b633f14525fe136e2798b6622f9f48f11bfd9c | [
"MIT"
] | null | null | null | Entrusted Toolkit/ensureFolderName.py | box-community/tool-python-admin-kit | 65b633f14525fe136e2798b6622f9f48f11bfd9c | [
"MIT"
] | null | null | null | import sys
from argparse import ArgumentParser
from common import authenticate_as_user, walk_folder_tree, path_str
## Parse command line arguments.
parser = ArgumentParser(description="Given a Box folder ID and some prefix, ensure that the prefix is prepended to the name of the folder and every subfolder.")
parser.add... | 57.818182 | 286 | 0.745807 | import sys
from argparse import ArgumentParser
from common import authenticate_as_user, walk_folder_tree, path_str
parser = ArgumentParser(description="Given a Box folder ID and some prefix, ensure that the prefix is prepended to the name of the folder and every subfolder.")
parser.add_argument("-f", "--folder", dest=... | true | true |
1c0b28ba3911b9eecb68a236b0aee708525a8b00 | 894 | py | Python | isi_sdk_8_0/test/test_antivirus_server.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0/test/test_antivirus_server.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0/test/test_antivirus_server.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0
from isi... | 21.804878 | 85 | 0.702461 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_0
from isi_sdk_8_0.models.antivirus_server import AntivirusServer from isi_sdk_8_0.rest import ApiException
class TestAntivirusServer(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test... | true | true |
1c0b28c620342e23e34981602d77ee59be7aa303 | 1,613 | py | Python | src/roughml/scripts/image_fft2d.py | DimitriosDelikonstantis/RoughML | 31a06db4b295a64af11c6cfa264563f61b52f772 | [
"MIT"
] | null | null | null | src/roughml/scripts/image_fft2d.py | DimitriosDelikonstantis/RoughML | 31a06db4b295a64af11c6cfa264563f61b52f772 | [
"MIT"
] | null | null | null | src/roughml/scripts/image_fft2d.py | DimitriosDelikonstantis/RoughML | 31a06db4b295a64af11c6cfa264563f61b52f772 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from skimage.color import rgb2gray
import cv2
import argparse
def get_image_fft(image_filename, show_original=False, show_grayscale=False, show_fft=False):
# load image
original_image = cv2.imread(image_filename)
if show_original:
# plot original ... | 37.511628 | 96 | 0.688159 | import numpy as np
import matplotlib.pyplot as plt
from skimage.color import rgb2gray
import cv2
import argparse
def get_image_fft(image_filename, show_original=False, show_grayscale=False, show_fft=False):
original_image = cv2.imread(image_filename)
if show_original:
cv2.imshow('original ... | true | true |
1c0b2a6c9705db9fae9b487615479178535e2c91 | 1,100 | py | Python | jp.atcoder/abc009/abc009_3/8781818.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc009/abc009_3/8781818.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc009/abc009_3/8781818.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
# この問題におけるswapの意味を考えると、2つのものを swapした場合に
# 左側が確定することから、一度swapされたcharacterが元のindexに戻ることはありえない。
# よって、changedとして一度でもswapされたindexを記録していけば良い
n, k = map(int, sys.stdin.readline().split())
s = [ord(c) - 97 for c in sys.stdin.readline().rstrip()]
def swap(i, j):
s[i], s[j] = s[j], s[i]
def ma... | 24.444444 | 57 | 0.410909 | import sys
n, k = map(int, sys.stdin.readline().split())
s = [ord(c) - 97 for c in sys.stdin.readline().rstrip()]
def swap(i, j):
s[i], s[j] = s[j], s[i]
def main():
r = k
changed = [False] * n
for i in range(n - 1):
m = min(s[i + 1 :])
if m < s[i]: f... | true | true |
1c0b2a92fbf01824e48330074cef06b7bb1180e4 | 2,283 | py | Python | forevis/crypto/Classes/Graphic.py | Leviosar/forevis | bab660f1b0a24abf1240dddaf9b38b8845e60b69 | [
"MIT"
] | null | null | null | forevis/crypto/Classes/Graphic.py | Leviosar/forevis | bab660f1b0a24abf1240dddaf9b38b8845e60b69 | [
"MIT"
] | null | null | null | forevis/crypto/Classes/Graphic.py | Leviosar/forevis | bab660f1b0a24abf1240dddaf9b38b8845e60b69 | [
"MIT"
] | null | null | null | from .Stoncks import Stoncks
from random import random
class Graphic:
def __init__(self, crypto, exchange, analysis):
self.crypto = crypto
self.exchange = exchange
self.analysis = analysis
def get_data(self):
request = Stoncks(function="DIGITAL_CURRENCY_DAILY", crypto=self.cryp... | 39.362069 | 133 | 0.505913 | from .Stoncks import Stoncks
from random import random
class Graphic:
def __init__(self, crypto, exchange, analysis):
self.crypto = crypto
self.exchange = exchange
self.analysis = analysis
def get_data(self):
request = Stoncks(function="DIGITAL_CURRENCY_DAILY", crypto=self.cryp... | true | true |
1c0b2ab915769a5aa529d003b7bf8094aa73760c | 380 | py | Python | mayan/apps/mailer/tests/test_copying.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 2 | 2021-09-12T19:41:19.000Z | 2021-09-12T19:41:20.000Z | mayan/apps/mailer/tests/test_copying.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 37 | 2021-09-13T01:00:12.000Z | 2021-10-02T03:54:30.000Z | mayan/apps/mailer/tests/test_copying.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 1 | 2021-09-22T13:17:30.000Z | 2021-09-22T13:17:30.000Z | from mayan.apps.common.tests.mixins import ObjectCopyTestMixin
from mayan.apps.testing.tests.base import BaseTestCase
from .mixins import MailerTestMixin
class MailerCopyTestCase(MailerTestMixin, ObjectCopyTestMixin, BaseTestCase):
def setUp(self):
super().setUp()
self._create_test_user_... | 31.666667 | 78 | 0.755263 | from mayan.apps.common.tests.mixins import ObjectCopyTestMixin
from mayan.apps.testing.tests.base import BaseTestCase
from .mixins import MailerTestMixin
class MailerCopyTestCase(MailerTestMixin, ObjectCopyTestMixin, BaseTestCase):
def setUp(self):
super().setUp()
self._create_test_user_... | true | true |
1c0b2ac7693b7de33463d9eb286af46057f37b2f | 290 | py | Python | Leetcoding-Actions/Explore-Monthly-Challenges/2020-08/10-excel-sheet-column-number.py | shoaibur/SWE | 1e114a2750f2df5d6c50b48c8e439224894d65da | [
"MIT"
] | 1 | 2020-11-14T18:28:13.000Z | 2020-11-14T18:28:13.000Z | Leetcoding-Actions/Explore-Monthly-Challenges/2020-08/10-excel-sheet-column-number.py | shoaibur/SWE | 1e114a2750f2df5d6c50b48c8e439224894d65da | [
"MIT"
] | null | null | null | Leetcoding-Actions/Explore-Monthly-Challenges/2020-08/10-excel-sheet-column-number.py | shoaibur/SWE | 1e114a2750f2df5d6c50b48c8e439224894d65da | [
"MIT"
] | null | null | null | class Solution:
def titleToNumber(self, s: str) -> int:
d = {}
for i, char in enumerate(string.ascii_uppercase):
d[char] = i + 1
result = 0
for i, char in enumerate(s[::-1]):
result += d[char] * 26 ** i
return result
| 26.363636 | 57 | 0.489655 | class Solution:
def titleToNumber(self, s: str) -> int:
d = {}
for i, char in enumerate(string.ascii_uppercase):
d[char] = i + 1
result = 0
for i, char in enumerate(s[::-1]):
result += d[char] * 26 ** i
return result
| true | true |
1c0b2b18bbd7e59b2cfeb153c9ec8c1fba2f862b | 5,531 | py | Python | setuptools/tests/test_integration.py | ssato/setuptools | 297f2adceda3af402fc08311e42505c8cdc9c54b | [
"MIT"
] | null | null | null | setuptools/tests/test_integration.py | ssato/setuptools | 297f2adceda3af402fc08311e42505c8cdc9c54b | [
"MIT"
] | null | null | null | setuptools/tests/test_integration.py | ssato/setuptools | 297f2adceda3af402fc08311e42505c8cdc9c54b | [
"MIT"
] | null | null | null | """Run some integration tests.
Try to install a few packages.
"""
import glob
import os
import sys
import re
import subprocess
import functools
import tarfile
import zipfile
from setuptools.extern.six.moves import urllib
import pytest
from setuptools.command.easy_install import easy_install
from setuptools.command ... | 31.971098 | 79 | 0.684325 |
import glob
import os
import sys
import re
import subprocess
import functools
import tarfile
import zipfile
from setuptools.extern.six.moves import urllib
import pytest
from setuptools.command.easy_install import easy_install
from setuptools.command import easy_install as easy_install_pkg
from setuptools.dist import... | true | true |
1c0b2b25ec5e08d6b0e2911e7da46cfab921b162 | 20,180 | py | Python | cate/core/opimpl.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | cate/core/opimpl.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | cate/core/opimpl.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | 1 | 2019-02-14T13:49:37.000Z | 2019-02-14T13:49:37.000Z | # The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including wi... | 34.793103 | 122 | 0.655055 |
__author__ = "Janis Gailis (S[&]T Norway)"
from datetime import datetime
from typing import Optional, Sequence, Union, Tuple
import numpy as np
import xarray as xr
from jdcal import jd2gcal
from shapely.geometry import Point, box, LineString, Polygon
def normalize_impl(ds: xr.Dataset) -> xr.Dataset:
ds = _nor... | true | true |
1c0b2baabc2a753a59f4c4f416e2d14030fda442 | 2,953 | py | Python | bowtie/auth.py | denis554/bowtie | d183086c94ba58b3cc910b406d4217b7a79fc320 | [
"MIT"
] | 1 | 2019-04-09T19:26:18.000Z | 2019-04-09T19:26:18.000Z | bowtie/auth.py | denis554/bowtie | d183086c94ba58b3cc910b406d4217b7a79fc320 | [
"MIT"
] | null | null | null | bowtie/auth.py | denis554/bowtie | d183086c94ba58b3cc910b406d4217b7a79fc320 | [
"MIT"
] | null | null | null | """Authentication out of the box.
References
----------
https://stackoverflow.com/questions/13428708/best-way-to-make-flask-logins-login-required-the-default
https://stackoverflow.com/questions/14367991/flask-before-request-add-exception-for-specific-route
"""
from typing import Dict, Optional
from abc import ABC, a... | 30.443299 | 101 | 0.61937 |
from typing import Dict, Optional
from abc import ABC, abstractmethod
from flask import Response, request, session
from bowtie._app import App
class Auth(ABC):
def __init__(self, app: App) -> None:
self.app = app
self.app.app.before_request(self.before_request)
self.app._socket... | true | true |
1c0b2c156dc2a812389a156da32dbd4f1acedd64 | 1,776 | py | Python | WesFlix/src/movie/movie_controller.py | barca/Talkies | 4ba8d6d5bcb33f56815b8a49f8db0dee5a25e27e | [
"MIT"
] | null | null | null | WesFlix/src/movie/movie_controller.py | barca/Talkies | 4ba8d6d5bcb33f56815b8a49f8db0dee5a25e27e | [
"MIT"
] | 3 | 2015-07-23T12:18:04.000Z | 2015-07-29T22:01:12.000Z | WesFlix/src/movie/movie_controller.py | barca/Talkies | 4ba8d6d5bcb33f56815b8a49f8db0dee5a25e27e | [
"MIT"
] | null | null | null | from flask import make_response
from flask import jsonify
from flask import Blueprint
from flask import request
from bson.json_util import dumps
from pymongo import MongoClient
from datetime import date
import pymongo
client = MongoClient()
db = client.moviesdb
movies = db.movies
movie = Blueprint('movie', __name__, te... | 28.645161 | 80 | 0.671734 | from flask import make_response
from flask import jsonify
from flask import Blueprint
from flask import request
from bson.json_util import dumps
from pymongo import MongoClient
from datetime import date
import pymongo
client = MongoClient()
db = client.moviesdb
movies = db.movies
movie = Blueprint('movie', __name__, te... | true | true |
1c0b2ceb74458a690fa5b72f6ff522b9ed47901e | 208 | py | Python | KJSC2019/WEIRWOOD-AGE/setter.py | KJSCE-Codecell/Contests | c47732ed413587c98061d14e103da9cee425d809 | [
"MIT"
] | 2 | 2018-09-09T07:40:23.000Z | 2018-09-13T15:35:19.000Z | KJSC2019/WEIRWOOD-AGE/setter.py | kjsce-codecell/Contests | c47732ed413587c98061d14e103da9cee425d809 | [
"MIT"
] | null | null | null | KJSC2019/WEIRWOOD-AGE/setter.py | kjsce-codecell/Contests | c47732ed413587c98061d14e103da9cee425d809 | [
"MIT"
] | 1 | 2020-12-08T14:49:04.000Z | 2020-12-08T14:49:04.000Z | import math
t=int(input())
for _ in range(t):
a,b,x=map(int,input().split())
assert 1 <= a <= 10**6
assert a <= b <= 10**6
assert 1 <= x <= (b-a)
n=((b-a)/x)+1
print(math.floor(n))
| 20.8 | 34 | 0.490385 | import math
t=int(input())
for _ in range(t):
a,b,x=map(int,input().split())
assert 1 <= a <= 10**6
assert a <= b <= 10**6
assert 1 <= x <= (b-a)
n=((b-a)/x)+1
print(math.floor(n))
| true | true |
1c0b2e055b1ebcc86dc73e04d0efbe39e5b0a5b6 | 698 | py | Python | python/euler39.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | python/euler39.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | python/euler39.py | feliposz/project-euler-solutions | 1aec50c4d2d86b515dc8607559575da9e4aecb3a | [
"MIT"
] | null | null | null | ##Problem 39
##14 March 2003
##
##If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120.
##
##{20,48,52}, {24,45,51}, {30,40,50}
##
##For which value of p 1000, is the number of solutions maximised?
import math
solutions = {}
for a in rang... | 23.266667 | 133 | 0.588825 |
import math
solutions = {}
for a in range(1, 1000):
for b in range(1, 1000):
h = math.sqrt(a*a + b*b)
if h == math.trunc(h):
p = int(a+b+h)
if p <= 1000:
solutions[p] = solutions.get(p, 0) + 1
most_solutions = 0
top_k = 0
for k in solutions.keys():
if ... | true | true |
1c0b2e09c78b04e943afe55a8b00bdeeef2dff23 | 16,703 | py | Python | json/gen_setup.py | ikueda/iotg_tsn_ref_sw | bf5229bde2735bb0b449b482be7915b8233988e4 | [
"BSD-3-Clause"
] | 94 | 2018-12-27T02:01:48.000Z | 2022-03-18T09:21:13.000Z | json/gen_setup.py | ikueda/iotg_tsn_ref_sw | bf5229bde2735bb0b449b482be7915b8233988e4 | [
"BSD-3-Clause"
] | 24 | 2019-04-11T21:55:17.000Z | 2021-12-05T15:47:59.000Z | json/gen_setup.py | ikueda/iotg_tsn_ref_sw | bf5229bde2735bb0b449b482be7915b8233988e4 | [
"BSD-3-Clause"
] | 48 | 2019-03-12T10:17:09.000Z | 2022-03-29T10:28:48.000Z | import argparse
import os.path
import re
import sys
import time
import os
import json
import math
###############################################################################
# Helpers
def initialize():
global IS_DRY
global genfile
IS_DRY=False
genfile = open("setup-generated.sh", "w")
genfile... | 35.462845 | 160 | 0.62372 | import argparse
import os.path
import re
import sys
import time
import os
import json
import math
def initialize():
global IS_DRY
global genfile
IS_DRY=False
genfile = open("setup-generated.sh", "w")
genfile.write("#!/bin/sh\n")
def teardown():
genfile.close()
def err_exit(msg):
print(m... | true | true |
1c0b2e95dceb48841ace442b1b9e863b235f45db | 9,130 | py | Python | code/babyinverse/inverse.py | zhaoyuzhi/ChildPredictor | ba36d9851a37522ec5a0de4eab3b973f872d885e | [
"MIT"
] | 6 | 2022-01-22T06:26:36.000Z | 2022-03-31T14:37:49.000Z | code/babyinverse/inverse.py | zhaoyuzhi/ChildPredictor | ba36d9851a37522ec5a0de4eab3b973f872d885e | [
"MIT"
] | null | null | null | code/babyinverse/inverse.py | zhaoyuzhi/ChildPredictor | ba36d9851a37522ec5a0de4eab3b973f872d885e | [
"MIT"
] | null | null | null | ''' Baisc packages
'''
import os
import glob
import tqdm
import copy
import random
import importlib
import numpy as np
''' Configuration packages
'''
import yaml
import argparse
from easydict import EasyDict as edict
''' PyTorch packages
'''
import torch
import torch.nn as nn
import torch.autograd as autograd
import ... | 41.126126 | 179 | 0.580285 | import os
import glob
import tqdm
import copy
import random
import importlib
import numpy as np
import yaml
import argparse
from easydict import EasyDict as edict
import torch
import torch.nn as nn
import torch.autograd as autograd
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.nn.fun... | true | true |
1c0b2f044381c2474b8fa07a64566f8fa256247b | 5,830 | py | Python | data/tests/proplogic_test.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | 22 | 2021-06-15T00:01:27.000Z | 2022-03-15T11:22:25.000Z | data/tests/proplogic_test.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | null | null | null | data/tests/proplogic_test.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | 2 | 2021-11-30T08:56:03.000Z | 2022-01-24T10:46:39.000Z | import unittest
from data import proplogic
from kernel.term import BoolVars, And, Or, Not
from logic import context
from logic.tests.conv_test import test_conv
from syntax import parser
A, B, C, D, E, F, G, P, Q, R = BoolVars('A B C D E F G P Q R')
class PropLogicTest(unittest.TestCase):
def testNNFConv(self):
... | 37.371795 | 98 | 0.421612 | import unittest
from data import proplogic
from kernel.term import BoolVars, And, Or, Not
from logic import context
from logic.tests.conv_test import test_conv
from syntax import parser
A, B, C, D, E, F, G, P, Q, R = BoolVars('A B C D E F G P Q R')
class PropLogicTest(unittest.TestCase):
def testNNFConv(self):
... | true | true |
1c0b2f7f1b76f647d40e9857105a53f0e3d7a6de | 713 | py | Python | app/application.py | redflex/get_builtwith | 9d0cbb6c41d5263969855d5cceec52f55cb5bd30 | [
"Apache-2.0"
] | null | null | null | app/application.py | redflex/get_builtwith | 9d0cbb6c41d5263969855d5cceec52f55cb5bd30 | [
"Apache-2.0"
] | null | null | null | app/application.py | redflex/get_builtwith | 9d0cbb6c41d5263969855d5cceec52f55cb5bd30 | [
"Apache-2.0"
] | null | null | null | import base64
import json
import os
import requests
def main():
target_hostname = os.getenv("TARGET_HOST")
if target_hostname is None:
raise ValueError("Missing TARGET_HOST env var!")
builtwith_token = os.getenv("BUILTWITH_TOKEN")
if builtwith_token is None:
raise ValueError("Missing B... | 28.52 | 71 | 0.697055 | import base64
import json
import os
import requests
def main():
target_hostname = os.getenv("TARGET_HOST")
if target_hostname is None:
raise ValueError("Missing TARGET_HOST env var!")
builtwith_token = os.getenv("BUILTWITH_TOKEN")
if builtwith_token is None:
raise ValueError("Missing B... | true | true |
1c0b2f8f3100b2dad7eabd24ab78ec77a90a93c8 | 631 | py | Python | Noticia/admin.py | igor-dantas/api-django-rest | 62a58564bf4ade070f2c834da83f789c3737450f | [
"MIT"
] | null | null | null | Noticia/admin.py | igor-dantas/api-django-rest | 62a58564bf4ade070f2c834da83f789c3737450f | [
"MIT"
] | null | null | null | Noticia/admin.py | igor-dantas/api-django-rest | 62a58564bf4ade070f2c834da83f789c3737450f | [
"MIT"
] | null | null | null | from django.contrib import admin
from Noticia.models import noticias
class Noticia(admin.ModelAdmin):
# configurando campos que estarão visíveis no admin do django
list_display = ('id_not', 'titulo', 'conteudo', 'autor', 'publicado', 'data_criacao')
# adicionando campos que funcionaram como uma espécie de ... | 52.583333 | 141 | 0.754358 | from django.contrib import admin
from Noticia.models import noticias
class Noticia(admin.ModelAdmin):
list_display = ('id_not', 'titulo', 'conteudo', 'autor', 'publicado', 'data_criacao')
list_display_links = ('id_not',)
search_fields = ('id_not', 'titulo',)
admin.site.register(noticias, Notici... | true | true |
1c0b309f8650143d06a309dcdc9ec5a09996b21d | 1,109 | py | Python | day15/p1.py | Seralpa/AdventOfCode2018 | da18189e872bd9a2d13a8950cf64f06892fcdf8d | [
"MIT"
] | null | null | null | day15/p1.py | Seralpa/AdventOfCode2018 | da18189e872bd9a2d13a8950cf64f06892fcdf8d | [
"MIT"
] | null | null | null | day15/p1.py | Seralpa/AdventOfCode2018 | da18189e872bd9a2d13a8950cf64f06892fcdf8d | [
"MIT"
] | null | null | null | from Unit import *
battlefield: list[list[str]] = list()
units: list[Unit] = list()
with open("input.txt", "r") as f:
battlefield = [list(l.strip()) for l in f.readlines()]
for i, row in enumerate(battlefield):
for j, c in enumerate(row):
if any(c == x.value for x in Race):
units.append(Unit((i, j), 200, 3,... | 29.972973 | 111 | 0.674482 | from Unit import *
battlefield: list[list[str]] = list()
units: list[Unit] = list()
with open("input.txt", "r") as f:
battlefield = [list(l.strip()) for l in f.readlines()]
for i, row in enumerate(battlefield):
for j, c in enumerate(row):
if any(c == x.value for x in Race):
units.append(Unit((i, j), 200, 3,... | true | true |
1c0b314f43a820fd52bacd85df0e9a7d98e9b1e5 | 35,047 | py | Python | tests/distributions/conftest.py | uber/pyro | e2aad5ed70d20709bfdd7bc3f50eb7f87577081b | [
"Apache-2.0"
] | 4,959 | 2017-11-03T14:39:17.000Z | 2019-02-04T16:14:30.000Z | tests/distributions/conftest.py | uber/pyro | e2aad5ed70d20709bfdd7bc3f50eb7f87577081b | [
"Apache-2.0"
] | 985 | 2017-11-03T14:27:56.000Z | 2019-02-02T18:52:54.000Z | tests/distributions/conftest.py | uber/pyro | e2aad5ed70d20709bfdd7bc3f50eb7f87577081b | [
"Apache-2.0"
] | 564 | 2017-11-03T15:05:55.000Z | 2019-01-31T14:02:29.000Z | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
from math import pi
import numpy as np
import pytest
import scipy.stats as sp
import pyro.distributions as dist
from pyro.distributions.testing.naive_dirichlet import NaiveBeta, NaiveDirichlet
from pyro.distributions.... | 32.907981 | 115 | 0.383314 |
import math
from math import pi
import numpy as np
import pytest
import scipy.stats as sp
import pyro.distributions as dist
from pyro.distributions.testing.naive_dirichlet import NaiveBeta, NaiveDirichlet
from pyro.distributions.testing.rejection_exponential import RejectionExponential
from pyro.distributions.testin... | true | true |
1c0b317e635e55e0a6a8bb613b4451dd0fd840df | 36,839 | py | Python | src/sequel/sequence/number_theory.py | simone-campagna/sequel | a96e0f8b5000f8d0174f97f772cca5ac8a140acd | [
"Apache-2.0"
] | null | null | null | src/sequel/sequence/number_theory.py | simone-campagna/sequel | a96e0f8b5000f8d0174f97f772cca5ac8a140acd | [
"Apache-2.0"
] | null | null | null | src/sequel/sequence/number_theory.py | simone-campagna/sequel | a96e0f8b5000f8d0174f97f772cca5ac8a140acd | [
"Apache-2.0"
] | null | null | null | """
Prime Sequence
"""
import itertools
import gmpy2
import sympy
from .base import Sequence, Iterator, StashedFunction, EnumeratedSequence
from .trait import Trait
from ..utils import divisors
__all__ = [
'Prime',
'MersenneExponent',
'MersennePrime',
'Pi',
'Phi',
'Tau',
'Sigma',
'Eu... | 69.507547 | 172 | 0.661256 |
import itertools
import gmpy2
import sympy
from .base import Sequence, Iterator, StashedFunction, EnumeratedSequence
from .trait import Trait
from ..utils import divisors
__all__ = [
'Prime',
'MersenneExponent',
'MersennePrime',
'Pi',
'Phi',
'Tau',
'Sigma',
'Euler',
'Bell',
'... | true | true |
1c0b3433b1d144099358c3007e936bfa18a6567e | 4,738 | py | Python | sgkit/distance/metrics.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | null | null | null | sgkit/distance/metrics.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | null | null | null | sgkit/distance/metrics.py | timothymillar/sgkit | a3a5e961b6b21ff7de235075955c0f797ad5027c | [
"Apache-2.0"
] | null | null | null | """
This module implements various distance metrics. To implement a new distance
metric, two methods needs to be written, one of them suffixed by 'map' and other
suffixed by 'reduce'. An entry for the same should be added in the N_MAP_PARAM
dictionary below.
"""
import numpy as np
from numba import guvectorize
from s... | 27.074286 | 87 | 0.582946 |
import numpy as np
from numba import guvectorize
from sgkit.typing import ArrayLike
N_MAP_PARAM = {
"correlation": 6,
"euclidean": 1,
}
@guvectorize( [
"void(float32[:], float32[:], float32[:], float32[:])",
"void(float64[:], float64[:], float64[:], float64[:])",
"void(int8[:],... | true | true |
1c0b352e46297f7282d14f00169eb18255c1c6a4 | 1,851 | py | Python | asf_search/ASFSession.py | gitter-badger/Discovery-asf_search | 35d0e796a6c926b3188a4aed1685358b0e9a8142 | [
"BSD-3-Clause"
] | 57 | 2021-03-02T18:16:01.000Z | 2022-03-30T09:35:01.000Z | asf_search/ASFSession.py | scalet98/Discovery-asf_search | 24f3c98bf5e626611dccdd1c85f7e6884f5a8cc2 | [
"BSD-3-Clause"
] | 14 | 2021-05-18T15:32:57.000Z | 2022-03-07T23:22:20.000Z | asf_search/ASFSession.py | scalet98/Discovery-asf_search | 24f3c98bf5e626611dccdd1c85f7e6884f5a8cc2 | [
"BSD-3-Clause"
] | 16 | 2021-03-30T00:56:17.000Z | 2022-03-30T09:35:09.000Z | import requests
import http.cookiejar
from asf_search import __version__
from asf_search.constants import EDL_CLIENT_ID, EDL_HOST, ASF_AUTH_HOST
from asf_search.exceptions import ASFAuthenticationError
class ASFSession(requests.Session):
def __init__(self):
super().__init__()
self.headers.update({... | 33.654545 | 145 | 0.687736 | import requests
import http.cookiejar
from asf_search import __version__
from asf_search.constants import EDL_CLIENT_ID, EDL_HOST, ASF_AUTH_HOST
from asf_search.exceptions import ASFAuthenticationError
class ASFSession(requests.Session):
def __init__(self):
super().__init__()
self.headers.update({... | true | true |
1c0b35d06b34f47bebca3e11a051e5ac690bbb60 | 2,784 | py | Python | xd/build/core/recipe_file.py | esben/xd-build-core | b1f805d4a50167f4c54003ffa8f33d224d4c819d | [
"MIT"
] | 1 | 2020-11-27T23:34:53.000Z | 2020-11-27T23:34:53.000Z | xd/build/core/recipe_file.py | esben/xd-build-core | b1f805d4a50167f4c54003ffa8f33d224d4c819d | [
"MIT"
] | 6 | 2015-10-30T12:22:56.000Z | 2016-08-25T09:38:48.000Z | xd/build/core/recipe_file.py | XD-embedded/xd-build-core | 357e4d78d35456d6906aa30151ddc989781227ab | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
from .recipe_version import *
from .data.parser import *
import os
import sys
import pprint
__all__ = ['RecipeFile', 'InvalidRecipeName', 'InvalidRecipeFilename']
class InvalidRecipeName(Exception):
pass
class InvalidRecipeFilename(Ex... | 27.294118 | 76 | 0.604167 | import logging
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
from .recipe_version import *
from .data.parser import *
import os
import sys
import pprint
__all__ = ['RecipeFile', 'InvalidRecipeName', 'InvalidRecipeFilename']
class InvalidRecipeName(Exception):
pass
class InvalidRecipeFilename(Ex... | true | true |
1c0b35fcbe839933836920256494958092bf47e3 | 511 | py | Python | vibromaf/util/common.py | hofbi/vibromaf | 7678042d18fa3b4ab006283bdbd1b1cc6d84e822 | [
"MIT"
] | 1 | 2022-03-11T19:56:59.000Z | 2022-03-11T19:56:59.000Z | vibromaf/util/common.py | hofbi/vibromaf | 7678042d18fa3b4ab006283bdbd1b1cc6d84e822 | [
"MIT"
] | null | null | null | vibromaf/util/common.py | hofbi/vibromaf | 7678042d18fa3b4ab006283bdbd1b1cc6d84e822 | [
"MIT"
] | null | null | null | """Common utilities"""
import numpy as np
from sklearn.metrics import mean_squared_error
def print_metirc(text: str, score: float):
"""Print metric score in predefined format"""
print(f"{text:40s} {score:.3f}")
def print_mse_and_pc(name: str, y_true, y_pred):
"""Print MSE and Pearson Correlation for si... | 26.894737 | 54 | 0.702544 |
import numpy as np
from sklearn.metrics import mean_squared_error
def print_metirc(text: str, score: float):
print(f"{text:40s} {score:.3f}")
def print_mse_and_pc(name: str, y_true, y_pred):
mse_test = mean_squared_error(y_true, y_pred)
cor_test = np.corrcoef(y_true, y_pred)[0, 1]
print_metirc(f"{... | true | true |
1c0b3662ba776c78ad87ea58f3db7dcc60cda979 | 4,983 | py | Python | blueapps/contrib/bk_commands/management/base.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 2 | 2021-07-28T01:48:31.000Z | 2021-11-17T11:02:26.000Z | blueapps/contrib/bk_commands/management/base.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | blueapps/contrib/bk_commands/management/base.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import os
import sys
import celery
try:
import django_celery_beat
except ImportError:
import djcelery
from kombu.utils.encoding import str_to_bytes
from django.core.management.base import BaseCommand
DB_SHARED_THREAD = """\
DatabaseWrapper objects cr... | 33.897959 | 111 | 0.602248 | from __future__ import absolute_import, unicode_literals
import os
import sys
import celery
try:
import django_celery_beat
except ImportError:
import djcelery
from kombu.utils.encoding import str_to_bytes
from django.core.management.base import BaseCommand
DB_SHARED_THREAD = """\
DatabaseWrapper objects cr... | true | true |
1c0b3714724f56cb651339b89910ca19272e9780 | 10,021 | py | Python | OpenSees/EXAMPLES/ExamplePython/Example3.3.py | kuanshi/ductile-fracture | ccb350564df54f5c5ec3a079100effe261b46650 | [
"MIT"
] | null | null | null | OpenSees/EXAMPLES/ExamplePython/Example3.3.py | kuanshi/ductile-fracture | ccb350564df54f5c5ec3a079100effe261b46650 | [
"MIT"
] | null | null | null | OpenSees/EXAMPLES/ExamplePython/Example3.3.py | kuanshi/ductile-fracture | ccb350564df54f5c5ec3a079100effe261b46650 | [
"MIT"
] | 1 | 2020-08-06T21:12:16.000Z | 2020-08-06T21:12:16.000Z | # OpenSees -- Open System for Earthquake Engineering Simulation
# Pacific Earthquake Engineering Research Center
# http://opensees.berkeley.edu/
#
# Portal Frame Example 3.3
# ------------------------
# Reinforced concrete one-bay, one-story frame
# Distributed vertical load on girder
# Uniform excitation acting at ... | 31.024768 | 119 | 0.589762 |
import opensees as ops
import math
ops.wipe()
ops.model("BasicBuilder", "-ndm",2, "-ndf",3)
ops.defaultUnits("-force", "kip", "-length", "in", "-time", "sec", "-temp", "F")
width = 360.0
height = 144.0
ops.node(1, 0.0, 0.0)
ops.node(2, width, 0.0)
ops.node(3, 0.0, height)
ops.node(4, width, height)
ops.fix(... | true | true |
1c0b3735a75097032a82e9d5fdff87bf331592ed | 122 | py | Python | murmeltier/__init__.py | malyvsen/evo-ai | 3f9c9bd01b5c212b26a13ca0c230ee3df42a9612 | [
"MIT"
] | 3 | 2018-06-23T09:45:49.000Z | 2018-11-27T23:39:46.000Z | murmeltier/__init__.py | malyvsen/evo-ai | 3f9c9bd01b5c212b26a13ca0c230ee3df42a9612 | [
"MIT"
] | null | null | null | murmeltier/__init__.py | malyvsen/evo-ai | 3f9c9bd01b5c212b26a13ca0c230ee3df42a9612 | [
"MIT"
] | null | null | null | __version__ = '0.1.0'
__author__ = 'Nicholas Bochenski <iceflamecode@gmail.com>'
__all__ = ['learning', 'units', 'utils']
| 30.5 | 58 | 0.704918 | __version__ = '0.1.0'
__author__ = 'Nicholas Bochenski <iceflamecode@gmail.com>'
__all__ = ['learning', 'units', 'utils']
| true | true |
1c0b378ba1c350ac2d1ced5015d20f45a8b63766 | 16,555 | py | Python | Packs/OpenLDAP/Integrations/OpenLDAP/OpenLDAP.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 1 | 2020-04-19T11:05:42.000Z | 2020-04-19T11:05:42.000Z | Packs/OpenLDAP/Integrations/OpenLDAP/OpenLDAP.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 9 | 2021-02-08T20:51:18.000Z | 2021-09-23T23:27:38.000Z | Packs/OpenLDAP/Integrations/OpenLDAP/OpenLDAP.py | ddi-danielsantander/content | 67e2edc404f50c332d928dbdbce00a447bb5532f | [
"MIT"
] | 1 | 2021-05-31T15:08:48.000Z | 2021-05-31T15:08:48.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from ldap3 import Server, Connection, Tls, BASE
from ldap3.utils.dn import parse_dn
from ldap3.core.exceptions import LDAPBindError, LDAPInvalidDnError, LDAPSocketOpenError, LDAPInvalidPortError
from ssl... | 45.356164 | 120 | 0.601268 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from ldap3 import Server, Connection, Tls, BASE
from ldap3.utils.dn import parse_dn
from ldap3.core.exceptions import LDAPBindError, LDAPInvalidDnError, LDAPSocketOpenError, LDAPInvalidPortError
from ssl import CERT_REQ... | true | true |
1c0b3890e65b5b2619fbe5db12cb78235693e7c4 | 19 | py | Python | autograde/static/inject_after.py | Feelx234/autograde | d41d8c280cbb83fc5fefb8fa1dea8342a5ba3731 | [
"MIT"
] | null | null | null | autograde/static/inject_after.py | Feelx234/autograde | d41d8c280cbb83fc5fefb8fa1dea8342a5ba3731 | [
"MIT"
] | null | null | null | autograde/static/inject_after.py | Feelx234/autograde | d41d8c280cbb83fc5fefb8fa1dea8342a5ba3731 | [
"MIT"
] | null | null | null | __IA_FLAG__ = True
| 9.5 | 18 | 0.789474 | __IA_FLAG__ = True
| true | true |
1c0b395085c32f3c3865bc4b107f3cea6c0a7dd4 | 2,469 | py | Python | smnist_exp/config_joint.py | andrearosasco/DistilledReplay | 2a4efa88d22b9afc7016f07549114688f346dbe8 | [
"MIT"
] | 7 | 2021-06-27T16:09:13.000Z | 2022-03-17T20:02:55.000Z | smnist_exp/config_joint.py | andrew-r96/DistilledReplay | 2a4efa88d22b9afc7016f07549114688f346dbe8 | [
"MIT"
] | null | null | null | smnist_exp/config_joint.py | andrew-r96/DistilledReplay | 2a4efa88d22b9afc7016f07549114688f346dbe8 | [
"MIT"
] | null | null | null | import importlib
import os
from collections import OrderedDict
import torch
import numpy as np
from torchvision.transforms import transforms
model_config = OrderedDict([
('arch', 'lenet5'),
('n_classes', 10),
('input_shape', (1, 28, 28)),
])
data_config = OrderedDict([
('dataset', 'SplitMNIST'),
... | 33.364865 | 107 | 0.610369 | import importlib
import os
from collections import OrderedDict
import torch
import numpy as np
from torchvision.transforms import transforms
model_config = OrderedDict([
('arch', 'lenet5'),
('n_classes', 10),
('input_shape', (1, 28, 28)),
])
data_config = OrderedDict([
('dataset', 'SplitMNIST'),
... | true | true |
1c0b39b7cc08c7ba00e4cf3245f43026bc06193e | 131 | py | Python | version.py | mjpernot/elastic-admin | c9ee86c86bbe12c8f4a6782bf8648164eb37fa28 | [
"MIT"
] | null | null | null | version.py | mjpernot/elastic-admin | c9ee86c86bbe12c8f4a6782bf8648164eb37fa28 | [
"MIT"
] | null | null | null | version.py | mjpernot/elastic-admin | c9ee86c86bbe12c8f4a6782bf8648164eb37fa28 | [
"MIT"
] | null | null | null | # Classification (U)
"""Program: version.py
Description: Single-source version control module.
"""
__version__ = "0.2.9"
| 13.1 | 55 | 0.671756 |
__version__ = "0.2.9"
| true | true |
1c0b3bd9a9cc65dd7a6dca4f2695b07073ab15a3 | 4,419 | py | Python | lenny_calibration/scripts/camera_robot_calibration.py | fsuarez6/lenny | 17ef3a5f85312a1626c8eec1ec5a91d08a644e8e | [
"BSD-3-Clause"
] | 1 | 2019-07-18T03:58:59.000Z | 2019-07-18T03:58:59.000Z | lenny_calibration/scripts/camera_robot_calibration.py | fsuarez6/lenny | 17ef3a5f85312a1626c8eec1ec5a91d08a644e8e | [
"BSD-3-Clause"
] | 2 | 2018-07-09T09:06:18.000Z | 2019-08-15T12:50:55.000Z | lenny_calibration/scripts/camera_robot_calibration.py | fsuarez6/lenny | 17ef3a5f85312a1626c8eec1ec5a91d08a644e8e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import yaml
import rospy
import rosbag
import argparse
import baldor as br
import criutils as cu
import resource_retriever
# Services
from handeye.srv import CalibrateHandEye, CalibrateHandEyeRequest
def parse_args():
# Remove extra IPython notebook args
clean_argv = rospy.myar... | 41.688679 | 116 | 0.664404 | import os
import yaml
import rospy
import rosbag
import argparse
import baldor as br
import criutils as cu
import resource_retriever
from handeye.srv import CalibrateHandEye, CalibrateHandEyeRequest
def parse_args():
clean_argv = rospy.myargv()[1:]
if '-f' in clean_argv:
clean_argv = clean_argv[2:... | true | true |
1c0b3bef6a437d5ec505175f26fc59ef0441f9a4 | 1,867 | py | Python | test/test_bottom_toolbar.py | farisachugthai/dynamic_ipython | 7572a01f09998812830379644c45af4df67a3e45 | [
"MIT"
] | 5 | 2019-04-03T02:00:13.000Z | 2020-11-15T13:06:47.000Z | test/test_bottom_toolbar.py | farisachugthai/dynamic_ipython | 7572a01f09998812830379644c45af4df67a3e45 | [
"MIT"
] | 23 | 2019-09-20T07:36:41.000Z | 2021-06-25T15:26:01.000Z | test/test_bottom_toolbar.py | farisachugthai/dynamic_ipython | 7572a01f09998812830379644c45af4df67a3e45 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import importlib
import inspect
import sys
import unittest
from io import StringIO
from importlib.util import module_from_spec
from unittest import TestCase
from unittest.mock import patch
from IPython.testing.globalipapp import get_ipython
from IPython.terminal.interactiv... | 27.865672 | 79 | 0.70541 | import importlib
import inspect
import sys
import unittest
from io import StringIO
from importlib.util import module_from_spec
from unittest import TestCase
from unittest.mock import patch
from IPython.testing.globalipapp import get_ipython
from IPython.terminal.interactiveshell import InteractiveShell
try:
spec... | true | true |
1c0b3ccc3d3b7f8f8cdc6e1ac25dccaee14362d6 | 1,712 | py | Python | dspftw/root_raised_cosine_filter_generator.py | dspftw/dspftw | 14de953f95e3a0710f10ee76d012c52ab12d6467 | [
"MIT"
] | null | null | null | dspftw/root_raised_cosine_filter_generator.py | dspftw/dspftw | 14de953f95e3a0710f10ee76d012c52ab12d6467 | [
"MIT"
] | 17 | 2021-02-03T15:46:45.000Z | 2021-05-05T14:09:49.000Z | dspftw/root_raised_cosine_filter_generator.py | dspftw/dspftw | 14de953f95e3a0710f10ee76d012c52ab12d6467 | [
"MIT"
] | 1 | 2021-01-28T03:09:20.000Z | 2021-01-28T03:09:20.000Z | # vim: expandtab tabstop=4 shiftwidth=4
from numpy import pi, sin, ceil, append, arange, zeros
from numpy import array as nparray
from .root_raised_cosine import root_raised_cosine
def root_raised_cosine_filter_generator(symbol_width: int, symbol_rate: float, sample_rate: float, beta: float=0.25) -> nparray:
'''... | 31.127273 | 133 | 0.669393 |
from numpy import pi, sin, ceil, append, arange, zeros
from numpy import array as nparray
from .root_raised_cosine import root_raised_cosine
def root_raised_cosine_filter_generator(symbol_width: int, symbol_rate: float, sample_rate: float, beta: float=0.25) -> nparray:
Ts = 1.0/symbol_rate
time_arr... | true | true |
1c0b3cf1d8e65b74c177948e9aeba8e9e522b39f | 19,459 | py | Python | libs/progress.py | lecler-i/ZTShows | 869b1495644727f8767ec108ae47f407ee6b15c0 | [
"Apache-2.0"
] | 1 | 2017-03-22T01:20:01.000Z | 2017-03-22T01:20:01.000Z | libs/progress.py | lecler-i/ZTShows | 869b1495644727f8767ec108ae47f407ee6b15c0 | [
"Apache-2.0"
] | null | null | null | libs/progress.py | lecler-i/ZTShows | 869b1495644727f8767ec108ae47f407ee6b15c0 | [
"Apache-2.0"
] | 1 | 2019-02-19T12:16:49.000Z | 2019-02-19T12:16:49.000Z | #!/usr/bin/python
"""Track and display progress, providing estimated completion time.
This module provides 2 classes to simply add progress display to any
application. Programs with more complex GUIs might still want to use it for the
estimates of time remaining it provides.
Use the ProgressDisplay class if your wor... | 35.770221 | 89 | 0.598335 |
__author__ = ("Tim Newsome <nuisance@casualhacker.net>")
__version__ = "1.0.0"
import time
import math
import sys
_gather_stats = False
if _gather_stats:
import os, os.path
_stats_file = os.path.join(os.environ["HOME"], ".progress_stats")
MULTI_LINE = 0
SINGLE_LINE = 1
def _time():
return time.tim... | true | true |
1c0b3d74eea1a74a5381ee7a5ccbb06edded88fb | 674 | py | Python | main.py | Kamikoto-sama/ImageFromClipboard | 5db0c7f209b30eced2bb9d4ab0afb3c33ec8185c | [
"MIT"
] | null | null | null | main.py | Kamikoto-sama/ImageFromClipboard | 5db0c7f209b30eced2bb9d4ab0afb3c33ec8185c | [
"MIT"
] | null | null | null | main.py | Kamikoto-sama/ImageFromClipboard | 5db0c7f209b30eced2bb9d4ab0afb3c33ec8185c | [
"MIT"
] | null | null | null | import os
import sys
from PIL import ImageGrab
from PyQt5.QtWidgets import QWidget, QFileDialog, QApplication, QMessageBox
def saveFileDialog():
widget = QWidget()
image = ImageGrab.grabclipboard()
if not hasattr(image, "save"):
QMessageBox.critical(widget, "Error", "There is no image in the clip... | 28.083333 | 110 | 0.688427 | import os
import sys
from PIL import ImageGrab
from PyQt5.QtWidgets import QWidget, QFileDialog, QApplication, QMessageBox
def saveFileDialog():
widget = QWidget()
image = ImageGrab.grabclipboard()
if not hasattr(image, "save"):
QMessageBox.critical(widget, "Error", "There is no image in the clip... | true | true |
1c0b3dd16e11c618c7dcff5a3ded5ac1746c6345 | 19,923 | py | Python | training/training_loop.py | alexquach/gansformer | 9b1e0d6633ca4d763c2e2e578d47960350797c57 | [
"MIT"
] | 1 | 2022-02-07T20:40:21.000Z | 2022-02-07T20:40:21.000Z | training/training_loop.py | shaun95/gansformer | 424fa33a33bbcb37af45ffa87b26f25369978d7a | [
"MIT"
] | null | null | null | training/training_loop.py | shaun95/gansformer | 424fa33a33bbcb37af45ffa87b26f25369978d7a | [
"MIT"
] | null | null | null | # Training loop:
# 1. Set up the environment and data
# 2. Build the generator (g) and discriminator (d) networks
# 3. Manage the training process
# 4. Run periodic evaluations on specified metrics
# 5. Produce sample images over the course of training
# It supports training over data in TF records as produced by prep... | 46.877647 | 128 | 0.611103 |
import glob
import numpy as np
import tensorflow as tf
import dnnlib
import dnnlib.tflib as tflib
from dnnlib.tflib.autosummary import autosummary
import pretrained_networks
from training import dataset as data
from training import misc
from training import visualize
from metrics import metric_base
def process_rea... | true | true |
1c0b3e6ae1b665b6ca9b1d7ccaa7aefc36539a6b | 364 | py | Python | mobile_version_app/serializers.py | SakyaSumedh/mobile_version_app | 60e1d7ace0e591e45b7524d2e711b09864456c66 | [
"MIT"
] | 5 | 2019-03-30T00:28:10.000Z | 2021-02-24T06:00:33.000Z | mobile_version_app/serializers.py | SakyaSumedh/mobile_version_app | 60e1d7ace0e591e45b7524d2e711b09864456c66 | [
"MIT"
] | null | null | null | mobile_version_app/serializers.py | SakyaSumedh/mobile_version_app | 60e1d7ace0e591e45b7524d2e711b09864456c66 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import MobileVersion
class MobileVersionSerializer(serializers.ModelSerializer):
class Meta:
model = MobileVersion
fields = "__all__"
class CheckVersionSerializer(serializers.ModelSerializer):
class Meta:
model = MobileVersion
... | 22.75 | 59 | 0.730769 | from rest_framework import serializers
from .models import MobileVersion
class MobileVersionSerializer(serializers.ModelSerializer):
class Meta:
model = MobileVersion
fields = "__all__"
class CheckVersionSerializer(serializers.ModelSerializer):
class Meta:
model = MobileVersion
... | true | true |
1c0b3e96cbb04d933cc3f50810954369e2846bf7 | 10,313 | py | Python | ipywidgets/widgets/widget_selection.py | vidartf/ipywidgets | 42ece696f1b53abb28eff08edadf7ac57695d722 | [
"BSD-3-Clause"
] | null | null | null | ipywidgets/widgets/widget_selection.py | vidartf/ipywidgets | 42ece696f1b53abb28eff08edadf7ac57695d722 | [
"BSD-3-Clause"
] | null | null | null | ipywidgets/widgets/widget_selection.py | vidartf/ipywidgets | 42ece696f1b53abb28eff08edadf7ac57695d722 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Selection classes.
Represents an enumeration using a widget.
"""
from collections import Mapping
try:
from itertools import izip
except ImportError: #python3.x
izip = zip
from .domwidget import LabeledWi... | 37.915441 | 113 | 0.658974 |
from collections import Mapping
try:
from itertools import izip
except ImportError: izip = zip
from .domwidget import LabeledWidget
from .valuewidget import ValueWidget
from .widget_core import CoreWidget
from .widget import register
from traitlets import (Unicode, Bool, Any, Dict, TraitError, CaselessStrEn... | true | true |
1c0b401f28cb48114487c03d7b110320a5dbd76d | 1,860 | py | Python | notice.py | hzyjerry/personalDriving | be90b75592d7d017096f8dbff0151fa1434136f6 | [
"MIT"
] | 1 | 2019-08-31T15:13:58.000Z | 2019-08-31T15:13:58.000Z | notice.py | hzyjerry/personalDriving | be90b75592d7d017096f8dbff0151fa1434136f6 | [
"MIT"
] | null | null | null | notice.py | hzyjerry/personalDriving | be90b75592d7d017096f8dbff0151fa1434136f6 | [
"MIT"
] | 1 | 2019-08-30T21:08:11.000Z | 2019-08-30T21:08:11.000Z | # Elis: Maybe this is a bit too much, but it is convenient.
import pyglet
class Notice(object):
def __init__(self, name = None, info_func = None, info = None):
self.name = name
self.info_func = info_func # check info function.
self.info = info # last updated info.
def reset(self):
... | 30.491803 | 99 | 0.609677 | import pyglet
class Notice(object):
def __init__(self, name = None, info_func = None, info = None):
self.name = name
self.info_func = info_func self.info = info def reset(self):
pass
class Truck_Maniac(Notice): def __init__(self, *args, **vargs):
Notice.__init__(se... | false | true |
1c0b4088ef921e88bb50ec66faf96620cb5beb00 | 1,670 | py | Python | allegation/tests/views/test_allegation_view.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 16 | 2016-05-20T09:03:32.000Z | 2020-09-13T14:23:06.000Z | allegation/tests/views/test_allegation_view.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 2 | 2016-05-24T01:44:14.000Z | 2016-06-17T22:19:45.000Z | allegation/tests/views/test_allegation_view.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 2 | 2016-10-10T16:14:19.000Z | 2020-10-26T00:17:02.000Z | from django.core.urlresolvers import reverse
from django.test import override_settings
from rest_framework.status import HTTP_301_MOVED_PERMANENTLY, HTTP_404_NOT_FOUND
from allegation.factories import AllegationCategoryFactory, OfficerAllegationFactory
from common.tests.core import SimpleTestCase
from common.utils.mob... | 47.714286 | 113 | 0.728743 | from django.core.urlresolvers import reverse
from django.test import override_settings
from rest_framework.status import HTTP_301_MOVED_PERMANENTLY, HTTP_404_NOT_FOUND
from allegation.factories import AllegationCategoryFactory, OfficerAllegationFactory
from common.tests.core import SimpleTestCase
from common.utils.mob... | true | true |
1c0b40ef962b43c479d667a6169ba2272c24e41e | 11,967 | py | Python | sendbee_api/bind.py | sendbee/sendbee-python-client | 20f27b733afb1f5143f0f604729f82158c584162 | [
"MIT"
] | null | null | null | sendbee_api/bind.py | sendbee/sendbee-python-client | 20f27b733afb1f5143f0f604729f82158c584162 | [
"MIT"
] | null | null | null | sendbee_api/bind.py | sendbee/sendbee-python-client | 20f27b733afb1f5143f0f604729f82158c584162 | [
"MIT"
] | null | null | null | import click
import requests
from abc import ABCMeta
from sendbee_api import constants
from sendbee_api.debug import Debug
from sendbee_api.auth import SendbeeAuth
from sendbee_api.response import Response
from sendbee_api.formatter import FormatterFactory
from sendbee_api.exceptions import SendbeeRequestApiException,... | 37.164596 | 84 | 0.546169 | import click
import requests
from abc import ABCMeta
from sendbee_api import constants
from sendbee_api.debug import Debug
from sendbee_api.auth import SendbeeAuth
from sendbee_api.response import Response
from sendbee_api.formatter import FormatterFactory
from sendbee_api.exceptions import SendbeeRequestApiException,... | true | true |
1c0b4195aafd968de56e6513cf0c7f5df0653824 | 1,008 | py | Python | examples/justswap.py | drodel/tronpy | 9e869fb508c3f77b432948cc56cd66985375843d | [
"MIT"
] | 87 | 2020-08-24T08:46:37.000Z | 2022-03-28T02:50:56.000Z | examples/justswap.py | drodel/tronpy | 9e869fb508c3f77b432948cc56cd66985375843d | [
"MIT"
] | 40 | 2020-07-17T11:15:46.000Z | 2022-03-30T01:02:16.000Z | examples/justswap.py | drodel/tronpy | 9e869fb508c3f77b432948cc56cd66985375843d | [
"MIT"
] | 50 | 2020-08-04T15:10:37.000Z | 2022-03-29T02:03:38.000Z |
import json
import os
import time
from tronpy import Tron
from tronpy import keys
__dir__ = os.path.dirname(__file__)
dzi_trade = 'TSMssi9ojNkzj5fT5bAjzuGjrLmsKau8Xj'
from_addr = 'TVrSWkL6a9xvtxRKq5RHg2HjUpGdPN3wBa'
priv_key = keys.PrivateKey.fromhex("975a98.....(omitted)..........86b98d97b")
def timestamp():
... | 22.4 | 101 | 0.729167 |
import json
import os
import time
from tronpy import Tron
from tronpy import keys
__dir__ = os.path.dirname(__file__)
dzi_trade = 'TSMssi9ojNkzj5fT5bAjzuGjrLmsKau8Xj'
from_addr = 'TVrSWkL6a9xvtxRKq5RHg2HjUpGdPN3wBa'
priv_key = keys.PrivateKey.fromhex("975a98.....(omitted)..........86b98d97b")
def timestamp():
... | true | true |
1c0b41f86a66baa01492666195abb14c5252f9bd | 431 | py | Python | bolinette/data/seeder.py | TheCaptainCat/flasque | d42deb57572084f513202a32c460186700ce8e0b | [
"MIT"
] | 3 | 2019-10-25T12:21:28.000Z | 2020-09-11T13:43:32.000Z | bolinette/data/seeder.py | TheCaptainCat/bolinette | d42deb57572084f513202a32c460186700ce8e0b | [
"MIT"
] | null | null | null | bolinette/data/seeder.py | TheCaptainCat/bolinette | d42deb57572084f513202a32c460186700ce8e0b | [
"MIT"
] | null | null | null | from collections.abc import Callable
from bolinette import core, data
class Seeder:
def __init__(self, func: Callable[[core.BolinetteContext], None]) -> None:
self._func = func
self._name = func.__name__
@property
def name(self) -> str:
return self._name
async def run(self, c... | 26.9375 | 84 | 0.686775 | from collections.abc import Callable
from bolinette import core, data
class Seeder:
def __init__(self, func: Callable[[core.BolinetteContext], None]) -> None:
self._func = func
self._name = func.__name__
@property
def name(self) -> str:
return self._name
async def run(self, c... | true | true |
1c0b420687de4ba6efb449fd1f035c5942372c87 | 53 | py | Python | src/new.py | archenroot/tcs-demo | 0e9584f5128a14ad38cb5b8c9808f2bd26c11c99 | [
"Apache-2.0"
] | null | null | null | src/new.py | archenroot/tcs-demo | 0e9584f5128a14ad38cb5b8c9808f2bd26c11c99 | [
"Apache-2.0"
] | null | null | null | src/new.py | archenroot/tcs-demo | 0e9584f5128a14ad38cb5b8c9808f2bd26c11c99 | [
"Apache-2.0"
] | null | null | null | def ErrorHospitel(string, month: str):
return ''
| 17.666667 | 38 | 0.679245 | def ErrorHospitel(string, month: str):
return ''
| true | true |
1c0b4279f15dc40dea85bf08efb18ce6366b5ef0 | 6,938 | py | Python | lixian_hash_bt.py | 1py/xunlei-lixian | 1881932b9d5ccba78c7788fbad12982e05bf7f86 | [
"MIT"
] | null | null | null | lixian_hash_bt.py | 1py/xunlei-lixian | 1881932b9d5ccba78c7788fbad12982e05bf7f86 | [
"MIT"
] | null | null | null | lixian_hash_bt.py | 1py/xunlei-lixian | 1881932b9d5ccba78c7788fbad12982e05bf7f86 | [
"MIT"
] | null | null | null |
import os.path
import sys
import hashlib
from cStringIO import StringIO
import re
from lixian_encoding import default_encoding
def magnet_to_infohash(magnet):
import re
import base64
m = re.match(r'magnet:\?xt=urn:btih:(\w+)', magnet)
assert m, magnet
code = m.group(1)
if re.match(r'^[a-zA-Z0-9]{40}$', code):
... | 27.752 | 119 | 0.682041 |
import os.path
import sys
import hashlib
from cStringIO import StringIO
import re
from lixian_encoding import default_encoding
def magnet_to_infohash(magnet):
import re
import base64
m = re.match(r'magnet:\?xt=urn:btih:(\w+)', magnet)
assert m, magnet
code = m.group(1)
if re.match(r'^[a-zA-Z0-9]{40}$', code):
... | false | true |
1c0b42cb33908df613bc596cfc4047a9bc4437e4 | 389 | py | Python | MyHome/wsgi.py | PeacefulWindy/MyHome | dd2d810c2aeb887bb88fb9bd881f9e145b4c7670 | [
"MIT"
] | null | null | null | MyHome/wsgi.py | PeacefulWindy/MyHome | dd2d810c2aeb887bb88fb9bd881f9e145b4c7670 | [
"MIT"
] | null | null | null | MyHome/wsgi.py | PeacefulWindy/MyHome | dd2d810c2aeb887bb88fb9bd881f9e145b4c7670 | [
"MIT"
] | null | null | null | """
WSGI config for MyHome project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MyHome.settings')
application = get_wsgi_application()
| true | true |
1c0b4325ba975fcb23ab12685036930e0b5a3ffa | 326 | py | Python | Mundo1/aula7i.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | Mundo1/aula7i.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | Mundo1/aula7i.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | ###faça um algoritmo que leia o salário de um funcionário e mostre seu novo sálario, com 15%de aumento
nome = input('Digite o nome do funcionário: ')
sal = float(input('Digite o valor do salario: '))
novo_salario = sal +(sal*0.15)
print(f'O salário do {nome} é R$:{sal:.2f}, com 15% de acrecimo fica R$:{novo_salario:.2... | 46.571429 | 102 | 0.702454 | nome = input('Digite o nome do funcionário: ')
sal = float(input('Digite o valor do salario: '))
novo_salario = sal +(sal*0.15)
print(f'O salário do {nome} é R$:{sal:.2f}, com 15% de acrecimo fica R$:{novo_salario:.2f}')
| true | true |
1c0b43ceceb72d2e358239507d8aed240bba3570 | 579 | py | Python | django_project/ecommerce_app/urls.py | locoentltd/simple_ecommerce-1 | 128ef400f506f2bf4ca90626e5e87eaed99a58db | [
"MIT"
] | null | null | null | django_project/ecommerce_app/urls.py | locoentltd/simple_ecommerce-1 | 128ef400f506f2bf4ca90626e5e87eaed99a58db | [
"MIT"
] | null | null | null | django_project/ecommerce_app/urls.py | locoentltd/simple_ecommerce-1 | 128ef400f506f2bf4ca90626e5e87eaed99a58db | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('product/<int:product_id>/<slug:product_slug>/',views.show_product, name='product_detail'),
path('cart/', views.show_cart, name='show_cart'),
path('checkout/', vie... | 44.538462 | 100 | 0.715026 | from django.conf.urls import url
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('product/<int:product_id>/<slug:product_slug>/',views.show_product, name='product_detail'),
path('cart/', views.show_cart, name='show_cart'),
path('checkout/', vie... | true | true |
1c0b44376decf08e4877bc6cad2fb54ff5b2cca7 | 2,210 | py | Python | test/test_plot.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | test/test_plot.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | test/test_plot.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | import torch
import numpy as np
import matplotlib.pyplot as plt
from torch_geometric.data import Data
from foam_graph.visualization.graph_plotting import plot_graph, plot_graph_contour
from foam_graph.visualization.graph_3d_plotting import plot_3d_graph
def test_plot_2d():
edge_index = torch.tensor([[0, 1], [1, 0... | 35.645161 | 86 | 0.628054 | import torch
import numpy as np
import matplotlib.pyplot as plt
from torch_geometric.data import Data
from foam_graph.visualization.graph_plotting import plot_graph, plot_graph_contour
from foam_graph.visualization.graph_3d_plotting import plot_3d_graph
def test_plot_2d():
edge_index = torch.tensor([[0, 1], [1, 0... | true | true |
1c0b45914a0e33bf02044c41a1c4aff0bc442bbc | 598 | py | Python | vut/lib/python3.8/site-packages/pipenv/vendor/passa/cli/install.py | dan-mutua/djangowk1 | 1e5dcb6443ef21451e21845ec639198719e11b10 | [
"MIT"
] | 6,263 | 2017-01-20T17:41:36.000Z | 2022-02-15T20:48:57.000Z | vut/lib/python3.8/site-packages/pipenv/vendor/passa/cli/install.py | dan-mutua/djangowk1 | 1e5dcb6443ef21451e21845ec639198719e11b10 | [
"MIT"
] | 1,100 | 2017-01-20T19:41:52.000Z | 2017-12-06T09:15:13.000Z | vut/lib/python3.8/site-packages/pipenv/vendor/passa/cli/install.py | dan-mutua/djangowk1 | 1e5dcb6443ef21451e21845ec639198719e11b10 | [
"MIT"
] | 366 | 2017-01-21T10:06:52.000Z | 2021-11-25T17:09:19.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ..actions.install import install
from ._base import BaseCommand
from .options import dev, no_check, no_clean
class Command(BaseCommand):
name = "install"
description = "Generate Pipfile.lock to synchronize ... | 26 | 85 | 0.702341 |
from __future__ import absolute_import, print_function, unicode_literals
from ..actions.install import install
from ._base import BaseCommand
from .options import dev, no_check, no_clean
class Command(BaseCommand):
name = "install"
description = "Generate Pipfile.lock to synchronize the environment."
a... | true | true |
1c0b45fad3bb486886ce804f06488f563201b026 | 303 | py | Python | apps/jobs/__init__.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 19 | 2018-09-04T14:49:01.000Z | 2020-06-09T22:13:10.000Z | apps/jobs/__init__.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 50 | 2018-09-18T17:28:57.000Z | 2021-01-09T16:18:45.000Z | apps/jobs/__init__.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 4 | 2019-12-15T13:44:18.000Z | 2021-06-09T20:39:54.000Z | from django.apps import AppConfig
class JobsConfig(AppConfig):
name = 'apps.jobs'
label = 'jobs'
verbose_name = 'Jobs'
def ready(self):
# pylint:disable=unused-import
import apps.jobs.signals
# pylint:disable=invalid-name
default_app_config = 'apps.jobs.JobsConfig'
| 18.9375 | 43 | 0.686469 | from django.apps import AppConfig
class JobsConfig(AppConfig):
name = 'apps.jobs'
label = 'jobs'
verbose_name = 'Jobs'
def ready(self):
import apps.jobs.signals
default_app_config = 'apps.jobs.JobsConfig'
| true | true |
1c0b4689d23e4b0ba3d8a4fb3652dc0de2b421bd | 13,245 | py | Python | sdk/python/pulumi_azure_native/datafactory/pipeline.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/pipeline.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/pipeline.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 57.337662 | 1,785 | 0.695357 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['Pipeline']
class Pipeline(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
1c0b46cdf9871ff7038de2d0d820c1372413eb01 | 5,033 | py | Python | src/data/load_weight_sensor.py | JiajunSong629/download-project | 83e31b3db18b83add4c7293a3375adb61b0c59c3 | [
"MIT"
] | null | null | null | src/data/load_weight_sensor.py | JiajunSong629/download-project | 83e31b3db18b83add4c7293a3375adb61b0c59c3 | [
"MIT"
] | null | null | null | src/data/load_weight_sensor.py | JiajunSong629/download-project | 83e31b3db18b83add4c7293a3375adb61b0c59c3 | [
"MIT"
] | null | null | null | """
load_weight_sensor.py
get the raw seat and foot weight data, and get
the clean total weight
"""
import warnings
import sqlite3
import os
import pandas as pd
import numpy as np
from typing import Optional, List
from src.data import load_water_distance
import config
warnings.filterwarnings("ignore", category=Runti... | 31.067901 | 99 | 0.698987 |
import warnings
import sqlite3
import os
import pandas as pd
import numpy as np
from typing import Optional, List
from src.data import load_water_distance
import config
warnings.filterwarnings("ignore", category=RuntimeWarning)
def get_seat_weight_raw(
user_id: int,
database_path: Optional[str] = config.DA... | true | true |
1c0b46db920de3866a44b57a1ff92bfdc6e7e173 | 18,277 | py | Python | train_ssd_network.py | vicFigure/tf-ssd-mobilenetv1 | 9adf4f821f5ddeb45c973dd52a440cfabc09c9fd | [
"Apache-2.0"
] | 3 | 2018-12-10T12:17:18.000Z | 2019-11-21T12:30:23.000Z | train_ssd_network.py | vicFigure/tf-ssd-mobilenetv1 | 9adf4f821f5ddeb45c973dd52a440cfabc09c9fd | [
"Apache-2.0"
] | 1 | 2018-11-17T02:34:08.000Z | 2018-11-17T02:34:08.000Z | train_ssd_network.py | vicFigure/tf-ssd-mobilenetv1 | 9adf4f821f5ddeb45c973dd52a440cfabc09c9fd | [
"Apache-2.0"
] | 2 | 2019-09-04T12:14:14.000Z | 2022-03-23T06:56:29.000Z | # Copyright 2016 Paul Balanca. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 46.388325 | 94 | 0.576189 | import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from datasets import dataset_factory
from deployment import model_deploy
from nets import nets_factory
from preprocessing import preprocessing_factory
import tf_utils
slim = tf.contrib.slim
DATA_FORMAT = 'NHWC'
tf.app.flags.DEFINE_float(
... | true | true |
1c0b47c4dbb10cbb5295f813aac7be1b471181fe | 23,241 | py | Python | src/python/zquantum/core/openfermion/_utils.py | zapatacomputing/z-quantum-core | 456f5d83ba641982e710e2abe19afa4e266ab4a8 | [
"Apache-2.0"
] | 24 | 2020-04-15T17:36:59.000Z | 2022-01-25T05:02:14.000Z | src/python/zquantum/core/openfermion/_utils.py | zapatacomputing/z-quantum-core | 456f5d83ba641982e710e2abe19afa4e266ab4a8 | [
"Apache-2.0"
] | 177 | 2020-04-23T15:19:59.000Z | 2022-03-30T18:06:17.000Z | src/python/zquantum/core/openfermion/_utils.py | zapatacomputing/z-quantum-core | 456f5d83ba641982e710e2abe19afa4e266ab4a8 | [
"Apache-2.0"
] | 19 | 2020-06-24T10:56:02.000Z | 2021-09-30T13:02:21.000Z | import itertools
import random
from typing import Iterable, List, Optional
import numpy as np
from openfermion import (
FermionOperator,
InteractionOperator,
InteractionRDM,
PolynomialTensor,
QubitOperator,
count_qubits,
)
from openfermion import expectation as openfermion_expectation
from open... | 35.482443 | 88 | 0.647649 | import itertools
import random
from typing import Iterable, List, Optional
import numpy as np
from openfermion import (
FermionOperator,
InteractionOperator,
InteractionRDM,
PolynomialTensor,
QubitOperator,
count_qubits,
)
from openfermion import expectation as openfermion_expectation
from open... | true | true |
1c0b47f102b5c4680184bd0365a0a787d2d86aef | 10,266 | py | Python | train_refinedet.py | lsc25846/R | 9712203f264f8a487c56135cdc4359d4e022f991 | [
"MIT"
] | null | null | null | train_refinedet.py | lsc25846/R | 9712203f264f8a487c56135cdc4359d4e022f991 | [
"MIT"
] | null | null | null | train_refinedet.py | lsc25846/R | 9712203f264f8a487c56135cdc4359d4e022f991 | [
"MIT"
] | null | null | null | import os
import time
import argparse
import torch
import _init_paths
from torch.autograd import Variable
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torch.utils.data as data
from libs.utils.augmentations import SSDAugmentation
from libs.networks.vgg_refinedet import VGGRefineDet
from libs.n... | 40.738095 | 109 | 0.621274 | import os
import time
import argparse
import torch
import _init_paths
from torch.autograd import Variable
import torch.optim as optim
import torch.backends.cudnn as cudnn
import torch.utils.data as data
from libs.utils.augmentations import SSDAugmentation
from libs.networks.vgg_refinedet import VGGRefineDet
from libs.n... | true | true |
1c0b485895e9458b0b33797c175e157dafccac3f | 1,931 | py | Python | eclcli/sss/sssclient/common/validators.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 32 | 2016-08-31T04:12:40.000Z | 2020-12-11T04:49:57.000Z | eclcli/sss/sssclient/common/validators.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 27 | 2016-09-06T07:50:36.000Z | 2021-09-14T09:46:03.000Z | eclcli/sss/sssclient/common/validators.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 24 | 2016-09-02T01:09:09.000Z | 2021-01-19T09:14:16.000Z | import netaddr
from . import exceptions
from ..i18n import _
def validate_int_range(parsed_args, attr_name, min_value=None, max_value=None):
val = getattr(parsed_args, attr_name, None)
if val is None:
return
try:
if not isinstance(val, int):
int_val = int(val, 0)
else:... | 35.109091 | 79 | 0.543242 | import netaddr
from . import exceptions
from ..i18n import _
def validate_int_range(parsed_args, attr_name, min_value=None, max_value=None):
val = getattr(parsed_args, attr_name, None)
if val is None:
return
try:
if not isinstance(val, int):
int_val = int(val, 0)
else:... | true | true |
1c0b4878b7499c83a6587709adb503cfa0eefcd6 | 13,783 | py | Python | docs/source/conf.py | sgaist/dask | 9c94ea294d511556d010efb7526663841b64287f | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | sgaist/dask | 9c94ea294d511556d010efb7526663841b64287f | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | sgaist/dask | 9c94ea294d511556d010efb7526663841b64287f | [
"BSD-3-Clause"
] | null | null | null | #
# dask documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 4 08:58:22 2015.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have ... | 33.453883 | 86 | 0.67859 |
import os
import sys
sys.path.insert(0, os.path.abspath("../../"))
source_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(source_dir, "ext"))
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
... | true | true |
1c0b48922098b435de32e8bb10ee7416c1d31ace | 10,801 | py | Python | test/test_models.py | junjihashimoto/vision | 791c172a337d98012018f98ffde93b1020ba3ed5 | [
"BSD-3-Clause"
] | 1 | 2020-04-17T05:11:16.000Z | 2020-04-17T05:11:16.000Z | test/test_models.py | junjihashimoto/vision | 791c172a337d98012018f98ffde93b1020ba3ed5 | [
"BSD-3-Clause"
] | null | null | null | test/test_models.py | junjihashimoto/vision | 791c172a337d98012018f98ffde93b1020ba3ed5 | [
"BSD-3-Clause"
] | null | null | null | from common_utils import TestCase, map_nested_tensor_object, freeze_rng_state
from collections import OrderedDict
from itertools import product
import torch
import numpy as np
from torchvision import models
import unittest
import traceback
import random
def set_rng_seed(seed):
torch.manual_seed(seed)
random.s... | 37.116838 | 119 | 0.637811 | from common_utils import TestCase, map_nested_tensor_object, freeze_rng_state
from collections import OrderedDict
from itertools import product
import torch
import numpy as np
from torchvision import models
import unittest
import traceback
import random
def set_rng_seed(seed):
torch.manual_seed(seed)
random.s... | true | true |
1c0b48ae020d9bf6915eeb28a1e443ea8aa79305 | 731 | py | Python | arm_prosthesis/services/myoelectronics/preprocessing/feture_extactor.py | paulrozhkin/arm_prosthesis_raspberry | a643dc84109f1d516fa2ca50414f95f408d6da7d | [
"MIT"
] | 2 | 2021-11-08T01:52:36.000Z | 2021-11-08T01:52:38.000Z | arm_prosthesis/services/myoelectronics/preprocessing/feture_extactor.py | paulrozhkin/arm_prosthesis_raspberry | a643dc84109f1d516fa2ca50414f95f408d6da7d | [
"MIT"
] | null | null | null | arm_prosthesis/services/myoelectronics/preprocessing/feture_extactor.py | paulrozhkin/arm_prosthesis_raspberry | a643dc84109f1d516fa2ca50414f95f408d6da7d | [
"MIT"
] | 1 | 2020-11-08T16:45:23.000Z | 2020-11-08T16:45:23.000Z | from typing import List
from arm_prosthesis.services.myoelectronics.preprocessing.signal_sampler import SignalSampler
class FeatureExtractor:
# Extract Mean absolute value (MAV)
@staticmethod
def extract_mav(signal: List[int]) -> List[float]:
mav_result = []
samples = Signal... | 27.074074 | 94 | 0.652531 | from typing import List
from arm_prosthesis.services.myoelectronics.preprocessing.signal_sampler import SignalSampler
class FeatureExtractor:
@staticmethod
def extract_mav(signal: List[int]) -> List[float]:
mav_result = []
samples = SignalSampler.sampling(signal)
for... | true | true |
1c0b49aa11d3b1aede94558c050276e9eb57a0f1 | 5,018 | py | Python | tests/unit/utils/test_bundle_utils.py | jgweir/hammr | 38adaab005e58294c1314b56957e4f040ad75749 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/test_bundle_utils.py | jgweir/hammr | 38adaab005e58294c1314b56957e4f040ad75749 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/test_bundle_utils.py | jgweir/hammr | 38adaab005e58294c1314b56957e4f040ad75749 | [
"Apache-2.0"
] | null | null | null | __author__ = 'UshareSoft'
import unittest
import json
import yaml
from mock import patch
from ussclicore.utils import generics_utils
from hammr.utils import bundle_utils
class TestFiles(unittest.TestCase):
@patch("ussclicore.utils.printer.out")
def test_check_bundle_should_failed_when_no_name(self, mock_met... | 40.467742 | 171 | 0.714428 | __author__ = 'UshareSoft'
import unittest
import json
import yaml
from mock import patch
from ussclicore.utils import generics_utils
from hammr.utils import bundle_utils
class TestFiles(unittest.TestCase):
@patch("ussclicore.utils.printer.out")
def test_check_bundle_should_failed_when_no_name(self, mock_met... | true | true |
1c0b49b8c373e69c4efd6bbda1e8b25e3ea22f21 | 599 | py | Python | customization/colorSquare.py | a358003542/wxpython_examples | af2958557cd7a2422d19692256558bb7fbab337a | [
"MIT"
] | null | null | null | customization/colorSquare.py | a358003542/wxpython_examples | af2958557cd7a2422d19692256558bb7fbab337a | [
"MIT"
] | null | null | null | customization/colorSquare.py | a358003542/wxpython_examples | af2958557cd7a2422d19692256558bb7fbab337a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*-coding:utf-8-*-
import wx
class ColorSquare(wx.Panel):
"""
带颜色的方块
"""
def __init__(self, parent, color='black', **kwargs):
super(ColorSquare, self).__init__(parent=parent, **kwargs)
self.parent = parent
self.color = color
self.Bind(wx.EVT_... | 19.966667 | 66 | 0.599332 |
import wx
class ColorSquare(wx.Panel):
def __init__(self, parent, color='black', **kwargs):
super(ColorSquare, self).__init__(parent=parent, **kwargs)
self.parent = parent
self.color = color
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, event):
dc = wx.Pa... | true | true |
1c0b4a0e8d0d0f1bf734df62f9b74a03153d1fcc | 40,897 | py | Python | chives/wallet/wallet_node.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | 1 | 2021-08-01T17:14:54.000Z | 2021-08-01T17:14:54.000Z | chives/wallet/wallet_node.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | null | null | null | chives/wallet/wallet_node.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | null | null | null | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union, Any
from blspy import PrivateKey
from chives.consensus.block_record import BlockRecord
from chives.consensus.constants import ConsensusCon... | 44.696175 | 119 | 0.599262 | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union, Any
from blspy import PrivateKey
from chives.consensus.block_record import BlockRecord
from chives.consensus.constants import ConsensusCon... | true | true |
1c0b4afddef70de60622c618f9ea8cd6746e7fd9 | 7,043 | py | Python | arm control/locate_jenga.py | wzhlifelover/JengaBot | eb161c7e0222c4f09f0d4c95b7650e4c2574e39e | [
"MIT"
] | 1 | 2021-08-10T02:58:48.000Z | 2021-08-10T02:58:48.000Z | arm control/locate_jenga.py | wzhlifelover/JengaBot | eb161c7e0222c4f09f0d4c95b7650e4c2574e39e | [
"MIT"
] | null | null | null | arm control/locate_jenga.py | wzhlifelover/JengaBot | eb161c7e0222c4f09f0d4c95b7650e4c2574e39e | [
"MIT"
] | 1 | 2021-05-25T03:24:19.000Z | 2021-05-25T03:24:19.000Z | import numpy as np
import cv2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import arm_camera_calibrate
import Calibration
def saveImage(labeled_img1, fname1, labeled_img2, fname2):
# show image for down camera
plt.imshow(cv2.cvtColor(labeled_img1, cv2.COLOR_BGR2RGB))
plt.axis("of... | 31.868778 | 105 | 0.660372 | import numpy as np
import cv2
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import arm_camera_calibrate
import Calibration
def saveImage(labeled_img1, fname1, labeled_img2, fname2):
plt.imshow(cv2.cvtColor(labeled_img1, cv2.COLOR_BGR2RGB))
plt.axis("off")
plt.title("Down Image... | true | true |
1c0b4b3f38caa1567c4887d3d373642c1ca257e4 | 78,295 | py | Python | src/borg/archive.py | Gelma/borg | e4247cc0d25f221efdf7447d316dcb022b38b8b7 | [
"BSD-3-Clause"
] | null | null | null | src/borg/archive.py | Gelma/borg | e4247cc0d25f221efdf7447d316dcb022b38b8b7 | [
"BSD-3-Clause"
] | null | null | null | src/borg/archive.py | Gelma/borg | e4247cc0d25f221efdf7447d316dcb022b38b8b7 | [
"BSD-3-Clause"
] | null | null | null | import errno
import json
import os
import socket
import stat
import sys
import time
from contextlib import contextmanager
from datetime import datetime, timezone, timedelta
from functools import partial
from getpass import getuser
from io import BytesIO
from itertools import groupby
from shutil import get_terminal_size... | 44.085023 | 148 | 0.581812 | import errno
import json
import os
import socket
import stat
import sys
import time
from contextlib import contextmanager
from datetime import datetime, timezone, timedelta
from functools import partial
from getpass import getuser
from io import BytesIO
from itertools import groupby
from shutil import get_terminal_size... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.