hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ed75b8a825782f227e671daaa305387cdcbcd9d0 | 2,688 | py | Python | v2_hier/site_stat.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | v2_hier/site_stat.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | v2_hier/site_stat.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | """Collecting statistics of site visits."""
import collections
from datetime import datetime
from functools import reduce
from django.utils.translation import gettext_lazy as _
from hier.models import IPInfo, AccessLog, SiteStat
from v2_hier.utils import APPS
def get_site_stat(user):
"""Processing a new portion of... | 31.623529 | 115 | 0.599702 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 583 | 0.21689 |
ed75ce190b9f65a6716720968d522d43762ebdb0 | 16,643 | py | Python | cli/pcluster/utils.py | mkosmo/cfncluster | f1817cc187f2b92127d48f16debb4b7ea4f4a80f | [
"Apache-2.0"
] | 1 | 2021-04-08T05:08:07.000Z | 2021-04-08T05:08:07.000Z | cli/pcluster/utils.py | mkosmo/cfncluster | f1817cc187f2b92127d48f16debb4b7ea4f4a80f | [
"Apache-2.0"
] | null | null | null | cli/pcluster/utils.py | mkosmo/cfncluster | f1817cc187f2b92127d48f16debb4b7ea4f4a80f | [
"Apache-2.0"
] | 1 | 2019-05-10T16:03:19.000Z | 2019-05-10T16:03:19.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
# the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 35.714592 | 119 | 0.672715 | 0 | 0 | 471 | 0.0283 | 0 | 0 | 0 | 0 | 7,890 | 0.474073 |
ed75ef3dbcd90991f3b2e3a5c73442983622bbb5 | 452 | py | Python | thinkutils_plus/eventbus/sample/myeventbus.py | ThinkmanWang/thinkutils_plus | 65d56a1a0cfce22dff08a4f0baea6b4eb08a2e35 | [
"MIT"
] | null | null | null | thinkutils_plus/eventbus/sample/myeventbus.py | ThinkmanWang/thinkutils_plus | 65d56a1a0cfce22dff08a4f0baea6b4eb08a2e35 | [
"MIT"
] | null | null | null | thinkutils_plus/eventbus/sample/myeventbus.py | ThinkmanWang/thinkutils_plus | 65d56a1a0cfce22dff08a4f0baea6b4eb08a2e35 | [
"MIT"
] | null | null | null | __author__ = 'Xsank'
import time
from thinkutils_plus.eventbus.eventbus import EventBus
from myevent import GreetEvent
from myevent import ByeEvent
from mylistener import MyListener
if __name__=="__main__":
eventbus=EventBus()
eventbus.register(MyListener())
ge=GreetEvent('world')
be=ByeEvent('world'... | 23.789474 | 54 | 0.743363 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 0.068584 |
ed7707a9a93d2eb459c06d85459c2db5718ad3cc | 3,963 | py | Python | tools/telemetry/telemetry/core/platform/android_device_unittest.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | tools/telemetry/telemetry/core/platform/android_device_unittest.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/core/platform/android_device_unittest.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry import benchmark
from telemetry.core import browser_options
from telemetry.core.platform import android_device
from telemetry... | 39.63 | 78 | 0.7459 | 3,542 | 0.893767 | 0 | 0 | 0 | 0 | 0 | 0 | 803 | 0.202624 |
ed7911d27c0fa532add30880dc5c7b6aaf924408 | 1,265 | py | Python | logger.py | bekaaa/xgboost_tuner | 2d93f6cc751b3a8778420a88caf73fd1dc8ef2ce | [
"MIT"
] | null | null | null | logger.py | bekaaa/xgboost_tuner | 2d93f6cc751b3a8778420a88caf73fd1dc8ef2ce | [
"MIT"
] | null | null | null | logger.py | bekaaa/xgboost_tuner | 2d93f6cc751b3a8778420a88caf73fd1dc8ef2ce | [
"MIT"
] | 1 | 2019-03-16T14:30:07.000Z | 2019-03-16T14:30:07.000Z | #! /usr/bin/env python
import logging
#---------------------------------------
class logger :
'''
A ready to use logging class.
All you need to do is set an object with the parameters (log_filename, directory to save it)
then whenever you want to add text, type obj.add("some text").
The function obj.close() is no... | 31.625 | 93 | 0.622925 | 1,184 | 0.935968 | 0 | 0 | 0 | 0 | 0 | 0 | 570 | 0.450593 |
ed79b8872d0353b944045d77a3b550a09342bdbf | 5,536 | py | Python | baselines/prep_baseline.py | lessleslie/slm-code-generation | 017ac0828faf3467e9f85883e27be09ec3898b14 | [
"MIT"
] | 64 | 2020-06-23T06:27:42.000Z | 2022-03-30T07:44:52.000Z | baselines/prep_baseline.py | lessleslie/slm-code-generation | 017ac0828faf3467e9f85883e27be09ec3898b14 | [
"MIT"
] | 11 | 2020-07-14T23:29:31.000Z | 2021-09-17T15:17:49.000Z | baselines/prep_baseline.py | tech-srl/slm-code-generation | 15fe4e1df82e49587f725577f870ca12dc42903a | [
"MIT"
] | 6 | 2020-07-09T08:42:04.000Z | 2021-03-02T14:35:31.000Z | import json
import multiprocessing as mp
import re
from argparse import ArgumentParser
from enum import Enum, auto
import javalang
from functools import partial
PRED_TOKEN = 'PRED'
modifiers = ['public', 'private', 'protected', 'static']
class TargetType(Enum):
seq = auto()
tree = auto()
@staticmethod
... | 40.408759 | 146 | 0.629516 | 203 | 0.036669 | 0 | 0 | 139 | 0.025108 | 0 | 0 | 1,059 | 0.191293 |
ed79d1c413293473a8ee91b105de6df7218762d5 | 1,865 | py | Python | var/spack/repos/builtin/packages/r-multicool/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-multicool/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-multicool/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RMulticool(RPackage):
"""Permutations of multisets in cool-lex order
A set of tools t... | 51.805556 | 97 | 0.759249 | 1,644 | 0.881501 | 0 | 0 | 0 | 0 | 0 | 0 | 1,680 | 0.900804 |
ed7af640d287226ceb10c1b2fceda155d15712f4 | 7,426 | py | Python | updatetranslations.py | erincerys/ergo | 0aeedcdcccb5348d8eedb5faa6a0536d93ca3ae3 | [
"MIT"
] | 1,122 | 2017-06-15T05:44:52.000Z | 2021-05-26T16:27:43.000Z | updatetranslations.py | erincerys/ergo | 0aeedcdcccb5348d8eedb5faa6a0536d93ca3ae3 | [
"MIT"
] | 1,031 | 2017-06-18T13:57:51.000Z | 2021-05-26T19:51:37.000Z | updatetranslations.py | erincerys/ergo | 0aeedcdcccb5348d8eedb5faa6a0536d93ca3ae3 | [
"MIT"
] | 113 | 2017-06-21T18:32:53.000Z | 2021-05-26T13:12:46.000Z | #!/usr/bin/env python3
# updatetranslations.py
#
# tl;dr this script updates our translation file with the newest, coolest strings we've added!
# it manually searches the source code, extracts strings and then updates the language files.
# Written in 2018 by Daniel Oaks <[email protected]>
#
# To the extent possib... | 37.887755 | 110 | 0.524239 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,038 | 0.274441 |
ed7b8022569fdf95c3598fcd38e2d1c4182f053f | 1,437 | py | Python | processing_tools/number_of_tenants.py | apanda/modeling | e032abd413bb3325ad6e5995abadeef74314f383 | [
"BSD-3-Clause"
] | 3 | 2017-08-30T05:24:11.000Z | 2021-02-25T12:17:19.000Z | processing_tools/number_of_tenants.py | apanda/modeling | e032abd413bb3325ad6e5995abadeef74314f383 | [
"BSD-3-Clause"
] | null | null | null | processing_tools/number_of_tenants.py | apanda/modeling | e032abd413bb3325ad6e5995abadeef74314f383 | [
"BSD-3-Clause"
] | 2 | 2017-11-15T07:00:48.000Z | 2020-12-13T17:29:03.000Z | import sys
from collections import defaultdict
def Process (fnames):
tenant_time = defaultdict(lambda: defaultdict(lambda: 0.0))
tenant_run = defaultdict(lambda: defaultdict(lambda:0))
for fname in fnames:
f = open(fname)
for l in f:
if l.startswith("tenant"):
co... | 35.04878 | 68 | 0.526792 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.070981 |
ed7d1c9bb5710045f4cb95dccf219d3b5c6faaa9 | 2,564 | py | Python | pyfisher/mpi.py | borisbolliet/pyfisher | 715e192baa4fadbff754416d2b001c3708c9276c | [
"BSD-3-Clause"
] | 7 | 2017-12-06T18:16:13.000Z | 2021-02-09T19:25:26.000Z | pyfisher/mpi.py | borisbolliet/pyfisher | 715e192baa4fadbff754416d2b001c3708c9276c | [
"BSD-3-Clause"
] | 34 | 2016-01-25T19:48:07.000Z | 2021-02-03T22:34:09.000Z | pyfisher/mpi.py | borisbolliet/pyfisher | 715e192baa4fadbff754416d2b001c3708c9276c | [
"BSD-3-Clause"
] | 10 | 2017-02-01T15:14:22.000Z | 2021-02-16T01:34:16.000Z | from __future__ import print_function
import numpy as np
import os,sys,time
"""
Copied from orphics.mpi
"""
try:
disable_mpi_env = os.environ['DISABLE_MPI']
disable_mpi = True if disable_mpi_env.lower().strip() == "true" else False
except:
disable_mpi = False
"""
Use the below cleanup stuff only for inte... | 29.813953 | 242 | 0.697738 | 294 | 0.114665 | 0 | 0 | 0 | 0 | 0 | 0 | 1,046 | 0.407956 |
ed7d572858561992a56ab8312f08925dad1d2745 | 6,260 | py | Python | ebay.py | SpironoZeppeli/Magic-The-Scannening | 93c595a4c98fb725a79eeddfaba99cb0409d41fb | [
"MIT"
] | null | null | null | ebay.py | SpironoZeppeli/Magic-The-Scannening | 93c595a4c98fb725a79eeddfaba99cb0409d41fb | [
"MIT"
] | null | null | null | ebay.py | SpironoZeppeli/Magic-The-Scannening | 93c595a4c98fb725a79eeddfaba99cb0409d41fb | [
"MIT"
] | null | null | null | import requests
import urllib.request
import urllib.parse
import PIL
import re
import configparser
import json
from PIL import Image
from ebaysdk.trading import Connection as Trading
from ebaysdk.exception import ConnectionError
from yaml import load
from PyQt5.QtWidgets import QMessageBox
class EbaySeller:
def ... | 42.013423 | 119 | 0.546486 | 5,966 | 0.953035 | 0 | 0 | 0 | 0 | 0 | 0 | 1,581 | 0.252556 |
ed7de0c98f16f1e656d840a2c9ad1e60a28cfa7f | 3,175 | py | Python | bot/exts/github/github.py | v1nam/gurkbot | a0f5e05a5f65e6169accc90271fca58f4df211fe | [
"MIT"
] | 24 | 2020-12-18T07:26:14.000Z | 2022-03-30T22:56:49.000Z | bot/exts/github/github.py | v1nam/gurkbot | a0f5e05a5f65e6169accc90271fca58f4df211fe | [
"MIT"
] | 143 | 2020-12-18T09:13:51.000Z | 2022-03-02T19:27:44.000Z | bot/exts/github/github.py | v1nam/gurkbot | a0f5e05a5f65e6169accc90271fca58f4df211fe | [
"MIT"
] | 44 | 2020-12-18T09:05:29.000Z | 2022-03-02T20:06:23.000Z | import typing
from bot.constants import BOT_REPO_URL
from discord import Embed
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from . import _issues, _profile, _source
class Github(commands.Cog):
"""
Github Category cog, which contains commands related to github.
... | 34.89011 | 88 | 0.640945 | 2,869 | 0.901918 | 0 | 0 | 2,424 | 0.762025 | 2,128 | 0.668972 | 837 | 0.263125 |
ed7de7f5235ff8dd0c5f7e122b59415ab3622dc6 | 1,154 | py | Python | log/slack_sender.py | SmashKs/BarBarian | b308dcb9e24ec621abbbc121847923e14e5b6a4b | [
"MIT"
] | null | null | null | log/slack_sender.py | SmashKs/BarBarian | b308dcb9e24ec621abbbc121847923e14e5b6a4b | [
"MIT"
] | 2 | 2020-06-05T19:25:24.000Z | 2021-06-10T20:56:57.000Z | log/slack_sender.py | SmashKs/BarBarian | b308dcb9e24ec621abbbc121847923e14e5b6a4b | [
"MIT"
] | null | null | null | from slackclient import SlackClient
from external import SLACK_API_KEY
class SlackBot:
API_CHAT_MSG = 'chat.postMessage'
BOT_NAME = 'News Bot'
DEFAULT_CHANNEL = 'news_notification'
def __new__(cls, *p, **k):
if '_the_instance' not in cls.__dict__:
cls._the_instance = object.__new... | 32.971429 | 70 | 0.559792 | 1,006 | 0.87175 | 0 | 0 | 0 | 0 | 0 | 0 | 91 | 0.078856 |
ed7e4d3da4d7bdad5eca61e8c5160dfe0d14608f | 2,379 | py | Python | src/pytezos/block/forge.py | miracle2k/pytezos | e6b99f00f342d9a05b0c36a9883040961fd6d58e | [
"MIT"
] | 98 | 2019-02-07T16:33:38.000Z | 2022-03-31T15:53:41.000Z | src/pytezos/block/forge.py | miracle2k/pytezos | e6b99f00f342d9a05b0c36a9883040961fd6d58e | [
"MIT"
] | 152 | 2019-05-20T16:38:56.000Z | 2022-03-30T14:24:38.000Z | src/pytezos/block/forge.py | miracle2k/pytezos | e6b99f00f342d9a05b0c36a9883040961fd6d58e | [
"MIT"
] | 34 | 2019-07-25T12:03:51.000Z | 2021-11-11T22:23:38.000Z | from typing import Any, Dict, List, Tuple
from pytezos.michelson.forge import forge_array, forge_base58, optimize_timestamp
def bump_fitness(fitness: Tuple[str, str]) -> Tuple[str, str]:
if len(fitness) == 0:
major = 0
minor = 1
else:
major = int.from_bytes(bytes.fromhex(fitness[0]), ... | 33.985714 | 87 | 0.666246 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 347 | 0.14586 |
ed7f467835f32242a9650f226b4a5ad9d6d87af4 | 5,321 | py | Python | python/paddle/fluid/tests/unittests/test_roi_pool_op.py | jichangjichang/Paddle | 4fa3cee5499c6df0ad6043b0cfa220d09f2034e8 | [
"Apache-2.0"
] | 9 | 2017-12-04T02:58:01.000Z | 2020-12-03T14:46:30.000Z | python/paddle/fluid/tests/unittests/test_roi_pool_op.py | jichangjichang/Paddle | 4fa3cee5499c6df0ad6043b0cfa220d09f2034e8 | [
"Apache-2.0"
] | 7 | 2017-12-05T20:29:08.000Z | 2018-10-15T08:57:40.000Z | python/paddle/fluid/tests/unittests/test_roi_pool_op.py | jichangjichang/Paddle | 4fa3cee5499c6df0ad6043b0cfa220d09f2034e8 | [
"Apache-2.0"
] | 6 | 2018-03-19T22:38:46.000Z | 2019-11-01T22:28:27.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 37.20979 | 80 | 0.543131 | 4,504 | 0.846457 | 0 | 0 | 0 | 0 | 0 | 0 | 737 | 0.138508 |
ed7fc7d6fb252e1b75bf1b904b18ffd861a8c42f | 1,162 | py | Python | testproject/testapp/tests/__init__.py | movermeyer/django-firestone | e045089f6ff4a6686633f9c5909c314a010bd4a0 | [
"WTFPL"
] | 1 | 2017-03-08T22:58:35.000Z | 2017-03-08T22:58:35.000Z | testproject/testapp/tests/__init__.py | movermeyer/django-firestone | e045089f6ff4a6686633f9c5909c314a010bd4a0 | [
"WTFPL"
] | null | null | null | testproject/testapp/tests/__init__.py | movermeyer/django-firestone | e045089f6ff4a6686633f9c5909c314a010bd4a0 | [
"WTFPL"
] | 1 | 2018-03-05T17:40:55.000Z | 2018-03-05T17:40:55.000Z | from test_proxy import *
from test_serializers import *
from test_deserializers import *
from test_exceptions import *
from test_authentication import *
from test_whole_flow import *
from test_handlers_metaclass_magic import *
from test_handlers_serialize_to_python import *
from test_handlers_is_method_allowed im... | 31.405405 | 47 | 0.865749 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed801190784fa836d2752af1e6b10b54a93fa361 | 2,518 | py | Python | Day20.py | SheepiCagio/Advent-of-Code-2021 | 52f0035da2cb258810d8947cbf56b51b65a9fe8b | [
"MIT"
] | null | null | null | Day20.py | SheepiCagio/Advent-of-Code-2021 | 52f0035da2cb258810d8947cbf56b51b65a9fe8b | [
"MIT"
] | null | null | null | Day20.py | SheepiCagio/Advent-of-Code-2021 | 52f0035da2cb258810d8947cbf56b51b65a9fe8b | [
"MIT"
] | null | null | null | import numpy as np
raw = open("inputs/20.txt","r").readlines()
input_array= [(i.replace('\n', '').replace('.','0').replace('#', '1')) for i in raw]
test_raw = open("inputs/20_test.txt","r").readlines()
test_array= [(i.replace('\n', '').replace('.','0').replace('#', '1')) for i in test_raw]
def addLayerZero(grid):
#if... | 35.464789 | 110 | 0.635822 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 481 | 0.191025 |
ed8134024179e7e4607f23c5ef95e9da1da3820b | 1,674 | py | Python | questions/53349623/main.py | sesu089/stackoverflow | 6fae69be6fa74fba9d554e6b5f387e5d3c1aad73 | [
"MIT"
] | 302 | 2017-03-04T00:05:23.000Z | 2022-03-28T22:51:29.000Z | questions/53349623/main.py | sesu089/stackoverflow | 6fae69be6fa74fba9d554e6b5f387e5d3c1aad73 | [
"MIT"
] | 30 | 2017-12-02T19:26:43.000Z | 2022-03-28T07:40:36.000Z | questions/53349623/main.py | sesu089/stackoverflow | 6fae69be6fa74fba9d554e6b5f387e5d3c1aad73 | [
"MIT"
] | 388 | 2017-07-04T16:53:12.000Z | 2022-03-18T22:20:19.000Z | import sys
from PyQt5 import QtCore, QtGui, QtWidgets
class Demo(QtWidgets.QWidget):
def __init__(self):
super(Demo, self).__init__()
self.button = QtWidgets.QPushButton()
self.label = QtWidgets.QLabel(alignment=QtCore.Qt.AlignCenter)
self.combo = QtWidgets.QComboBox(self)
... | 32.823529 | 84 | 0.642772 | 1,491 | 0.888029 | 0 | 0 | 313 | 0.18642 | 0 | 0 | 90 | 0.053603 |
ed81492b65a1f232ede7d038b4670a415f3f191c | 1,638 | py | Python | tests/test_error_descriptions_from_raises.py | iterait/apistrap | e83460fa97f13a95a928971b0d2defe0ac611911 | [
"MIT"
] | 6 | 2018-09-06T18:32:48.000Z | 2021-05-28T01:03:32.000Z | tests/test_error_descriptions_from_raises.py | iterait/apistrap | e83460fa97f13a95a928971b0d2defe0ac611911 | [
"MIT"
] | 53 | 2018-09-06T16:16:53.000Z | 2021-05-19T14:36:58.000Z | tests/test_error_descriptions_from_raises.py | iterait/apistrap | e83460fa97f13a95a928971b0d2defe0ac611911 | [
"MIT"
] | null | null | null | import pytest
from apistrap.flask import FlaskApistrap
from apistrap.schemas import ErrorResponse
@pytest.fixture()
def app_with_raises(app):
oapi = FlaskApistrap()
@app.route("/", methods=["GET"])
def view():
"""
Something something.
:raises KeyError: KeyError description
... | 23.4 | 69 | 0.527473 | 0 | 0 | 0 | 0 | 579 | 0.35348 | 0 | 0 | 510 | 0.311355 |
ed82dc9fed173aeada3cbab76076165a4c9b3932 | 1,126 | py | Python | projects/api/UsersApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | projects/api/UsersApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | projects/api/UsersApi.py | chamathshashika/projects-python-wrappers | 33e9f6bccba16a581b115c582033a93d43bb159c | [
"MIT"
] | null | null | null | #$Id$
from projects.util.ZohoHttpClient import ZohoHttpClient
from projects.api.Api import Api
from projects.parser.UsersParser import UsersParser
base_url = Api().base_url
zoho_http_client = ZohoHttpClient()
parser = UsersParser()
class UsersApi:
"""Users Api class is used to
1.Get all the users in th... | 25.590909 | 101 | 0.617229 | 889 | 0.78952 | 0 | 0 | 0 | 0 | 0 | 0 | 499 | 0.443162 |
ed82e608ff9e5d51a3d3e7cab08afa27210afbdb | 11,340 | py | Python | useless/tuck_arms.py | leader1313/Baxter_teleoperation_system | 856d999acd73e6c1dc15a342cb6c4fcd1a482863 | [
"Apache-2.0"
] | null | null | null | useless/tuck_arms.py | leader1313/Baxter_teleoperation_system | 856d999acd73e6c1dc15a342cb6c4fcd1a482863 | [
"Apache-2.0"
] | 2 | 2019-10-15T07:24:24.000Z | 2019-10-15T07:28:19.000Z | useless/tuck_arms.py | leader1313/Baxter_teleoperation_system | 856d999acd73e6c1dc15a342cb6c4fcd1a482863 | [
"Apache-2.0"
] | 1 | 2020-09-15T12:37:13.000Z | 2020-09-15T12:37:13.000Z | #!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# ... | 42.47191 | 79 | 0.568078 | 8,698 | 0.767019 | 0 | 0 | 0 | 0 | 0 | 0 | 3,659 | 0.322663 |
ed8397333a807416a6c46033a45a38d2847fa564 | 203 | py | Python | django-system/src/tsm_api/serializers.py | Deepak-Kharah/ioe-project | 6f83ddcfced25130e0f05c3380dde97429d1f224 | [
"MIT"
] | null | null | null | django-system/src/tsm_api/serializers.py | Deepak-Kharah/ioe-project | 6f83ddcfced25130e0f05c3380dde97429d1f224 | [
"MIT"
] | null | null | null | django-system/src/tsm_api/serializers.py | Deepak-Kharah/ioe-project | 6f83ddcfced25130e0f05c3380dde97429d1f224 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Measurement
class MeasurementSerializer(serializers.ModelSerializer):
class Meta:
model = Measurement
fields = '__all__'
| 20.3 | 57 | 0.748768 | 128 | 0.630542 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0.044335 |
ed83e8c908ff960c5bf16835dd114bff6b5f51a1 | 123 | py | Python | src/GalaxyDynamicsFromVc/units.py | pabferde/galaxy_dynamics_from_Vc | 7232f7bfd6d2338bcec3bbf87478f7a482c749ef | [
"MIT"
] | null | null | null | src/GalaxyDynamicsFromVc/units.py | pabferde/galaxy_dynamics_from_Vc | 7232f7bfd6d2338bcec3bbf87478f7a482c749ef | [
"MIT"
] | null | null | null | src/GalaxyDynamicsFromVc/units.py | pabferde/galaxy_dynamics_from_Vc | 7232f7bfd6d2338bcec3bbf87478f7a482c749ef | [
"MIT"
] | null | null | null |
_Msun_kpc3_to_GeV_cm3_factor = 0.3/8.0e6
def Msun_kpc3_to_GeV_cm3(value):
return value*_Msun_kpc3_to_GeV_cm3_factor
| 17.571429 | 45 | 0.821138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed849abb775e5f57be3b9019dbf370e35893e0b2 | 606 | py | Python | Python/leetcode.031.next-permutation.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | 4 | 2015-10-10T00:30:55.000Z | 2020-07-27T19:45:54.000Z | Python/leetcode.031.next-permutation.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | Python/leetcode.031.next-permutation.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | class Solution(object):
def nextPermutation(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
if not nums: return
n = len(nums)-1
while n > 0 and nums[n-1] >= nums[n]:
n -= 1
t = n... | 27.545455 | 74 | 0.429043 | 606 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 120 | 0.19802 |
ed84e43c822be0079982b64c82f1405fcf82f103 | 1,114 | py | Python | poll/models/telemetry_models.py | mirokrastev/poll-website | 4f26cce3f838ab05de91f0e1dba34d9bc59927b4 | [
"MIT"
] | 3 | 2021-07-03T19:05:56.000Z | 2022-02-02T17:22:17.000Z | poll/models/telemetry_models.py | mirokrastev/poll-website | 4f26cce3f838ab05de91f0e1dba34d9bc59927b4 | [
"MIT"
] | null | null | null | poll/models/telemetry_models.py | mirokrastev/poll-website | 4f26cce3f838ab05de91f0e1dba34d9bc59927b4 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
from poll.models.poll_models import Poll
class BasePollTelemetry(models.Model):
"""
This Base class gives a hint that in the future
more Telemetry classes could be implemented.
"""
poll = models.ForeignKey(db_index=True, ... | 27.85 | 91 | 0.72711 | 988 | 0.886894 | 0 | 0 | 0 | 0 | 0 | 0 | 307 | 0.275583 |
ed84fba26398a78d3cfbc33d60c7ec3256e7da8a | 208 | py | Python | pcdet/models/backbones_2d/__init__.py | HenryLittle/OpenPCDet-HL | 7dba01750e10d170849314723ec0665782236a70 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_2d/__init__.py | HenryLittle/OpenPCDet-HL | 7dba01750e10d170849314723ec0665782236a70 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_2d/__init__.py | HenryLittle/OpenPCDet-HL | 7dba01750e10d170849314723ec0665782236a70 | [
"Apache-2.0"
] | null | null | null | from .base_bev_backbone import BaseBEVBackbone
from .decouple_bev_backbone import DecoupledBEVBackbone
__all__ = {
'BaseBEVBackbone': BaseBEVBackbone,
'DecoupledBEVBackbone': DecoupledBEVBackbone,
}
| 26 | 55 | 0.817308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 39 | 0.1875 |
ed86102b88fe53e5292e7840680746dc239293e9 | 4,883 | py | Python | test/unit/app/tools/test_select_parameters.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | test/unit/app/tools/test_select_parameters.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | test/unit/app/tools/test_select_parameters.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | from unittest.mock import Mock
import pytest
from galaxy import model
from galaxy.tools.parameters import basic
from .util import BaseParameterTestCase
class SelectToolParameterTestCase(BaseParameterTestCase):
def test_validated_values(self):
self.options_xml = """<options><filter type="data_meta" ref="... | 45.635514 | 137 | 0.643662 | 4,723 | 0.967233 | 0 | 0 | 719 | 0.147246 | 0 | 0 | 1,415 | 0.289781 |
ed874fc7d5498d0b2a5744718551a9a50f16e262 | 141 | py | Python | recumpiler/__init__.py | Toasterstein/recumpiler | 390957cfaa8f60ffeb24adb43b91981dd445c6b9 | [
"MIT"
] | null | null | null | recumpiler/__init__.py | Toasterstein/recumpiler | 390957cfaa8f60ffeb24adb43b91981dd445c6b9 | [
"MIT"
] | 8 | 2021-03-23T21:54:29.000Z | 2021-03-30T23:17:06.000Z | recumpiler/__init__.py | nklapste/recumpiler | 80efcfad995211c010f4d962221ab576ca50229f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""recumpiler
Recompile text to be semi-readable memey garbage.
"""
__version__ = (0, 0, 0)
| 14.1 | 49 | 0.638298 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 112 | 0.794326 |
ed87f843694726a8943e8ca3120951277107fd9a | 108,939 | gyp | Python | net/net.gyp | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | net/net.gyp | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | net/net.gyp | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:25:45.000Z | 2020-11-04T07:25:45.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
'linux_link_kerberos%': 0,
'conditions': [
['chromeos==1 or OS=="android" or OS=="ios"', {
... | 39.074247 | 106 | 0.589587 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 75,380 | 0.691947 |
ed88b978abfea5e45767847b3da18555a2c06112 | 2,268 | py | Python | python/clx/analytics/detector.py | mdemoret-nv/clx | 3737706187d8f5720561e10b85cbd638c77b9267 | [
"Apache-2.0"
] | null | null | null | python/clx/analytics/detector.py | mdemoret-nv/clx | 3737706187d8f5720561e10b85cbd638c77b9267 | [
"Apache-2.0"
] | null | null | null | python/clx/analytics/detector.py | mdemoret-nv/clx | 3737706187d8f5720561e10b85cbd638c77b9267 | [
"Apache-2.0"
] | null | null | null | import logging
import torch
import torch.nn as nn
from abc import ABC, abstractmethod
log = logging.getLogger(__name__)
class Detector(ABC):
def __init__(self, lr=0.001):
self.lr = lr
self.__model = None
self.__optimizer = None
self.__criterion = nn.CrossEntropyLoss()
@proper... | 25.772727 | 76 | 0.618166 | 2,144 | 0.945326 | 0 | 0 | 444 | 0.195767 | 0 | 0 | 492 | 0.216931 |
ed89a6742f6b5bd9686166ceba6ffc217d6833e0 | 5,366 | py | Python | street_score/project/models.py | openplans/streetscore | ea27f70399b070d3199f236d99575c5962943d67 | [
"MIT"
] | 4 | 2017-01-02T22:30:44.000Z | 2019-10-08T20:50:02.000Z | street_score/project/models.py | openplans/streetscore | ea27f70399b070d3199f236d99575c5962943d67 | [
"MIT"
] | 3 | 2020-02-11T21:42:47.000Z | 2021-06-10T17:28:28.000Z | street_score/project/models.py | openplans/streetscore | ea27f70399b070d3199f236d99575c5962943d67 | [
"MIT"
] | 2 | 2017-03-09T12:24:57.000Z | 2019-12-20T20:39:24.000Z | import math
import random
from django.db import models
class TimeStampedModel (models.Model):
"""
Base model class for when you want to keep track of created and updated
times for model instances.
"""
created_datetime = models.DateTimeField(auto_now_add=True)
updated_datetime = models.DateTim... | 28.391534 | 89 | 0.617965 | 5,290 | 0.985837 | 0 | 0 | 1,013 | 0.188781 | 0 | 0 | 1,774 | 0.3306 |
ed8c04e174410b92850aae3e034c73bb05a4abae | 4,351 | py | Python | src/selfdroid/appstorage/crud/AppAdder.py | vitlabuda/selfdroid-web-app | 9eac9ee2c34038de13e179b6afb3d530a086e7b2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-03-13T14:57:04.000Z | 2022-03-13T14:57:04.000Z | src/selfdroid/appstorage/crud/AppAdder.py | vitlabuda/selfdroid-web-app | 9eac9ee2c34038de13e179b6afb3d530a086e7b2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/selfdroid/appstorage/crud/AppAdder.py | vitlabuda/selfdroid-web-app | 9eac9ee2c34038de13e179b6afb3d530a086e7b2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
#
# Copyright (c) 2021 Vít Labuda. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice... | 44.397959 | 234 | 0.75385 | 2,235 | 0.513557 | 0 | 0 | 0 | 0 | 0 | 0 | 1,980 | 0.454963 |
ed8c508acbabfde1092353a8acaec8aac8951535 | 47 | py | Python | library/libvirt_filter.py | bkmeneguello/ansible-role-libvirt | e7f82077b1fd4c2ec5afa463973ecde599209549 | [
"MIT"
] | 1 | 2019-02-19T19:41:36.000Z | 2019-02-19T19:41:36.000Z | library/libvirt_filter.py | bkmeneguello/ansible-role-libvirt | e7f82077b1fd4c2ec5afa463973ecde599209549 | [
"MIT"
] | null | null | null | library/libvirt_filter.py | bkmeneguello/ansible-role-libvirt | e7f82077b1fd4c2ec5afa463973ecde599209549 | [
"MIT"
] | null | null | null | # TODO: https://libvirt.org/formatnwfilter.html | 47 | 47 | 0.787234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 1 |
71ea1c59255a1948249d1ed69284c07777e83df9 | 669 | py | Python | estafeta/core/__init__.py | Solunest/pyestafeta | cd24cea4973f5184f4cc7e72a653de8b22e32f69 | [
"MIT"
] | null | null | null | estafeta/core/__init__.py | Solunest/pyestafeta | cd24cea4973f5184f4cc7e72a653de8b22e32f69 | [
"MIT"
] | null | null | null | estafeta/core/__init__.py | Solunest/pyestafeta | cd24cea4973f5184f4cc7e72a653de8b22e32f69 | [
"MIT"
] | null | null | null |
from estafeta.core.client import EstafetaClient
user = None
password = None
id = None
account_number = None
production = None
from estafeta.core.error import EstafetaWrongData, EstafetaEmptyField
__url_label__ = [
'https://labelqa.estafeta.com/EstafetaLabel20/services/EstafetaLabelWS?wsdl',
'https://label.e... | 25.730769 | 81 | 0.762332 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 368 | 0.550075 |
71eac23074999fc487a373bc24fa920adcc09f2f | 355 | py | Python | yunionclient/api/flavors.py | tb365/mcclient_python | 06647e7496b9e2c3aeb5ade1276c81871063159b | [
"Apache-2.0"
] | 3 | 2021-09-22T11:34:08.000Z | 2022-03-13T04:55:17.000Z | yunionclient/api/flavors.py | xhw20190116/python_yunionsdk | eb7c8c08300d38dac204ec4980a775abc9c7083a | [
"Apache-2.0"
] | 13 | 2019-06-06T08:25:41.000Z | 2021-07-16T07:26:10.000Z | yunionclient/api/flavors.py | xhw20190116/python_yunionsdk | eb7c8c08300d38dac204ec4980a775abc9c7083a | [
"Apache-2.0"
] | 7 | 2019-03-31T05:43:36.000Z | 2021-03-04T09:59:05.000Z | from yunionclient.common import base
class FlavorManager(base.StandaloneManager):
keyword = 'flavor'
keyword_plural = 'flavors'
_columns = ['ID', 'Name', 'VCPU_count', 'VMEM_size', 'Disk_size',
'Disk_backend', 'Ext_Bandwidth', 'Int_Bandwidth', 'is_public',
'Description', 'A... | 35.5 | 78 | 0.659155 | 315 | 0.887324 | 0 | 0 | 0 | 0 | 0 | 0 | 162 | 0.456338 |
71eb4d213edb33b0bf4b80a95a7ac788fefb3194 | 892 | py | Python | char_map.py | rakib313/Bangla-End2End-Speech-Recognition | 67e776841bf2bb3f108e94d0567dc707497605ff | [
"MIT"
] | null | null | null | char_map.py | rakib313/Bangla-End2End-Speech-Recognition | 67e776841bf2bb3f108e94d0567dc707497605ff | [
"MIT"
] | null | null | null | char_map.py | rakib313/Bangla-End2End-Speech-Recognition | 67e776841bf2bb3f108e94d0567dc707497605ff | [
"MIT"
] | null | null | null | """
Defines two dictionaries for converting
between text and integer sequences.
"""
char_map_str = """
' 0
<SPACE> 1
ব 2
া 3
ং 4
ল 5
দ 6
ে 7
শ 8
য 9
় 10
ি 11
ত 12
্ 13
ন 14
এ 15
ধ 16
র 17
ণ 18
ক 19
ড 20
হ 21
উ 22
প 23
জ 24
অ 25
থ 26
স 27
ষ 28
ই 29
আ 30
ছ 31
গ 32
ু 33
ো 34
ও 35
ভ 36
ী 37
ট 38
ূ 39
ম 40
ৈ 41
ৃ 42
ঙ 4... | 7.023622 | 45 | 0.600897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 842 | 0.808838 |
71eb86a2745c8b7f4f02262f1b986e3f1a2ff12c | 238 | py | Python | app.py | MaggieChege/New_App | 75a2be55d50cf21305036c875af2120607ac33c0 | [
"MIT"
] | null | null | null | app.py | MaggieChege/New_App | 75a2be55d50cf21305036c875af2120607ac33c0 | [
"MIT"
] | null | null | null | app.py | MaggieChege/New_App | 75a2be55d50cf21305036c875af2120607ac33c0 | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask_restful import Api
# from restful import Api
from resources.Hello import CategoryResource
api_bp = Blueprint('api', __name__)
api = Api(api_bp)
# Route
api.add_resource(CategoryResource, '/Hello') | 21.636364 | 44 | 0.794118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 0.189076 |
71ebf7fd79d9cbf3e546f3b0a0480b99be5ed04d | 3,549 | py | Python | websockets.py | ejojmjn/indiana-phone | 5d666ac651d3e02291806f24c265564002912e00 | [
"MIT"
] | null | null | null | websockets.py | ejojmjn/indiana-phone | 5d666ac651d3e02291806f24c265564002912e00 | [
"MIT"
] | null | null | null | websockets.py | ejojmjn/indiana-phone | 5d666ac651d3e02291806f24c265564002912e00 | [
"MIT"
] | null | null | null | #from gevent import monkey
#monkey.patch_all()
from flask import Flask, render_template, json
from flask_socketio import SocketIO, emit
from pydbus import SystemBus
from gi.repository import GLib
import threading
import json
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app, async_m... | 32.263636 | 151 | 0.641589 | 0 | 0 | 0 | 0 | 909 | 0.256128 | 0 | 0 | 1,737 | 0.489434 |
71ec7e1ab519fe39c3c2b69f2a497fd39095d1ca | 15,524 | py | Python | tests/pytests/test_tags.py | wayn111/RediSearch | 897b2de35988b84851dd8380c614a21ad8da7c0f | [
"BSD-3-Clause",
"Ruby",
"Apache-2.0",
"MIT"
] | null | null | null | tests/pytests/test_tags.py | wayn111/RediSearch | 897b2de35988b84851dd8380c614a21ad8da7c0f | [
"BSD-3-Clause",
"Ruby",
"Apache-2.0",
"MIT"
] | null | null | null | tests/pytests/test_tags.py | wayn111/RediSearch | 897b2de35988b84851dd8380c614a21ad8da7c0f | [
"BSD-3-Clause",
"Ruby",
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from includes import *
from common import *
def search(env, r, *args):
return r.execute_command('ft.search', *args)
def testTagIndex(env):
r = env
env.expect('ft.create', 'idx', 'ON', 'HASH','schema', 'title', 'text', 'tags', 'tag').ok()
N = 10
for n in range(N):
... | 42.184783 | 142 | 0.523448 | 0 | 0 | 0 | 0 | 699 | 0.045027 | 0 | 0 | 6,198 | 0.399253 |
71ecbe30760d8ff6d5c97c8f6cb9ae037d64dc1b | 39,956 | py | Python | sc2/bot_ai.py | Lexa307/PhotonDefender | a08dc652e5c64e3ccb33b7cfa206846dca0575bd | [
"MIT"
] | 2 | 2019-07-17T13:00:32.000Z | 2019-07-17T13:09:30.000Z | sc2/bot_ai.py | Lexa307/PhotonDefender | a08dc652e5c64e3ccb33b7cfa206846dca0575bd | [
"MIT"
] | null | null | null | sc2/bot_ai.py | Lexa307/PhotonDefender | a08dc652e5c64e3ccb33b7cfa206846dca0575bd | [
"MIT"
] | null | null | null | import itertools
import logging
import math
import random
from collections import Counter
from typing import Any, Dict, List, Optional, Set, Tuple, Union # mypy type checking
from .cache import property_cache_forever, property_cache_once_per_frame
from .data import ActionResult, Alert, Race, Result, Target, race_gas,... | 44.150276 | 180 | 0.633922 | 39,058 | 0.977525 | 0 | 0 | 8,442 | 0.211282 | 17,149 | 0.429197 | 10,831 | 0.271073 |
71ecddbb1bd02f445d97d4e77a4a4128c68a4abe | 4,260 | py | Python | src/python/pants/jvm/resolve/lockfile_metadata.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | src/python/pants/jvm/resolve/lockfile_metadata.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | 6 | 2022-01-25T15:49:26.000Z | 2022-02-09T11:21:13.000Z | src/python/pants/jvm/resolve/lockfile_metadata.py | thejcannon/pants | 7c24f42cb78cc462b63698cef736eda7a85c40e0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import Any, Iterable, cast
from pants.core.util_rules.lockfile_metadata import (
... | 33.809524 | 100 | 0.711268 | 3,549 | 0.833099 | 0 | 0 | 3,535 | 0.829812 | 0 | 0 | 1,239 | 0.290845 |
71ece1b40046a77ed95f80492a330f22d42912ee | 1,528 | py | Python | generator/generator.py | GregorKikelj/opendbc | a20ed24ea2593e5d019adf538dc0cecfc7ef8709 | [
"MIT"
] | 1,059 | 2017-05-31T06:33:27.000Z | 2022-03-31T23:02:29.000Z | generator/generator.py | DIMO-Network/opendbc | 9a1fbe581846f9d0191f142f498ef3f1c35826ea | [
"MIT"
] | 248 | 2017-07-14T01:45:40.000Z | 2022-03-21T17:55:26.000Z | generator/generator.py | DIMO-Network/opendbc | 9a1fbe581846f9d0191f142f498ef3f1c35826ea | [
"MIT"
] | 940 | 2017-06-02T16:40:42.000Z | 2022-03-29T16:49:58.000Z | #!/usr/bin/env python3
import os
import re
cur_path = os.path.dirname(os.path.realpath(__file__))
opendbc_root = os.path.join(cur_path, '../')
include_pattern = re.compile(r'CM_ "IMPORT (.*?)";')
def read_dbc(src_dir, filename):
with open(os.path.join(src_dir, filename)) as file_in:
return file_in.read()
def... | 28.296296 | 90 | 0.716623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 238 | 0.155759 |
71eed31624e7569b476bc79838cb16831bf90648 | 1,105 | py | Python | customer/admin.py | matheusdemicheli/dogtel | 4eed44c8214fe814c26a6df0125af9b065c81c1c | [
"MIT"
] | null | null | null | customer/admin.py | matheusdemicheli/dogtel | 4eed44c8214fe814c26a6df0125af9b065c81c1c | [
"MIT"
] | null | null | null | customer/admin.py | matheusdemicheli/dogtel | 4eed44c8214fe814c26a6df0125af9b065c81c1c | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.utils.safestring import mark_safe
from customer.models import Owner, Dog, Breed, SubBreed
class OwnerAdmin(admin.ModelAdmin):
"""
Owner ModelAdmin.
"""
search_fields = ['name']
class BreedAdmin(admin.ModelAdmin):
"""
Breed ModelAdmin.
"""
s... | 24.021739 | 71 | 0.650679 | 800 | 0.723982 | 0 | 0 | 0 | 0 | 0 | 0 | 344 | 0.311312 |
71eee010313a8cf81a43634e4dc40236254335a2 | 464 | py | Python | kaneda/tasks/rq.py | APSL/kaneda | 739db48588d2237dd7710b16f23921d489182868 | [
"MIT"
] | 59 | 2016-05-03T20:17:59.000Z | 2019-09-05T18:35:21.000Z | kaneda/tasks/rq.py | APSL/kaneda | 739db48588d2237dd7710b16f23921d489182868 | [
"MIT"
] | 2 | 2018-07-25T21:51:18.000Z | 2019-07-31T22:51:09.000Z | kaneda/tasks/rq.py | APSL/kaneda | 739db48588d2237dd7710b16f23921d489182868 | [
"MIT"
] | 11 | 2016-05-20T19:07:46.000Z | 2021-09-10T17:43:58.000Z | from __future__ import absolute_import
from redis import Redis
from rq.decorators import job
from kaneda.utils import get_backend
backend = get_backend()
@job(queue='kaneda', connection=Redis())
def report(name, metric, value, tags, id_):
"""
RQ job to report metrics to the configured backend in kanedasett... | 23.2 | 75 | 0.724138 | 0 | 0 | 0 | 0 | 304 | 0.655172 | 0 | 0 | 165 | 0.355603 |
71ef13879f7d9412c115fe5712bcdcce5a10b758 | 4,067 | py | Python | src/ripper.py | jg-rivera/cert-ripper | 2bab5e02cd2da8e92a1c308640917b6f5ee729cb | [
"MIT"
] | null | null | null | src/ripper.py | jg-rivera/cert-ripper | 2bab5e02cd2da8e92a1c308640917b6f5ee729cb | [
"MIT"
] | null | null | null | src/ripper.py | jg-rivera/cert-ripper | 2bab5e02cd2da8e92a1c308640917b6f5ee729cb | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
from PyPDF2 import PdfFileReader, PdfFileWriter
import os
import json
class CertRipper:
def __init__(
self,
start_page_index=0,
master_pdf_path=None,
json_points_path=None,
ripped_certs_path=None,
ripped_cert_file_name=None,
):
... | 35.060345 | 152 | 0.614212 | 3,572 | 0.878289 | 0 | 0 | 0 | 0 | 0 | 0 | 643 | 0.158102 |
71ef7b545410fc717e2f36b835e68675481e1947 | 2,192 | py | Python | venv/Lib/site-packages/tests/test_111_FieldNumAddCol.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_111_FieldNumAddCol.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_111_FieldNumAddCol.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | #
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_111_FieldNumAddCol(self):
obj = IbmDbTestFunctions()
obj.assert_expect(self.run_... | 21.92 | 123 | 0.629562 | 1,689 | 0.770529 | 0 | 0 | 0 | 0 | 0 | 0 | 653 | 0.297901 |
71f05726793fa3f17f84622c2fdc4b1adae30d42 | 2,382 | py | Python | foundation/djangocms_pagebanner/cms_toolbar.py | Mindelirium/foundation | 2d07e430915d696ca7376afea633692119c4d30e | [
"MIT"
] | null | null | null | foundation/djangocms_pagebanner/cms_toolbar.py | Mindelirium/foundation | 2d07e430915d696ca7376afea633692119c4d30e | [
"MIT"
] | null | null | null | foundation/djangocms_pagebanner/cms_toolbar.py | Mindelirium/foundation | 2d07e430915d696ca7376afea633692119c4d30e | [
"MIT"
] | null | null | null | from cms.api import get_page_draft
from cms.toolbar_pool import toolbar_pool
from cms.toolbar_base import CMSToolbar
from cms.utils import get_cms_setting
from cms.utils.permissions import has_page_change_permission
from django.core.urlresolvers import reverse, NoReverseMatch
from django.utils.translation import ugette... | 41.789474 | 76 | 0.625105 | 1,834 | 0.769941 | 0 | 0 | 1,857 | 0.779597 | 0 | 0 | 318 | 0.133501 |
71f0694c1e4dfc112a543268e37e44700697d2ed | 7,346 | py | Python | tasks/lm/models/lm.py | etri-edgeai/nn-comp-discblock | 6e00a019c223508797ca91a7d5ffec7917b12c6d | [
"Apache-2.0"
] | 10 | 2021-11-19T06:24:51.000Z | 2022-02-09T15:44:00.000Z | tasks/lm/models/lm.py | etri-edgeai/nn-comp-discblock | 6e00a019c223508797ca91a7d5ffec7917b12c6d | [
"Apache-2.0"
] | 9 | 2021-10-01T11:06:27.000Z | 2021-12-23T02:10:52.000Z | tasks/lm/models/lm.py | etri-edgeai/nn-comp-discblock | 6e00a019c223508797ca91a7d5ffec7917b12c6d | [
"Apache-2.0"
] | 2 | 2021-09-14T04:08:36.000Z | 2021-11-19T06:24:54.000Z | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class RNNModel(nn.Module):
"""Container module with an encoder, a recurrent module, and a decoder."""
def __init__(self, rnn_type, ntoken, ninp, nhid, nlayers, dropout=0.5, tie_weights=False, encoder=None, decoder=None):
su... | 40.585635 | 122 | 0.611081 | 7,179 | 0.977267 | 0 | 0 | 0 | 0 | 0 | 0 | 1,974 | 0.268718 |
71f079a62757b3209f276ed71f4e310438ef3cc4 | 248 | py | Python | fibo.py | Baibhabswain/pythonPrograms | 38380174f22e73b766b98754b00cd78a56b4bf59 | [
"MIT"
] | 1 | 2019-03-29T04:32:09.000Z | 2019-03-29T04:32:09.000Z | fibo.py | Baibhabswain/pythonPrograms | 38380174f22e73b766b98754b00cd78a56b4bf59 | [
"MIT"
] | null | null | null | fibo.py | Baibhabswain/pythonPrograms | 38380174f22e73b766b98754b00cd78a56b4bf59 | [
"MIT"
] | null | null | null | def main():
a=input("The enter the first number :")
b=input("The enter the second number :")
range=input("Please enter the range")
i=0;count=0;
print a
print b
while count!=range:
c=a+b
count +=1
print c
a=b
b=c
main() | 17.714286 | 42 | 0.608871 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 85 | 0.342742 |
71f16750be3a7d0922d774531a82147a9b72ab6b | 44 | py | Python | scrapper/playstation/__init__.py | gghf-service/gghf-api | 9740700d1dd160e90fc949f9c3e652c3483a49aa | [
"MIT"
] | 1 | 2018-12-10T14:37:11.000Z | 2018-12-10T14:37:11.000Z | scrapper/playstation/__init__.py | tapkain/gghf.api | 9740700d1dd160e90fc949f9c3e652c3483a49aa | [
"MIT"
] | null | null | null | scrapper/playstation/__init__.py | tapkain/gghf.api | 9740700d1dd160e90fc949f9c3e652c3483a49aa | [
"MIT"
] | null | null | null | from scrapper.playstation.spider import main | 44 | 44 | 0.886364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71f1b81a3d9a5c16cb1f510f6c706a2a817d94b4 | 2,737 | py | Python | plugins/number.py | motakine/ILAS_slackbot | ddfb34db1cddcb459fef34cfc04c498d6f85d135 | [
"MIT"
] | null | null | null | plugins/number.py | motakine/ILAS_slackbot | ddfb34db1cddcb459fef34cfc04c498d6f85d135 | [
"MIT"
] | null | null | null | plugins/number.py | motakine/ILAS_slackbot | ddfb34db1cddcb459fef34cfc04c498d6f85d135 | [
"MIT"
] | null | null | null | import slackbot.bot
import random
answer = random.randint(1, 50)
max = 50
def number(num):
'''number 判定
Args:
num (int): 判定する数字
Returns:
str: num が answer より大きい: 'Too large'
num が answer より小さい: 'Too small'
num が answer と一致: 'Correct!'、新しくゲームを始める
その他: 'C... | 25.110092 | 93 | 0.588235 | 0 | 0 | 0 | 0 | 1,429 | 0.42391 | 0 | 0 | 2,117 | 0.628004 |
71f3dc5d5c4a8e087378f18d43a8168ef202c67c | 30,964 | py | Python | pytype/analyze.py | hatal175/pytype | 22150dd56c2a11f3d385a1cbb28eed985df31d72 | [
"Apache-2.0"
] | null | null | null | pytype/analyze.py | hatal175/pytype | 22150dd56c2a11f3d385a1cbb28eed985df31d72 | [
"Apache-2.0"
] | null | null | null | pytype/analyze.py | hatal175/pytype | 22150dd56c2a11f3d385a1cbb28eed985df31d72 | [
"Apache-2.0"
] | null | null | null | """Code for checking and inferring types."""
import collections
import logging
import re
import subprocess
from typing import Any, Dict, Union
from pytype import abstract
from pytype import abstract_utils
from pytype import convert_structural
from pytype import debug
from pytype import function
from pytype import met... | 41.61828 | 80 | 0.687993 | 24,286 | 0.78433 | 0 | 0 | 1,268 | 0.040951 | 0 | 0 | 8,263 | 0.266858 |
71f490ebabe7d689d377fda1a39b6fe3eaf67bee | 3,979 | py | Python | src/cupcake/post_isoseq_cluster/demux_by_barcode_groups.py | milescsmith/cDNA_Cupcake | 776d841c69fc6d8b3dce95bb9f076546bc0429c0 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/cupcake/post_isoseq_cluster/demux_by_barcode_groups.py | milescsmith/cDNA_Cupcake | 776d841c69fc6d8b3dce95bb9f076546bc0429c0 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/cupcake/post_isoseq_cluster/demux_by_barcode_groups.py | milescsmith/cDNA_Cupcake | 776d841c69fc6d8b3dce95bb9f076546bc0429c0 | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python
__author__ = "[email protected]"
"""
Given a pooled input GFF + demux CSV file, write out per-{barcode group} GFFs
If input fasta/fastq is given, optionally also output per-{barcode group} FASTA/FASTQ
"""
import re
from collections import defaultdict
from csv import DictReader
from typing import Op... | 32.349593 | 111 | 0.6381 | 0 | 0 | 0 | 0 | 937 | 0.235486 | 0 | 0 | 1,223 | 0.307364 |
71f49ed361f20a67913d6d3671205fa5c226035f | 5,168 | py | Python | vll/data/circle_dataset.py | paulhfu/3dcv-students | f8d42c985cf33903170733b0c8f6a2199099553c | [
"MIT"
] | 4 | 2020-04-21T21:40:13.000Z | 2022-02-13T18:18:13.000Z | vll/data/circle_dataset.py | paulhfu/3dcv-students | f8d42c985cf33903170733b0c8f6a2199099553c | [
"MIT"
] | 1 | 2022-02-03T11:24:07.000Z | 2022-02-03T11:24:07.000Z | vll/data/circle_dataset.py | paulhfu/3dcv-students | f8d42c985cf33903170733b0c8f6a2199099553c | [
"MIT"
] | 8 | 2020-04-22T10:24:27.000Z | 2022-01-13T16:25:52.000Z | import random
import numpy as np
import math
from skimage.draw import line, line_aa, circle, set_color, circle_perimeter_aa
from skimage.io import imsave
from skimage.util import random_noise
maxSlope = 10 # restrict the maximum slope of generated lines for stability
minLength = 20 # restrict the minimum length of li... | 31.13253 | 147 | 0.663893 | 4,834 | 0.935372 | 0 | 0 | 0 | 0 | 0 | 0 | 2,577 | 0.498646 |
71f5039371a3b37776d4da5587717221d15a60a1 | 5,276 | py | Python | VAE/reduced_model/nesm_generator.py | youngmg1995/NES-Music-Maker | aeda10a541cfd439cfa46c45e63411e0d98e41c1 | [
"MIT"
] | 3 | 2020-06-26T22:02:35.000Z | 2021-11-20T19:24:33.000Z | VAE/reduced_model/nesm_generator.py | youngmg1995/NES-Music-Maker | aeda10a541cfd439cfa46c45e63411e0d98e41c1 | [
"MIT"
] | null | null | null | VAE/reduced_model/nesm_generator.py | youngmg1995/NES-Music-Maker | aeda10a541cfd439cfa46c45e63411e0d98e41c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 1 17:14:19 2020
@author: Mitchell
nesm_generator.py
~~~~~~~~~~~~~~~~~
This file serves as a script for using our pre-trained VAE model to generate
brand new NES music soundtracks. NOTE - using the reduced model we only
generate the first melodic voice for each track rat... | 32.567901 | 79 | 0.638931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,121 | 0.591547 |
71f546859f563e461fa98070b804316bbbaa69c8 | 1,030 | py | Python | anlogger/logger.py | anttin/anlogger | dfa7be7ba2f4651507b188f986c10bab9bd7460e | [
"MIT"
] | null | null | null | anlogger/logger.py | anttin/anlogger | dfa7be7ba2f4651507b188f986c10bab9bd7460e | [
"MIT"
] | null | null | null | anlogger/logger.py | anttin/anlogger | dfa7be7ba2f4651507b188f986c10bab9bd7460e | [
"MIT"
] | null | null | null | import logging
import logging.handlers
import os
class Logger(object):
def __init__(self, name, default_loglevel='INFO', fmt=None, syslog=None):
self.name = name
self.syslog = syslog
self.fmt = fmt if fmt is not None else "%(asctime)-15s %(name)s %(levelname)s %(message)s"
if 'LOGLEVEL' in os.env... | 28.611111 | 94 | 0.659223 | 979 | 0.950485 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 0.094175 |
71f5e7d6ce9c05a9fca443446dc43b2633e1dc3d | 133 | py | Python | Python/hello_world-theopaid.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Python/hello_world-theopaid.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Python/hello_world-theopaid.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | #Author Theodosis Paidakis
print("Hello World")
hello_list = ["Hello World"]
print(hello_list[0])
for i in hello_list:
print(i) | 16.625 | 28 | 0.721805 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 0.390977 |
71f6399c6d0b985a134ae6927664662c261371d5 | 330 | py | Python | question_answering/stubs.py | uliang/NaturalLanguageQueryingSystem | d18b4ae429362ba311d6f26debbcfe391b810458 | [
"MIT"
] | null | null | null | question_answering/stubs.py | uliang/NaturalLanguageQueryingSystem | d18b4ae429362ba311d6f26debbcfe391b810458 | [
"MIT"
] | null | null | null | question_answering/stubs.py | uliang/NaturalLanguageQueryingSystem | d18b4ae429362ba311d6f26debbcfe391b810458 | [
"MIT"
] | null | null | null | from collections import namedtuple
from unittest.mock import MagicMock
_fake_ext = namedtuple('_', ['qtype', 'kb_ident'])
class FakeDoc:
def __init__(self, text, qtype, kb_ident):
self._ = _fake_ext(qtype, kb_ident)
self.text = text
def __str__(self):
return f"<[MOCKED NLP]{sel... | 23.571429 | 51 | 0.654545 | 202 | 0.612121 | 0 | 0 | 0 | 0 | 0 | 0 | 48 | 0.145455 |
71f66963cc795d3d06ec835c6cc0e9a8392f9d65 | 729 | py | Python | lib/env/trade/BaseTradeStrategy.py | devas123/Bitcoin-Trader-RL | 097cb0ba7428b2c4f997bdb0425a6153c23f9c83 | [
"MIT"
] | null | null | null | lib/env/trade/BaseTradeStrategy.py | devas123/Bitcoin-Trader-RL | 097cb0ba7428b2c4f997bdb0425a6153c23f9c83 | [
"MIT"
] | null | null | null | lib/env/trade/BaseTradeStrategy.py | devas123/Bitcoin-Trader-RL | 097cb0ba7428b2c4f997bdb0425a6153c23f9c83 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from typing import Tuple, Callable
class BaseTradeStrategy(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self,
commissionPercent: float,
maxSlippagePercent: float,
base_precision: int,
asset_... | 30.375 | 90 | 0.577503 | 651 | 0.893004 | 0 | 0 | 589 | 0.807956 | 0 | 0 | 0 | 0 |
71f75308f26d63f94b10ee2cdd22fde8e48a6afe | 304 | py | Python | 4day/Book04_1.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 4day/Book04_1.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 4day/Book04_1.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | # Book04_1.py
class Book:
category = '소설' # Class 멤버
b1 = Book(); print(b1.category)
b2 = b1; print(b2.category)
print(Book.category)
Book.category = '수필'
print(b2.category); print(b1.category) ; print(Book.category)
b2.category = 'IT'
print(b2.category); print(b1.category) ; print(Book.category) | 23.384615 | 61 | 0.700658 | 50 | 0.158228 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 0.148734 |
71f7f60857c1f64d4455062df57530ef2f07c039 | 4,146 | py | Python | wrappers/python/virgil_crypto_lib/foundation/kdf1.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 26 | 2018-12-17T13:45:25.000Z | 2022-01-16T20:00:04.000Z | wrappers/python/virgil_crypto_lib/foundation/kdf1.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 4 | 2019-01-03T12:08:52.000Z | 2021-12-02T05:21:13.000Z | wrappers/python/virgil_crypto_lib/foundation/kdf1.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 8 | 2019-01-24T08:22:06.000Z | 2022-02-07T11:37:00.000Z | # Copyright (C) 2015-2021 Virgil Security, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this li... | 37.017857 | 117 | 0.7137 | 2,260 | 0.545104 | 0 | 0 | 654 | 0.157742 | 0 | 0 | 1,956 | 0.47178 |
71f886304dcb6c6099a9de6e408e657ec12b3bde | 497 | py | Python | mysite/zoo/tests.py | leixiayang/django-python | 8faa84867af5645d3d3d8e67fe8020be4dc68551 | [
"Apache-2.0"
] | 54 | 2015-07-13T14:23:01.000Z | 2021-08-05T10:51:00.000Z | mysite/zoo/tests.py | leixiayang/django-python | 8faa84867af5645d3d3d8e67fe8020be4dc68551 | [
"Apache-2.0"
] | 32 | 2015-07-16T08:58:00.000Z | 2020-04-30T09:41:57.000Z | mysite/zoo/tests.py | leixiayang/django-python | 8faa84867af5645d3d3d8e67fe8020be4dc68551 | [
"Apache-2.0"
] | 31 | 2015-07-13T15:32:01.000Z | 2022-02-19T17:19:51.000Z | #!/usr/bin/env python
# encoding: utf-8
from django.test import TestCase
from zoo import models
class AnimalTestCase(TestCase):
"""Test animals' sound """
def test_dog_says(self):
"""test dog says woof or not
"""
dog = models.Dog(name='Snoopy')
self.assertEqual(dog.says()... | 18.407407 | 44 | 0.593561 | 395 | 0.794769 | 0 | 0 | 0 | 0 | 0 | 0 | 176 | 0.354125 |
71f8c70583f9e40977155faf528bc04d31d42d94 | 123 | py | Python | EX025.py | gjaosdij/PythonProject | ae27990efa93462b632f165d13c08c7fd93beb38 | [
"MIT"
] | null | null | null | EX025.py | gjaosdij/PythonProject | ae27990efa93462b632f165d13c08c7fd93beb38 | [
"MIT"
] | null | null | null | EX025.py | gjaosdij/PythonProject | ae27990efa93462b632f165d13c08c7fd93beb38 | [
"MIT"
] | null | null | null | print('Digite seu nome completo: ')
nome = input().strip().upper()
print('Seu nome tem "Silva"?')
print('SILVA' in nome)
| 17.571429 | 35 | 0.658537 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 58 | 0.471545 |
71f9440eb1c326307f7552af69580f96b76f02f9 | 3,283 | py | Python | configs/_base_/datasets/stvqa_dataset.py | linxi1158/iMIX | af87a17275f02c94932bb2e29f132a84db812002 | [
"Apache-2.0"
] | 23 | 2021-06-26T08:45:19.000Z | 2022-03-02T02:13:33.000Z | configs/_base_/datasets/stvqa_dataset.py | XChuanLee/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/stvqa_dataset.py | XChuanLee/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | 9 | 2021-06-10T02:36:20.000Z | 2021-11-09T02:18:16.000Z | dataset_type = 'STVQADATASET'
data_root = '/home/datasets/mix_data/iMIX/'
feature_path = 'data/datasets/stvqa/defaults/features/'
ocr_feature_path = 'data/datasets/stvqa/defaults/ocr_features/'
annotation_path = 'data/datasets/stvqa/defaults/annotations/'
vocab_path = 'data/datasets/stvqa/defaults/extras/vocabs/'
trai... | 36.88764 | 101 | 0.696924 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,030 | 0.313737 |
71f98ce850b9a0d28247d4a6575715ee5f7a82c8 | 2,955 | py | Python | src/rpocore/migrations/0007_auto_20160927_1517.py | 2martens/rpo-website | 14990920722c537810aecd2b97f5af6bbdd1b5ec | [
"MIT"
] | null | null | null | src/rpocore/migrations/0007_auto_20160927_1517.py | 2martens/rpo-website | 14990920722c537810aecd2b97f5af6bbdd1b5ec | [
"MIT"
] | null | null | null | src/rpocore/migrations/0007_auto_20160927_1517.py | 2martens/rpo-website | 14990920722c537810aecd2b97f5af6bbdd1b5ec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-27 13:17
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields
class Migration(migrations.Migration):
dependencies = [
('rpocore', '0006_auto_20160921_19... | 43.455882 | 186 | 0.626396 | 2,737 | 0.926227 | 0 | 0 | 0 | 0 | 0 | 0 | 787 | 0.266328 |
71fa3b7f37795303ef477432b9138d2cfeb1171c | 320 | py | Python | code/Line.py | manno-xx/FutureLearnRobotBuggy | d5f0172597ad88d6a8b883b0b16d425a76edfb0b | [
"MIT"
] | null | null | null | code/Line.py | manno-xx/FutureLearnRobotBuggy | d5f0172597ad88d6a8b883b0b16d425a76edfb0b | [
"MIT"
] | null | null | null | code/Line.py | manno-xx/FutureLearnRobotBuggy | d5f0172597ad88d6a8b883b0b16d425a76edfb0b | [
"MIT"
] | null | null | null | #LineSensor test
from gpiozero import LineSensor
from time import sleep
from signal import pause
def lineDetected():
print('line detected')
def noLineDetected():
print('no line detected')
sensor = LineSensor(14)
sensor.when_line = lineDetected
sensor.when_no_line = noLineDetected
pause()
sensor.close()
| 14.545455 | 36 | 0.759375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0.153125 |
71fa640b3932ba3d1df289310da43d75dd4a2089 | 4,239 | py | Python | litex_boards/platforms/myminieye_runber.py | chmousset/litex-boards | c081177d77f37a4ea6cff150d42a69bd6f0abbc2 | [
"BSD-2-Clause"
] | null | null | null | litex_boards/platforms/myminieye_runber.py | chmousset/litex-boards | c081177d77f37a4ea6cff150d42a69bd6f0abbc2 | [
"BSD-2-Clause"
] | null | null | null | litex_boards/platforms/myminieye_runber.py | chmousset/litex-boards | c081177d77f37a4ea6cff150d42a69bd6f0abbc2 | [
"BSD-2-Clause"
] | null | null | null | #
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 Gwenhael Goavec-Merou <[email protected]>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.build.generic_platform import *
from litex.build.gowin.platform import GowinPlatform
from litex.build.openfpgaloader import ... | 36.543103 | 118 | 0.550366 | 564 | 0.13305 | 0 | 0 | 0 | 0 | 0 | 0 | 1,862 | 0.439255 |
71fafdbd17b589475cd452d3837ecd482b296f0c | 8,468 | py | Python | combo/search/discrete/policy.py | zhangkunliang/BayesOptimization | 6d78c9e9f96239b0dbb85650a0d878e9410158ec | [
"MIT"
] | 139 | 2016-02-18T02:31:04.000Z | 2022-02-18T10:38:06.000Z | combo/search/discrete/policy.py | zhangkunliang/BayesOptimization | 6d78c9e9f96239b0dbb85650a0d878e9410158ec | [
"MIT"
] | 8 | 2016-04-18T08:10:44.000Z | 2020-12-30T08:49:33.000Z | combo/search/discrete/policy.py | zhangkunliang/BayesOptimization | 6d78c9e9f96239b0dbb85650a0d878e9410158ec | [
"MIT"
] | 50 | 2016-05-21T01:17:23.000Z | 2022-02-18T01:27:41.000Z | import numpy as np
import copy
import combo.misc
import cPickle as pickle
from results import history
from .. import utility
from ...variable import variable
from ..call_simulator import call_simulator
from ... import predictor
from ...gp import predictor as gp_predictor
from ...blm import predictor as blm_predictor
im... | 32.694981 | 78 | 0.594473 | 8,098 | 0.956306 | 0 | 0 | 0 | 0 | 0 | 0 | 235 | 0.027752 |
71fafe5ef80b5403322b57c793f98a2f2f5a763c | 213 | py | Python | venv/lib/python3.9/site-packages/py2app/bootstrap/disable_linecache.py | dequeb/asmbattle | 27e8b209de5787836e288a2f2f9b7644ce07563e | [
"MIT"
] | 193 | 2020-01-15T09:34:20.000Z | 2022-03-18T19:14:16.000Z | .eggs/py2app-0.21-py3.7.egg/py2app/bootstrap/disable_linecache.py | mdanisurrahmanrony/Covid-Doctor | 1e0e854d01325c1a18dd52f33064aed4c21b8161 | [
"Apache-2.0"
] | 185 | 2020-01-15T08:38:27.000Z | 2022-03-27T17:29:29.000Z | .eggs/py2app-0.21-py3.7.egg/py2app/bootstrap/disable_linecache.py | mdanisurrahmanrony/Covid-Doctor | 1e0e854d01325c1a18dd52f33064aed4c21b8161 | [
"Apache-2.0"
] | 23 | 2020-01-24T14:47:18.000Z | 2022-02-22T17:19:47.000Z | def _disable_linecache():
import linecache
def fake_getline(*args, **kwargs):
return ""
linecache.orig_getline = linecache.getline
linecache.getline = fake_getline
_disable_linecache()
| 17.75 | 46 | 0.704225 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0.00939 |
71fb4a0f65f1788e4523139873b94749e767304c | 693 | py | Python | source.py | s403o/tw_bot | fd26ebc86d4c7d1be1ae654f26f5ca74c2566a03 | [
"MIT"
] | null | null | null | source.py | s403o/tw_bot | fd26ebc86d4c7d1be1ae654f26f5ca74c2566a03 | [
"MIT"
] | null | null | null | source.py | s403o/tw_bot | fd26ebc86d4c7d1be1ae654f26f5ca74c2566a03 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup as bs
import os
#source
url = '' # the source you want the bot take images from
#down page
page = requests.get(url)
html = bs(page.text, 'html.parser')
#locate
image_loc = html.findAll('img')
#create folder for located imgs
if not os.path.exists('imgs'):
os.makedirs(... | 19.25 | 63 | 0.65368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 202 | 0.291486 |
71fc1181a50c5c3f0fee92d2187d798fa7535036 | 2,403 | py | Python | lib/appController.py | QIAOANGeo/BZB_ydzw | 8c11e9797cca31d1fab26be7eb0a71666cfac15f | [
"MIT"
] | 2 | 2019-12-06T14:49:34.000Z | 2021-06-10T15:57:59.000Z | lib/appController.py | QIAOANGeo/BZB_ydzw | 8c11e9797cca31d1fab26be7eb0a71666cfac15f | [
"MIT"
] | null | null | null | lib/appController.py | QIAOANGeo/BZB_ydzw | 8c11e9797cca31d1fab26be7eb0a71666cfac15f | [
"MIT"
] | null | null | null | '''
1、启动appium服务
subproccess
配置文件
1.1、校验服务是否启动
1.2、杀掉上一次的服务
2、启动driver
'''
from lib.tools import Tool
import subprocess
from lib.path import SYSTEMPATH, ERRORPATH
import time
from appium import webdriver
import queue
# 声明一个python队列
driver_queue = queue.Queue()
class Controller(object):
def __init__(se... | 30.417722 | 109 | 0.553891 | 2,084 | 0.805566 | 0 | 0 | 0 | 0 | 0 | 0 | 723 | 0.279474 |
71fcdf4c5cb6b34edec79a08f7d295031300d28a | 2,226 | py | Python | pondSizes.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | 1 | 2019-08-29T01:12:47.000Z | 2019-08-29T01:12:47.000Z | pondSizes.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | pondSizes.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
@project : LeetCode
@File : pondSizes.py
@Contact : [email protected]
@Desc :
你有一个用于表示一片土地的整数矩阵land,该矩阵中每个点的值代表对应地点的海拔高度。若值为0则表示水域。由垂直、水平或对角连接的水域为池塘。池塘的大小是指相连接的水域的个数。编写一个方法来计算矩阵中所有池塘的大小,返回值需要从小到大排序。
示例:
输入:
[
[0,2,1,0],
[0,1,0,1],
[1,1,0,1],
... | 25.011236 | 124 | 0.444295 | 1,314 | 0.5256 | 0 | 0 | 0 | 0 | 0 | 0 | 955 | 0.382 |
71fdcd33231ded5dc2f9d6d67f26d46eb50eca3d | 5,990 | py | Python | geolucidate/functions.py | kurtraschke/geolucidate | 827195a90d972fa5efce5a03bdbe53d8395d94ba | [
"MIT"
] | 3 | 2015-09-17T01:01:53.000Z | 2019-09-10T14:30:43.000Z | geolucidate/functions.py | kurtraschke/geolucidate | 827195a90d972fa5efce5a03bdbe53d8395d94ba | [
"MIT"
] | null | null | null | geolucidate/functions.py | kurtraschke/geolucidate | 827195a90d972fa5efce5a03bdbe53d8395d94ba | [
"MIT"
] | 5 | 2018-09-11T21:54:36.000Z | 2020-06-25T19:05:45.000Z | # -*- coding: utf-8 -*-
from decimal import Decimal, setcontext, ExtendedContext
from geolucidate.links.google import google_maps_link
from geolucidate.links.tools import MapLink
from geolucidate.parser import parser_re
setcontext(ExtendedContext)
def _cleanup(parts):
"""
Normalize up the parts matched by :... | 35.235294 | 184 | 0.602337 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,343 | 0.558097 |
71fe29113947026b758491d3c116f1982f10cf36 | 715 | py | Python | setup.py | rluzuriaga/pokedex | e5c18c410994d5fb589bc3dceaba71f85268edfb | [
"MIT"
] | 30 | 2020-08-15T01:16:17.000Z | 2022-03-12T17:51:17.000Z | setup.py | rluzuriaga/pokedex | e5c18c410994d5fb589bc3dceaba71f85268edfb | [
"MIT"
] | 86 | 2020-08-12T17:20:55.000Z | 2022-03-28T18:19:28.000Z | setup.py | rluzuriaga/pokedex | e5c18c410994d5fb589bc3dceaba71f85268edfb | [
"MIT"
] | 38 | 2020-08-18T00:09:15.000Z | 2022-03-01T07:47:41.000Z | from setuptools import setup, find_packages
setup(
name='Pokedex',
version='0.1',
zip_safe=False,
packages=find_packages(),
package_data={
'pokedex': ['data/csv/*.csv']
},
install_requires=[
'SQLAlchemy>=1.0,<2.0',
'whoosh>=2.5,<2.7',
'markdown==2.4.1',
... | 23.833333 | 54 | 0.524476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 340 | 0.475524 |
71feb582dac7753ba6da1c6d33e4df9c56ad4249 | 17,900 | py | Python | lingvo/tasks/asr/encoder.py | j-luo93/lingvo | 7398974078391362f0c1b027164a8f33f88cf86b | [
"Apache-2.0"
] | 4 | 2019-01-08T02:59:38.000Z | 2022-02-18T11:31:37.000Z | lingvo/tasks/asr/encoder.py | j-luo93/lingvo | 7398974078391362f0c1b027164a8f33f88cf86b | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/asr/encoder.py | j-luo93/lingvo | 7398974078391362f0c1b027164a8f33f88cf86b | [
"Apache-2.0"
] | 1 | 2019-07-02T14:09:42.000Z | 2019-07-02T14:09:42.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.517815 | 80 | 0.655587 | 16,616 | 0.928268 | 0 | 0 | 8,520 | 0.475978 | 0 | 0 | 5,229 | 0.292123 |
71feffbb5e24e7f37afedbf05e8ccd4bc8d2a4ea | 1,898 | py | Python | pos_neg_graph/graph_ratio.py | Yudabin/Review_Project | b924199d6845defeb4cd243a99426070c014d8d8 | [
"MIT"
] | null | null | null | pos_neg_graph/graph_ratio.py | Yudabin/Review_Project | b924199d6845defeb4cd243a99426070c014d8d8 | [
"MIT"
] | null | null | null | pos_neg_graph/graph_ratio.py | Yudabin/Review_Project | b924199d6845defeb4cd243a99426070c014d8d8 | [
"MIT"
] | 1 | 2020-11-10T00:54:45.000Z | 2020-11-10T00:54:45.000Z | import matplotlib.font_manager as fm
import matplotlib.pyplot as plt
import numpy as np
font_location = './wordcloud_file/malgun.ttf' # For Windows
font_name = fm.FontProperties(fname=font_location).get_name()
plt.rc('font', family=font_name)
def percent_graph2(movie_review) :
b = movie_review
labelss = sorte... | 42.177778 | 105 | 0.553741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 938 | 0.42792 |
71ff26bb500f7231ddf77573e218582db161237c | 143 | py | Python | blog/views.py | kbilak/City-portal | f567764f3c4ae0287a178acf77f060dde0424f26 | [
"MIT"
] | null | null | null | blog/views.py | kbilak/City-portal | f567764f3c4ae0287a178acf77f060dde0424f26 | [
"MIT"
] | null | null | null | blog/views.py | kbilak/City-portal | f567764f3c4ae0287a178acf77f060dde0424f26 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic import TemplateView
def index(request):
return render(request, 'index.html') | 28.6 | 45 | 0.797203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0.083916 |
71ffb4e7bdba22327963714071779d2e8b20d391 | 3,727 | py | Python | my_area/views.py | Vincent-Juma/area_master | 3ea1dd1039053fb4de6326deb967383d09d7145b | [
"MIT"
] | 1 | 2021-05-28T14:16:54.000Z | 2021-05-28T14:16:54.000Z | my_area/views.py | Vincent-Juma/area_master | 3ea1dd1039053fb4de6326deb967383d09d7145b | [
"MIT"
] | null | null | null | my_area/views.py | Vincent-Juma/area_master | 3ea1dd1039053fb4de6326deb967383d09d7145b | [
"MIT"
] | 1 | 2021-04-13T09:14:07.000Z | 2021-04-13T09:14:07.000Z | from django.shortcuts import render
from .forms import *
from django.shortcuts import redirect,get_object_or_404
from django.contrib.auth.decorators import login_required
from . models import *
from django.views import generic
@login_required(login_url='/accounts/login/')
def home(request):
mylocs = Myloc.objects.... | 37.646465 | 96 | 0.676952 | 0 | 0 | 0 | 0 | 3,199 | 0.858331 | 0 | 0 | 509 | 0.136571 |
9c013815ab64fbbe61aec8c1d395c39f802c887c | 361 | py | Python | 2020/day_01/__main__.py | d02d33pak/Advent-Of-Code | 765b0302c256ad61864095a537a3f6379901b1c2 | [
"MIT"
] | null | null | null | 2020/day_01/__main__.py | d02d33pak/Advent-Of-Code | 765b0302c256ad61864095a537a3f6379901b1c2 | [
"MIT"
] | null | null | null | 2020/day_01/__main__.py | d02d33pak/Advent-Of-Code | 765b0302c256ad61864095a537a3f6379901b1c2 | [
"MIT"
] | null | null | null | """
Day 1 Main Module
"""
from day01 import parse_input, part1, part2
if __name__ == "__main__":
# trying out the new walrus[:=] oprtr in python
if (part := int(input("Enter Part: "))) == 1:
print(part1(parse_input("input.txt")))
elif part == 2:
print(part2(parse_input("input.txt")))
e... | 24.066667 | 51 | 0.595568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 138 | 0.382271 |
9c01b072850e72696bc89430b3763e9313e105ec | 4,406 | py | Python | quiz_app/settings.py | ignasgri/Django_Quiz | c98969d4181350eaaf8883f3930d0e800c240a44 | [
"MIT"
] | null | null | null | quiz_app/settings.py | ignasgri/Django_Quiz | c98969d4181350eaaf8883f3930d0e800c240a44 | [
"MIT"
] | 6 | 2020-06-05T19:26:57.000Z | 2022-03-11T23:33:08.000Z | quiz_app/settings.py | ignasgri/Django_Quiz | c98969d4181350eaaf8883f3930d0e800c240a44 | [
"MIT"
] | null | null | null | """
Django settings for quiz_app project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
SITE_ID = 1
... | 27.886076 | 91 | 0.70631 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,921 | 0.66296 |
9c01e95549f9ef77973f439bfde72aea99322f8e | 20,840 | py | Python | scripts/data/topple_dataset.py | davrempe/predicting-physical-dynamics | b0abb385a7ac491e25d1df0b9a9a943621fc2d37 | [
"MIT"
] | 16 | 2020-02-29T06:44:16.000Z | 2022-02-20T13:05:12.000Z | scripts/data/topple_dataset.py | davrempe/predicting-physical-dynamics | b0abb385a7ac491e25d1df0b9a9a943621fc2d37 | [
"MIT"
] | 6 | 2020-02-13T08:09:28.000Z | 2022-02-09T23:35:55.000Z | scripts/data/topple_dataset.py | davrempe/predicting-physical-dynamics | b0abb385a7ac491e25d1df0b9a9a943621fc2d37 | [
"MIT"
] | 4 | 2020-04-22T09:46:55.000Z | 2021-04-15T06:17:48.000Z | import numpy as np
import pickle
from os.path import exists, realpath
import sys
import math
from topple_data_loader import ToppleData, ToppleDataLoader
import transforms3d
class ToppleNormalizationInfo():
'''
Structure to hold all the normalization information for a dataset.
'''
def __init__(self... | 45.010799 | 149 | 0.613964 | 19,459 | 0.933733 | 0 | 0 | 0 | 0 | 0 | 0 | 5,115 | 0.245441 |
9c0252cbabe1a0b566b1ac4670f0fdedec520c7a | 370 | py | Python | Part1/AverageAccuracy.py | efkandurakli/Graduation-Project1 | fd2cba89929da2cef49ec67214b54c310b57ce01 | [
"MIT"
] | 1 | 2019-12-18T08:16:55.000Z | 2019-12-18T08:16:55.000Z | Part1/AverageAccuracy.py | efkandurakli/Graduation-Project1 | fd2cba89929da2cef49ec67214b54c310b57ce01 | [
"MIT"
] | null | null | null | Part1/AverageAccuracy.py | efkandurakli/Graduation-Project1 | fd2cba89929da2cef49ec67214b54c310b57ce01 | [
"MIT"
] | null | null | null | import numpy as np
from operator import truediv
def AA_andEachClassAccuracy(confusion_matrix):
counter = confusion_matrix.shape[0]
list_diag = np.diag(confusion_matrix)
list_raw_sum = np.sum(confusion_matrix, axis=1)
each_acc = np.nan_to_num(truediv(list_diag, list_raw_sum))
average_acc = n... | 37 | 63 | 0.751351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c029add7c4d9a1a7902d4f882039de120a387b3 | 13,193 | py | Python | scripts/sct_apply_transfo.py | YangHee-Min/spinalcordtoolbox | 38ca15aa99b03ca99b7885ddc98adf2755adc43d | [
"MIT"
] | null | null | null | scripts/sct_apply_transfo.py | YangHee-Min/spinalcordtoolbox | 38ca15aa99b03ca99b7885ddc98adf2755adc43d | [
"MIT"
] | null | null | null | scripts/sct_apply_transfo.py | YangHee-Min/spinalcordtoolbox | 38ca15aa99b03ca99b7885ddc98adf2755adc43d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#########################################################################################
#
# Apply transformations. This function is a wrapper for sct_WarpImageMultiTransform
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechn... | 42.973941 | 175 | 0.560373 | 8,352 | 0.633063 | 0 | 0 | 0 | 0 | 0 | 0 | 4,347 | 0.329493 |
9c04726d3c874dda1b944aacaee1f8285db82b6a | 3,132 | py | Python | tests/plugins/test_plugin_base.py | vurankar/mongo-connector | 202aa28743855643fddd77d3e66bf1a640df3ed6 | [
"Apache-2.0"
] | 1 | 2019-08-24T21:06:00.000Z | 2019-08-24T21:06:00.000Z | tests/plugins/test_plugin_base.py | vurankar/mongo-connector | 202aa28743855643fddd77d3e66bf1a640df3ed6 | [
"Apache-2.0"
] | 13 | 2017-08-07T04:36:25.000Z | 2021-02-08T17:37:27.000Z | tests/plugins/test_plugin_base.py | vurankar/mongo-connector | 202aa28743855643fddd77d3e66bf1a640df3ed6 | [
"Apache-2.0"
] | 4 | 2018-10-22T17:30:46.000Z | 2020-07-07T21:24:48.000Z | # Copyright 2013-2014 MongoDB, 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 agreed to in writin... | 27 | 74 | 0.623244 | 2,254 | 0.719668 | 0 | 0 | 0 | 0 | 0 | 0 | 1,068 | 0.340996 |
9c048e3e8bdc9b4b95cc9e0528a68aa1fd3efcf5 | 10,365 | py | Python | address/models.py | PerchLive/django-address | edab73847ba95d4f7a71993bcd55ea6bf300693e | [
"BSD-3-Clause"
] | null | null | null | address/models.py | PerchLive/django-address | edab73847ba95d4f7a71993bcd55ea6bf300693e | [
"BSD-3-Clause"
] | null | null | null | address/models.py | PerchLive/django-address | edab73847ba95d4f7a71993bcd55ea6bf300693e | [
"BSD-3-Clause"
] | null | null | null | import logging
import sys
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.related import ForeignObject
from django.utils.encoding import python_2_unicode_compatible
try:
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
... | 31.409091 | 117 | 0.625663 | 5,065 | 0.488664 | 0 | 0 | 3,992 | 0.385142 | 0 | 0 | 2,048 | 0.197588 |
9c0520151db9426f768e41a165d1e59bc2354107 | 198 | py | Python | src/eavatar.ava/pod/mods/tasks/__init__.py | eavatar/ava | 4f09c5417b7187dd919b7edabb8c516d8efc0696 | [
"BSD-3-Clause"
] | null | null | null | src/eavatar.ava/pod/mods/tasks/__init__.py | eavatar/ava | 4f09c5417b7187dd919b7edabb8c516d8efc0696 | [
"BSD-3-Clause"
] | null | null | null | src/eavatar.ava/pod/mods/tasks/__init__.py | eavatar/ava | 4f09c5417b7187dd919b7edabb8c516d8efc0696 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Modules for exposing functions that can be run as tasks.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
| 28.285714 | 57 | 0.651515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 87 | 0.439394 |
9c07713f7b2c917072be6181205756050fc2c5cb | 7,715 | py | Python | addons/hr_payroll_account/models/hr_payroll_account.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/hr_payroll_account/models/hr_payroll_account.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/hr_payroll_account/models/hr_payroll_account.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare, float_is_zero
class HrPayslipLine(models.Model):
_inherit = 'hr.payslip.line'
def _get_partner_... | 46.757576 | 142 | 0.583279 | 7,475 | 0.968892 | 0 | 0 | 5,078 | 0.658198 | 0 | 0 | 1,612 | 0.208944 |
9c08054f6ca4be429f3f9506fd1f8ea55ac7ad8b | 3,048 | py | Python | ml_datasets/utils.py | abkoesdw/ml-datasets | c8c7b85ba8ed9c0ea233b4092d499d5022952011 | [
"MIT"
] | 1 | 2020-07-05T04:58:07.000Z | 2020-07-05T04:58:07.000Z | ml_datasets/utils.py | abkoesdw/ml-datasets | c8c7b85ba8ed9c0ea233b4092d499d5022952011 | [
"MIT"
] | null | null | null | ml_datasets/utils.py | abkoesdw/ml-datasets | c8c7b85ba8ed9c0ea233b4092d499d5022952011 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import sys
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.colors import BoundaryNorm
def plot_images(
num_sample_perclass=10, x=None, y=None, labels=None, title=None, cmap=None
):
grid_x = num_samp... | 27.709091 | 86 | 0.597113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 340 | 0.111549 |
9c09326eb5f4c01f6725f6f04b0ab3e2c2184c2f | 4,794 | py | Python | Simulator/simulator.py | MasterRadule/DefenceFirst | d3c3a652357ac433213c38fa6134780e286f6cf2 | [
"MIT"
] | null | null | null | Simulator/simulator.py | MasterRadule/DefenceFirst | d3c3a652357ac433213c38fa6134780e286f6cf2 | [
"MIT"
] | null | null | null | Simulator/simulator.py | MasterRadule/DefenceFirst | d3c3a652357ac433213c38fa6134780e286f6cf2 | [
"MIT"
] | 2 | 2020-08-02T10:47:17.000Z | 2021-08-31T06:00:44.000Z | import logging
import os
import random
from abc import ABC, abstractmethod
from random import randint
from time import sleep, strftime
HOSTNAME = ['defence-first.rs', 'defence-first.de', 'defence-first.ru']
HOSTIP = ['78.218.236.218', '87.236.11.212', '54.147.165.86']
SOURCEIP = ['163.189.141.53', '204.164.10.7', '213... | 32.612245 | 118 | 0.569462 | 3,703 | 0.772424 | 0 | 0 | 199 | 0.04151 | 0 | 0 | 1,173 | 0.244681 |
9c097a6d565de2831c6dc5b3639c640259afd08c | 50 | py | Python | bayes_race/pp/__init__.py | DaniMarts/bayesrace | 3d0d2b26dac2e33ad7e38513304cfb259abe351c | [
"MIT"
] | 23 | 2020-03-27T03:28:04.000Z | 2022-02-24T11:21:18.000Z | bayes_race/pp/__init__.py | DaniMarts/bayesrace | 3d0d2b26dac2e33ad7e38513304cfb259abe351c | [
"MIT"
] | 1 | 2021-07-08T22:02:15.000Z | 2021-07-08T22:02:15.000Z | bayes_race/pp/__init__.py | DaniMarts/bayesrace | 3d0d2b26dac2e33ad7e38513304cfb259abe351c | [
"MIT"
] | 17 | 2020-10-27T06:09:34.000Z | 2022-03-23T05:28:23.000Z | from bayes_race.pp.pure_pursuit import purePursuit | 50 | 50 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c0a0b0b086b2b7d8551997a7e4a8ba952ff7a5b | 793 | py | Python | pysteam/evaluator/vector_space_error_eval.py | utiasASRL/pysteam | c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b | [
"BSD-3-Clause"
] | 5 | 2021-10-23T00:35:20.000Z | 2022-03-22T02:32:43.000Z | pysteam/evaluator/vector_space_error_eval.py | utiasASRL/pysteam | c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b | [
"BSD-3-Clause"
] | null | null | null | pysteam/evaluator/vector_space_error_eval.py | utiasASRL/pysteam | c0c8809ee2a5e1dab5ce7f9e5ff9de91138ce68b | [
"BSD-3-Clause"
] | 1 | 2022-02-04T21:49:48.000Z | 2022-02-04T21:49:48.000Z | from typing import Optional
import numpy as np
from . import Evaluator
from ..state import VectorSpaceStateVar
class VectorSpaceErrorEval(Evaluator):
"""Error evaluator for a measured vector space state variable"""
def __init__(self, meas: np.ndarray, state_vec: VectorSpaceStateVar) -> None:
super().__init_... | 24.78125 | 79 | 0.711223 | 679 | 0.856242 | 0 | 0 | 0 | 0 | 0 | 0 | 64 | 0.080706 |
9c0a5c02779cee26231b6b416177aadae209d132 | 83 | py | Python | torch_geometric/nn/unpool/__init__.py | mwussow/pytorch_geometric | 01c68f9b58c94d9efd1f6e39b9c85177aae521bb | [
"MIT"
] | 13 | 2019-11-07T02:57:41.000Z | 2021-12-28T08:19:56.000Z | torch_geometric/nn/unpool/__init__.py | mwussow/pytorch_geometric | 01c68f9b58c94d9efd1f6e39b9c85177aae521bb | [
"MIT"
] | 3 | 2019-10-30T20:20:27.000Z | 2022-03-12T22:56:11.000Z | torch_geometric/nn/unpool/__init__.py | mwussow/pytorch_geometric | 01c68f9b58c94d9efd1f6e39b9c85177aae521bb | [
"MIT"
] | 3 | 2020-10-19T02:53:20.000Z | 2022-01-31T04:31:02.000Z | from .knn_interpolate import knn_interpolate
__all__ = [
'knn_interpolate',
]
| 13.833333 | 44 | 0.746988 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.204819 |
9c0adaf30cf08d06f29b5570721ed08bc9df2c6a | 937 | py | Python | bc4py/bip32/utils.py | namuyan/bc4py | 6484d356096261d0d57e9e1f5ffeae1f9a9865f3 | [
"MIT"
] | 12 | 2018-09-19T14:02:09.000Z | 2020-01-27T16:20:14.000Z | bc4py/bip32/utils.py | namuyan/bc4py | 6484d356096261d0d57e9e1f5ffeae1f9a9865f3 | [
"MIT"
] | 1 | 2019-09-09T23:58:47.000Z | 2019-09-16T09:33:20.000Z | bc4py/bip32/utils.py | namuyan/bc4py | 6484d356096261d0d57e9e1f5ffeae1f9a9865f3 | [
"MIT"
] | 6 | 2018-11-13T17:20:14.000Z | 2020-02-15T11:46:52.000Z | from bc4py_extension import PyAddress
import hashlib
def is_address(ck: PyAddress, hrp, ver):
"""check bech32 format and version"""
try:
if ck.hrp != hrp:
return False
if ck.version != ver:
return False
except ValueError:
return False
return True
def g... | 24.025641 | 79 | 0.662753 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 176 | 0.187834 |
9c0b22579bc28f35e8719b18a2963cb1c1518847 | 2,687 | py | Python | cubi_tk/snappy/kickoff.py | LaborBerlin/cubi-tk | 4aa5306c547c38eb41d5623ff6e4bace828f85b1 | [
"MIT"
] | null | null | null | cubi_tk/snappy/kickoff.py | LaborBerlin/cubi-tk | 4aa5306c547c38eb41d5623ff6e4bace828f85b1 | [
"MIT"
] | null | null | null | cubi_tk/snappy/kickoff.py | LaborBerlin/cubi-tk | 4aa5306c547c38eb41d5623ff6e4bace828f85b1 | [
"MIT"
] | null | null | null | """``cubi-tk snappy kickoff``: kickoff SNAPPY pipeline."""
import argparse
import os
import subprocess
import typing
from logzero import logger
from toposort import toposort
from . import common
from cubi_tk.exceptions import ParseOutputException
def run(
args, _parser: argparse.ArgumentParser, _subparser: ar... | 34.448718 | 97 | 0.633048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 753 | 0.280238 |
9c0b572f391a67c770410e50b8bf0631101d5372 | 4,152 | py | Python | tests/test_autotuner.py | RajatRasal/devito | 162abb6b318e77eaa4e8f719047327c45782056f | [
"MIT"
] | null | null | null | tests/test_autotuner.py | RajatRasal/devito | 162abb6b318e77eaa4e8f719047327c45782056f | [
"MIT"
] | null | null | null | tests/test_autotuner.py | RajatRasal/devito | 162abb6b318e77eaa4e8f719047327c45782056f | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from functools import reduce
from operator import mul
try:
from StringIO import StringIO
except ImportError:
# Python3 compatibility
from io import StringIO
import pytest
from conftest import skipif_yask
import numpy as np
from devito import Grid, Function, TimeFun... | 35.793103 | 87 | 0.67317 | 0 | 0 | 0 | 0 | 3,739 | 0.90053 | 0 | 0 | 923 | 0.222303 |
9c0c673d58dcba5d4585b62a8e7fbc1916ed2edb | 2,683 | py | Python | projects/CharGrid/data/bizcard2coco.py | timctho/detectron2-chargrid | 547479c88ad7d1de2348377706167a84d024a622 | [
"Apache-2.0"
] | 3 | 2020-03-15T18:33:21.000Z | 2020-03-28T18:06:45.000Z | projects/CharGrid/data/bizcard2coco.py | timctho/detectron2-chargrid | 547479c88ad7d1de2348377706167a84d024a622 | [
"Apache-2.0"
] | 2 | 2021-09-08T01:46:39.000Z | 2022-01-13T02:22:56.000Z | projects/CharGrid/data/bizcard2coco.py | timctho/detectron2-chargrid | 547479c88ad7d1de2348377706167a84d024a622 | [
"Apache-2.0"
] | null | null | null | from data.data_reader import BIZCARD_LABEL_MAP, BizcardDataParser
import argparse
from pathlib import Path
import os
import json
import cv2
import numpy as np
def convert_bizcard_to_coco_format(image_dir, json_dir, id_list, out_dir, out_name):
coco_json = {}
images = []
annotations = []
categories = [... | 31.197674 | 120 | 0.566157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 231 | 0.086098 |
9c0cd3c1e4e41a88f41a644df51b7c36f341d915 | 643 | py | Python | deckz/cli/run.py | m09/deckz | 0f97ef2a43c2c714ac18173a4fe3266cccba31e2 | [
"Apache-2.0"
] | null | null | null | deckz/cli/run.py | m09/deckz | 0f97ef2a43c2c714ac18173a4fe3266cccba31e2 | [
"Apache-2.0"
] | 41 | 2020-04-06T13:49:18.000Z | 2020-12-24T11:14:47.000Z | deckz/cli/run.py | m09/deckz | 0f97ef2a43c2c714ac18173a4fe3266cccba31e2 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import List, Optional
from typer import Argument
from deckz.cli import app
from deckz.paths import Paths
from deckz.running import run as running_run
@app.command()
def run(
targets: Optional[List[str]] = Argument(None),
handout: bool = True,
presentation: bool = Tru... | 22.964286 | 50 | 0.676516 | 0 | 0 | 0 | 0 | 451 | 0.7014 | 0 | 0 | 30 | 0.046656 |
9c0e837a9fbf8aa155047aa8574f5db7dc5ea5ad | 248 | py | Python | postgresqleu/confreg/templatetags/miscutil.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | postgresqleu/confreg/templatetags/miscutil.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | postgresqleu/confreg/templatetags/miscutil.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
@register.filter(name='isboolean')
def isboolean(value):
return isinstance(value, bool)
@register.filter(name='vartypename')
def vartypename(value):
return type(value).__name__
| 17.714286 | 36 | 0.754032 | 0 | 0 | 0 | 0 | 183 | 0.737903 | 0 | 0 | 24 | 0.096774 |
9c0e950fb4a4ebdf55176f8dd2da092d38504b70 | 2,171 | py | Python | chat.py | rchampa/chat-server | 34b5897e90b580754ad95b36bf7f23ac9baf3175 | [
"MIT"
] | null | null | null | chat.py | rchampa/chat-server | 34b5897e90b580754ad95b36bf7f23ac9baf3175 | [
"MIT"
] | null | null | null | chat.py | rchampa/chat-server | 34b5897e90b580754ad95b36bf7f23ac9baf3175 | [
"MIT"
] | null | null | null | import asyncio
import contextvars
import aioredis
import uvloop
from aioredis import Redis
from fastapi import FastAPI
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.staticfiles import StaticFiles
from RLog import rprint
from routers import apirest, websockets
REDIS_HOST = 'redis'
REDIS_PORT =... | 31.463768 | 119 | 0.720405 | 374 | 0.172271 | 0 | 0 | 745 | 0.34316 | 862 | 0.397052 | 432 | 0.198987 |
9c0eb1c40d85566bde4854bf69d4592341ad2835 | 1,009 | py | Python | cli.py | abel-bernabeu/facecompressor | 9322f4e3d3f2787dc9dec2fad6b3f1995d052077 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T09:35:56.000Z | 2021-04-27T11:27:47.000Z | cli.py | abel-bernabeu/facecompressor | 9322f4e3d3f2787dc9dec2fad6b3f1995d052077 | [
"BSD-3-Clause"
] | null | null | null | cli.py | abel-bernabeu/facecompressor | 9322f4e3d3f2787dc9dec2fad6b3f1995d052077 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import autoencoder
def addTrainablesArg(parser):
parser.add_argument('--model', dest='model', help='Trained model', default='model.pt')
def addExchangeArg(parser):
parser.add_argument('--exchange', dest='exchange', help='File with exchanged data', required=True)
parser = argparse.ArgumentPa... | 31.53125 | 102 | 0.769078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 210 | 0.208127 |