hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79062d699b07af1961840333e4032853eda92dee | 45,068 | py | Python | tencentcloud/mongodb/v20180408/models.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | tencentcloud/mongodb/v20180408/models.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | tencentcloud/mongodb/v20180408/models.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | 32.031272 | 110 | 0.600071 |
import warnings
from tencentcloud.common.abstract_model import AbstractModel
class AssignProjectRequest(AbstractModel):
def __init__(self):
self.InstanceIds = None
self.ProjectId = None
def _deserialize(self, params):
self.InstanceIds = params.get("InstanceIds")
... | true | true |
79062f5522c6299ac2fe1bfd30769fdb10226e88 | 392 | py | Python | recipes/gflags/all/test_package/conanfile.py | balintfodor/conan-center-index | 9afc15a805f8ab323a312327c68c80f81a6ceade | [
"MIT"
] | 3 | 2020-04-16T15:01:33.000Z | 2022-01-13T08:05:47.000Z | recipes/gflags/all/test_package/conanfile.py | balintfodor/conan-center-index | 9afc15a805f8ab323a312327c68c80f81a6ceade | [
"MIT"
] | 33 | 2020-02-18T15:54:50.000Z | 2022-03-28T08:54:10.000Z | recipes/lyra/all/test_package/conanfile.py | GavinNL/conan-center-index | 0ae829a362c1cc6a20d97e023ca0aafc805797c3 | [
"MIT"
] | 8 | 2020-03-06T14:38:18.000Z | 2022-03-28T08:41:15.000Z | from conans import ConanFile, CMake, tools
import os
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
bin_path = os.path.join(... | 23.058824 | 54 | 0.632653 | from conans import ConanFile, CMake, tools
import os
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
bin_path = os.path.join(... | true | true |
79062f6182eb8091b6a54c4c22672d53706fb058 | 3,466 | py | Python | hawkmoth/__init__.py | mv0/hawkmoth | 81424935ede79fd8836b8b18f6ad6210fd3c0d38 | [
"BSD-2-Clause"
] | null | null | null | hawkmoth/__init__.py | mv0/hawkmoth | 81424935ede79fd8836b8b18f6ad6210fd3c0d38 | [
"BSD-2-Clause"
] | null | null | null | hawkmoth/__init__.py | mv0/hawkmoth | 81424935ede79fd8836b8b18f6ad6210fd3c0d38 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2016-2017, Jani Nikula <jani@nikula.org>
# Licensed under the terms of BSD 2-Clause, see LICENSE for details.
"""
Hawkmoth
========
Sphinx C Domain autodoc directive extension.
"""
import glob
import os
import re
import stat
import subprocess
import sys
from docutils import nodes, statemachine
from d... | 34.316832 | 82 | 0.634737 |
import glob
import os
import re
import stat
import subprocess
import sys
from docutils import nodes, statemachine
from docutils.parsers.rst import directives, Directive
from docutils.statemachine import ViewList
from sphinx.ext.autodoc import AutodocReporter
from sphinx.util.nodes import nested_parse_with_titles
fr... | true | true |
7906312da098eb0cd514ed73552105109d16c5c4 | 5,268 | py | Python | src/lib/trains/mot.py | CaptainEven/FairMOTVehicle | 1d9033bcab9723cc5be3d5d94a5ac3712e8e143e | [
"MIT"
] | 152 | 2020-06-11T08:27:32.000Z | 2022-03-26T16:35:55.000Z | src/lib/trains/mot.py | christw16/FairMOTVehicle | 1d9033bcab9723cc5be3d5d94a5ac3712e8e143e | [
"MIT"
] | 24 | 2020-06-11T14:57:41.000Z | 2022-03-19T10:07:42.000Z | src/lib/trains/mot.py | christw16/FairMOTVehicle | 1d9033bcab9723cc5be3d5d94a5ac3712e8e143e | [
"MIT"
] | 29 | 2020-06-11T09:42:22.000Z | 2022-01-28T22:32:12.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from lib.models.decode import mot_decode
from lib.models.losses import FocalLoss
from lib.models.losses import RegL1Loss, RegLoss,... | 42.483871 | 120 | 0.579157 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from lib.models.decode import mot_decode
from lib.models.losses import FocalLoss
from lib.models.losses import RegL1Loss, RegLoss,... | true | true |
790632599ec0c5e0db7b70a082f0a63ae4a7dec4 | 26,693 | py | Python | lib/python2.7/matplotlib/projections/polar.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | 1 | 2017-01-25T00:38:48.000Z | 2017-01-25T00:38:48.000Z | lib/python2.7/matplotlib/projections/polar.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | null | null | null | lib/python2.7/matplotlib/projections/polar.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | null | null | null | import math
import warnings
import numpy as np
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.axes import Axes
import matplotlib.axis as maxis
from matplotlib import cbook
from matplotlib import docstring
from matplotlib.patches import Circle
from matplotlib.path import Path
from matplotlib.ticker i... | 35.076216 | 106 | 0.559173 | import math
import warnings
import numpy as np
import matplotlib
rcParams = matplotlib.rcParams
from matplotlib.axes import Axes
import matplotlib.axis as maxis
from matplotlib import cbook
from matplotlib import docstring
from matplotlib.patches import Circle
from matplotlib.path import Path
from matplotlib.ticker i... | true | true |
7906325fff586a997f3830749f9ea02b50c622e1 | 486 | py | Python | www/captions.py | divlv/servicerepo | e46766edadfcbe9cd46df0d07dc86428fcf14a5b | [
"MIT"
] | 1 | 2020-02-22T13:13:36.000Z | 2020-02-22T13:13:36.000Z | www/captions.py | divlv/servicerepo | e46766edadfcbe9cd46df0d07dc86428fcf14a5b | [
"MIT"
] | null | null | null | www/captions.py | divlv/servicerepo | e46766edadfcbe9cd46df0d07dc86428fcf14a5b | [
"MIT"
] | null | null | null | #
# Captions:
#
project_title="Services Repository"
project_owner1=""
project_owner2=""
project_cip="ServiceRepo"
nav_up="To the top"
cap_findsrv="Find service"
cap_findsrv_desc="Find service by JSON key"
cap_findsrvtag_desc="...or by query variable, tag etc."
cap_injson="Incoming JSON"
cap_outjson="Outgoing JSON"
ca... | 16.758621 | 55 | 0.771605 |
project_title="Services Repository"
project_owner1=""
project_owner2=""
project_cip="ServiceRepo"
nav_up="To the top"
cap_findsrv="Find service"
cap_findsrv_desc="Find service by JSON key"
cap_findsrvtag_desc="...or by query variable, tag etc."
cap_injson="Incoming JSON"
cap_outjson="Outgoing JSON"
cap_search_and=... | true | true |
7906340d65e6dcafb6603ae74103b9afcf7f3663 | 384 | py | Python | tests/test_nvl.py | Jhengsh/tidyframe | aa4f8a35cb4abe4d883eb59b6ef6a920580b611f | [
"MIT"
] | null | null | null | tests/test_nvl.py | Jhengsh/tidyframe | aa4f8a35cb4abe4d883eb59b6ef6a920580b611f | [
"MIT"
] | 30 | 2019-01-28T04:07:15.000Z | 2021-10-04T15:06:13.000Z | tests/test_nvl.py | Jhengsh/tidyframe | aa4f8a35cb4abe4d883eb59b6ef6a920580b611f | [
"MIT"
] | null | null | null | import pandas as pd
from tidyframe import nvl
def test_nvl_series():
test_list = [0, 1, None, pd.np.NaN]
test_series = pd.Series(test_list)
nvl(test_series, 10)
def test_nvl_list():
test_list = [0, 1, None, pd.np.NaN]
nvl(test_list, 10)
def test_nvl_int():
nvl(None, 10)
def test_nvl_str(... | 14.769231 | 39 | 0.643229 | import pandas as pd
from tidyframe import nvl
def test_nvl_series():
test_list = [0, 1, None, pd.np.NaN]
test_series = pd.Series(test_list)
nvl(test_series, 10)
def test_nvl_list():
test_list = [0, 1, None, pd.np.NaN]
nvl(test_list, 10)
def test_nvl_int():
nvl(None, 10)
def test_nvl_str(... | true | true |
7906340dc0bd97f7adefe0418f967d9dc8e9a430 | 540 | py | Python | src/mkdv/tools/hdl/hdl_tool.py | fvutils/sim-mk | 271b4374a21785ab1b22fac333e423b5febb6a81 | [
"Apache-2.0"
] | null | null | null | src/mkdv/tools/hdl/hdl_tool.py | fvutils/sim-mk | 271b4374a21785ab1b22fac333e423b5febb6a81 | [
"Apache-2.0"
] | null | null | null | src/mkdv/tools/hdl/hdl_tool.py | fvutils/sim-mk | 271b4374a21785ab1b22fac333e423b5febb6a81 | [
"Apache-2.0"
] | null | null | null | '''
Created on Nov 16, 2021
@author: mballance
'''
from mkdv.tools.hdl.hdl_tool_config import HdlToolConfig
import os
class HdlTool(object):
def config(self, cfg : HdlToolConfig):
raise NotImplementedError("config not implemented for %s" % str(type(self)))
def setup(self, cfg : HdlToolConfig... | 28.421053 | 84 | 0.67963 | from mkdv.tools.hdl.hdl_tool_config import HdlToolConfig
import os
class HdlTool(object):
def config(self, cfg : HdlToolConfig):
raise NotImplementedError("config not implemented for %s" % str(type(self)))
def setup(self, cfg : HdlToolConfig):
raise NotImplementedError("setup not impl... | true | true |
7906368e1d9c659eb0406aa3ca794ff9bb4ab5dc | 1,131 | py | Python | tests/discrete/binomial_test.py | TylerYep/probs | feb46808bd7fe324f78642b581d6117fd6fedca4 | [
"MIT"
] | null | null | null | tests/discrete/binomial_test.py | TylerYep/probs | feb46808bd7fe324f78642b581d6117fd6fedca4 | [
"MIT"
] | null | null | null | tests/discrete/binomial_test.py | TylerYep/probs | feb46808bd7fe324f78642b581d6117fd6fedca4 | [
"MIT"
] | null | null | null | from probs import Binomial
class TestBinomial:
@staticmethod
def test_binomial() -> None:
d = Binomial()
assert d.expectation() == 0
assert d.variance() == 0
# TODO: Python 3.7 implementation differs from 3.8+
# assert P(d == 0) == 1
# assert P(d == 1) == 0
... | 25.704545 | 59 | 0.458002 | from probs import Binomial
class TestBinomial:
@staticmethod
def test_binomial() -> None:
d = Binomial()
assert d.expectation() == 0
assert d.variance() == 0
@st... | true | true |
790636d7bd1cc17e99e9693ac4f2a1d8a4a0f220 | 389 | py | Python | logkit/logkit/asgi.py | zhaheyan/logkit | 6f30a82aa88a5fff3a0b4160374de4482a4f5fb4 | [
"Apache-2.0"
] | null | null | null | logkit/logkit/asgi.py | zhaheyan/logkit | 6f30a82aa88a5fff3a0b4160374de4482a4f5fb4 | [
"Apache-2.0"
] | null | null | null | logkit/logkit/asgi.py | zhaheyan/logkit | 6f30a82aa88a5fff3a0b4160374de4482a4f5fb4 | [
"Apache-2.0"
] | 1 | 2020-03-21T02:16:13.000Z | 2020-03-21T02:16:13.000Z | """
ASGI config for logkit project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'logkit.settings')
application = get_asgi_application()
| true | true |
790636fd3ea0fbc5a98ffb372028f6cb49d267fb | 2,052 | py | Python | src/example_helper.py | ArthurBernard/quant-reseach | 8b6385c7e688f33b6e98d5b470af2cb0c1cafb2c | [
"MIT"
] | null | null | null | src/example_helper.py | ArthurBernard/quant-reseach | 8b6385c7e688f33b6e98d5b470af2cb0c1cafb2c | [
"MIT"
] | null | null | null | src/example_helper.py | ArthurBernard/quant-reseach | 8b6385c7e688f33b6e98d5b470af2cb0c1cafb2c | [
"MIT"
] | null | null | null | import msgpack
import zlib
import numpy as np
import helper_functions as hf
import datetime_helper as dh
def strip_data_by_time(t_data, data, t_min, t_max):
data = np.array([s for s, t in zip(data, t_data) if t >= t_min and t <= t_max])
t_data = np.array([t for t in t_data if t >= t_min and t <= t_max])
return t_da... | 39.461538 | 92 | 0.705653 | import msgpack
import zlib
import numpy as np
import helper_functions as hf
import datetime_helper as dh
def strip_data_by_time(t_data, data, t_min, t_max):
data = np.array([s for s, t in zip(data, t_data) if t >= t_min and t <= t_max])
t_data = np.array([t for t in t_data if t >= t_min and t <= t_max])
return t_da... | true | true |
79063825397602ee85dc1a634bc561da559cd420 | 937 | py | Python | src/Classes/MSDS400/Module 7/polution.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 7/polution.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 7/polution.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | from sympy import symbols, integrate, Rational, lambdify
import matplotlib.pyplot as plt
import numpy as np
# Pollution from a factory is entering a lake. The rate of concentration of the pollutant at time t is given by
t = symbols( 't', positive = True )
dP = 91*t ** Rational( 5, 2 )
# where t is the number of years... | 33.464286 | 132 | 0.708645 | from sympy import symbols, integrate, Rational, lambdify
import matplotlib.pyplot as plt
import numpy as np
t = symbols( 't', positive = True )
dP = 91*t ** Rational( 5, 2 )
P = integrate( dP, ( t, 0, 5 ) ).evalf()
round( P )
g_xlim = [ 1, 10 ]
g_ylim = [ -5, 15 ]
lam_p = lambdify( t, integrate( dP, t ), n... | true | true |
79063838a9fdaec6a3b656af830209367d06537e | 6,096 | py | Python | activation_generator.py | Gareth001/tcav | e391e7682c34933e27bd592106c119317383ef10 | [
"Apache-2.0"
] | null | null | null | activation_generator.py | Gareth001/tcav | e391e7682c34933e27bd592106c119317383ef10 | [
"Apache-2.0"
] | null | null | null | activation_generator.py | Gareth001/tcav | e391e7682c34933e27bd592106c119317383ef10 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 33.494505 | 88 | 0.674869 |
from abc import ABCMeta
from abc import abstractmethod
from multiprocessing import dummy as multiprocessing
import os.path
import numpy as np
import PIL.Image
import tensorflow as tf
class ActivationGeneratorInterface(object):
__metaclass__ = ABCMeta
@abstractmethod
def process_and_load_activations(self, bot... | true | true |
790639972680792d281d3fa1431e804ec104d35f | 1,158 | py | Python | posts/migrations/0001_initial.py | AmrMKayid/django-blog | 09bab49da81800b1605769dd756dcbe2e691ff1e | [
"MIT"
] | null | null | null | posts/migrations/0001_initial.py | AmrMKayid/django-blog | 09bab49da81800b1605769dd756dcbe2e691ff1e | [
"MIT"
] | null | null | null | posts/migrations/0001_initial.py | AmrMKayid/django-blog | 09bab49da81800b1605769dd756dcbe2e691ff1e | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-07-05 16:13
from django.db import migrations, models
import posts.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', ... | 35.090909 | 164 | 0.578584 |
from django.db import migrations, models
import posts.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key... | true | true |
7906399aebd737d245c8c29de5b7cae402ac6e4d | 377 | py | Python | mlbench_core/controlflow/pytorch/__init__.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | mlbench_core/controlflow/pytorch/__init__.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | mlbench_core/controlflow/pytorch/__init__.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | from .checkpoints_evaluation import CheckpointsEvaluationControlFlow
from .controlflow import (
record_train_batch_stats,
record_validation_stats,
validation_round,
)
from .helpers import prepare_batch
__all__ = [
"CheckpointsEvaluationControlFlow",
"record_validation_stats",
"record_train_batc... | 23.5625 | 68 | 0.777188 | from .checkpoints_evaluation import CheckpointsEvaluationControlFlow
from .controlflow import (
record_train_batch_stats,
record_validation_stats,
validation_round,
)
from .helpers import prepare_batch
__all__ = [
"CheckpointsEvaluationControlFlow",
"record_validation_stats",
"record_train_batc... | true | true |
79063a6a2c9a0a173bbd60d73d5c82033ab1c010 | 6,067 | py | Python | xfaster/spec_tools.py | SPIDER-CMB/xfaster | 1b8e56d775f2c3a8693d1372ae461392c21da7ca | [
"MIT"
] | 1 | 2021-03-25T14:15:44.000Z | 2021-03-25T14:15:44.000Z | xfaster/spec_tools.py | annegambrel/xfaster | 03d5a2971d3cc19ae360d78995e3575f3f678d6e | [
"MIT"
] | 7 | 2021-04-20T23:34:38.000Z | 2021-08-24T00:00:53.000Z | xfaster/spec_tools.py | SPIDER-CMB/xfaster | 1b8e56d775f2c3a8693d1372ae461392c21da7ca | [
"MIT"
] | 1 | 2021-05-18T16:43:54.000Z | 2021-05-18T16:43:54.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
__all__ = [
"wigner3j",
"get_camb_cl",
"scale_dust",
]
def blackbody(nu, ref_freq=353.0):
"""
The ratio of the blackbody function for dust at frequency nu
over the v... | 27.577273 | 83 | 0.60656 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
__all__ = [
"wigner3j",
"get_camb_cl",
"scale_dust",
]
def blackbody(nu, ref_freq=353.0):
k = 1.38064852e-23
h = 6.626070040e-34
T = 19.6
nu_ref = ref_freq *... | true | true |
79063bc3575f6f0e9e00ae7a9cc592d7d8155cf9 | 1,364 | py | Python | Controller-Implementation/libs/core/SwitchConnection.py | qcz994/p4-bier | 38d28a58d40a16d9c3aaabd4a37a61404705d0dd | [
"Apache-2.0"
] | 11 | 2019-04-16T11:23:37.000Z | 2021-05-28T14:56:25.000Z | Controller-Implementation/libs/core/SwitchConnection.py | qcz994/p4-bier | 38d28a58d40a16d9c3aaabd4a37a61404705d0dd | [
"Apache-2.0"
] | null | null | null | Controller-Implementation/libs/core/SwitchConnection.py | qcz994/p4-bier | 38d28a58d40a16d9c3aaabd4a37a61404705d0dd | [
"Apache-2.0"
] | 2 | 2020-10-28T03:23:49.000Z | 2021-09-04T06:47:42.000Z | import grpc
import threading
import proto.connection_pb2_grpc
from libs.core.Log import Log
from libs.core.Switch import Switch
from libs.core.Event import Event
from libs.Configuration import Configuration
class SwitchConnection:
def __init__(self, grpc_address=None):
self.channel = grpc.insecure_channe... | 34.974359 | 158 | 0.674487 | import grpc
import threading
import proto.connection_pb2_grpc
from libs.core.Log import Log
from libs.core.Switch import Switch
from libs.core.Event import Event
from libs.Configuration import Configuration
class SwitchConnection:
def __init__(self, grpc_address=None):
self.channel = grpc.insecure_channe... | true | true |
79063c15265324d68540db88b7769a66ef94a146 | 486 | py | Python | pysimplegui/values_from_some_elements.py | CrazyJ36/python | 4cff6e7240672a273d978521bb511065f45d4312 | [
"MIT"
] | null | null | null | pysimplegui/values_from_some_elements.py | CrazyJ36/python | 4cff6e7240672a273d978521bb511065f45d4312 | [
"MIT"
] | null | null | null | pysimplegui/values_from_some_elements.py | CrazyJ36/python | 4cff6e7240672a273d978521bb511065f45d4312 | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
layout = [
[sg.Text('text')],
[sg.Input('input', key= 'input1')],
[sg.Input('input', key='input2')],
[sg.Button('button', key='button1')]
]
window = sg.Window('list values - list or dict', layout)
while True:
event, values = window.Read()
if event == 'button1':
print(values[... | 18 | 58 | 0.627572 | import PySimpleGUI as sg
layout = [
[sg.Text('text')],
[sg.Input('input', key= 'input1')],
[sg.Input('input', key='input2')],
[sg.Button('button', key='button1')]
]
window = sg.Window('list values - list or dict', layout)
while True:
event, values = window.Read()
if event == 'button1':
print(values[... | true | true |
79063cd16685cd58176874482bf9832e97c1beeb | 198 | py | Python | topCoder/srms/500s/srm509/div2/palindromizeation_div_2.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/500s/srm509/div2/palindromizeation_div_2.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/500s/srm509/div2/palindromizeation_div_2.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | class PalindromizationDiv2:
def getMinimumCost(self, X):
def p(n):
s = str(n)
return s == s[::-1]
return next(i for i in xrange(X+1) if p(X+i) or p(X-i))
| 28.285714 | 63 | 0.510101 | class PalindromizationDiv2:
def getMinimumCost(self, X):
def p(n):
s = str(n)
return s == s[::-1]
return next(i for i in xrange(X+1) if p(X+i) or p(X-i))
| true | true |
79063d3c1c520a30d84ac76b8b18f780c167d3ec | 541 | py | Python | ansible/tests/TestIncompleteConditional.py | SODALITE-EU/defect-prediction | 0d53f04a4572b3555bb87a223dbfedf06ec5bd09 | [
"Apache-2.0"
] | 2 | 2020-11-27T07:18:42.000Z | 2021-03-25T14:12:25.000Z | ansible/tests/TestIncompleteConditional.py | SODALITE-EU/defect-prediction | 0d53f04a4572b3555bb87a223dbfedf06ec5bd09 | [
"Apache-2.0"
] | 3 | 2020-11-23T16:37:29.000Z | 2021-09-12T20:56:15.000Z | ansible/tests/TestIncompleteConditional.py | SODALITE-EU/defect-prediction | 0d53f04a4572b3555bb87a223dbfedf06ec5bd09 | [
"Apache-2.0"
] | 1 | 2020-02-09T11:31:56.000Z | 2020-02-09T11:31:56.000Z | import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.runner import Runner
from ansiblelints.stage.IncompleteConditional import IncompleteConditional
class TestIncompleteConditional(unittest.TestCase):
collection = RulesCollection()
def setUp(self):
self.collection.register... | 27.05 | 74 | 0.770795 | import unittest
from ansiblelint.rules import RulesCollection
from ansiblelint.runner import Runner
from ansiblelints.stage.IncompleteConditional import IncompleteConditional
class TestIncompleteConditional(unittest.TestCase):
collection = RulesCollection()
def setUp(self):
self.collection.register... | true | true |
79063d731fe4afc084efefc90254d9062d43347c | 11,703 | py | Python | src/secondaires/navigation/equipage/objectifs/rejoindre.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/equipage/objectifs/rejoindre.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/equipage/objectifs/rejoindre.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2014 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | 36.12037 | 79 | 0.608989 |
from math import fabs, radians, sqrt
from vector import Vector
from primaires.vehicule.vecteur import Vecteur
from secondaires.navigation.constantes import *
from secondaires.navigation.equipage.objectif import Objectif
class Rejoindre(Objectif):
def __init__(self, equipage, x=No... | true | true |
79063e026dbd8ff02b4d2b9728c64b760a739851 | 1,182 | py | Python | test/functional/rpc_generate.py | hhhogannwo/bitcoin | cb81907eb1e5a87669a8244d8657041aa8456328 | [
"MIT"
] | null | null | null | test/functional/rpc_generate.py | hhhogannwo/bitcoin | cb81907eb1e5a87669a8244d8657041aa8456328 | [
"MIT"
] | null | null | null | test/functional/rpc_generate.py | hhhogannwo/bitcoin | cb81907eb1e5a87669a8244d8657041aa8456328 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test generate RPC."""
from test_framework.test_framework import MAGATestFramework
from test_framework.util ... | 31.945946 | 95 | 0.690355 |
from test_framework.test_framework import MAGATestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
class RPCGenerateTest(MAGATestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
message = (
"generate\n"
... | true | true |
79063e1c7b5d581ba648e7e5d23b27c3fe2cf71f | 542 | py | Python | rateMyProf/manage.py | DefCon-007/rateMyProfessor | 78a4a336136f3c5675a13b80b95963dbfdf2e88d | [
"MIT"
] | 10 | 2018-12-30T15:44:59.000Z | 2021-01-19T20:24:11.000Z | rateMyProf/manage.py | DefCon-007/rateMyProfessor | 78a4a336136f3c5675a13b80b95963dbfdf2e88d | [
"MIT"
] | 6 | 2020-02-11T23:40:43.000Z | 2021-06-10T21:13:42.000Z | rateMyProf/manage.py | DefCon-007/rateMyProfessor | 78a4a336136f3c5675a13b80b95963dbfdf2e88d | [
"MIT"
] | 2 | 2018-12-31T15:47:43.000Z | 2019-10-04T11:51:26.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rateMyProf.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. A... | 33.875 | 74 | 0.688192 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'rateMyProf.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's inst... | true | true |
79063fa907026da92f56074f756cdf53977749be | 3,976 | py | Python | app/recipe/tests/test_tags_api.py | deborahoni/recipe-app-api | da0051515f5cf05f48ca61366923cb11fb8a2ce0 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | deborahoni/recipe-app-api | da0051515f5cf05f48ca61366923cb11fb8a2ce0 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | deborahoni/recipe-app-api | da0051515f5cf05f48ca61366923cb11fb8a2ce0 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag,Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class P... | 31.555556 | 71 | 0.629527 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag,Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class P... | true | true |
79063fc4091307d7ca99586e5e73c511ea517bf9 | 10,262 | py | Python | app.py | NazarenoCavazzon/EuroPriceAPI | 9be4d4e0229260e662281bf01e45f512a6f97d5f | [
"MIT"
] | 1 | 2021-06-30T01:46:20.000Z | 2021-06-30T01:46:20.000Z | app.py | NazarenoCavazzon/BlueAPI | 9be4d4e0229260e662281bf01e45f512a6f97d5f | [
"MIT"
] | 1 | 2021-07-01T01:48:31.000Z | 2021-07-01T01:48:31.000Z | app.py | NazarenoCavazzon/BlueAPI | 9be4d4e0229260e662281bf01e45f512a6f97d5f | [
"MIT"
] | 1 | 2021-06-30T01:47:13.000Z | 2021-06-30T01:47:13.000Z | import os
import codecs
from busSchedules import schedule1B
from busSchedules import schedule2
from busSchedules import schedule3
from busSchedules import schedule4
from busSchedules import schedule5
from busSchedules import schedule6
from busZonesTimes import busZonesTimesOne
from busZonesTimes import busZone... | 29.153409 | 145 | 0.693432 | import os
import codecs
from busSchedules import schedule1B
from busSchedules import schedule2
from busSchedules import schedule3
from busSchedules import schedule4
from busSchedules import schedule5
from busSchedules import schedule6
from busZonesTimes import busZonesTimesOne
from busZonesTimes import busZone... | true | true |
7906402d8b6164a6553114659c0ac051616ffcf6 | 969 | py | Python | AdventOfCode/Day24.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | AdventOfCode/Day24.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | AdventOfCode/Day24.py | JanStoltman/100DaysOfCode | 1d18b76ed1e3e942e8392006a5d4bfb41484d047 | [
"MIT"
] | null | null | null | from Tree import TreeNode
def zdir(root):
if root[0] == 0:
return 0 #left
elif root[1] ==0:
return 1 #right
else:
return 2 #nothing
def add_nodes(root, nodes):
for i in range(0,len(nodes)):
if nodes[i][0] == root.gfv():
root.addChild(add_nodes(TreeNode(nodes[i], 0), nodes[0:i] + nodes[i+1:]))
eli... | 23.634146 | 90 | 0.593395 | from Tree import TreeNode
def zdir(root):
if root[0] == 0:
return 0
elif root[1] ==0:
return 1
else:
return 2
def add_nodes(root, nodes):
for i in range(0,len(nodes)):
if nodes[i][0] == root.gfv():
root.addChild(add_nodes(TreeNode(nodes[i], 0), nodes[0:i] + nodes[i+1:]))
elif nodes[i][1] == ro... | false | true |
7906405ca6b73f3096cb749f8b7799c56afd83f5 | 1,194 | py | Python | azure-mgmt-web/azure/mgmt/web/models/resource_metric_name.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/web/models/resource_metric_name.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure/mgmt/web/models/resource_metric_name.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 29.85 | 76 | 0.579564 |
from msrest.serialization import Model
class ResourceMetricName(Model):
_validation = {
'value': {'readonly': True},
'localized_value': {'readonly': True},
}
_attribute_map = {
'value': {'key': 'value', 'type': 'str'},
'localized_value': {'key': 'localizedValue... | true | true |
790640758e1e32a9bff9aff50842c2b0edfa79dd | 6,688 | py | Python | rasa_core/policies/keras_policy.py | KeshavInamdar/rasa_core | 432638e9df53e2b5d68771ea5cf6af6ef1ac6b72 | [
"Apache-2.0"
] | 1 | 2018-07-03T16:04:17.000Z | 2018-07-03T16:04:17.000Z | rasa_core/policies/keras_policy.py | KeshavInamdar/rasa_core | 432638e9df53e2b5d68771ea5cf6af6ef1ac6b72 | [
"Apache-2.0"
] | null | null | null | rasa_core/policies/keras_policy.py | KeshavInamdar/rasa_core | 432638e9df53e2b5d68771ea5cf6af6ef1ac6b72 | [
"Apache-2.0"
] | 2 | 2019-02-18T07:38:26.000Z | 2021-07-17T16:24:03.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import warnings
from builtins import str
from typing import Any
from rasa_core import utils
from rasa_core.domain import ... | 37.363128 | 77 | 0.612141 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import warnings
from builtins import str
from typing import Any
from rasa_core import utils
from rasa_core.domain import ... | true | true |
790640dc9d95970eb4f04f76846efe08f0aca2b9 | 6,347 | py | Python | pixiedust/display/chart/renderers/commonOptions.py | elgalu/pixiedust | e98b91b6ae5a974cbcda985fa305d0cb25b88ba0 | [
"Apache-2.0"
] | null | null | null | pixiedust/display/chart/renderers/commonOptions.py | elgalu/pixiedust | e98b91b6ae5a974cbcda985fa305d0cb25b88ba0 | [
"Apache-2.0"
] | null | null | null | pixiedust/display/chart/renderers/commonOptions.py | elgalu/pixiedust | e98b91b6ae5a974cbcda985fa305d0cb25b88ba0 | [
"Apache-2.0"
] | 1 | 2018-04-13T18:25:52.000Z | 2018-04-13T18:25:52.000Z | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | 31.26601 | 169 | 0.540728 |
import math
import numpy
import pixiedust
myLogger = pixiedust.getLogger(__name__)
def append(displayObject, arr, option):
if option is not None and displayObject.acceptOption(option["name"]):
arr.append(option)
def chartSize():
return {
'name': 'chartsize',
'descriptio... | true | true |
79064114e4ebf50fb5a7286102992e3f802b6549 | 1,293 | py | Python | tools/tags/storage.py | polaretto/topocity | a0b2f2f0f2d109bc7ffdf5b1f6b9367cf7b11fbe | [
"Unlicense"
] | 3 | 2019-09-18T12:17:37.000Z | 2020-11-26T13:42:07.000Z | tools/tags/storage.py | ennioVisco/topocity | a0b2f2f0f2d109bc7ffdf5b1f6b9367cf7b11fbe | [
"Unlicense"
] | null | null | null | tools/tags/storage.py | ennioVisco/topocity | a0b2f2f0f2d109bc7ffdf5b1f6b9367cf7b11fbe | [
"Unlicense"
] | null | null | null | import sys
from os import listdir
from os.path import isfile, join, dirname, realpath
import struct
import gzip
def list_dir(d):
return [f for f in listdir(d) if isfile(join(d, f))]
def store(p, file):
try:
output_file = open(p, "w", encoding="utf-8", errors="xmlcharrefreplace")
output_file.... | 23.089286 | 80 | 0.595514 | import sys
from os import listdir
from os.path import isfile, join, dirname, realpath
import struct
import gzip
def list_dir(d):
return [f for f in listdir(d) if isfile(join(d, f))]
def store(p, file):
try:
output_file = open(p, "w", encoding="utf-8", errors="xmlcharrefreplace")
output_file.... | true | true |
7906412b9fa10fe80d8adb057a6cd4ac7eb08bdf | 3,387 | py | Python | tests/providers/amazon/aws/hooks/test_cloud_formation.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 4 | 2020-02-16T18:13:54.000Z | 2021-01-01T03:22:19.000Z | tests/providers/amazon/aws/hooks/test_cloud_formation.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 20 | 2021-01-23T12:33:08.000Z | 2021-12-07T22:30:37.000Z | tests/providers/amazon/aws/hooks/test_cloud_formation.py | daemon-demon/airflow | 6f96e81f0123b30750fb68ec496246023bf63f35 | [
"Apache-2.0"
] | 2 | 2020-10-23T18:55:05.000Z | 2022-02-16T21:53:10.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 38.05618 | 110 | 0.708001 |
import json
import unittest
from airflow.providers.amazon.aws.hooks.cloud_formation import AWSCloudFormationHook
try:
from moto import mock_cloudformation
except ImportError:
mock_cloudformation = None
@unittest.skipIf(mock_cloudformation is None, 'moto package not present')
class TestAWSC... | true | true |
7906416b851a8d07e9cbc674852b1cde9e66fe35 | 680 | py | Python | manage.py | eferos93/ODMC_exam_implementation | 14fd113b00dc45d2b99b2a83c662d6a70171b5e5 | [
"CC-BY-4.0"
] | null | null | null | manage.py | eferos93/ODMC_exam_implementation | 14fd113b00dc45d2b99b2a83c662d6a70171b5e5 | [
"CC-BY-4.0"
] | null | null | null | manage.py | eferos93/ODMC_exam_implementation | 14fd113b00dc45d2b99b2a83c662d6a70171b5e5 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ODMC_exam_implementation.settings')
try:
from django.core.management import execute_from_command_lin... | 29.565217 | 88 | 0.686765 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ODMC_exam_implementation.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's inst... | true | true |
790641e28b00c1411b38806eeef70efe573c3db3 | 2,657 | py | Python | weights.py | FireRedz/HFR-Resampler | 1246e40c836f2e6e5cb0cf1aeaafd03bc7bf5d48 | [
"MIT"
] | null | null | null | weights.py | FireRedz/HFR-Resampler | 1246e40c836f2e6e5cb0cf1aeaafd03bc7bf5d48 | [
"MIT"
] | null | null | null | weights.py | FireRedz/HFR-Resampler | 1246e40c836f2e6e5cb0cf1aeaafd03bc7bf5d48 | [
"MIT"
] | null | null | null | import math
import numpy as np
from enum import IntEnum
class Mode(IntEnum):
CUSTOM = 0
EQUAL = 1
GAUSS = 2
GAUSS_SYM = 3
PYRAMID = 4
PYRAMID_SYM = 5
SIVEROO_1 = 6
SIVEROO_2 = 7
#This function will return an list of value, like... | 27.968421 | 96 | 0.515995 | import math
import numpy as np
from enum import IntEnum
class Mode(IntEnum):
CUSTOM = 0
EQUAL = 1
GAUSS = 2
GAUSS_SYM = 3
PYRAMID = 4
PYRAMID_SYM = 5
SIVEROO_1 = 6
SIVEROO_2 = 7
def scaleRange(n: int, a: int, b: int):
ret... | true | true |
790641fac07b70ce14f042decb16966503edbc03 | 19,826 | py | Python | google/ads/googleads/v10/services/services/feed_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/services/services/feed_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v10/services/services/feed_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 40.96281 | 107 | 0.632705 |
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth... | true | true |
7906447f2dbea215a62effae1c0161bccfc62e6a | 538 | py | Python | LeetcodeAlgorithms/116. Populating Next Right Pointers in Each Node/populating-next-right-pointers-in-each-node.py | Fenghuapiao/PyLeetcode | d804a62643fe935eb61808196a2c093ea9583654 | [
"MIT"
] | 3 | 2019-08-20T06:54:38.000Z | 2022-01-07T12:56:46.000Z | LeetcodeAlgorithms/116. Populating Next Right Pointers in Each Node/populating-next-right-pointers-in-each-node.py | Fenghuapiao/PyLeetcode | d804a62643fe935eb61808196a2c093ea9583654 | [
"MIT"
] | null | null | null | LeetcodeAlgorithms/116. Populating Next Right Pointers in Each Node/populating-next-right-pointers-in-each-node.py | Fenghuapiao/PyLeetcode | d804a62643fe935eb61808196a2c093ea9583654 | [
"MIT"
] | 2 | 2018-06-07T02:56:39.000Z | 2018-08-01T15:27:55.000Z | # Definition for binary tree with next pointer.
# class TreeLinkNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# self.next = None
class Solution:
# @param root, a tree link node
# @return nothing
def connect(self, root):
... | 33.625 | 70 | 0.585502 |
class Solution:
def connect(self, root):
if root and root.left and root.right:
root.left.next = root.right
root.right.next = root.next and root.next.left
return self.connect(root.left) or self.connect(root.right) | true | true |
790644a1ad87fae9a4d2498a6d2cad85fa73d67d | 869 | py | Python | tests_python/tests/test_many_bakers.py | noclouds/tezos-master | 6c31af7ab3ea782f89f988e389e9b0860207a8d6 | [
"MIT"
] | null | null | null | tests_python/tests/test_many_bakers.py | noclouds/tezos-master | 6c31af7ab3ea782f89f988e389e9b0860207a8d6 | [
"MIT"
] | null | null | null | tests_python/tests/test_many_bakers.py | noclouds/tezos-master | 6c31af7ab3ea782f89f988e389e9b0860207a8d6 | [
"MIT"
] | 1 | 2021-06-04T09:31:48.000Z | 2021-06-04T09:31:48.000Z | import time
import pytest
from tools import utils, constants
PARAMS = ['--connections', '500']
# TODO parameterize test
@pytest.mark.baker
@pytest.mark.multinode
@pytest.mark.slow
@pytest.mark.incremental
class TestManyBakers:
"""Run 5 bakers and num nodes, wait and check logs"""
def test_init(self, sandb... | 24.828571 | 60 | 0.638665 | import time
import pytest
from tools import utils, constants
PARAMS = ['--connections', '500']
@pytest.mark.baker
@pytest.mark.multinode
@pytest.mark.slow
@pytest.mark.incremental
class TestManyBakers:
def test_init(self, sandbox):
for i in range(10):
sandbox.add_node(i, params=PARAMS)
... | true | true |
79064628611c6e9502d07eef23a9c0d64f14b2fc | 315 | py | Python | Chapter10/default_dict_list_of_tuples.py | LuisPereda/Learning_Python | e89e69346c5584be10d991010f39b59329793ba5 | [
"MIT"
] | null | null | null | Chapter10/default_dict_list_of_tuples.py | LuisPereda/Learning_Python | e89e69346c5584be10d991010f39b59329793ba5 | [
"MIT"
] | null | null | null | Chapter10/default_dict_list_of_tuples.py | LuisPereda/Learning_Python | e89e69346c5584be10d991010f39b59329793ba5 | [
"MIT"
] | null | null | null | from collections import defaultdict
game = defaultdict(list)
tuple_list_county = [('US', 'Visconsin'), ('Germany', 'Bavaria'), ('UK', 'Bradfordshire'), ('India', 'punjab'), ('China', 'Shandong'), ('Canada', 'Nova Scotia')]
print game["any_value"]
for k,v in tuple_list_county:
game[k].append(v)
print game | 26.25 | 162 | 0.669841 | from collections import defaultdict
game = defaultdict(list)
tuple_list_county = [('US', 'Visconsin'), ('Germany', 'Bavaria'), ('UK', 'Bradfordshire'), ('India', 'punjab'), ('China', 'Shandong'), ('Canada', 'Nova Scotia')]
print game["any_value"]
for k,v in tuple_list_county:
game[k].append(v)
print game | false | true |
79064688870260d6a5b4eb36b1cf009bb9eb49b9 | 12,593 | py | Python | splunk_eventgen/splunk_app/lib/mod_input/fields.py | technimad/eventgen | f33c07227182603d532db065a917a8faba1f01c9 | [
"Apache-2.0"
] | null | null | null | splunk_eventgen/splunk_app/lib/mod_input/fields.py | technimad/eventgen | f33c07227182603d532db065a917a8faba1f01c9 | [
"Apache-2.0"
] | 5 | 2021-03-31T20:15:06.000Z | 2022-02-26T10:40:39.000Z | splunk_eventgen/splunk_app/lib/mod_input/fields.py | technimad/eventgen | f33c07227182603d532db065a917a8faba1f01c9 | [
"Apache-2.0"
] | null | null | null | import json
import re
class FieldValidationException(Exception):
pass
class Field(object):
"""
This is the base class that should be used to create field validators. Sub-class this and override to_python if you
need custom validation.
"""
DATA_TYPE_STRING = 'string'
DATA_TYPE_NUMBER = '... | 28.426637 | 120 | 0.58334 | import json
import re
class FieldValidationException(Exception):
pass
class Field(object):
DATA_TYPE_STRING = 'string'
DATA_TYPE_NUMBER = 'number'
DATA_TYPE_BOOLEAN = 'boolean'
def get_data_type(self):
return Field.DATA_TYPE_STRING
def __init__(self, name, title, description, req... | true | true |
790647080e90218c847c23aa214848a351882c4a | 326 | py | Python | simple_task_python/rename.py | sagorbrur/sagorbrur.github.io | 4e510029a9d56754a80dfc897cf477e62a530c01 | [
"CC0-1.0"
] | null | null | null | simple_task_python/rename.py | sagorbrur/sagorbrur.github.io | 4e510029a9d56754a80dfc897cf477e62a530c01 | [
"CC0-1.0"
] | null | null | null | simple_task_python/rename.py | sagorbrur/sagorbrur.github.io | 4e510029a9d56754a80dfc897cf477e62a530c01 | [
"CC0-1.0"
] | null | null | null | # a simple script to rename multiple files
import os
import re
path = 'myimages/'
files = os.listdir(path)
files.sort(key=lambda var:[int(x) if x.isdigit() else x for x in re.findall(r'[^0-9]|[0-9]+', var)])
for i, file in enumerate(files):
os.rename(path + file, path + "rename_{}".format(i)+".jpg")
print('do... | 27.166667 | 100 | 0.653374 |
import os
import re
path = 'myimages/'
files = os.listdir(path)
files.sort(key=lambda var:[int(x) if x.isdigit() else x for x in re.findall(r'[^0-9]|[0-9]+', var)])
for i, file in enumerate(files):
os.rename(path + file, path + "rename_{}".format(i)+".jpg")
print('done!')
| true | true |
79064728f1c2ca0961b36d99d98adda990fc58fc | 16,175 | py | Python | eval.py | FLyingLSJ/ssd.pytorch | 9caca0788f0bebab345f969a7d3c1f8b2081b809 | [
"MIT"
] | 1 | 2020-07-09T12:56:20.000Z | 2020-07-09T12:56:20.000Z | eval.py | FLyingLSJ/ssd.pytorch | 9caca0788f0bebab345f969a7d3c1f8b2081b809 | [
"MIT"
] | null | null | null | eval.py | FLyingLSJ/ssd.pytorch | 9caca0788f0bebab345f969a7d3c1f8b2081b809 | [
"MIT"
] | null | null | null | """Adapted from:
@longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch
@rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn
Licensed under The MIT License [see LICENSE for details]
"""
from __future__ import print_function
import torch
import torch.nn as nn
import to... | 36.43018 | 109 | 0.563277 |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
from data import VOC_ROOT, VOCAnnotationTransform, VOCDetection, BaseTransform
from data import VOC_CLASSES as labelmap
import torch.utils.data as data
from ssd import buil... | true | true |
7906473a9cd846f2a116b74c8b89d57712d64dc9 | 759 | py | Python | setup.py | aroberge/nonstandard | b415e4b5360a44ee2e1927a2b5b45c4d74ca9803 | [
"MIT"
] | 2 | 2017-04-30T23:27:06.000Z | 2017-05-01T18:30:54.000Z | setup.py | aroberge/nonstandard | b415e4b5360a44ee2e1927a2b5b45c4d74ca9803 | [
"MIT"
] | null | null | null | setup.py | aroberge/nonstandard | b415e4b5360a44ee2e1927a2b5b45c4d74ca9803 | [
"MIT"
] | null | null | null | #pylint: skip-file
from setuptools import setup, find_packages
from pypandoc import convert
def convert_md(filename):
return convert(filename, 'rst')
setup(name='nonstandard',
version='0.9.3',
description="Obsolete; see package *experimental*.",
long_description = convert_md('README.md'),
classi... | 29.192308 | 63 | 0.661397 |
from setuptools import setup, find_packages
from pypandoc import convert
def convert_md(filename):
return convert(filename, 'rst')
setup(name='nonstandard',
version='0.9.3',
description="Obsolete; see package *experimental*.",
long_description = convert_md('README.md'),
classifiers=[
'D... | true | true |
79064849dfdc57c635437ee4fce0592a06c34f62 | 9,993 | py | Python | torchvision/models/densenet.py | NunoEdgarGFlowHub/vision | 86001a871d3335046e2dca7715d9babf73e6956f | [
"BSD-3-Clause"
] | 19 | 2018-10-30T22:24:54.000Z | 2022-01-11T05:14:38.000Z | torchvision/models/densenet.py | NunoEdgarGFlowHub/vision | 86001a871d3335046e2dca7715d9babf73e6956f | [
"BSD-3-Clause"
] | 4 | 2018-11-21T06:09:13.000Z | 2019-04-14T15:09:37.000Z | torchvision/models/densenet.py | NunoEdgarGFlowHub/vision | 86001a871d3335046e2dca7715d9babf73e6956f | [
"BSD-3-Clause"
] | 4 | 2018-11-06T00:31:25.000Z | 2021-01-30T12:37:35.000Z | import re
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
__all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161']
model_urls = {
'densenet121': 'https://download.pytorch.org/models/densenet... | 44.216814 | 109 | 0.625638 | import re
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from collections import OrderedDict
__all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161']
model_urls = {
'densenet121': 'https://download.pytorch.org/models/densenet... | true | true |
79064a24a2f2ea1b8ed6da5d1f4966737bba642e | 1,871 | py | Python | examples/archive_experiments.py | Honzys/clearml-agent | f58071fc74e2df9bdba8ca91569e0bfd70ad4f46 | [
"Apache-2.0"
] | 112 | 2019-10-29T10:36:20.000Z | 2020-12-19T08:08:27.000Z | examples/archive_experiments.py | Honzys/clearml-agent | f58071fc74e2df9bdba8ca91569e0bfd70ad4f46 | [
"Apache-2.0"
] | 53 | 2020-12-29T07:52:40.000Z | 2022-03-31T10:11:54.000Z | examples/archive_experiments.py | Honzys/clearml-agent | f58071fc74e2df9bdba8ca91569e0bfd70ad4f46 | [
"Apache-2.0"
] | 29 | 2019-10-29T13:06:29.000Z | 2020-12-19T08:09:24.000Z | #!/usr/bin/python3
"""
An example script that cleans up failed experiments by moving them to the archive
"""
import argparse
from datetime import datetime
from clearml_agent import APIClient
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--project", "-P", help="Project ID. Only clean up ex... | 31.183333 | 105 | 0.676644 |
import argparse
from datetime import datetime
from clearml_agent import APIClient
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--project", "-P", help="Project ID. Only clean up experiments from this project")
parser.add_argument("--user", "-U", help="User ID. Only clean up experiments a... | true | true |
79064b1fe249f52e1762ce79eb150d0770eeded4 | 2,386 | py | Python | demo/demoproject/settings.py | atharvapj/django-webcam | a24ad4453cb55afe7f60729765b6601c11682d5a | [
"BSD-1-Clause"
] | 11 | 2015-01-09T16:46:04.000Z | 2021-02-12T17:45:15.000Z | demo/demoproject/settings.py | atharvapj/django-webcam | a24ad4453cb55afe7f60729765b6601c11682d5a | [
"BSD-1-Clause"
] | 1 | 2017-01-17T04:11:53.000Z | 2017-07-16T01:06:29.000Z | demo/demoproject/settings.py | atharvapj/django-webcam | a24ad4453cb55afe7f60729765b6601c11682d5a | [
"BSD-1-Clause"
] | 24 | 2015-08-18T16:55:28.000Z | 2020-10-01T17:53:06.000Z | import os
HERE = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'webcam_test.sqlite',
}
}
ALLOWED_HOSTS = []
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1... | 25.115789 | 75 | 0.657167 | import os
HERE = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = ()
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'webcam_test.sqlite',
}
}
ALLOWED_HOSTS = []
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1... | true | true |
79064b5bb5deec657dfe19a602df8c39e5f4df11 | 3,039 | py | Python | ambari-agent/src/main/python/ambari_agent/Heartbeat.py | zhanganha/ambari | c99dbff12a6b180c74f14e2fda06a204181e6e2c | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/Heartbeat.py | zhanganha/ambari | c99dbff12a6b180c74f14e2fda06a204181e6e2c | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/main/python/ambari_agent/Heartbeat.py | zhanganha/ambari | c99dbff12a6b180c74f14e2fda06a204181e6e2c | [
"Apache-2.0"
] | 2 | 2020-11-04T06:30:31.000Z | 2020-11-06T11:02:33.000Z | #!/usr/bin/env python2.6
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"Licens... | 33.395604 | 81 | 0.676867 |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use thi... | false | true |
79064d978e8556f453a514dbe1eca9b9bc5463b1 | 1,228 | bzl | Python | src/third_party/mtools/mtools_repositories.bzl | rkolchmeyer/cos-customizer | 57712f0f5b4bfdbce8d4b8aac3e9e1a685e531d3 | [
"Apache-2.0"
] | 39 | 2019-04-01T18:00:44.000Z | 2021-10-09T00:40:49.000Z | src/third_party/mtools/mtools_repositories.bzl | rkolchmeyer/cos-customizer | 57712f0f5b4bfdbce8d4b8aac3e9e1a685e531d3 | [
"Apache-2.0"
] | 24 | 2019-04-02T22:45:14.000Z | 2021-08-16T09:25:22.000Z | src/third_party/mtools/mtools_repositories.bzl | rkolchmeyer/cos-customizer | 57712f0f5b4bfdbce8d4b8aac3e9e1a685e531d3 | [
"Apache-2.0"
] | 18 | 2019-05-07T22:24:27.000Z | 2021-07-30T00:56:35.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 38.375 | 85 | 0.699511 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def mtools_repositories():
maybe(
http_archive,
name = "mtools",
build_file = Label("//src/third_party/mtools:BUILD.mtools.bazel"),
stri... | true | true |
79064df0e2e2cd614f0700ccfc7fabd3de24ae63 | 288 | py | Python | onepanman_api/admin/code.py | Capstone-onepanman/api-server | 1a5174fbc441d2718f3963863590f634ba2014e1 | [
"MIT"
] | null | null | null | onepanman_api/admin/code.py | Capstone-onepanman/api-server | 1a5174fbc441d2718f3963863590f634ba2014e1 | [
"MIT"
] | 12 | 2020-03-24T18:09:30.000Z | 2022-03-12T00:15:07.000Z | onepanman_api/admin/code.py | Capstone-onepanman/api-server | 1a5174fbc441d2718f3963863590f634ba2014e1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .. import models
@admin.register(models.Code)
class CodeAdmin(admin.ModelAdmin):
"""
코드 정보
"""
list_display = ['id', 'author', 'problem', 'language', 'name', 'available_game', 'date' ]
class Meta:
model = models.Code
| 18 | 93 | 0.628472 | from django.contrib import admin
from .. import models
@admin.register(models.Code)
class CodeAdmin(admin.ModelAdmin):
list_display = ['id', 'author', 'problem', 'language', 'name', 'available_game', 'date' ]
class Meta:
model = models.Code
| true | true |
79064e0dd9a36aac9346be63f116f0bfd30fa81a | 6,592 | py | Python | netbox/secrets/forms.py | Megzo/netbox | f8a21da9f034b31d7b91587cc6a295bbc4d9edea | [
"Apache-2.0"
] | null | null | null | netbox/secrets/forms.py | Megzo/netbox | f8a21da9f034b31d7b91587cc6a295bbc4d9edea | [
"Apache-2.0"
] | null | null | null | netbox/secrets/forms.py | Megzo/netbox | f8a21da9f034b31d7b91587cc6a295bbc4d9edea | [
"Apache-2.0"
] | null | null | null | from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from django import forms
from taggit.forms import TagField
from dcim.models import Device
from extras.forms import (
AddRemoveTagsForm, CustomFieldBulkEditForm, CustomFieldFilterForm, CustomFieldModelForm, CustomFieldModelCSVForm,
)
from utiliti... | 27.932203 | 134 | 0.622118 | from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from django import forms
from taggit.forms import TagField
from dcim.models import Device
from extras.forms import (
AddRemoveTagsForm, CustomFieldBulkEditForm, CustomFieldFilterForm, CustomFieldModelForm, CustomFieldModelCSVForm,
)
from utiliti... | true | true |
79064e6afedde8610b1ef693125b360838dd1d59 | 20,897 | py | Python | pygbif/occurrences/search.py | livatras/pygbif | ede8a66e824f030c13b6e9feaeb8f25c9e6ef923 | [
"MIT"
] | null | null | null | pygbif/occurrences/search.py | livatras/pygbif | ede8a66e824f030c13b6e9feaeb8f25c9e6ef923 | [
"MIT"
] | null | null | null | pygbif/occurrences/search.py | livatras/pygbif | ede8a66e824f030c13b6e9feaeb8f25c9e6ef923 | [
"MIT"
] | null | null | null | import re
from pygbif.gbifutils import gbif_baseurl, bool2str, requests_argset, gbif_GET
def search(
taxonKey=None,
repatriated=None,
kingdomKey=None,
phylumKey=None,
classKey=None,
orderKey=None,
familyKey=None,
genusKey=None,
subgenusKey=None,
scientificName=None,
countr... | 50.844282 | 250 | 0.676748 | import re
from pygbif.gbifutils import gbif_baseurl, bool2str, requests_argset, gbif_GET
def search(
taxonKey=None,
repatriated=None,
kingdomKey=None,
phylumKey=None,
classKey=None,
orderKey=None,
familyKey=None,
genusKey=None,
subgenusKey=None,
scientificName=None,
countr... | true | true |
79065068ec60bff32a4fab5b386f44567c3f3a7e | 52 | py | Python | python-example/local.py | DavidLeoni/prova-qcb | 38520ab66b34a145e43ffb0ee808562eae31c325 | [
"Apache-2.0"
] | null | null | null | python-example/local.py | DavidLeoni/prova-qcb | 38520ab66b34a145e43ffb0ee808562eae31c325 | [
"Apache-2.0"
] | 85 | 2017-09-20T12:29:11.000Z | 2022-02-22T09:42:33.000Z | python-example/local.py | DavidLeoni/prova-qcb | 38520ab66b34a145e43ffb0ee808562eae31c325 | [
"Apache-2.0"
] | 3 | 2020-09-11T11:59:22.000Z | 2021-07-28T09:09:36.000Z |
def gimme(x):
print("It was a %s indeed" % x)
| 10.4 | 35 | 0.538462 |
def gimme(x):
print("It was a %s indeed" % x)
| true | true |
790652187b5cf6041a3ae071dce885a612225a0f | 3,309 | py | Python | scannerKH/scannerKH/settings.py | JanGut/scannerKH | 1814d2f110af3abdde75e253cab96300701dd531 | [
"MIT"
] | 1 | 2020-05-27T16:18:43.000Z | 2020-05-27T16:18:43.000Z | scannerKH/scannerKH/settings.py | JanGut/scannerKH | 1814d2f110af3abdde75e253cab96300701dd531 | [
"MIT"
] | null | null | null | scannerKH/scannerKH/settings.py | JanGut/scannerKH | 1814d2f110af3abdde75e253cab96300701dd531 | [
"MIT"
] | null | null | null | """
Django settings for scannerKH project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 25.651163 | 91 | 0.699003 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '74lbuyy!_ihecg*uh8i9^j!wq3gc_)vv$55!h&0yon03f2%c$$'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
79065290e0d3103c497382cd8b322890f0dd3eb1 | 11,196 | py | Python | app.py | jtsuchiyama/hawaii-covid-tracker | 456f63728f6e17208477e7b585e997e8f8b35657 | [
"MIT"
] | null | null | null | app.py | jtsuchiyama/hawaii-covid-tracker | 456f63728f6e17208477e7b585e997e8f8b35657 | [
"MIT"
] | null | null | null | app.py | jtsuchiyama/hawaii-covid-tracker | 456f63728f6e17208477e7b585e997e8f8b35657 | [
"MIT"
] | null | null | null | import os
import time
import requests
from bs4 import BeautifulSoup
import datetime
from twilio.rest import Client
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import math
class Data():
def __init__(self,link): # Automatically stores the data from parsed link as the object's attribute
... | 36.828947 | 264 | 0.567256 | import os
import time
import requests
from bs4 import BeautifulSoup
import datetime
from twilio.rest import Client
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import math
class Data():
def __init__(self,link):
self.data = self.update(link)
self.prev = None
de... | true | true |
790653625db722369992146051dd80a8d2df7b86 | 10,465 | py | Python | voc_classifier/metrics_for_multilabel.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | 6 | 2021-08-18T00:52:38.000Z | 2021-12-03T12:37:18.000Z | voc_classifier/metrics_for_multilabel.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | null | null | null | voc_classifier/metrics_for_multilabel.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | 1 | 2022-03-24T08:02:44.000Z | 2022-03-24T08:02:44.000Z | # https://github.com/iliaschalkidis/lmtc-eurlex57k/blob/master/metrics.py
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score
import numpy as np
def mean_precision_k(y_true, y_score, k=10):
"""Mean ... | 28.360434 | 96 | 0.602389 |
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import f1_score
import numpy as np
def mean_precision_k(y_true, y_score, k=10):
p_ks = []
for y_t, y_s in zip(y_true, y_score):
if np.sum(y_t == 1):... | true | true |
79065452ef9d0ced2e62447f9f620825073dedd2 | 154 | py | Python | src/models/HostsModel.py | xrzhev/abysswatcher-api | e387127c6ecffb8ff820ca7657e0e25a9ba98ca8 | [
"MIT"
] | null | null | null | src/models/HostsModel.py | xrzhev/abysswatcher-api | e387127c6ecffb8ff820ca7657e0e25a9ba98ca8 | [
"MIT"
] | null | null | null | src/models/HostsModel.py | xrzhev/abysswatcher-api | e387127c6ecffb8ff820ca7657e0e25a9ba98ca8 | [
"MIT"
] | null | null | null | from pydantic import BaseModel, HttpUrl
from typing import List
class RegisterHostModel(BaseModel):
name: str
url: HttpUrl
ports: List[int]
| 19.25 | 39 | 0.74026 | from pydantic import BaseModel, HttpUrl
from typing import List
class RegisterHostModel(BaseModel):
name: str
url: HttpUrl
ports: List[int]
| true | true |
790654c3c78d2d88e919b53b5edf4132bdfff07f | 1,271 | py | Python | pysc2/bin/battle_net_maps.py | rainwangphy/pysc2 | 9e3e5af7ba02b65ade3b902d830770cfa24d7c74 | [
"Apache-2.0"
] | null | null | null | pysc2/bin/battle_net_maps.py | rainwangphy/pysc2 | 9e3e5af7ba02b65ade3b902d830770cfa24d7c74 | [
"Apache-2.0"
] | null | null | null | pysc2/bin/battle_net_maps.py | rainwangphy/pysc2 | 9e3e5af7ba02b65ade3b902d830770cfa24d7c74 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 31 | 74 | 0.730921 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from pysc2 import run_configs
def main(unused_argv):
with run_configs.get().start(want_rgb=False) as controller:
available_maps = controller.available_maps()
... | true | true |
79065532d452f966f3cc40595e26fdfe54efe0f5 | 7,380 | py | Python | imageLoader.py | gitpharm01/Parapose | 220f3af30011e1dd7c0d5f20660a1dd01eab63db | [
"Apache-2.0"
] | null | null | null | imageLoader.py | gitpharm01/Parapose | 220f3af30011e1dd7c0d5f20660a1dd01eab63db | [
"Apache-2.0"
] | null | null | null | imageLoader.py | gitpharm01/Parapose | 220f3af30011e1dd7c0d5f20660a1dd01eab63db | [
"Apache-2.0"
] | null | null | null | import numpy as np
import random
import os
import json
import math
import cv2
def getPaddedROI(img, center_x, center_y, width, height):
#print(str(int(center_x)) + "," + str(int(center_y)))
paddingColor = [0,0,0]
top_left_x = center_x - int(width/2)-1
#print("top_left_x:")
#print(top_left_x)
to... | 35.311005 | 137 | 0.628862 | import numpy as np
import random
import os
import json
import math
import cv2
def getPaddedROI(img, center_x, center_y, width, height):
paddingColor = [0,0,0]
top_left_x = center_x - int(width/2)-1
top_left_y = center_y - int(height/2)-1
bottom_right_x = center_x + int(width/2... | true | true |
790655962fe5f0dedfca81c1496d202aa334601e | 47 | py | Python | hello_world.py | jzfarmer/learning_python | 279fc19d4405625b49f853575252bf1dee3cbb99 | [
"MIT"
] | null | null | null | hello_world.py | jzfarmer/learning_python | 279fc19d4405625b49f853575252bf1dee3cbb99 | [
"MIT"
] | null | null | null | hello_world.py | jzfarmer/learning_python | 279fc19d4405625b49f853575252bf1dee3cbb99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
print( 'hello world' )
| 11.75 | 22 | 0.659574 |
print( 'hello world' )
| true | true |
790655ea6c80cb158eb146494c56364a9049bf42 | 2,918 | py | Python | align/compiler/create_database.py | mabrains/ALIGN-public | 9a6c14310de13df369a8340f465911b629f15a3f | [
"BSD-3-Clause"
] | null | null | null | align/compiler/create_database.py | mabrains/ALIGN-public | 9a6c14310de13df369a8340f465911b629f15a3f | [
"BSD-3-Clause"
] | null | null | null | align/compiler/create_database.py | mabrains/ALIGN-public | 9a6c14310de13df369a8340f465911b629f15a3f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 15 10:38:14 2021
@author: kunal001
"""
import logging
logger = logging.getLogger(__name__)
class CreateDatabase:
def __init__(self,hier_graph,const_parse):
self.hier_graph_dict = {}
self.const_parse = const_parse
self.G ... | 38.906667 | 119 | 0.532557 |
import logging
logger = logging.getLogger(__name__)
class CreateDatabase:
def __init__(self,hier_graph,const_parse):
self.hier_graph_dict = {}
self.const_parse = const_parse
self.G = hier_graph
def read_inputs(self,name:str):
top_ports = []
ports_weight = {}
... | true | true |
790656792cf1a06755ecb98d07fc56893c0250cc | 3,151 | py | Python | tests/test_docs/test_standalone_transaction/test_standalone_transaction.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/test_docs/test_standalone_transaction/test_standalone_transaction.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/test_docs/test_standalone_transaction/test_standalone_transaction.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 35.404494 | 95 | 0.671215 |
import logging
import os
from unittest.mock import patch
import pytest
from aea.test_tools.test_cases import BaseAEATestCase
from tests.conftest import CUR_PATH, MAX_FLAKY_RERUNS_INTEGRATION, ROOT_DIR
from tests.test_docs.helper import extract_code_blocks, extract_python_code
from tests.test_doc... | true | true |
790656dfc67283942aa59d35297a0f07c93f209a | 346 | py | Python | piprot/test/test_piprot.py | sedrubal/piprot | 53a9f33556168b137df328a928400ea787c0ca7f | [
"MIT"
] | 199 | 2015-01-14T11:09:54.000Z | 2022-01-12T16:36:06.000Z | piprot/test/test_piprot.py | sedrubal/piprot | 53a9f33556168b137df328a928400ea787c0ca7f | [
"MIT"
] | 49 | 2015-01-14T21:26:31.000Z | 2020-06-12T10:51:30.000Z | piprot/test/test_piprot.py | sedrubal/piprot | 53a9f33556168b137df328a928400ea787c0ca7f | [
"MIT"
] | 35 | 2015-02-05T04:37:26.000Z | 2021-07-31T10:28:51.000Z | #!/usr/bin/env python
import unittest
from piprot.piprot import main
class TestRequirementsParser(unittest.TestCase):
def setUp(self):
pass
def test_requirement_exact(self):
with self.assertRaises(SystemExit):
main([open('piprot/test/files/pytz_req.txt')])
if __name__ == '__mai... | 19.222222 | 58 | 0.684971 |
import unittest
from piprot.piprot import main
class TestRequirementsParser(unittest.TestCase):
def setUp(self):
pass
def test_requirement_exact(self):
with self.assertRaises(SystemExit):
main([open('piprot/test/files/pytz_req.txt')])
if __name__ == '__main__':
unittest.ma... | true | true |
790656ed3b45cbb39f2ccbb5be021d26bc38a0db | 312 | py | Python | exerc27/27.py | WilliamSampaio/ExerciciosPython | 4317d242d2944b91b5d455da8a4ac3a33e154385 | [
"MIT"
] | null | null | null | exerc27/27.py | WilliamSampaio/ExerciciosPython | 4317d242d2944b91b5d455da8a4ac3a33e154385 | [
"MIT"
] | null | null | null | exerc27/27.py | WilliamSampaio/ExerciciosPython | 4317d242d2944b91b5d455da8a4ac3a33e154385 | [
"MIT"
] | null | null | null | import os
turno = input('Qual turno você estuda? ')
if turno[0] == 'm' or turno[0] == 'M':
print('Bom Dia!')
elif turno[0] == 'v' or turno[0] == 'V':
print('Boa Tarde')
elif turno[0] == 'n' or turno[0] == 'N':
print('Boa Noite')
else:
print('Valor Inválido!')
os.system("pause")
| 20.8 | 42 | 0.535256 | import os
turno = input('Qual turno você estuda? ')
if turno[0] == 'm' or turno[0] == 'M':
print('Bom Dia!')
elif turno[0] == 'v' or turno[0] == 'V':
print('Boa Tarde')
elif turno[0] == 'n' or turno[0] == 'N':
print('Boa Noite')
else:
print('Valor Inválido!')
os.system("pause")
| true | true |
790657d1965476ce384e27b1371c9e99996e94c1 | 3,947 | py | Python | TextMagic/models/reopen_chats_bulk_input_object.py | imissyouso/textmagic-rest-python | 172c4c2bd588119eb97cdfaab3d8ba24bf3f3e09 | [
"MIT"
] | null | null | null | TextMagic/models/reopen_chats_bulk_input_object.py | imissyouso/textmagic-rest-python | 172c4c2bd588119eb97cdfaab3d8ba24bf3f3e09 | [
"MIT"
] | null | null | null | TextMagic/models/reopen_chats_bulk_input_object.py | imissyouso/textmagic-rest-python | 172c4c2bd588119eb97cdfaab3d8ba24bf3f3e09 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
TextMagic API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
... | 27.034247 | 119 | 0.558905 |
import pprint
import re
import six
class ReopenChatsBulkInputObject(object):
swagger_types = {
'ids': 'str',
'all': 'bool'
}
attribute_map = {
'ids': 'ids',
'all': 'all'
}
def __init__(self, ids=None, all=None):
self._ids = None
self._al... | true | true |
7906586313260e60731734c5a3175fce5e81afdf | 59,084 | py | Python | keystone-moon/keystone/tests/unit/test_associate_project_endpoint_extension.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/tests/unit/test_associate_project_endpoint_extension.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/tests/unit/test_associate_project_endpoint_extension.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 42.445402 | 79 | 0.627243 |
import copy
import uuid
import mock
from oslo_log import versionutils
from six.moves import http_client
from testtools import matchers
from keystone.contrib.endpoint_filter import routers
from keystone.tests import unit
from keystone.tests.unit import test_v3
class EndpointFilterTestCase(test_v3.Restf... | true | true |
790658778885073a7b7f1ed07c9ef5cb057d811e | 7,924 | py | Python | py_scripts/preprocessing/prep_shard.py | usc-isi-i2/dig-text-similarity-search | 88109725a44837c9c5f3ae15c630bd8c5901f1ea | [
"MIT"
] | 7 | 2018-08-28T22:02:34.000Z | 2020-07-21T07:44:19.000Z | py_scripts/preprocessing/prep_shard.py | usc-isi-i2/dig-text-similarity-search | 88109725a44837c9c5f3ae15c630bd8c5901f1ea | [
"MIT"
] | 11 | 2018-08-23T19:25:27.000Z | 2019-03-01T20:34:04.000Z | py_scripts/preprocessing/prep_shard.py | usc-isi-i2/dig-text-similarity-search | 88109725a44837c9c5f3ae15c630bd8c5901f1ea | [
"MIT"
] | 3 | 2020-02-18T13:24:02.000Z | 2021-12-25T22:17:25.000Z | # <editor-fold desc="Basic Imports">
import os
import os.path as p
import requests
from time import time
from argparse import ArgumentParser
import sys
sys.path.append(p.join(p.dirname(__file__), '..'))
sys.path.append(p.join(p.dirname(__file__), '../..'))
# </editor-fold>
# <editor-fold desc="Parse Command Line Args... | 40.428571 | 90 | 0.652196 |
import os
import os.path as p
import requests
from time import time
from argparse import ArgumentParser
import sys
sys.path.append(p.join(p.dirname(__file__), '..'))
sys.path.append(p.join(p.dirname(__file__), '../..'))
prog_file_path = p.join(p.dirname(__file__), 'progress.txt')
relative_base_path = '../../base_i... | true | true |
7906590296d72f430ee23d3c9699c4e26c77d3ba | 8,783 | py | Python | elasticsearch/_sync/client/text_structure.py | rwcanand/elasticsearch-py | b090faa967afb6e426a0d6060e0c92fbf6dcbea0 | [
"Apache-2.0"
] | null | null | null | elasticsearch/_sync/client/text_structure.py | rwcanand/elasticsearch-py | b090faa967afb6e426a0d6060e0c92fbf6dcbea0 | [
"Apache-2.0"
] | null | null | null | elasticsearch/_sync/client/text_structure.py | rwcanand/elasticsearch-py | b090faa967afb6e426a0d6060e0c92fbf6dcbea0 | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 55.238994 | 96 | 0.669703 |
import typing as t
from elastic_transport import ObjectApiResponse
from ._base import NamespacedClient
from .utils import _rewrite_parameters
class TextStructureClient(NamespacedClient):
@_rewrite_parameters(
body_name="text_files",
)
def find_structure(
self,
*,... | true | true |
7906591fea522eb12da131c6f3bcc4260ebd1c0c | 989 | py | Python | python/example_code/greengrass/snippets/connector_modbus_rtu_usage.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 5,166 | 2016-09-02T08:48:38.000Z | 2022-03-31T19:12:43.000Z | python/example_code/greengrass/snippets/connector_modbus_rtu_usage.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 1,186 | 2016-09-28T23:05:19.000Z | 2022-03-31T18:07:47.000Z | python/example_code/greengrass/snippets/connector_modbus_rtu_usage.py | iconara/aws-doc-sdk-examples | 52706b31b4fce8fb89468e56743edf5369e69628 | [
"Apache-2.0"
] | 4,003 | 2016-08-29T19:51:40.000Z | 2022-03-31T16:40:02.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to implement an AWS Lambda function that publishes messages to an
AWS IoT Greengrass connector.
"""
# snippet-start:[greengrass.python.connector-modbus-rtu-usage.complete]
import json
impo... | 24.121951 | 75 | 0.706775 |
import json
import greengrasssdk
iot_client = greengrasssdk.client('iot-data')
send_topic = 'modbus/adapter/request'
def create_read_coils_request():
return {
"request": {
"operation": "ReadCoilsRequest",
"device": 1,
"address": 0x01,
"count": 1},
... | true | true |
7906593965714f1263e201b03c96797d1677290a | 1,133 | py | Python | tools/convert_json_to_mat.py | MichaelGoodale/opensauce-python | cafad071fa1ed675b4e7177b37ed41af94b39c5f | [
"Apache-2.0"
] | 38 | 2015-02-10T08:35:50.000Z | 2022-03-15T10:56:40.000Z | tools/convert_json_to_mat.py | MichaelGoodale/opensauce-python | cafad071fa1ed675b4e7177b37ed41af94b39c5f | [
"Apache-2.0"
] | 37 | 2015-09-23T00:17:07.000Z | 2022-02-24T17:52:56.000Z | tools/convert_json_to_mat.py | CobiELF/opensauce-python | 03c278ca92b150188821dadfc9702ff9f939aa4e | [
"Apache-2.0"
] | 11 | 2018-08-28T06:41:41.000Z | 2022-01-21T05:07:40.000Z | # Script to convert json into proprietary .mat files
# Licensed under Apache v2 (see LICENSE)
import sys
import os
import glob
import json
from scipy.io import savemat
def main(json_dir, out_dir):
""" Script to convert all .json files in json_dir into corresponding .mat
files in out_dir
.mat files ... | 29.815789 | 93 | 0.661077 |
import sys
import os
import glob
import json
from scipy.io import savemat
def main(json_dir, out_dir):
json_files = glob.glob(os.path.join(json_dir, '*.json'))
for json_file in json_files:
with open(json_file) as f:
json_dict = json.load(f)
if not o... | true | true |
790659b5400546f61617455b3c2bc812fc214d2f | 19,791 | py | Python | plotting.py | HanMeh/dreamerv2 | ec9904613cb70dded51017f724f05eb688c1bc3d | [
"MIT"
] | 1 | 2021-04-13T11:00:11.000Z | 2021-04-13T11:00:11.000Z | plotting.py | HanMeh/dreamerv2 | ec9904613cb70dded51017f724f05eb688c1bc3d | [
"MIT"
] | null | null | null | plotting.py | HanMeh/dreamerv2 | ec9904613cb70dded51017f724f05eb688c1bc3d | [
"MIT"
] | null | null | null | import argparse
import collections
import functools
import itertools
import json
import multiprocessing as mp
import os
import pathlib
import re
import subprocess
import warnings
os.environ['NO_AT_BRIDGE'] = '1' # Hide X org false warning.
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
impor... | 36.582255 | 79 | 0.637411 | import argparse
import collections
import functools
import itertools
import json
import multiprocessing as mp
import os
import pathlib
import re
import subprocess
import warnings
os.environ['NO_AT_BRIDGE'] = '1'
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as tick... | true | true |
790659ba52b92a5a6517cff35b202a27924f483b | 56,165 | py | Python | flopy/mbase.py | andrewcalderwood/flopy | 0432ce96a0a5eec4d20adb4d384505632a2db3dc | [
"CC0-1.0",
"BSD-3-Clause"
] | 351 | 2015-01-03T15:18:48.000Z | 2022-03-31T09:46:43.000Z | flopy/mbase.py | andrewcalderwood/flopy | 0432ce96a0a5eec4d20adb4d384505632a2db3dc | [
"CC0-1.0",
"BSD-3-Clause"
] | 1,256 | 2015-01-15T21:10:42.000Z | 2022-03-31T22:43:06.000Z | flopy/mbase.py | andrewcalderwood/flopy | 0432ce96a0a5eec4d20adb4d384505632a2db3dc | [
"CC0-1.0",
"BSD-3-Clause"
] | 553 | 2015-01-31T22:46:48.000Z | 2022-03-31T17:43:35.000Z | """
mbase module
This module contains the base model class from which
all of the other models inherit from.
"""
import abc
import os
import shutil
import threading
import warnings
import queue as Queue
from datetime import datetime
from shutil import which
from subprocess import Popen, PIPE, STDOUT
import copy
im... | 31.202778 | 89 | 0.531968 | import abc
import os
import shutil
import threading
import warnings
import queue as Queue
from datetime import datetime
from shutil import which
from subprocess import Popen, PIPE, STDOUT
import copy
import numpy as np
from flopy import utils, discretization
from .version import __version__
from .discretization.grid i... | true | true |
79065a35e9b373ad699a0edd6b2417b0ba72f4ea | 6,770 | py | Python | pennylane/ops/qubit/arithmetic_ops.py | QDaria/pennylane | 5a28983fc7bd950cde8a4014e54261fef4b54293 | [
"Apache-2.0"
] | null | null | null | pennylane/ops/qubit/arithmetic_ops.py | QDaria/pennylane | 5a28983fc7bd950cde8a4014e54261fef4b54293 | [
"Apache-2.0"
] | null | null | null | pennylane/ops/qubit/arithmetic_ops.py | QDaria/pennylane | 5a28983fc7bd950cde8a4014e54261fef4b54293 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# 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... | 31.342593 | 136 | 0.550812 |
import numpy as np
import pennylane as qml
from pennylane.operation import Operation
class QubitCarry(Operation):
num_wires = 4
num_params = 0
_mat = np.array(
[
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | true | true |
79065aed458ad131937200dcf31582f0b7102f8a | 2,644 | py | Python | utilities/log_parser/parser_utility.py | cihuang123/Next-simulation | e8552a5804184b30022d103d47c8728fb242b5bc | [
"BSD-3-Clause"
] | null | null | null | utilities/log_parser/parser_utility.py | cihuang123/Next-simulation | e8552a5804184b30022d103d47c8728fb242b5bc | [
"BSD-3-Clause"
] | null | null | null | utilities/log_parser/parser_utility.py | cihuang123/Next-simulation | e8552a5804184b30022d103d47c8728fb242b5bc | [
"BSD-3-Clause"
] | 2 | 2021-05-05T14:59:37.000Z | 2021-06-17T03:19:45.000Z | import csv
import itertools
import sys
import re
import math
def get_root_mean_square( mean_square, number):
return math.sqrt(mean_square / number)
def gpsr_tlm_compare(target_arr, answer_arr, lift_off_time, fileobj, csv_header):
cache_idx = 0
sim_data_list = []
start_flight_idx = 0
iter_idx = 0
... | 41.968254 | 127 | 0.580938 | import csv
import itertools
import sys
import re
import math
def get_root_mean_square( mean_square, number):
return math.sqrt(mean_square / number)
def gpsr_tlm_compare(target_arr, answer_arr, lift_off_time, fileobj, csv_header):
cache_idx = 0
sim_data_list = []
start_flight_idx = 0
iter_idx = 0
... | true | true |
79065b39026273c110873050fd38dd038152970a | 1,085 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/Domain.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Autodesk/Revit/DB/__init___parts/Domain.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Autodesk/Revit/DB/__init___parts/Domain.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class Domain(Enum,IComparable,IFormattable,IConvertible):
"""
Enumeration of connector domain types
enum Domain,values: DomainCableTrayConduit (4),DomainElectrical (2),DomainHvac (1),DomainPiping (3),DomainUndefined (0)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq... | 27.820513 | 215 | 0.684793 | class Domain(Enum,IComparable,IFormattable,IConvertible):
def __eq__(self,*args):
pass
def __format__(self,*args):
pass
def __ge__(self,*args):
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
pass
def __le__(self,*args):
pass
def __lt__(self,*args):
pass
def __ne__(self,... | true | true |
79065bcf6ad565741783848b2deb3f3fe40685e3 | 18,818 | py | Python | log_complete/model_160.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_160.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_160.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.349515 | 710 | 0.806515 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
79065cc2d8327872894a396a7ff96af30ded2d5b | 1,494 | py | Python | deepSI/systems/narendra_li_benchmark.py | csutakbalazs/deepSI | 895030225937fb5fcbd4fc0eaba6c306ec0b5820 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T13:56:00.000Z | 2022-01-19T13:56:00.000Z | deepSI/systems/narendra_li_benchmark.py | csutakbalazs/deepSI | 895030225937fb5fcbd4fc0eaba6c306ec0b5820 | [
"BSD-3-Clause"
] | null | null | null | deepSI/systems/narendra_li_benchmark.py | csutakbalazs/deepSI | 895030225937fb5fcbd4fc0eaba6c306ec0b5820 | [
"BSD-3-Clause"
] | null | null | null | import deepSI
from deepSI.systems.system import System_ss, System_data
import numpy as np
class NarendraLiBenchmark(System_ss): #https://arxiv.org/pdf/2003.14162.pdf
"""docstring for NarendraLiBenchmark"""
def __init__(self):
'''Noise, system setting and x0 settings'''
super(NarendraLiBenchmark... | 37.35 | 109 | 0.655957 | import deepSI
from deepSI.systems.system import System_ss, System_data
import numpy as np
class NarendraLiBenchmark(System_ss):
def __init__(self):
super(NarendraLiBenchmark, self).__init__(nx=2)
def f(self,x,u):
x1,x2 = x
x1new = (x1/(1+x1**2)+1)*np.sin(x2)
x2new = x2*np.cos(... | true | true |
79065d9567f305e04b73dbf1a532c46c2739b9fe | 530,439 | py | Python | ns-3-dev-git/src/flow-monitor/bindings/modulegen__gcc_ILP32.py | rahul0324/Upgrade-AQM-Evaluation-Suite-of-ns-3 | 9d46441749da1059b2e9525d72fce61cb0e42150 | [
"MIT"
] | 1 | 2022-03-23T13:55:42.000Z | 2022-03-23T13:55:42.000Z | ns-3-dev-git/src/flow-monitor/bindings/modulegen__gcc_ILP32.py | rahulkumdas/Upgrade-AQM-Evaluation-Suite-of-ns-3 | 9d46441749da1059b2e9525d72fce61cb0e42150 | [
"MIT"
] | null | null | null | ns-3-dev-git/src/flow-monitor/bindings/modulegen__gcc_ILP32.py | rahulkumdas/Upgrade-AQM-Evaluation-Suite-of-ns-3 | 9d46441749da1059b2e9525d72fce61cb0e42150 | [
"MIT"
] | null | null | null | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | 69.094568 | 934 | 0.631931 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | true | true |
79065e5eadad7bc0e642e51294c0672d7f8e4553 | 13,148 | py | Python | gensim/gensim/corpora/hashdictionary.py | Abas-Khan/thesis | b733bd4382371203cc4992571890619a2e314047 | [
"MIT"
] | null | null | null | gensim/gensim/corpora/hashdictionary.py | Abas-Khan/thesis | b733bd4382371203cc4992571890619a2e314047 | [
"MIT"
] | null | null | null | gensim/gensim/corpora/hashdictionary.py | Abas-Khan/thesis | b733bd4382371203cc4992571890619a2e314047 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Homer Strong, Radim Rehurek
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module implements the "hashing trick" [1]_ -- a mapping between words and their integer ids
using a fixed and static mapping.
Notes
-----... | 37.673352 | 120 | 0.604198 |
from __future__ import with_statement
import logging
import itertools
import zlib
from gensim import utils
from six import iteritems, iterkeys
logger = logging.getLogger(__name__)
class HashDictionary(utils.SaveLoad, dict):
def __init__(self, documents=None, id_range=32000, myhash=zlib.adler32, debug=... | true | true |
79065f7ba534a9c1105db44f908ee2d05be5fa9f | 2,957 | py | Python | homeassistant/components/statsd/__init__.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/components/statsd/__init__.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/components/statsd/__init__.py | itewk/home-assistant | 769cf19052f8c9ef374d8ba8ae7705ccc7bf4cf4 | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Support for sending data to StatsD."""
import logging
import statsd
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PREFIX, EVENT_STATE_CHANGED
from homeassistant.helpers import state as state_helper
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogg... | 31.126316 | 86 | 0.630369 | import logging
import statsd
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_PREFIX, EVENT_STATE_CHANGED
from homeassistant.helpers import state as state_helper
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
CONF_ATTR = "log_attributes"... | true | true |
7906604bab7a983563a8a3143f954fce57d6797d | 557 | py | Python | examples_old/run_executable_redis/basic_wait.py | shepilov-vladislav/aiotasks | be888895b6509d062ee4e1564b7eec05477f5a7d | [
"BSD-3-Clause"
] | 462 | 2017-03-28T08:01:28.000Z | 2022-03-17T19:13:55.000Z | examples_old/run_executable_redis/basic_wait.py | shepilov-vladislav/aiotasks | be888895b6509d062ee4e1564b7eec05477f5a7d | [
"BSD-3-Clause"
] | 12 | 2017-04-02T10:20:57.000Z | 2020-10-06T12:18:55.000Z | examples_old/run_executable_redis/basic_wait.py | shepilov-vladislav/aiotasks | be888895b6509d062ee4e1564b7eec05477f5a7d | [
"BSD-3-Clause"
] | 51 | 2017-03-31T17:43:34.000Z | 2022-03-31T13:42:35.000Z | import asyncio
from aiotasks import build_manager
loop = asyncio.get_event_loop()
loop.set_debug(True)
manager = build_manager(loop=loop)
@manager.task()
async def task_01(num):
print("Task 01 starting: {}".format(num))
await asyncio.sleep(2, loop=loop)
print("Task 01 stopping")
ret... | 15.472222 | 45 | 0.644524 | import asyncio
from aiotasks import build_manager
loop = asyncio.get_event_loop()
loop.set_debug(True)
manager = build_manager(loop=loop)
@manager.task()
async def task_01(num):
print("Task 01 starting: {}".format(num))
await asyncio.sleep(2, loop=loop)
print("Task 01 stopping")
ret... | true | true |
79066068c67dd1791d3f4736391e42f5f8a64968 | 29,153 | py | Python | kornia/geometry/conversions.py | lferraz/kornia | c30ef6149bd92054d482339a2b0cd18f8272f5f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/geometry/conversions.py | lferraz/kornia | c30ef6149bd92054d482339a2b0cd18f8272f5f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | kornia/geometry/conversions.py | lferraz/kornia | c30ef6149bd92054d482339a2b0cd18f8272f5f5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.constants import pi
__all__ = [
# functional api
"rad2deg",
"deg2rad",
"pol2cart",
"cart2pol",
"convert_points_from_homogeneous",
"convert_points_to_homogeneous",
"convert_affinematr... | 35.379854 | 126 | 0.618941 | from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from kornia.constants import pi
__all__ = [
"rad2deg",
"deg2rad",
"pol2cart",
"cart2pol",
"convert_points_from_homogeneous",
"convert_points_to_homogeneous",
"convert_affinematrix_to_homography... | true | true |
790660d2c32c54d06613ec3e49f63111f96101b8 | 2,090 | py | Python | advent/year2015/day20.py | davweb/advent-of-code | 6d9ac52092f4aad26a84d7cfd2fcd8420f1ea612 | [
"Unlicense"
] | null | null | null | advent/year2015/day20.py | davweb/advent-of-code | 6d9ac52092f4aad26a84d7cfd2fcd8420f1ea612 | [
"Unlicense"
] | null | null | null | advent/year2015/day20.py | davweb/advent-of-code | 6d9ac52092f4aad26a84d7cfd2fcd8420f1ea612 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from functools import cache
INPUT = 33100000
def sigma_pentagonal_numbers(limit):
"""
>>> list(sigma_pentagonal_numbers(16))
[1, 2, 5, 7, 12, 15]
"""
n = 1
p = 1
while p <= limit:
yield p
if n > 0:
n = -n
else:
n... | 16.076923 | 58 | 0.507177 |
from functools import cache
INPUT = 33100000
def sigma_pentagonal_numbers(limit):
n = 1
p = 1
while p <= limit:
yield p
if n > 0:
n = -n
else:
n = -n + 1
p = (3 * n * n - n) // 2
def sigma_sign_generator():
while True:
yield 1
... | true | true |
790660f1ba7f0dd430d2a6d62416017cafec0be7 | 4,197 | py | Python | TIDALDL-PY/tidal_dl/lang/spanish.py | joyel24/Tidal-Media-Downloader | a73a7a0923dbbfad50c8faa64f75cc64ec568c02 | [
"Apache-2.0"
] | 2 | 2020-11-01T09:41:14.000Z | 2021-12-15T22:51:37.000Z | TIDALDL-PY/tidal_dl/lang/spanish.py | joyel24/Tidal-Media-Downloader | a73a7a0923dbbfad50c8faa64f75cc64ec568c02 | [
"Apache-2.0"
] | null | null | null | TIDALDL-PY/tidal_dl/lang/spanish.py | joyel24/Tidal-Media-Downloader | a73a7a0923dbbfad50c8faa64f75cc64ec568c02 | [
"Apache-2.0"
] | 1 | 2020-11-03T10:14:02.000Z | 2020-11-03T10:14:02.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : spanish.py
@Time : 2020/08/21
@Author : JavierSC
@Version : 1.0
@Contact :
@Desc :
'''
class LangSpanish(object):
SETTING = "AJUSTES"
VALUE = "VALORES"
SETTING_DOWNLOAD_PATH = "Ruta de descarga"
SETTING_ONLY_M4... | 45.129032 | 108 | 0.688825 |
class LangSpanish(object):
SETTING = "AJUSTES"
VALUE = "VALORES"
SETTING_DOWNLOAD_PATH = "Ruta de descarga"
SETTING_ONLY_M4A = "Convertir mp4 a m4a"
SETTING_ADD_EXPLICIT_TAG = "Añadir tag de 'Contenido explícito'"
SETTING_ADD_HYPHEN = "Agregar guión"
SETTING_ADD_YEAR = "Agregar añ... | true | true |
79066141ab07cc37c365024fff632e3454036b72 | 462 | py | Python | onegreek/rush_forms/urls.py | goldhand/onegreek | 1ad105f15608284a9e80802734f0c6222413a4a0 | [
"BSD-3-Clause"
] | 1 | 2019-06-13T11:46:08.000Z | 2019-06-13T11:46:08.000Z | onegreek/rush_forms/urls.py | goldhand/onegreek | 1ad105f15608284a9e80802734f0c6222413a4a0 | [
"BSD-3-Clause"
] | null | null | null | onegreek/rush_forms/urls.py | goldhand/onegreek | 1ad105f15608284a9e80802734f0c6222413a4a0 | [
"BSD-3-Clause"
] | null | null | null | try:
from django.conf.urls import *
except ImportError: # django < 1.4
from django.conf.urls.defaults import *
urlpatterns = patterns("rush_forms.views",
#url(r"^(?P<pk>\d+)/$", 'form_view', name='form-detail'),
url(r"^(?P<pk>\d+)/$", 'rush_form_view', name='detai... | 42 | 111 | 0.512987 | try:
from django.conf.urls import *
except ImportError:
from django.conf.urls.defaults import *
urlpatterns = patterns("rush_forms.views",
url(r"^(?P<pk>\d+)/$", 'rush_form_view', name='detail'),
url(r"^(?P<pk>\d+)/(?P<user_id>\d+)/$", 'ru... | true | true |
790661648fbf214e95c84c634f4fa5493716091a | 10,890 | py | Python | classification/src/train.py | WayneGame/InformationExtraction | d593adc5ad02fa7046873c95a1b4af0befe08c5f | [
"MIT"
] | null | null | null | classification/src/train.py | WayneGame/InformationExtraction | d593adc5ad02fa7046873c95a1b4af0befe08c5f | [
"MIT"
] | null | null | null | classification/src/train.py | WayneGame/InformationExtraction | d593adc5ad02fa7046873c95a1b4af0befe08c5f | [
"MIT"
] | null | null | null |
import config
import pandas as pd
import pickle
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import classification_report
import tensorflow as tf
from keras import Sequ... | 39.314079 | 126 | 0.697062 |
import config
import pandas as pd
import pickle
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import classification_report
import tensorflow as tf
from keras import Sequ... | true | true |
790662547c95ddbae1a51a96718eeecea12c6c67 | 334 | py | Python | students/K33401/Kunal_Shubham/lab3/hotel_project/hotel_app/router.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 4 | 2020-09-03T15:41:42.000Z | 2021-12-24T15:28:20.000Z | students/K33401/Kunal_Shubham/lab3/hotel_project/hotel_app/router.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 48 | 2020-09-13T20:22:42.000Z | 2021-04-30T11:13:30.000Z | students/K33401/Kunal_Shubham/lab3/hotel_project/hotel_app/router.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 69 | 2020-09-06T10:32:37.000Z | 2021-11-28T18:13:17.000Z | from hotel_app.views import *
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'rooms', RoomAPIView)
router.register(r'employee', EmployeeAPIView)
router.register(r'resident', ResidentAPIView)
router.register(r'booking', BookingRecordAPIView)
router.register(r'cleaning', CleaningSch... | 33.4 | 53 | 0.826347 | from hotel_app.views import *
from rest_framework import routers
router = routers.DefaultRouter()
router.register(r'rooms', RoomAPIView)
router.register(r'employee', EmployeeAPIView)
router.register(r'resident', ResidentAPIView)
router.register(r'booking', BookingRecordAPIView)
router.register(r'cleaning', CleaningSch... | true | true |
790662d12902dbc2c3c011234e157734ef8e4ddf | 3,307 | py | Python | Spy-Game/code.py | umeshpal93/ga-learner-dsb-repo | c8da26325e65f62955b72b6b4449a5cac7ac00d3 | [
"MIT"
] | null | null | null | Spy-Game/code.py | umeshpal93/ga-learner-dsb-repo | c8da26325e65f62955b72b6b4449a5cac7ac00d3 | [
"MIT"
] | null | null | null | Spy-Game/code.py | umeshpal93/ga-learner-dsb-repo | c8da26325e65f62955b72b6b4449a5cac7ac00d3 | [
"MIT"
] | null | null | null | # --------------
##File path for the file
file_path
def read_file(path):
file = open(file_path , 'r')
sentence = file.readline()
file.close()
return sentence
sample_message = read_file(file_path)
print(sample_message)
#Code starts here
# --------------
#Code starts here
fil... | 19.226744 | 87 | 0.638645 |
_file(path):
file = open(file_path , 'r')
sentence = file.readline()
file.close()
return sentence
sample_message = read_file(file_path)
print(sample_message)
file_path_1
file_path_2
def read_file(path):
file = open(file_path_1 , 'r')
sentence = file.readline()
... | true | true |
790663da37099808d35615fd047642ed91a5fd01 | 6,800 | py | Python | benchmark/IPLoM_agreement.py | dhetong/LogSampleTest | 7ae4cffd43ba6c90f4a5cf164eb44072ece5f08d | [
"MIT"
] | 1 | 2022-02-12T15:09:15.000Z | 2022-02-12T15:09:15.000Z | benchmark/IPLoM_agreement.py | dhetong/LogSampleTest | 7ae4cffd43ba6c90f4a5cf164eb44072ece5f08d | [
"MIT"
] | null | null | null | benchmark/IPLoM_agreement.py | dhetong/LogSampleTest | 7ae4cffd43ba6c90f4a5cf164eb44072ece5f08d | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
from logparser import IPLoM, evaluator
import os
import pandas as pd
CT = [0.25, 0.3, 0.4, 0.4, 0.35, 0.58, 0.3, 0.3, 0.9, 0.78, 0.35, 0.3, 0.4]
lb = [0.3, 0.4, 0.01, 0.2, 0.25, 0.25, 0.3, 0.25, 0.25, 0.25, 0.3, 0.2, 0.7]
n_para = 13
benchmark_settings = {
'HDFS': {
'log_... | 30.222222 | 125 | 0.524118 | import sys
sys.path.append('../')
from logparser import IPLoM, evaluator
import os
import pandas as pd
CT = [0.25, 0.3, 0.4, 0.4, 0.35, 0.58, 0.3, 0.3, 0.9, 0.78, 0.35, 0.3, 0.4]
lb = [0.3, 0.4, 0.01, 0.2, 0.25, 0.25, 0.3, 0.25, 0.25, 0.25, 0.3, 0.2, 0.7]
n_para = 13
benchmark_settings = {
'HDFS': {
'log_... | true | true |
790663f05c783a503c06df853519c767591861fd | 336 | py | Python | blueapps/account/urls.py | wangzishuo111/bk_prometheus | c6aa16d8a547a3d00fbca317f6846ad35b1297ea | [
"MIT"
] | null | null | null | blueapps/account/urls.py | wangzishuo111/bk_prometheus | c6aa16d8a547a3d00fbca317f6846ad35b1297ea | [
"MIT"
] | 2 | 2021-02-08T20:48:38.000Z | 2021-06-10T23:03:39.000Z | blueapps/account/urls.py | wangzishuo111/bk_prometheus | c6aa16d8a547a3d00fbca317f6846ad35b1297ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import url
from blueapps.account import views
app_name = 'account'
urlpatterns = [
url(r'^login_success/$', views.login_success, name="login_success"),
url(r'^login_page/$', views.login_page, name="login_page"),
url(r'^send_code/$', views.send_code_view, name... | 25.846154 | 72 | 0.693452 |
from django.conf.urls import url
from blueapps.account import views
app_name = 'account'
urlpatterns = [
url(r'^login_success/$', views.login_success, name="login_success"),
url(r'^login_page/$', views.login_page, name="login_page"),
url(r'^send_code/$', views.send_code_view, name="send_code")
]
| true | true |
7906640c2dbfc6ab93f04849e869d3e7a0e97285 | 22,035 | py | Python | pyscf/tools/Molpro2Pyscf/wmme.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 1 | 2021-01-24T13:35:42.000Z | 2021-01-24T13:35:42.000Z | pyscf/tools/Molpro2Pyscf/wmme.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/tools/Molpro2Pyscf/wmme.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | # TODO: By PySCF-1.5 release
# Copyright 2014-2020 The PySCF Developers. 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.... | 37.158516 | 274 | 0.621103 |
from __future__ import print_function
import numpy as np
from numpy import dot, array
from os import path
from sys import version_info
def GetModulePath():
import inspect
return path.dirname(path.abspath(inspect.getfile(inspect.currentframe())))
if 0:
_Wmme... | true | true |
79066490d56c44bc5d1a863dc599a0ba58b3e34a | 11,357 | py | Python | main.py | kgantsov/instafollower | 4720fd074907761044b3a8aa060a146eab605b3d | [
"MIT"
] | null | null | null | main.py | kgantsov/instafollower | 4720fd074907761044b3a8aa060a146eab605b3d | [
"MIT"
] | null | null | null | main.py | kgantsov/instafollower | 4720fd074907761044b3a8aa060a146eab605b3d | [
"MIT"
] | null | null | null | import time
import random
import os
import logging
import sys
from datetime import datetime
from datetime import timedelta
from urllib.parse import urlparse
from urllib.parse import urljoin
import click
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions imp... | 26.59719 | 99 | 0.588095 | import time
import random
import os
import logging
import sys
from datetime import datetime
from datetime import timedelta
from urllib.parse import urlparse
from urllib.parse import urljoin
import click
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions imp... | true | true |
790664cbc975f154699499faf04f7a7c0e40ed09 | 1,186 | py | Python | SoftLayer/CLI/virt/placementgroup/create_options.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | SoftLayer/CLI/virt/placementgroup/create_options.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | SoftLayer/CLI/virt/placementgroup/create_options.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """List options for creating Placement Groups"""
# :license: MIT, see LICENSE for more details.
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.managers.vs_placement import PlacementManager as PlacementManager
@click.command()
@environment.pass_env
def cli(env)... | 30.410256 | 98 | 0.711636 |
import click
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.managers.vs_placement import PlacementManager as PlacementManager
@click.command()
@environment.pass_env
def cli(env):
manager = PlacementManager(env.client)
routers = manager.get_routers()
env.fout(... | true | true |
7906654c4de88ccb0d6873323dde8c9eb701060e | 20,038 | py | Python | whisk/test_merge3.py | aiporre/whisk | e07c381bc5d0df4e5dcabd7d75c0c97d0de3ad2c | [
"BSD-3-Clause"
] | null | null | null | whisk/test_merge3.py | aiporre/whisk | e07c381bc5d0df4e5dcabd7d75c0c97d0de3ad2c | [
"BSD-3-Clause"
] | null | null | null | whisk/test_merge3.py | aiporre/whisk | e07c381bc5d0df4e5dcabd7d75c0c97d0de3ad2c | [
"BSD-3-Clause"
] | null | null | null | """
Author: Nathan Clack
Date : 2009
Copyright (c) 2009 HHMI. Free downloads and distribution are allowed for any
non-profit research and educational purposes as long as proper credit is given
to the author. All other rights reserved.
"""
from .tests import plot_whiskers
from ui.whiskerdata.trace import Whisker_Seg
f... | 32.529221 | 99 | 0.550155 | from .tests import plot_whiskers
from ui.whiskerdata.trace import Whisker_Seg
from numpy import *
import pdb
from functools import reduce
def load():
from ui.whiskerdata import load_whiskers, load_trajectories
from ui.genetiff import Reader
movie = Reader('data/seq/whisker_data_0140.seq',adjuststipple=1)
w,wid... | true | true |
790665b03cae28ec6403cb0697d66a4ee43fe3ae | 4,283 | py | Python | otp/launcher/DownloadWatcher.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 3 | 2021-02-25T06:38:13.000Z | 2022-03-22T07:00:15.000Z | otp/launcher/DownloadWatcher.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | null | null | null | otp/launcher/DownloadWatcher.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 1 | 2021-02-25T06:38:17.000Z | 2021-02-25T06:38:17.000Z | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: otp.launcher.DownloadWatcher
from direct.task import Task
from otp.otpbase import OTPLocalizer
from direct.gui.DirectGui import *
from p... | 99.604651 | 318 | 0.257063 |
from direct.task import Task
from otp.otpbase import OTPLocalizer
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
class DownloadWatcher(DirectObject):
__module__ = __name__
def __init__(self, phaseNames):
self.phaseNames = ... | true | true |
790667ab3346fc7bd8fc01edc7ecb50ef8669b01 | 9,962 | py | Python | Allura/allura/model/index.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | null | null | null | Allura/allura/model/index.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | null | null | null | Allura/allura/model/index.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 36.225455 | 118 | 0.57639 |
from __future__ import unicode_literals
from __future__ import absolute_import
import re
import logging
from itertools import groupby
from six.moves.cPickle import dumps, loads
from collections import defaultdict
from six.moves.urllib.parse import unquote
import bson
import pymongo
from tg import tmpl... | true | true |
790667b9e8d7f3a6d2c1475a4dbdaaabec469b79 | 3,463 | py | Python | rustici_software_cloud_v2/models/destination_id_schema.py | ryanhope2/scormcloud-api-v2-client-python | fcc392933218d32b70987f8bfb1711f891f31c06 | [
"Apache-2.0"
] | null | null | null | rustici_software_cloud_v2/models/destination_id_schema.py | ryanhope2/scormcloud-api-v2-client-python | fcc392933218d32b70987f8bfb1711f891f31c06 | [
"Apache-2.0"
] | null | null | null | rustici_software_cloud_v2/models/destination_id_schema.py | ryanhope2/scormcloud-api-v2-client-python | fcc392933218d32b70987f8bfb1711f891f31c06 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
SCORM Cloud Rest API
REST API used for SCORM Cloud integrations.
OpenAPI spec version: 2.0
Contact: systems@rusticisoftware.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class Destina... | 24.387324 | 77 | 0.524978 |
from pprint import pformat
from six import iteritems
import re
class DestinationIdSchema(object):
def __init__(self, id=None, data=None):
self.swagger_types = {
'id': 'str',
'data': 'DestinationSchema'
}
self.attribute_map = {
'id': 'id',
... | true | true |
790667c757587de0f3d043867d3b48b90b9679be | 2,324 | py | Python | rest_waspmote/models.py | Infinityloopsistemas/SIVA | 92b6c82f018d39ef405989639974d1f2757476ed | [
"BSD-3-Clause"
] | null | null | null | rest_waspmote/models.py | Infinityloopsistemas/SIVA | 92b6c82f018d39ef405989639974d1f2757476ed | [
"BSD-3-Clause"
] | 1 | 2018-09-27T12:07:19.000Z | 2018-10-08T15:56:30.000Z | rest_waspmote/models.py | Infinityloopsistemas/SIVA | 92b6c82f018d39ef405989639974d1f2757476ed | [
"BSD-3-Clause"
] | 1 | 2018-10-12T13:41:20.000Z | 2018-10-12T13:41:20.000Z | from django.utils import timezone
from maestros.models import Unidades
from maestros_generales.models import Empresas
__author__ = 'julian'
from django.contrib.gis.db import models
import datetime
class WaspTypeSensor(models.Model):
name = models.CharField(max_length=50)
units = models.... | 45.568627 | 121 | 0.671687 | from django.utils import timezone
from maestros.models import Unidades
from maestros_generales.models import Empresas
__author__ = 'julian'
from django.contrib.gis.db import models
import datetime
class WaspTypeSensor(models.Model):
name = models.CharField(max_length=50)
units = models.... | true | true |
7906682ea597efb6454e0a11ae1047ad087ef53b | 1,700 | py | Python | fuzzers/ECP5/143-bankref8/fuzzer.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 256 | 2018-03-05T00:28:46.000Z | 2022-03-04T22:33:29.000Z | fuzzers/ECP5/143-bankref8/fuzzer.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 70 | 2018-03-12T21:55:02.000Z | 2020-06-22T12:06:08.000Z | fuzzers/ECP5/143-bankref8/fuzzer.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 68 | 2018-03-12T21:05:01.000Z | 2021-03-14T21:08:33.000Z | from fuzzconfig import FuzzConfig
import nonrouting
import nets
import pytrellis
import re
import fuzzloops
jobs = [
{
"cfg": FuzzConfig(job="BANKREF8", family="ECP5", device="LFE5U-45F", ncl="empty.ncl",
tiles=["MIB_R71C3:BANKREF8"]),
"side": "B",
"pin": "R1"
... | 26.984127 | 130 | 0.468235 | from fuzzconfig import FuzzConfig
import nonrouting
import nets
import pytrellis
import re
import fuzzloops
jobs = [
{
"cfg": FuzzConfig(job="BANKREF8", family="ECP5", device="LFE5U-45F", ncl="empty.ncl",
tiles=["MIB_R71C3:BANKREF8"]),
"side": "B",
"pin": "R1"
... | true | true |
7906684775fc8960a9d705006ec1d98ea3ffcb4c | 7,715 | py | Python | experiments/digit/unsupervised_digit_inspect.py | viniciusarruda/SHOT | 46e122026805833df36b40d68fe8d815f8d614af | [
"MIT"
] | null | null | null | experiments/digit/unsupervised_digit_inspect.py | viniciusarruda/SHOT | 46e122026805833df36b40d68fe8d815f8d614af | [
"MIT"
] | null | null | null | experiments/digit/unsupervised_digit_inspect.py | viniciusarruda/SHOT | 46e122026805833df36b40d68fe8d815f8d614af | [
"MIT"
] | null | null | null | import argparse
import os, sys
import os.path as osp
import torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import network, loss
from torch.utils.data import DataLoader
import random, pdb, math, copy
from tqdm import tqdm
from scipy.spatia... | 40.820106 | 126 | 0.61024 | import argparse
import os, sys
import os.path as osp
import torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import network, loss
from torch.utils.data import DataLoader
import random, pdb, math, copy
from tqdm import tqdm
from scipy.spatia... | true | true |
790668cb9fdd6ece569f358e157a257b12f0dcb2 | 1,291 | py | Python | playlist_parser.py | MikeWent/applepd_bot | bf093d52f6f97f0e5bb2c969b4a31f0e44cb018f | [
"MIT"
] | null | null | null | playlist_parser.py | MikeWent/applepd_bot | bf093d52f6f97f0e5bb2c969b4a31f0e44cb018f | [
"MIT"
] | null | null | null | playlist_parser.py | MikeWent/applepd_bot | bf093d52f6f97f0e5bb2c969b4a31f0e44cb018f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Data schema:
# (start) (12b junk) artist (5* byte) (1b junk) title (col) (1b junk) date and time (col) (1b junk) url (urldur) duration (col) (1b junk) thumbnail url (end)
keybytes = {
"row_start": "80 09 80 00 80", # row start
"col": "5F 10", # column delimeter
"urldur": "58", # u... | 37.970588 | 157 | 0.543765 |
keybytes = {
"row_start": "80 09 80 00 80",
"col": "5F 10",
"urldur": "58",
"urldur2": "D8",
"urldur3": "D2",
"row_end": "D8 00 0A 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 30 00 31 00 32 00"
}
for k, v in keybytes.items():
keybytes[k] = bytearray.fromhex(v)
def get_urls_from_playli... | true | true |
79066a340dfaa07ea5013899ead5c2fd00fc74b5 | 4,223 | py | Python | examples/termui/termui.py | D4N/asyncclick | fa4decbe3537cf280c8e5371d7ab0b2db4b8a706 | [
"BSD-3-Clause"
] | null | null | null | examples/termui/termui.py | D4N/asyncclick | fa4decbe3537cf280c8e5371d7ab0b2db4b8a706 | [
"BSD-3-Clause"
] | null | null | null | examples/termui/termui.py | D4N/asyncclick | fa4decbe3537cf280c8e5371d7ab0b2db4b8a706 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
import math
import random
import time
import asyncclick as click
@click.group()
def cli():
"""This script showcases different terminal UI helpers in Click."""
pass
@cli.command()
def colordemo():
"""Demonstrates ANSI color support."""
for color in "red", "green", "blue":
cli... | 24.695906 | 85 | 0.550556 |
import math
import random
import time
import asyncclick as click
@click.group()
def cli():
pass
@cli.command()
def colordemo():
for color in "red", "green", "blue":
click.echo(click.style("I am colored {}".format(color), fg=color))
click.echo(click.style("I am background colored {}".format... | true | true |
79066bbfa4d827febdef30e544ab1b3979535a20 | 3,230 | py | Python | feast_trino/trino_type_map.py | tpvasconcelos/feast-trino | d628182753c23aa2e851014e54f48aff28d43207 | [
"MIT"
] | 810 | 2018-12-25T15:16:11.000Z | 2020-05-14T09:49:40.000Z | feast_trino/trino_type_map.py | tpvasconcelos/feast-trino | d628182753c23aa2e851014e54f48aff28d43207 | [
"MIT"
] | 701 | 2018-12-21T05:18:43.000Z | 2020-05-16T01:30:21.000Z | feast_trino/trino_type_map.py | tpvasconcelos/feast-trino | d628182753c23aa2e851014e54f48aff28d43207 | [
"MIT"
] | 155 | 2018-12-22T11:05:04.000Z | 2020-05-14T07:33:41.000Z | from typing import Dict
import pyarrow as pa
import regex as re
from feast import ValueType
def trino_to_feast_value_type(trino_type_as_str: str) -> ValueType:
type_map: Dict[str, ValueType] = {
"tinyint": ValueType.INT32,
"smallint": ValueType.INT32,
"int": ValueType.INT32,
"int... | 28.839286 | 86 | 0.603406 | from typing import Dict
import pyarrow as pa
import regex as re
from feast import ValueType
def trino_to_feast_value_type(trino_type_as_str: str) -> ValueType:
type_map: Dict[str, ValueType] = {
"tinyint": ValueType.INT32,
"smallint": ValueType.INT32,
"int": ValueType.INT32,
"int... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.