hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0e63b684ca3c40b5df78715454f1e018a1b1f8 | 4,035 | py | Python | smartsheet/models/event.py | bromic007/smartsheet-python-sdk | ef256b7421a65a56a7138dc2b3eb5d69a1a06590 | [
"Apache-2.0"
] | 106 | 2015-02-21T14:26:32.000Z | 2022-03-31T05:56:53.000Z | smartsheet/models/event.py | bromic007/smartsheet-python-sdk | ef256b7421a65a56a7138dc2b3eb5d69a1a06590 | [
"Apache-2.0"
] | 94 | 2015-02-09T13:16:00.000Z | 2022-03-16T06:37:41.000Z | smartsheet/models/event.py | bromic007/smartsheet-python-sdk | ef256b7421a65a56a7138dc2b3eb5d69a1a06590 | [
"Apache-2.0"
] | 85 | 2015-02-06T22:05:25.000Z | 2022-03-16T06:22:59.000Z | # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2019 Smartsheet.com, 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.... | 26.032258 | 75 | 0.667162 |
from __future__ import absolute_import
from .enums import EventObjectType, EventAction, EventSource
from ..types import *
from ..util import serialize
from ..util import deserialize
class Event(object):
def __init__(self, props=None, base_obj=None):
self._base = None
if base_obj is not None:
... | true | true |
1c0e64ed8f4b88763d9cf08242a17fb28e7615e0 | 2,045 | py | Python | Artificial_Neural_Networks/python/FeedForwardANN/FFANN_VanillaSGD.py | dkaramit/ASAP | afade2737b332e7dbf0ea06eb4f31564a478ee40 | [
"MIT"
] | null | null | null | Artificial_Neural_Networks/python/FeedForwardANN/FFANN_VanillaSGD.py | dkaramit/ASAP | afade2737b332e7dbf0ea06eb4f31564a478ee40 | [
"MIT"
] | null | null | null | Artificial_Neural_Networks/python/FeedForwardANN/FFANN_VanillaSGD.py | dkaramit/ASAP | afade2737b332e7dbf0ea06eb4f31564a478ee40 | [
"MIT"
] | 1 | 2021-12-15T02:03:01.000Z | 2021-12-15T02:03:01.000Z | from numpy import sqrt as np_sqrt
from numpy import abs as np_abs
from .FFANN_SGD import StochasticGradientDescent
class VanillaSGD(StochasticGradientDescent):
'''
Not the best (far from it) strategy, but the simplest. Will use it to test if the implementation works.
'''
def __init__(self,loss,alpha=1e... | 39.326923 | 107 | 0.56088 | from numpy import sqrt as np_sqrt
from numpy import abs as np_abs
from .FFANN_SGD import StochasticGradientDescent
class VanillaSGD(StochasticGradientDescent):
def __init__(self,loss,alpha=1e-2):
StochasticGradientDescent.__init__(self,loss)
self.alpha=alpha
def update(self, data_out,abs_t... | true | true |
1c0e677734a6a5f02b1e51c8f03d61329ee1c8c8 | 7,220 | py | Python | identify/identify.py | Skylion007/identify | fcb10465955fe8ba163ff034b7ebf2b04529508e | [
"MIT"
] | 1 | 2020-11-20T12:22:25.000Z | 2020-11-20T12:22:25.000Z | identify/identify.py | Skylion007/identify | fcb10465955fe8ba163ff034b7ebf2b04529508e | [
"MIT"
] | 3 | 2020-11-20T14:40:17.000Z | 2020-11-27T00:57:50.000Z | identify/identify.py | Skylion007/identify | fcb10465955fe8ba163ff034b7ebf2b04529508e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import io
import os.path
import re
import shlex
import string
import sys
from identify import extensions
from identify import interpreters
from identify.vendor import licenses
print... | 28.425197 | 103 | 0.641274 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import io
import os.path
import re
import shlex
import string
import sys
from identify import extensions
from identify import interpreters
from identify.vendor import licenses
printable = frozenset(string.... | true | true |
1c0e6790af8135a5bdeb850880a6d01bc18b09f7 | 8,199 | py | Python | proxy/__init__.py | kwestpharedhat/quay | a0df895005bcd3e53847046f69f6a7add87c88fd | [
"Apache-2.0"
] | null | null | null | proxy/__init__.py | kwestpharedhat/quay | a0df895005bcd3e53847046f69f6a7add87c88fd | [
"Apache-2.0"
] | null | null | null | proxy/__init__.py | kwestpharedhat/quay | a0df895005bcd3e53847046f69f6a7add87c88fd | [
"Apache-2.0"
] | null | null | null | """
The proxy module provides the means to proxy images from other registry instances.
Registries following the distribution spec are supported.
"""
from __future__ import annotations
import re
import requests
from requests.exceptions import RequestException
from app import model_cache
from data.cache import cache_ke... | 37.610092 | 99 | 0.628491 | from __future__ import annotations
import re
import requests
from requests.exceptions import RequestException
from app import model_cache
from data.cache import cache_key
from data.database import ProxyCacheConfig
WWW_AUTHENTICATE_REGEX = re.compile(r'(\w+)[=] ?"?([^",]+)"?')
TOKEN_VALIDITY_LIFETIME_S = 60 * 60 # ... | true | true |
1c0e698a65ca22288df4bd33ef679b014b2e5ac8 | 86 | py | Python | app/corpus/__init__.py | jonasengelmann/bibliographic_corpus_webapp | 0fedf091c8afefdc9d85fb1b55cab2a3e9a98c8c | [
"MIT"
] | null | null | null | app/corpus/__init__.py | jonasengelmann/bibliographic_corpus_webapp | 0fedf091c8afefdc9d85fb1b55cab2a3e9a98c8c | [
"MIT"
] | null | null | null | app/corpus/__init__.py | jonasengelmann/bibliographic_corpus_webapp | 0fedf091c8afefdc9d85fb1b55cab2a3e9a98c8c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''The corpus module.'''
from app.corpus import views # noqa
| 21.5 | 36 | 0.616279 | from app.corpus import views | true | true |
1c0e6abb57dd0f484e5cb0694dc495adc9d83fea | 21,687 | bzl | Python | bazel/repositories.bzl | TAOXUY/envoy | 5e95cc3e545deba4a42c629ef9c7d8ccd8ec271d | [
"Apache-2.0"
] | 1 | 2019-07-06T03:33:55.000Z | 2019-07-06T03:33:55.000Z | bazel/repositories.bzl | mnktsts2/envoy | 5e95cc3e545deba4a42c629ef9c7d8ccd8ec271d | [
"Apache-2.0"
] | null | null | null | bazel/repositories.bzl | mnktsts2/envoy | 5e95cc3e545deba4a42c629ef9c7d8ccd8ec271d | [
"Apache-2.0"
] | null | null | null | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(":genrule_repository.bzl", "genrule_repository")
load("@envoy_api//bazel:envoy_http_archive.bzl", "envoy_http_archive")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
# di... | 31.476052 | 108 | 0.660903 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(":genrule_repository.bzl", "genrule_repository")
load("@envoy_api//bazel:envoy_http_archive.bzl", "envoy_http_archive")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
PPC_... | true | true |
1c0e6b62373e21c7ccc45bfcc5ea79aeeaed8951 | 1,262 | py | Python | homeassistant/components/process.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | 1 | 2017-03-01T10:57:20.000Z | 2017-03-01T10:57:20.000Z | homeassistant/components/process.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | null | null | null | homeassistant/components/process.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | 1 | 2020-11-13T10:06:21.000Z | 2020-11-13T10:06:21.000Z | """
homeassistant.components.process
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to watch for specific processes running
on the host machine.
Author: Markus Stenberg <fingon@iki.fi>
"""
import os
from homeassistant.components import STATE_ON, STATE_OFF
import homeassistant.util as util
DOMAIN = 'proces... | 25.755102 | 79 | 0.664025 |
import os
from homeassistant.components import STATE_ON, STATE_OFF
import homeassistant.util as util
DOMAIN = 'process'
DEPENDENCIES = []
ENTITY_ID_FORMAT = DOMAIN + '.{}'
PS_STRING = 'ps awx'
def setup(hass, config):
entities = {ENTITY_ID_FORMAT.format(util.slugify(pname)): pstring
for pname... | true | true |
1c0e6b780e7d58596beb1c0dea1440c41c1c8801 | 2,731 | py | Python | src/python/Utils/Timers.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/Utils/Timers.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/Utils/Timers.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/bin/env python
"""
Utilities related to timing and performance testing
"""
from __future__ import print_function, division, absolute_import
from builtins import object
import time
from datetime import tzinfo, timedelta
def timeFunction(func):
"""
source: https://www.andreas-jung.com/contents/a-python-dec... | 27.31 | 112 | 0.631637 |
from __future__ import print_function, division, absolute_import
from builtins import object
import time
from datetime import tzinfo, timedelta
def timeFunction(func):
def wrapper(*arg, **kw):
t1 = time.time()
res = func(*arg, **kw)
t2 = time.time()
return round((t2 - t1), 4), r... | true | true |
1c0e6d158bad0757feda9972834a5a3b9da3d035 | 645 | py | Python | NLPAlgorithms/DynamicGallantAlgorithm.py | PavlosP1987/PythonNaturalLanguageAlgorithmsLibrary | c6154f1a07968fe08636a172b7b2f3bab3e5e93d | [
"MIT"
] | null | null | null | NLPAlgorithms/DynamicGallantAlgorithm.py | PavlosP1987/PythonNaturalLanguageAlgorithmsLibrary | c6154f1a07968fe08636a172b7b2f3bab3e5e93d | [
"MIT"
] | null | null | null | NLPAlgorithms/DynamicGallantAlgorithm.py | PavlosP1987/PythonNaturalLanguageAlgorithmsLibrary | c6154f1a07968fe08636a172b7b2f3bab3e5e93d | [
"MIT"
] | null | null | null | def superSeq1(X, Y, m, n):
dp = [[0] * (n + 2) for i in range(m + 2)]
for i in range(m + 1):
for j in range(n + 1):
if (not i):
dp[i][j] = j
elif (not j):
dp[i][j] = i
elif (X[i - 1] == Y[j - 1]):
... | 22.241379 | 51 | 0.327132 | def superSeq1(X, Y, m, n):
dp = [[0] * (n + 2) for i in range(m + 2)]
for i in range(m + 1):
for j in range(n + 1):
if (not i):
dp[i][j] = j
elif (not j):
dp[i][j] = i
elif (X[i - 1] == Y[j - 1]):
... | true | true |
1c0e6d1e550299799467c1de95dc8dc1e6432c0d | 2,767 | py | Python | tests/unit/test_expression_tree/test_symbolic_diff.py | zlgenuine/pybamm | 5c43d17225710c5bea8e61b3863688eb7080e678 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_expression_tree/test_symbolic_diff.py | zlgenuine/pybamm | 5c43d17225710c5bea8e61b3863688eb7080e678 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_expression_tree/test_symbolic_diff.py | zlgenuine/pybamm | 5c43d17225710c5bea8e61b3863688eb7080e678 | [
"BSD-3-Clause"
] | null | null | null | #
# Tests for the symbolic differentiation methods
#
import numpy as np
import pybamm
import unittest
from numpy import testing
class TestSymbolicDifferentiation(unittest.TestCase):
def test_advanced(self):
a = pybamm.StateVector(slice(0, 1))
b = pybamm.StateVector(slice(1, 2))
y = np.arra... | 32.174419 | 84 | 0.533068 | import numpy as np
import pybamm
import unittest
from numpy import testing
class TestSymbolicDifferentiation(unittest.TestCase):
def test_advanced(self):
a = pybamm.StateVector(slice(0, 1))
b = pybamm.StateVector(slice(1, 2))
y = np.array([5, 3])
func = (a * 2 + 5 * (-b)) ... | true | true |
1c0e6d6f93582037ca43e89094300eece5fcd2f3 | 1,043 | py | Python | app/core/migrations/0004_recipe.py | leemingo/recipe-app-api | 24838b5a92c03618da0ca2ba09377b67a45fd5ef | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | leemingo/recipe-app-api | 24838b5a92c03618da0ca2ba09377b67a45fd5ef | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | leemingo/recipe-app-api | 24838b5a92c03618da0ca2ba09377b67a45fd5ef | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-01-09 08:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... | 35.965517 | 118 | 0.604027 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
name='Recipe',
fields=[
... | true | true |
1c0e6e079daa3bbc9487f9025723d1b46df05771 | 1,100 | py | Python | Work/open_okular.py | Runamook/PyCharmProjects | 1b1a063345e052451f00e3fdea82e31bdd2a0cae | [
"MIT"
] | null | null | null | Work/open_okular.py | Runamook/PyCharmProjects | 1b1a063345e052451f00e3fdea82e31bdd2a0cae | [
"MIT"
] | null | null | null | Work/open_okular.py | Runamook/PyCharmProjects | 1b1a063345e052451f00e3fdea82e31bdd2a0cae | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import subprocess as sp
okular = '/usr/bin/okular'
data_dir = '/home/egk/.local/share/okular/docdata'
def find_files():
file_list = []
files_to_open = []
today = f" {sp.check_output(['/bin/date', '+%b %d']).decode().strip()} "
command = f'/bin/ls -ltr {data_dir}'.split()
all_f... | 28.947368 | 92 | 0.616364 |
import subprocess as sp
okular = '/usr/bin/okular'
data_dir = '/home/egk/.local/share/okular/docdata'
def find_files():
file_list = []
files_to_open = []
today = f" {sp.check_output(['/bin/date', '+%b %d']).decode().strip()} "
command = f'/bin/ls -ltr {data_dir}'.split()
all_files = sp.check_out... | true | true |
1c0e6e0906fa4480845cf0a5873938417292098e | 7,782 | py | Python | pype/plugins/blender/load/load_animation.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | pype/plugins/blender/load/load_animation.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | pype/plugins/blender/load/load_animation.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | """Load an animation in Blender."""
import logging
from pathlib import Path
from pprint import pformat
from typing import Dict, List, Optional
from avalon import api, blender
import bpy
import pype.hosts.blender.plugin
logger = logging.getLogger("pype").getChild(
"blender").getChild("load_animation")
class Bl... | 31.003984 | 78 | 0.621049 |
import logging
from pathlib import Path
from pprint import pformat
from typing import Dict, List, Optional
from avalon import api, blender
import bpy
import pype.hosts.blender.plugin
logger = logging.getLogger("pype").getChild(
"blender").getChild("load_animation")
class BlendAnimationLoader(pype.hosts.blende... | true | true |
1c0e6ea04fc5ee82259486e819d7ae26bd340cfc | 4,840 | py | Python | src/cmd_exec/util/ModuleUtil.py | ahuyuktepe/cmd-exec | 835037a4b7784d4901bf35db5eaa88a0757c5ce9 | [
"MIT"
] | null | null | null | src/cmd_exec/util/ModuleUtil.py | ahuyuktepe/cmd-exec | 835037a4b7784d4901bf35db5eaa88a0757c5ce9 | [
"MIT"
] | 1 | 2021-06-07T21:25:52.000Z | 2021-06-07T21:25:52.000Z | src/cmd_exec/util/ModuleUtil.py | ahuyuktepe/cmd-exec | 835037a4b7784d4901bf35db5eaa88a0757c5ce9 | [
"MIT"
] | null | null | null | import os
from ..error.CmdExecError import CmdExecError
from ..util.FileUtil import FileUtil
from ..util.ListUtil import ListUtil
from ..util.StrUtil import StrUtil
from ..util.ValidationUtil import ValidationUtil
class ModuleUtil:
@staticmethod
def getModuleNames() -> list:
modulesDirPat... | 44.40367 | 111 | 0.633884 | import os
from ..error.CmdExecError import CmdExecError
from ..util.FileUtil import FileUtil
from ..util.ListUtil import ListUtil
from ..util.StrUtil import StrUtil
from ..util.ValidationUtil import ValidationUtil
class ModuleUtil:
@staticmethod
def getModuleNames() -> list:
modulesDirPat... | true | true |
1c0e7001c64989213a544957673e8531768125d4 | 2,661 | py | Python | venv/lib/python3.8/site-packages/django/utils/crypto.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 1 | 2022-03-16T14:43:26.000Z | 2022-03-16T14:43:26.000Z | venv/lib/python3.8/site-packages/django/utils/crypto.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | null | null | null | venv/lib/python3.8/site-packages/django/utils/crypto.py | Joshua-Barawa/My-Photos | adcaea48149c6b31e9559b045709d538d0b749bc | [
"PostgreSQL",
"Unlicense"
] | 4 | 2022-03-12T10:17:00.000Z | 2022-03-26T08:40:43.000Z | """
Django's standard crypto functions and utilities.
"""
import hashlib
import hmac
import secrets
from django.conf import settings
from django.utils.encoding import force_bytes
class InvalidAlgorithm(ValueError):
"""Algorithm is not supported by hashlib."""
pass
def salted_hmac(key_salt, value, secret=N... | 34.558442 | 86 | 0.709884 | import hashlib
import hmac
import secrets
from django.conf import settings
from django.utils.encoding import force_bytes
class InvalidAlgorithm(ValueError):
pass
def salted_hmac(key_salt, value, secret=None, *, algorithm="sha1"):
if secret is None:
secret = settings.SECRET_KEY
key_salt = forc... | true | true |
1c0e70d00a797e4bf79a0d04559cfd03fadd17f5 | 2,069 | py | Python | CondTools/SiPixel/test/SiPixelBadModuleByHandBuilderFromROCList_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondTools/SiPixel/test/SiPixelBadModuleByHandBuilderFromROCList_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondTools/SiPixel/test/SiPixelBadModuleByHandBuilderFromROCList_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("ICALIB")
process.load("Configuration.Geometry.GeometryExtended2017_cff")
process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
process.MessageLogger = cms.Service("MessageLog... | 37.618182 | 109 | 0.650072 | import FWCore.ParameterSet.Config as cms
process = cms.Process("ICALIB")
process.load("Configuration.Geometry.GeometryExtended2017_cff")
process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
process.MessageLogger = cms.Service("MessageLog... | true | true |
1c0e713278c7d2ea48f80460a66d8008bd581ee4 | 60,814 | py | Python | lib/networks.py | TatsukichiShibuya/theoretical_framework_for_target_propagation | b6ee350c238be645e9cb42e12c79606f28f20f11 | [
"Apache-2.0"
] | 15 | 2020-11-04T04:41:14.000Z | 2022-03-13T02:52:25.000Z | lib/networks.py | AlexanderMeulemans/TheoreticalFrameworkForTargetPropagation | b6ee350c238be645e9cb42e12c79606f28f20f11 | [
"Apache-2.0"
] | null | null | null | lib/networks.py | AlexanderMeulemans/TheoreticalFrameworkForTargetPropagation | b6ee350c238be645e9cb42e12c79606f28f20f11 | [
"Apache-2.0"
] | 7 | 2021-01-11T01:33:49.000Z | 2022-01-11T01:16:49.000Z | #!/usr/bin/env python3
# Copyright 2019 Alexander Meulemans
#
# 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... | 42.231944 | 100 | 0.585852 |
import torch
import torch.nn as nn
import numpy as np
import warnings
from lib.dtp_layers import DTPLayer
from lib.dtpdrl_layers import DTPDRLLayer
from tensorboardX import SummaryWriter
import lib.utils as utils
from lib.utils import NetworkError
import pandas as pd
import torch.nn.functional as F
class DTPNetwork(... | true | true |
1c0e7416211d452ed042557163e400187afb7820 | 7,224 | py | Python | test/test_comment.py | Namyalg/mongo-python-driver | fc85a24888e3c1fe556eb8f755aeecb053b5815e | [
"Apache-2.0"
] | null | null | null | test/test_comment.py | Namyalg/mongo-python-driver | fc85a24888e3c1fe556eb8f755aeecb053b5815e | [
"Apache-2.0"
] | null | null | null | test/test_comment.py | Namyalg/mongo-python-driver | fc85a24888e3c1fe556eb8f755aeecb053b5815e | [
"Apache-2.0"
] | null | null | null | # Copyright 2022-present 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 wri... | 39.26087 | 99 | 0.542636 |
import inspect
import sys
from collections import defaultdict
from typing import Any, Union
sys.path[0:0] = [""]
from test import IntegrationTest, SkipTest, client_context, unittest
from test.utils import EventListener, rs_or_single_client
from bson.dbref import DBRef
from pymongo.collection import Collection
from... | true | true |
1c0e7479e0a666ec7af01836338afc90e4a039ab | 2,790 | py | Python | simulation.py | GiftofHermes/queue_simulation | aeb7ef818e1b2671c55d33179a6dc72e67976351 | [
"MIT"
] | null | null | null | simulation.py | GiftofHermes/queue_simulation | aeb7ef818e1b2671c55d33179a6dc72e67976351 | [
"MIT"
] | null | null | null | simulation.py | GiftofHermes/queue_simulation | aeb7ef818e1b2671c55d33179a6dc72e67976351 | [
"MIT"
] | null | null | null | from abc import ABC
import numpy as np
from collections import deque
import heapq
class Simulation:
"""
Fill here according to python guidelines
"""
def __init__(self):
self.event_id = 0
self.time = 0.0
self.event_queue = [] #should be a heapq
self.num_e... | 32.068966 | 83 | 0.543011 | from abc import ABC
import numpy as np
from collections import deque
import heapq
class Simulation:
def __init__(self):
self.event_id = 0
self.time = 0.0
self.event_queue = [] self.num_events = 0
self.total_wait_time = 0
self.max_wait_time = 0
sel... | true | true |
1c0e752df75229cdb426e35b014ca972bb9e4c6d | 8,300 | py | Python | src/uniimg.py | jayanthkoushik/cmu-ammml-project | d087924b64f91754addb19ef251b5dececb672e3 | [
"MIT"
] | 14 | 2017-04-07T20:58:15.000Z | 2021-11-07T11:56:53.000Z | src/uniimg.py | jayanthkoushik/cmu-ammml-project | d087924b64f91754addb19ef251b5dececb672e3 | [
"MIT"
] | 1 | 2017-09-13T07:02:01.000Z | 2017-09-13T07:02:01.000Z | src/uniimg.py | jayanthkoushik/cmu-ammml-project | d087924b64f91754addb19ef251b5dececb672e3 | [
"MIT"
] | 6 | 2016-05-20T06:07:08.000Z | 2019-10-13T00:44:55.000Z | # coding=utf-8
# uniimg.py: unimodal image based classifier.
from __future__ import print_function
import argparse
import sys
import os
import random
import glob
import cPickle
import math
from datetime import datetime
import numpy as np
from models.vgg16 import VGG16
from keras.optimizers import Adam
from keras.call... | 35.319149 | 84 | 0.592169 |
from __future__ import print_function
import argparse
import sys
import os
import random
import glob
import cPickle
import math
from datetime import datetime
import numpy as np
from models.vgg16 import VGG16
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint
from keras.preprocessing.image i... | true | true |
1c0e76440900bdc1b32ffa0e56c8da9eb7bd0cc4 | 402 | py | Python | app/__init__.py | sakuyaf/guestbook | fc34b1b14c0ef53632fe8fbd041b4363848f6112 | [
"MIT"
] | null | null | null | app/__init__.py | sakuyaf/guestbook | fc34b1b14c0ef53632fe8fbd041b4363848f6112 | [
"MIT"
] | null | null | null | app/__init__.py | sakuyaf/guestbook | fc34b1b14c0ef53632fe8fbd041b4363848f6112 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
login = LoginManager(app)
login.login_view = 'login'
from... | 25.125 | 39 | 0.803483 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
login = LoginManager(app)
login.login_view = 'login'
from... | true | true |
1c0e76fb3b8f9837c61884042959020c79b996e9 | 387 | py | Python | instagram/posts/migrations/0002_auto_20200108_2007.py | djangojeng-e/revision | b01ccb459c4bb29211ba96a825e5b37a66e81a9f | [
"MIT"
] | null | null | null | instagram/posts/migrations/0002_auto_20200108_2007.py | djangojeng-e/revision | b01ccb459c4bb29211ba96a825e5b37a66e81a9f | [
"MIT"
] | null | null | null | instagram/posts/migrations/0002_auto_20200108_2007.py | djangojeng-e/revision | b01ccb459c4bb29211ba96a825e5b37a66e81a9f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2020-01-08 11:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='postimage',
name='image',
f... | 20.368421 | 62 | 0.591731 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='postimage',
name='image',
field=models.ImageField(upload_to='posts/images')... | true | true |
1c0e7817172c1fc1036f644df1f85a5ccf9edcac | 1,763 | py | Python | bluebottle/cms/migrations/0016_auto_20161228_1420.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/cms/migrations/0016_auto_20161228_1420.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/cms/migrations/0016_auto_20161228_1420.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-28 13:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('cms', '0015_merge_20161219_0946'),
]
operations = [... | 41.97619 | 394 | 0.629609 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('cms', '0015_merge_20161219_0946'),
]
operations = [
migrations.AddField(
model_name='shareresultscontent... | true | true |
1c0e79ce69caf2531e0f57cc0ef0d292fdfbb9f6 | 2,720 | py | Python | aiohttp_login/asyncpg_storage.py | kirlf/aiohttp-login | 7e52ea4ef694b6bfe2ad19b0a3d1077b04cfe221 | [
"0BSD"
] | null | null | null | aiohttp_login/asyncpg_storage.py | kirlf/aiohttp-login | 7e52ea4ef694b6bfe2ad19b0a3d1077b04cfe221 | [
"0BSD"
] | null | null | null | aiohttp_login/asyncpg_storage.py | kirlf/aiohttp-login | 7e52ea4ef694b6bfe2ad19b0a3d1077b04cfe221 | [
"0BSD"
] | null | null | null | from logging import getLogger
from datetime import datetime
from .utils import get_random_string
from . import sql
log = getLogger(__name__)
class AsyncpgStorage:
def __init__(self, pool, *,
user_table_name='users',
confirmation_table_name='confirmations'):
self.pool =... | 33.580247 | 93 | 0.586029 | from logging import getLogger
from datetime import datetime
from .utils import get_random_string
from . import sql
log = getLogger(__name__)
class AsyncpgStorage:
def __init__(self, pool, *,
user_table_name='users',
confirmation_table_name='confirmations'):
self.pool =... | true | true |
1c0e7a06b2b47fe90222d832cb29298616ca06dd | 3,956 | py | Python | complete/main.py | ajmaurais/peptide_analyzer | 62f37d88fefd0a8cfb57a8c157cfc85692956360 | [
"MIT"
] | null | null | null | complete/main.py | ajmaurais/peptide_analyzer | 62f37d88fefd0a8cfb57a8c157cfc85692956360 | [
"MIT"
] | null | null | null | complete/main.py | ajmaurais/peptide_analyzer | 62f37d88fefd0a8cfb57a8c157cfc85692956360 | [
"MIT"
] | null | null | null |
import os
import argparse
import pandas as pd
import uniprot
import molecular_formula
# def main():
# '''
# Main method.
#
# This is the function which will be executed first when you call the program form the command line.
# '''
#
# # Load and parse command line arguments
# parser = argpars... | 39.168317 | 104 | 0.709302 |
import os
import argparse
import pandas as pd
import uniprot
import molecular_formula
# Main method.
#
# This is the function which will be executed first when you call the program form the command line.
# '''
BASE_DATA_PATH = os.path.abspath(os.path.dirname(__file__) + '/../data')
INPUT_FILE_PATH = BA... | true | true |
1c0e7c109d98a8a522e0b8d1ddea2c4f7ed678f6 | 25 | py | Python | tests/io/complex/__init__.py | spowlas/sarpy | c4a404203607d404b93a556459aa5311d7148e95 | [
"MIT"
] | null | null | null | tests/io/complex/__init__.py | spowlas/sarpy | c4a404203607d404b93a556459aa5311d7148e95 | [
"MIT"
] | 1 | 2019-11-14T20:55:57.000Z | 2019-12-27T18:11:29.000Z | tests/io/complex/__init__.py | spowlas/sarpy | c4a404203607d404b93a556459aa5311d7148e95 | [
"MIT"
] | 2 | 2020-02-12T20:11:00.000Z | 2020-03-26T16:55:03.000Z |
from .. import unittest
| 8.333333 | 23 | 0.72 |
from .. import unittest
| true | true |
1c0e7c745ea061ac962babc3d0d0c13e8aaea336 | 23,704 | py | Python | otp/level/DistributedLevel.py | journeyfan/toontown-journey | 7a4db507e5c1c38a014fc65588086d9655aaa5b4 | [
"MIT"
] | 1 | 2020-09-27T22:12:47.000Z | 2020-09-27T22:12:47.000Z | otp/level/DistributedLevel.py | journeyfan/toontown-journey | 7a4db507e5c1c38a014fc65588086d9655aaa5b4 | [
"MIT"
] | null | null | null | otp/level/DistributedLevel.py | journeyfan/toontown-journey | 7a4db507e5c1c38a014fc65588086d9655aaa5b4 | [
"MIT"
] | 2 | 2020-09-26T20:37:18.000Z | 2020-11-15T20:55:33.000Z | from direct.distributed.ClockDelta import *
from pandac.PandaModules import *
from direct.showbase.PythonUtil import Functor, sameElements, list2dict, uniqueElements
from direct.interval.IntervalGlobal import *
from toontown.distributed.ToontownMsgTypes import *
from toontown.toonbase import ToontownGlobals
from otp.ot... | 40.176271 | 311 | 0.625548 | from direct.distributed.ClockDelta import *
from pandac.PandaModules import *
from direct.showbase.PythonUtil import Functor, sameElements, list2dict, uniqueElements
from direct.interval.IntervalGlobal import *
from toontown.distributed.ToontownMsgTypes import *
from toontown.toonbase import ToontownGlobals
from otp.ot... | true | true |
1c0e7e0be5385dd55ae803c002d4bfb55c369fbe | 818 | py | Python | communeapp/migrations/0001_initial.py | Kiptim54/Commune | c6820bed8a457dbc95ab53e52d2a7fb54bcd0455 | [
"MIT"
] | null | null | null | communeapp/migrations/0001_initial.py | Kiptim54/Commune | c6820bed8a457dbc95ab53e52d2a7fb54bcd0455 | [
"MIT"
] | null | null | null | communeapp/migrations/0001_initial.py | Kiptim54/Commune | c6820bed8a457dbc95ab53e52d2a7fb54bcd0455 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-24 10:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | 29.214286 | 121 | 0.652812 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | true | true |
1c0e7e3cef59028cb26f24b721d30b62e254b588 | 15,821 | py | Python | nvidia-examples/gluon/model_zoo_CV/detection/CenterNet/train_center_net.py | sneaxiy/NVIDIA-MxNet | ce30b18212fbf23f68c006a02cc034e417bb5518 | [
"Apache-2.0"
] | null | null | null | nvidia-examples/gluon/model_zoo_CV/detection/CenterNet/train_center_net.py | sneaxiy/NVIDIA-MxNet | ce30b18212fbf23f68c006a02cc034e417bb5518 | [
"Apache-2.0"
] | null | null | null | nvidia-examples/gluon/model_zoo_CV/detection/CenterNet/train_center_net.py | sneaxiy/NVIDIA-MxNet | ce30b18212fbf23f68c006a02cc034e417bb5518 | [
"Apache-2.0"
] | 3 | 2021-07-20T07:40:15.000Z | 2021-08-03T08:39:17.000Z | """Train CenterNet"""
import argparse
import os
import logging
import warnings
import time
import mxnet as mx
from mxnet import gluon
from mxnet import autograd
from mxnet.contrib import amp
import gluoncv as gcv
gcv.utils.check_version('0.6.0')
from gluoncv import data as gdata
from gluoncv import utils as gutils
from... | 49.751572 | 134 | 0.633715 | import argparse
import os
import logging
import warnings
import time
import mxnet as mx
from mxnet import gluon
from mxnet import autograd
from mxnet.contrib import amp
import gluoncv as gcv
gcv.utils.check_version('0.6.0')
from gluoncv import data as gdata
from gluoncv import utils as gutils
from gluoncv.model_zoo imp... | true | true |
1c0e80b44ea92df16d39e658ed0618449e2301ae | 5,950 | py | Python | h2o-py/tests/testdir_sklearn/pyunit_sklearn_classification_all_estimators.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 1 | 2022-03-15T06:08:14.000Z | 2022-03-15T06:08:14.000Z | h2o-py/tests/testdir_sklearn/pyunit_sklearn_classification_all_estimators.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 58 | 2021-10-01T12:43:37.000Z | 2021-12-08T22:58:43.000Z | h2o-py/tests/testdir_sklearn/pyunit_sklearn_classification_all_estimators.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from collections import defaultdict
from functools import partial
import gc, inspect, os, sys
import numpy as np
from sklearn.datasets import make_classification
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
import h2o
from h2o.sk... | 38.888889 | 126 | 0.708739 | from __future__ import print_function
from collections import defaultdict
from functools import partial
import gc, inspect, os, sys
import numpy as np
from sklearn.datasets import make_classification
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
import h2o
from h2o.sk... | true | true |
1c0e80d781048bd2577d7ec900e4e641e4c8831b | 1,712 | py | Python | data/test/test_userfiles.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | 1 | 2020-10-16T19:30:41.000Z | 2020-10-16T19:30:41.000Z | data/test/test_userfiles.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | 15 | 2020-06-18T15:32:06.000Z | 2022-03-03T23:06:24.000Z | data/test/test_userfiles.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | import pytest
from mock import Mock
from io import BytesIO
from data.userfiles import DelegateUserfiles, Userfiles
from test.fixtures import *
@pytest.mark.parametrize(
"prefix,path,expected",
[
("test", "foo", "test/foo"),
("test", "bar", "test/bar"),
("test", "/bar", "test/bar"),
... | 29.517241 | 97 | 0.63785 | import pytest
from mock import Mock
from io import BytesIO
from data.userfiles import DelegateUserfiles, Userfiles
from test.fixtures import *
@pytest.mark.parametrize(
"prefix,path,expected",
[
("test", "foo", "test/foo"),
("test", "bar", "test/bar"),
("test", "/bar", "test/bar"),
... | true | true |
1c0e814aad199af790b0be560557df9a9ee6191e | 3,959 | py | Python | categories/migrations/0001_initial.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | null | null | null | categories/migrations/0001_initial.py | Dogechi/Me2U | 0852600983dc1058ee347f4065ee801e16c1249e | [
"MIT"
] | 9 | 2020-06-06T01:16:25.000Z | 2021-06-04T23:20:37.000Z | categories/migrations/0001_initial.py | Me2U-Afrika/Me2U | aee054afedff1e6c87f87494eaddf044e217aa95 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-12-15 10:20
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import stdimage.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
na... | 60.907692 | 423 | 0.608487 |
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import stdimage.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | true | true |
1c0e817fc0ee1fd35c76cb6fa2a1819c108380ba | 35 | py | Python | stack/__init__.py | carlaTV/annotation_postprocessor | 86d59993cd02720fa07eba8c52356a0fa5855959 | [
"MIT"
] | null | null | null | stack/__init__.py | carlaTV/annotation_postprocessor | 86d59993cd02720fa07eba8c52356a0fa5855959 | [
"MIT"
] | null | null | null | stack/__init__.py | carlaTV/annotation_postprocessor | 86d59993cd02720fa07eba8c52356a0fa5855959 | [
"MIT"
] | null | null | null | from .stack import Stack
del stack
| 11.666667 | 24 | 0.8 | from .stack import Stack
del stack
| true | true |
1c0e81cbbc7e74e83fd07f23642c4b544b269249 | 2,692 | py | Python | xpython/stdlib/builtins_31.py | rocky/xpython | ce4ed4329cee2af0aab94254276f5a5687dd25f9 | [
"MIT"
] | 1 | 2020-04-28T13:18:13.000Z | 2020-04-28T13:18:13.000Z | xpython/stdlib/builtins_31.py | rocky/xbyterun | fde8f8a31ffd3e3c4545d76b4b1edf4b7e0191d9 | [
"MIT"
] | null | null | null | xpython/stdlib/builtins_31.py | rocky/xbyterun | fde8f8a31ffd3e3c4545d76b4b1edf4b7e0191d9 | [
"MIT"
] | null | null | null | """
A list of builtins for 3.1
"""
builtins = set(
[
"ArithmeticError",
"AssertionError",
"AttributeError",
"BaseException",
"BufferError",
"BytesWarning",
"DeprecationWarning",
"EOFError",
"Ellipsis",
"EnvironmentError",
"Excep... | 19.649635 | 36 | 0.412333 | builtins = set(
[
"ArithmeticError",
"AssertionError",
"AttributeError",
"BaseException",
"BufferError",
"BytesWarning",
"DeprecationWarning",
"EOFError",
"Ellipsis",
"EnvironmentError",
"Exception",
"False",
"Fl... | true | true |
1c0e81ece5712cd39087c19c81a6ca85f2ffa8a9 | 2,593 | py | Python | ve/fwrisc_tracer_bfm/src/fwrisc_tracer_bfm/fwrisc_tracer_bfm.py | Kamran-10xe/fwrisc | 5c742c60ba620944ba19741c02782fb6b45d514e | [
"Apache-2.0"
] | 10 | 2020-12-23T07:55:03.000Z | 2022-03-01T07:20:39.000Z | ve/fwrisc_tracer_bfm/src/fwrisc_tracer_bfm/fwrisc_tracer_bfm.py | Kamran-10xe/fwrisc | 5c742c60ba620944ba19741c02782fb6b45d514e | [
"Apache-2.0"
] | 1 | 2021-12-04T06:12:19.000Z | 2022-02-18T13:20:55.000Z | ve/fwrisc_tracer_bfm/src/fwrisc_tracer_bfm/fwrisc_tracer_bfm.py | Kamran-10xe/fwrisc | 5c742c60ba620944ba19741c02782fb6b45d514e | [
"Apache-2.0"
] | 8 | 2021-02-08T02:25:24.000Z | 2022-03-01T05:13:44.000Z | '''
Created on Nov 19, 2019
@author: ballance
'''
import cocotb
from cocotb.bfms import bfm_hdl_path
from cocotb.decorators import bfm_vlog, bfm_sv
from cocotb.triggers import Lock, Event
@cocotb.bfm(hdl={
bfm_vlog : bfm_hdl_path(__file__, "hdl/fwrisc_tracer_bfm.v"),
bfm_sv : bfm_hdl_path(__file__, "hdl/fwr... | 28.494505 | 106 | 0.634786 |
import cocotb
from cocotb.bfms import bfm_hdl_path
from cocotb.decorators import bfm_vlog, bfm_sv
from cocotb.triggers import Lock, Event
@cocotb.bfm(hdl={
bfm_vlog : bfm_hdl_path(__file__, "hdl/fwrisc_tracer_bfm.v"),
bfm_sv : bfm_hdl_path(__file__, "hdl/fwrisc_tracer_bfm.v")
})
class FwriscTracerBfm():
... | true | true |
1c0e823d687073f1704f23b05661de855549afa0 | 15,975 | py | Python | app/models/control_lists.py | ArianePinche/pyrrha | db5e20faff6c972360609394bc58f6318797c478 | [
"MIT"
] | null | null | null | app/models/control_lists.py | ArianePinche/pyrrha | db5e20faff6c972360609394bc58f6318797c478 | [
"MIT"
] | null | null | null | app/models/control_lists.py | ArianePinche/pyrrha | db5e20faff6c972360609394bc58f6318797c478 | [
"MIT"
] | null | null | null | # Base Python
import datetime
import csv
import enum
import os.path
import io
import glob
from collections import Counter
# PIP Packages
import unidecode
import yaml
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import backref
from sqlalchemy import literal, case
from werkzeug.except... | 35.898876 | 116 | 0.6082 | import datetime
import csv
import enum
import os.path
import io
import glob
from collections import Counter
import unidecode
import yaml
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.orm import backref
from sqlalchemy import literal, case
from werkzeug.exceptions import BadRequest
from .... | true | true |
1c0e82a171565a3c0e91edea27e709669a6927ed | 537 | py | Python | gooey/gui/components/widgets/password.py | geosaleh/Gooey | c2aa8afc269271d55f011c6bc89828992a30b3f0 | [
"MIT"
] | 1 | 2022-02-21T05:51:21.000Z | 2022-02-21T05:51:21.000Z | gooey/gui/components/widgets/password.py | geosaleh/Gooey | c2aa8afc269271d55f011c6bc89828992a30b3f0 | [
"MIT"
] | 1 | 2021-12-02T07:42:03.000Z | 2021-12-02T07:42:03.000Z | gooey/gui/components/widgets/password.py | geosaleh/Gooey | c2aa8afc269271d55f011c6bc89828992a30b3f0 | [
"MIT"
] | null | null | null | from gooey.gui.components.widgets.core.text_input import PasswordInput
from gooey.gui.components.widgets.textfield import TextField
from gooey.python_bindings import types as t
__ALL__ = ('PasswordField',)
class PasswordField(TextField):
widget_class = PasswordInput # type: ignore
def __init__(self... | 33.5625 | 71 | 0.711359 | from gooey.gui.components.widgets.core.text_input import PasswordInput
from gooey.gui.components.widgets.textfield import TextField
from gooey.python_bindings import types as t
__ALL__ = ('PasswordField',)
class PasswordField(TextField):
widget_class = PasswordInput
def __init__(self, *args, **kwarg... | true | true |
1c0e84eda313e656cfca7402bcc55f239684fd5c | 38,285 | py | Python | rdkit/sping/PDF/pdfgen.py | chcltchunk/rdkit | af0ccf686779a8efd9db7c77f0bb3cab718ea2ba | [
"BSD-3-Clause"
] | null | null | null | rdkit/sping/PDF/pdfgen.py | chcltchunk/rdkit | af0ccf686779a8efd9db7c77f0bb3cab718ea2ba | [
"BSD-3-Clause"
] | 1 | 2021-02-17T07:26:29.000Z | 2021-02-17T07:26:29.000Z | rdkit/sping/PDF/pdfgen.py | chcltchunk/rdkit | af0ccf686779a8efd9db7c77f0bb3cab718ea2ba | [
"BSD-3-Clause"
] | null | null | null | ## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#pdfgen.py
"""
PDFgen is a library to generate PDF files containing text and graphics. It is the
foundation for a complete reporting solution in Python. It is also the
foundation for piddlePDF, the PDF back end for PIDDLE.
Documentation is a little sl... | 36.706616 | 99 | 0.615803 |
import os
import sys
import time
import tempfile
from io import StringIO
from types import *
from math import sin, cos, tan, pi, ceil
from . import pdfutils
from . import pdfdoc
from . import pdfmetrics
from . import pdfgeom
class PDFError(ValueError):
pass
FILL_EVEN_ODD = 0
FILL_NON_ZERO = 1
PATH_OPS = {(0, 0... | true | true |
1c0e8528e37c754884f2cf97f68860246bfd7a03 | 1,740 | py | Python | tests/tconfig.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | 5 | 2018-01-31T04:49:00.000Z | 2020-11-05T10:10:43.000Z | tests/tconfig.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | 1 | 2021-06-01T21:44:48.000Z | 2021-06-01T21:44:48.000Z | tests/tconfig.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | 3 | 2019-03-18T06:50:11.000Z | 2020-09-08T10:12:26.000Z | # --------------------------------------------------------------------------
# Copyright 2014 Digital Sapphire Development Team
#
# 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://... | 34.117647 | 76 | 0.639655 | from __future__ import unicode_literals
class TConfig(object):
bad_attr = 'bad attr'
APP_NAME = 'jms'
COMPANY_NAME = 'JMS LLC'
DATA_DIR = None
PUBLIC_KEYS = ['iBFNlFxQZ17n3SakBmF2fI6dZhrbkdf5GtP9m/wVrTQ',
'zj1LPcRgx5I3GcxUHlLtltMAdo8v0P1rCMMZEqZeB9',
... | true | true |
1c0e857cccebc5e39ee450c94b7d7c5605a317d7 | 816 | py | Python | async_queues.py | infotraining-team/python-asyncio-2021-04-19 | 7cc1bfca5ec2140f6a08be50ac1798f69ba6f3f8 | [
"CC0-1.0"
] | null | null | null | async_queues.py | infotraining-team/python-asyncio-2021-04-19 | 7cc1bfca5ec2140f6a08be50ac1798f69ba6f3f8 | [
"CC0-1.0"
] | null | null | null | async_queues.py | infotraining-team/python-asyncio-2021-04-19 | 7cc1bfca5ec2140f6a08be50ac1798f69ba6f3f8 | [
"CC0-1.0"
] | null | null | null | import asyncio
async def producer(q: asyncio.Queue):
for i in range(10):
await q.put(f"task {i}")
#await asyncio.sleep(1)
async def watcher(q: asyncio.Queue, name: str):
while True:
task = await q.get()
print(f"{name} got {task}")
await asyncio.sleep(1)
q.task_... | 24 | 70 | 0.582108 | import asyncio
async def producer(q: asyncio.Queue):
for i in range(10):
await q.put(f"task {i}")
async def watcher(q: asyncio.Queue, name: str):
while True:
task = await q.get()
print(f"{name} got {task}")
await asyncio.sleep(1)
q.task_done()
async def main()... | true | true |
1c0e870080fcbfb8e8f63d2212050ef0944cb32c | 174 | py | Python | huxley/settings/registration.py | brett-patterson/huxley | 294e3251cff159e08bcb28820720c1de41534ea1 | [
"BSD-3-Clause"
] | null | null | null | huxley/settings/registration.py | brett-patterson/huxley | 294e3251cff159e08bcb28820720c1de41534ea1 | [
"BSD-3-Clause"
] | null | null | null | huxley/settings/registration.py | brett-patterson/huxley | 294e3251cff159e08bcb28820720c1de41534ea1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
REGISTRATION_OPEN = True
| 34.8 | 77 | 0.770115 |
REGISTRATION_OPEN = True
| true | true |
1c0e87ad0cffc4ae3fd5f0745c50ae76eafdc9a4 | 585 | py | Python | web-gui/UserManagement/gui_server.py | Over42M/Fun5Ga | 7712fcae3968a80c3f7957457e5f0492fbd1f812 | [
"Apache-2.0"
] | 7 | 2017-04-26T12:28:22.000Z | 2021-02-09T18:59:50.000Z | web-gui/UserManagement/gui_server.py | Over42M/Fun5Ga | 7712fcae3968a80c3f7957457e5f0492fbd1f812 | [
"Apache-2.0"
] | 1 | 2017-04-26T15:22:51.000Z | 2017-04-28T04:41:51.000Z | web-gui/UserManagement/gui_server.py | Over42M/Fun5Ga | 7712fcae3968a80c3f7957457e5f0492fbd1f812 | [
"Apache-2.0"
] | 8 | 2017-06-01T08:42:16.000Z | 2020-07-23T12:30:19.000Z |
import json
from flask import Flask, jsonify, request, render_template, redirect
from flask.ext.restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
config = json.load(open('./config.json', 'r'))
@app.route('/')
def helloworld():
return render_template('index.html')
@app.route('/list'... | 15.810811 | 68 | 0.670085 |
import json
from flask import Flask, jsonify, request, render_template, redirect
from flask.ext.restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
config = json.load(open('./config.json', 'r'))
@app.route('/')
def helloworld():
return render_template('index.html')
@app.route('/list'... | true | true |
1c0e8832c9a5bd4c9e53045b3ae87fca18f83006 | 166 | py | Python | armyguys/aws/rds/__init__.py | jtpaasch/armyguys | 4f138420ba42d6d9864176a87c709af014034429 | [
"MIT"
] | null | null | null | armyguys/aws/rds/__init__.py | jtpaasch/armyguys | 4f138420ba42d6d9864176a87c709af014034429 | [
"MIT"
] | null | null | null | armyguys/aws/rds/__init__.py | jtpaasch/armyguys | 4f138420ba42d6d9864176a87c709af014034429 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Utilities for working with RDS."""
from . import instance
from . import parameter
from . import parametergroup
from . import subnetgroup
| 18.444444 | 37 | 0.710843 |
from . import instance
from . import parameter
from . import parametergroup
from . import subnetgroup
| true | true |
1c0e88dac4713727ca49ae91390e4ec37328bf88 | 3,687 | py | Python | swim_aim/data_mappers/db_mappers.py | eurocontrol-swim/swim-aim | d1dd3ce9d4abd84a5d16a877a86b6daaed5e6b49 | [
"BSD-3-Clause"
] | null | null | null | swim_aim/data_mappers/db_mappers.py | eurocontrol-swim/swim-aim | d1dd3ce9d4abd84a5d16a877a86b6daaed5e6b49 | [
"BSD-3-Clause"
] | null | null | null | swim_aim/data_mappers/db_mappers.py | eurocontrol-swim/swim-aim | d1dd3ce9d4abd84a5d16a877a86b6daaed5e6b49 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2019 EUROCONTROL
==========================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions an... | 44.421687 | 121 | 0.781123 | from typing import Dict, Union
from swim_aim.xml import MappedValueType
from swim_aim.data_mappers.xml_mappers import AirportHeliportXMLMapper, DesignatedPointXMLMapper, NavaidXMLMapper, \
RouteXMLMapper, RouteSegmentXMLMapper
import swim_aim.db.models as db
from swim_aim.data_mappers.utils import string_to_coordi... | true | true |
1c0e897c66dd60c57f059af385a4bd2f6ecd4d50 | 1,314 | py | Python | src/core_backend/utils/date.py | jhchen3121/wechat_shop | c9d9ad009df1e5bb0eb23ca8d830dd5c15df5328 | [
"Apache-2.0"
] | null | null | null | src/core_backend/utils/date.py | jhchen3121/wechat_shop | c9d9ad009df1e5bb0eb23ca8d830dd5c15df5328 | [
"Apache-2.0"
] | 5 | 2021-01-28T21:18:27.000Z | 2022-03-25T19:10:01.000Z | src/core_backend/utils/date.py | jhchen3121/wechat_shop | c9d9ad009df1e5bb0eb23ca8d830dd5c15df5328 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from datetime import timedelta
from datetime import date, datetime
DATE_FMT = "%Y-%m-%d"
DATE_FMT2 = "%Y%m%d"
def convert2date(in_date):
'''
将in_date转换为datetime.date类型
'''
if ... | 25.764706 | 64 | 0.648402 |
from __future__ import unicode_literals
from __future__ import absolute_import
from datetime import timedelta
from datetime import date, datetime
DATE_FMT = "%Y-%m-%d"
DATE_FMT2 = "%Y%m%d"
def convert2date(in_date):
if isinstance(in_date, str) or isinstance(in_date, unicode):
if len(in_date) == 10:
... | true | true |
1c0e8b9bbe5aa2878671781b2cf22351f799d331 | 2,795 | py | Python | flipsyrup/abstract_memory/run_controller_generator.py | PyHDI/flipSyrup | 6567005bfcd6d33949c860a503f20f013d209efe | [
"Apache-2.0"
] | 5 | 2016-01-14T00:05:57.000Z | 2018-10-17T18:10:14.000Z | flipsyrup/abstract_memory/run_controller_generator.py | PyHDI/flipSyrup | 6567005bfcd6d33949c860a503f20f013d209efe | [
"Apache-2.0"
] | 1 | 2015-06-10T14:59:10.000Z | 2015-07-08T16:53:24.000Z | flipsyrup/abstract_memory/run_controller_generator.py | PyHDI/flipSyrup | 6567005bfcd6d33949c860a503f20f013d209efe | [
"Apache-2.0"
] | 3 | 2017-04-11T04:33:35.000Z | 2021-05-17T08:21:29.000Z | #-------------------------------------------------------------------------------
# run_controller_generator.py
#
# Automatic Generator for Verilog HDL Design of Scratchpad Memory and Cache
#
# Copyright (C) 2013, Shinya Takamaeda-Yamazaki
# License: Apache 2.0
#----------------------------------------------------------... | 37.77027 | 131 | 0.698748 | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
from optparse import OptionParser
from jinja2 import Environment, FileSystemLoader
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from flipsyrup.configuration_reader.reso... | true | true |
1c0e8c61156f25c2764f0ed513b4272ecf32cd63 | 11,793 | py | Python | denonavr/const.py | MarBra/denonavr | 0ba0c91c70bd76e4ac8d4527cf4bed199a4e3627 | [
"MIT"
] | 1 | 2021-11-29T13:00:44.000Z | 2021-11-29T13:00:44.000Z | denonavr/const.py | MarBra/denonavr | 0ba0c91c70bd76e4ac8d4527cf4bed199a4e3627 | [
"MIT"
] | 1 | 2020-10-23T20:42:16.000Z | 2020-10-23T20:42:16.000Z | denonavr/const.py | MarBra/denonavr | 0ba0c91c70bd76e4ac8d4527cf4bed199a4e3627 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module inherits constants for Denon AVR receivers.
:copyright: (c) 2021 by Oliver Goetz.
:license: MIT, see LICENSE for more details.
"""
import re
from collections import namedtuple, OrderedDict
import attr
# Attr constants
DENON_ATTR_SETATTR = [attr.setters... | 41.378947 | 79 | 0.702451 |
import re
from collections import namedtuple, OrderedDict
import attr
DENON_ATTR_SETATTR = [attr.setters.validate, attr.setters.convert]
ReceiverType = namedtuple("ReceiverType", ["type", "port"])
DescriptionType = namedtuple("DescriptionType", ["port", "url"])
ReceiverURLs = namedtuple(
"ReceiverURLs", [
... | true | true |
1c0e8c6e890292ce8eb9de524a1edca54a118b5d | 1,173 | py | Python | udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 4 - Self Organizing Maps (SOM)/som.py | balazssimon/ml-playground | c2eba497bebc53e5a03807bdd8873c55f0ec73e1 | [
"Apache-2.0"
] | null | null | null | udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 4 - Self Organizing Maps (SOM)/som.py | balazssimon/ml-playground | c2eba497bebc53e5a03807bdd8873c55f0ec73e1 | [
"Apache-2.0"
] | null | null | null | udemy/Deep Learning A-Z/Volume 2 - Unsupervised Deep Learning/Part 4 - Self Organizing Maps (SOM)/som.py | balazssimon/ml-playground | c2eba497bebc53e5a03807bdd8873c55f0ec73e1 | [
"Apache-2.0"
] | null | null | null | # Self Organizing Map
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Credit_Card_Applications.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
# Feature Scaling
from sklearn.preprocessing import MinMa... | 26.066667 | 79 | 0.674339 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('Credit_Card_Applications.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
from sklearn.preprocessing import MinMaxScaler
sc = MinMaxScaler(feature_range = (0, 1))
X = sc.fit_transform(X)
from minisom im... | true | true |
1c0e8cd6c5657da5a9d90c9f47c18aa4f1baef61 | 1,556 | py | Python | trainer/lr_reduce_args.py | jihuacao/Putil | b753fc94bea4cbda00f483681c55f0e9f54adef2 | [
"Apache-2.0"
] | 1 | 2018-12-09T06:09:29.000Z | 2018-12-09T06:09:29.000Z | trainer/lr_reduce_args.py | jihuacao/Putil | b753fc94bea4cbda00f483681c55f0e9f54adef2 | [
"Apache-2.0"
] | null | null | null | trainer/lr_reduce_args.py | jihuacao/Putil | b753fc94bea4cbda00f483681c55f0e9f54adef2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import argparse
def generate_args(parser, property_type=''):
parser.add_argument('--{}lr_reduce_init_lr'.format(property_type), type=float, action='store', default=0.1, \
help='the init lr, defautl: 0.1')
parser.add_argument('--{}lr_reduce_lr_factor'.format(property_type), type=float, ... | 67.652174 | 118 | 0.703085 |
import argparse
def generate_args(parser, property_type=''):
parser.add_argument('--{}lr_reduce_init_lr'.format(property_type), type=float, action='store', default=0.1, \
help='the init lr, defautl: 0.1')
parser.add_argument('--{}lr_reduce_lr_factor'.format(property_type), type=float, action='store',... | true | true |
1c0e8e408f45e50f749a20b4c74ca8efc06b5e83 | 1,209 | py | Python | modules/notifiarr.py | pianomanx/Plex-Meta-Manager | 022857435f47e04f0df0e54a8f2ca5778434da71 | [
"MIT"
] | null | null | null | modules/notifiarr.py | pianomanx/Plex-Meta-Manager | 022857435f47e04f0df0e54a8f2ca5778434da71 | [
"MIT"
] | 7 | 2021-10-05T16:21:09.000Z | 2022-03-18T16:22:08.000Z | modules/notifiarr.py | pianomanx/Plex-Meta-Manager | 022857435f47e04f0df0e54a8f2ca5778434da71 | [
"MIT"
] | null | null | null | import logging
from modules.util import Failed
logger = logging.getLogger("Plex Meta Manager")
base_url = "https://notifiarr.com/api/v1/"
dev_url = "https://dev.notifiarr.com/api/v1/"
class Notifiarr:
def __init__(self, config, params):
self.config = config
self.apikey = params["apikey"]
... | 37.78125 | 118 | 0.643507 | import logging
from modules.util import Failed
logger = logging.getLogger("Plex Meta Manager")
base_url = "https://notifiarr.com/api/v1/"
dev_url = "https://dev.notifiarr.com/api/v1/"
class Notifiarr:
def __init__(self, config, params):
self.config = config
self.apikey = params["apikey"]
... | true | true |
1c0e8ea5879957e24dc31ff29549cc51122ec8b5 | 104 | py | Python | SUBDOMAINS-Introduction/Print Function.py | AbdallahHemdan/HackerRank-Python-Solutions | 0e388b4f594a210426791246ca1278a6a872dd96 | [
"MIT"
] | 3 | 2020-01-03T11:39:24.000Z | 2021-03-13T13:35:23.000Z | SUBDOMAINS-Introduction/Print Function.py | AbdallahHemdan/HackerRank-Python-Solutions | 0e388b4f594a210426791246ca1278a6a872dd96 | [
"MIT"
] | null | null | null | SUBDOMAINS-Introduction/Print Function.py | AbdallahHemdan/HackerRank-Python-Solutions | 0e388b4f594a210426791246ca1278a6a872dd96 | [
"MIT"
] | 1 | 2018-10-20T09:36:06.000Z | 2018-10-20T09:36:06.000Z | if __name__ == '__main__':
n = int(input())
for i in range(n):
print(i+1,sep='',end='')
| 20.8 | 32 | 0.5 | if __name__ == '__main__':
n = int(input())
for i in range(n):
print(i+1,sep='',end='')
| true | true |
1c0e8ececfd6ef7d3282b49415f8c9cf30daf424 | 1,090 | py | Python | python/linguagem-de-programacao/funcao-com-retorno-com-parametro/exercicio_1.py | BrenoPremoli/Faculdade | dcf5d106b10453224e37af830a53b2214af1d2ee | [
"MIT"
] | 1 | 2022-03-19T22:50:12.000Z | 2022-03-19T22:50:12.000Z | python/linguagem-de-programacao/funcao-com-retorno-com-parametro/exercicio_1.py | BrenoPremoli/Faculdade | dcf5d106b10453224e37af830a53b2214af1d2ee | [
"MIT"
] | null | null | null | python/linguagem-de-programacao/funcao-com-retorno-com-parametro/exercicio_1.py | BrenoPremoli/Faculdade | dcf5d106b10453224e37af830a53b2214af1d2ee | [
"MIT"
] | null | null | null | # 1. (Função com retorno com parâmetro) Faça um programa contendo uma função/método que receba por parâmetro um número e o multiplique por 2, retorne e apresente o resultado da função.
def multiplicar(numero):
r = numero * 2
return r
def main():
n = int(input('Informe o número: '))
print('O resultado ... | 32.058824 | 184 | 0.544954 |
def multiplicar(numero):
r = numero * 2
return r
def main():
n = int(input('Informe o número: '))
print('O resultado da multiplicação é',multiplicar(n))
x = multiplicar(n)
print('O resultado da multiplicação é...:',x)
if x > 5:
print('É maior que 5')
w = x + 10... | true | true |
1c0e8f00b5f5a732074151a96e816b4926e3cf64 | 41,370 | py | Python | tests/fetch/test_fetch_ubuntu.py | sahid/charm-helpers | 92a6feb5c16e0ee869cb15aea338d7db72b06a53 | [
"Apache-2.0"
] | null | null | null | tests/fetch/test_fetch_ubuntu.py | sahid/charm-helpers | 92a6feb5c16e0ee869cb15aea338d7db72b06a53 | [
"Apache-2.0"
] | null | null | null | tests/fetch/test_fetch_ubuntu.py | sahid/charm-helpers | 92a6feb5c16e0ee869cb15aea338d7db72b06a53 | [
"Apache-2.0"
] | null | null | null | import six
import subprocess
import io
import os
from tests.helpers import patch_open
from testtools import TestCase
from mock import (
patch,
MagicMock,
call,
sentinel,
)
from charmhelpers.fetch import ubuntu as fetch
if six.PY3:
builtin_open = 'builtins.open'
else:
builtin_open = '__builtin_... | 42.085453 | 1,023 | 0.620595 | import six
import subprocess
import io
import os
from tests.helpers import patch_open
from testtools import TestCase
from mock import (
patch,
MagicMock,
call,
sentinel,
)
from charmhelpers.fetch import ubuntu as fetch
if six.PY3:
builtin_open = 'builtins.open'
else:
builtin_open = '__builtin_... | true | true |
1c0e9086c63ee3c19d6090ed5c0b388b0c9e56a8 | 13,738 | py | Python | vb_suite/frame_methods.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2019-05-21T21:07:03.000Z | 2019-05-21T21:07:03.000Z | vb_suite/frame_methods.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | vb_suite/frame_methods.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
#----------------------------------------------------------------------
# lookup
setup = common_setup + """
df = DataFrame(np.random.randn(10000, 8), columns=list('abcdefgh'))
df['foo'] = 'bar'
row_la... | 30.193407 | 89 | 0.549207 | from vbench.api import Benchmark
from datetime import datetime
common_setup = """from pandas_vb_common import *
"""
setup = common_setup + """
df = DataFrame(np.random.randn(10000, 8), columns=list('abcdefgh'))
df['foo'] = 'bar'
row_labels = list(df.index[::10])[:900]
col_labels = list(df.columns) * 100
row_labels_... | true | true |
1c0e928326a688386a04b4de4d1d280937e7ab45 | 46,246 | py | Python | vyper/parser/expr.py | t4n6a1ka/vyper | 8f4bbe6fc28ad8a2f61a9fba5101947e0aafe2f6 | [
"MIT"
] | null | null | null | vyper/parser/expr.py | t4n6a1ka/vyper | 8f4bbe6fc28ad8a2f61a9fba5101947e0aafe2f6 | [
"MIT"
] | null | null | null | vyper/parser/expr.py | t4n6a1ka/vyper | 8f4bbe6fc28ad8a2f61a9fba5101947e0aafe2f6 | [
"MIT"
] | null | null | null | import warnings
from vyper import ast
from vyper.exceptions import (
InvalidLiteralException,
NonPayableViolationException,
ParserException,
StructureException,
TypeMismatchException,
VariableDeclarationException,
)
from vyper.parser import (
external_call,
self_call,
)
from vyper.parse... | 40.961913 | 158 | 0.524932 | import warnings
from vyper import ast
from vyper.exceptions import (
InvalidLiteralException,
NonPayableViolationException,
ParserException,
StructureException,
TypeMismatchException,
VariableDeclarationException,
)
from vyper.parser import (
external_call,
self_call,
)
from vyper.parse... | true | true |
1c0e959beaff996ce38deb06ccdbcbc7793a7fe2 | 1,937 | py | Python | research/cv/ssd_inceptionv2/src/lr_schedule.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ssd_inceptionv2/src/lr_schedule.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ssd_inceptionv2/src/lr_schedule.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 34.589286 | 98 | 0.647909 |
import math
import numpy as np
def get_lr(global_step, lr_init, lr_end, lr_max, warmup_epochs, total_epochs, steps_per_epoch):
lr_each_step = []
total_steps = steps_per_epoch * total_epochs
warmup_steps = steps_per_epoch * warmup_epochs
for i in range(total_steps):
if i < warmup_steps:
... | true | true |
1c0e9635183d78fa3444b7e5e91d0109f5b7303a | 1,238 | py | Python | src/graphql/validation/rules/unique_variable_names.py | KingDarBoja/graphql-core | 22970e94f1016e813848fc0ab5d1e7ab9ad612e4 | [
"MIT"
] | 590 | 2015-10-06T18:22:49.000Z | 2022-03-22T16:32:17.000Z | src/graphql/validation/rules/unique_variable_names.py | KingDarBoja/graphql-core | 22970e94f1016e813848fc0ab5d1e7ab9ad612e4 | [
"MIT"
] | 300 | 2015-10-06T18:58:11.000Z | 2022-03-22T14:01:44.000Z | src/graphql/validation/rules/unique_variable_names.py | KingDarBoja/graphql-core | 22970e94f1016e813848fc0ab5d1e7ab9ad612e4 | [
"MIT"
] | 270 | 2015-10-08T19:47:38.000Z | 2022-03-10T04:17:51.000Z | from typing import Any, Dict
from ...error import GraphQLError
from ...language import NameNode, VariableDefinitionNode
from . import ASTValidationContext, ASTValidationRule
__all__ = ["UniqueVariableNamesRule"]
class UniqueVariableNamesRule(ASTValidationRule):
"""Unique variable names
A GraphQL operation ... | 33.459459 | 80 | 0.673667 | from typing import Any, Dict
from ...error import GraphQLError
from ...language import NameNode, VariableDefinitionNode
from . import ASTValidationContext, ASTValidationRule
__all__ = ["UniqueVariableNamesRule"]
class UniqueVariableNamesRule(ASTValidationRule):
def __init__(self, context: ASTValidationContext)... | true | true |
1c0e97621434858a75f01d98da2fa332d9e9d28b | 19,091 | py | Python | data/import_sirius_scores.py | aalto-ics-kepaco/lcms2struct_exp | 5baa3edd0e58d24f739efd4086031f6fbdba6ad9 | [
"MIT"
] | null | null | null | data/import_sirius_scores.py | aalto-ics-kepaco/lcms2struct_exp | 5baa3edd0e58d24f739efd4086031f6fbdba6ad9 | [
"MIT"
] | null | null | null | data/import_sirius_scores.py | aalto-ics-kepaco/lcms2struct_exp | 5baa3edd0e58d24f739efd4086031f6fbdba6ad9 | [
"MIT"
] | null | null | null | ####
#
# The MIT License (MIT)
#
# Copyright 2021 Eric Bach <eric.bach@aalto.fi>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... | 49.716146 | 123 | 0.510817 | import sqlite3
import argparse
import tarfile
import os
import pandas as pd
import re
import glob
import logging
import traceback
import numpy as np
from massbank2db.db import MassbankDB
LOGGER = logging.getLogger("Import CSI:FingerID Scores")
LOGGER.setLevel(logging.WARNING)
LOGGER.propagate = False
CH = logging.St... | true | true |
1c0e981985aa39a63eab214eda9ee69ddd59aecd | 3,986 | py | Python | xintian/server.py | huangxinping/xintian | ab5814837fec0b1e3e2d5fc70728e122c0f137a4 | [
"MIT"
] | null | null | null | xintian/server.py | huangxinping/xintian | ab5814837fec0b1e3e2d5fc70728e122c0f137a4 | [
"MIT"
] | null | null | null | xintian/server.py | huangxinping/xintian | ab5814837fec0b1e3e2d5fc70728e122c0f137a4 | [
"MIT"
] | null | null | null | import asyncio
import datetime
from sanic import Sanic
from sanic.response import json, text
from sanic.exceptions import RequestTimeout, NotFound
from sanic_openapi import swagger_blueprint
from sanic_useragent import SanicUserAgent
from sanic_sentry import SanicSentry
from sanic_compress import Compress
from sanic_... | 26.573333 | 88 | 0.660813 | import asyncio
import datetime
from sanic import Sanic
from sanic.response import json, text
from sanic.exceptions import RequestTimeout, NotFound
from sanic_openapi import swagger_blueprint
from sanic_useragent import SanicUserAgent
from sanic_sentry import SanicSentry
from sanic_compress import Compress
from sanic_... | true | true |
1c0e985defcebc0fd66a87c7f19c985d17bf4fd0 | 7,807 | py | Python | src/python/pants/backend/docker/target_types.py | asherf/pants | e010b93c4123b4446a631cac5db0b7ea15634686 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/docker/target_types.py | asherf/pants | e010b93c4123b4446a631cac5db0b7ea15634686 | [
"Apache-2.0"
] | 14 | 2021-05-03T13:54:41.000Z | 2022-03-30T10:20:58.000Z | src/python/pants/backend/docker/target_types.py | asherf/pants | e010b93c4123b4446a631cac5db0b7ea15634686 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
import shlex
from abc import ABC, abstractmethod
from textwrap import dedent
from typing import ClassVar, Iterator
from typing_extensions imp... | 34.852679 | 99 | 0.640451 |
from __future__ import annotations
import os
import shlex
from abc import ABC, abstractmethod
from textwrap import dedent
from typing import ClassVar, Iterator
from typing_extensions import final
from pants.backend.docker.registries import ALL_DEFAULT_REGISTRIES
from pants.base.build_environment import get_buildroo... | true | true |
1c0e9865fd44316d629407cf89133e2261cc8455 | 9,958 | py | Python | surprise/similarities.py | lpworld/LatentUnexp | 55cfa214733d6fd31f8113b8ae47f83e03984f0d | [
"MIT"
] | 1 | 2021-08-12T03:10:35.000Z | 2021-08-12T03:10:35.000Z | surprise/similarities.py | lpworld/LatentUnexp | 55cfa214733d6fd31f8113b8ae47f83e03984f0d | [
"MIT"
] | null | null | null | surprise/similarities.py | lpworld/LatentUnexp | 55cfa214733d6fd31f8113b8ae47f83e03984f0d | [
"MIT"
] | null | null | null | """
The :mod:`similarities <surprise.similarities>` module includes tools to
compute similarity metrics between users or items. You may need to refer to the
:ref:`notation_standards` page. See also the
:ref:`similarity_measures_configuration` section of the User Guide.
Available similarity measures:
.. autosummary::
... | 32.756579 | 99 | 0.537558 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from six.moves import range
from six import iteritems
def cosine(n_x, yr, min_support):
min_sprt = min_support
prods = np.zeros((n_x, n_x), np.double)
freq = np.zeros((n_x, n... | true | true |
1c0e99c70744709bfab9132c629b5f2ae24f64a5 | 6,290 | py | Python | bk7084/graphics/shader.py | bk7084/framework | c364174409c63dbee90e36d8b08fde17df482e8c | [
"Apache-2.0"
] | 1 | 2022-03-29T10:25:10.000Z | 2022-03-29T10:25:10.000Z | bk7084/graphics/shader.py | bk7084/framework | c364174409c63dbee90e36d8b08fde17df482e8c | [
"Apache-2.0"
] | 3 | 2021-11-18T23:35:40.000Z | 2021-12-02T20:00:06.000Z | bk7084/graphics/shader.py | bk7084/framework | c364174409c63dbee90e36d8b08fde17df482e8c | [
"Apache-2.0"
] | null | null | null | import enum
import os.path
import re
import sys
from .util import ShaderCodeParser, GpuObject
from .. import gl
from ..assets.resolver import PathResolver
OPENGL_ERROR_REGEX = [
# Nvidia
# 0(7): error C1008: undefined variable "MV"
# 0(2) : error C0118: macros prefixed with '__' are reserved
re.compil... | 31.45 | 111 | 0.588871 | import enum
import os.path
import re
import sys
from .util import ShaderCodeParser, GpuObject
from .. import gl
from ..assets.resolver import PathResolver
OPENGL_ERROR_REGEX = [
re.compile(r'^\s*(\d+)\((?P<line_no>\d+)\)\s*:\s(?P<error_msg>.*)', re.MULTILINE),
re.compile(r'^\s*ERROR:\s(\d+... | true | true |
1c0e9a250e0152c6e58dd1d58faad888d67493b4 | 6,685 | py | Python | exercise/venv/lib/python3.7/site-packages/sqreen/_vendors/pyasn1/codec/native/encoder.py | assuzzanne/my-sqreen | 81ae0eab417a1dbc0ae6b1778ebfdd71591c3c5b | [
"MIT"
] | null | null | null | exercise/venv/lib/python3.7/site-packages/sqreen/_vendors/pyasn1/codec/native/encoder.py | assuzzanne/my-sqreen | 81ae0eab417a1dbc0ae6b1778ebfdd71591c3c5b | [
"MIT"
] | 1 | 2021-06-02T00:27:34.000Z | 2021-06-02T00:27:34.000Z | exercise/venv/lib/python3.7/site-packages/sqreen/_vendors/pyasn1/codec/native/encoder.py | assuzzanne/notifications-dispatcher-api | 81ae0eab417a1dbc0ae6b1778ebfdd71591c3c5b | [
"MIT"
] | null | null | null | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from ... import debug
from ... import error
from ...type import base
from... | 29.065217 | 102 | 0.675692 | try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
from ... import debug
from ... import error
from ...type import base
from ...type import char
from ...type import tag
from ...type import univ
from ...type import useful
__all__ = ['encode']
class AbstractItemEncoder(object):
... | true | true |
1c0e9b2956921b7ee90d0b82cc145e8298661774 | 6,768 | py | Python | test/cut/test_cut_mixing.py | glynpu/lhotse | 1d7807025575fdaa96cb907c451db0fb0fd23cde | [
"Apache-2.0"
] | null | null | null | test/cut/test_cut_mixing.py | glynpu/lhotse | 1d7807025575fdaa96cb907c451db0fb0fd23cde | [
"Apache-2.0"
] | null | null | null | test/cut/test_cut_mixing.py | glynpu/lhotse | 1d7807025575fdaa96cb907c451db0fb0fd23cde | [
"Apache-2.0"
] | null | null | null | from math import isclose
import numpy as np
import pytest
from lhotse.cut import CutSet, MixedCut, MonoCut
from lhotse.supervision import SupervisionSegment
from lhotse.testing.dummies import remove_spaces_from_segment_text
from lhotse.utils import nullcontext as does_not_raise
# Note:
# Definitions for `cut1`, `cu... | 32.538462 | 118 | 0.690751 | from math import isclose
import numpy as np
import pytest
from lhotse.cut import CutSet, MixedCut, MonoCut
from lhotse.supervision import SupervisionSegment
from lhotse.testing.dummies import remove_spaces_from_segment_text
from lhotse.utils import nullcontext as does_not_raise
def test_append_cut_duration_and_su... | true | true |
1c0e9b51807ffb0ca9caa95ae21faa56b2e2e838 | 14,242 | py | Python | bcbio/ngsalign/tophat.py | lbeltrame/bcbio-nextgen | 1135176df8cb6a47ae39f997ffa4eaac17f8b4ff | [
"MIT"
] | 418 | 2015-01-01T18:21:17.000Z | 2018-03-02T07:26:28.000Z | bcbio/ngsalign/tophat.py | lbeltrame/bcbio-nextgen | 1135176df8cb6a47ae39f997ffa4eaac17f8b4ff | [
"MIT"
] | 1,634 | 2015-01-04T11:43:43.000Z | 2018-03-05T18:06:39.000Z | bcbio/ngsalign/tophat.py | lbeltrame/bcbio-nextgen | 1135176df8cb6a47ae39f997ffa4eaac17f8b4ff | [
"MIT"
] | 218 | 2015-01-26T05:58:18.000Z | 2018-03-03T05:50:05.000Z | """Next-gen alignments with TopHat a spliced read mapper for RNA-seq experiments.
http://tophat.cbcb.umd.edu
"""
import os
import shutil
import glob
import subprocess
import numpy
import pysam
from bcbio.pipeline import config_utils
from bcbio.ngsalign import bowtie, bowtie2
from bcbio.utils import safe_makedir, fil... | 38.38814 | 98 | 0.638674 | import os
import shutil
import glob
import subprocess
import numpy
import pysam
from bcbio.pipeline import config_utils
from bcbio.ngsalign import bowtie, bowtie2
from bcbio.utils import safe_makedir, file_exists, get_in, symlink_plus
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance im... | true | true |
1c0e9b94b138acdfa8b92aaa8d4558f8b5346a87 | 8,520 | py | Python | ipython/How_Naive_AB_Testing_Goes_Wrong/abstract_abtest.py | ewulczyn/ewulczyn.github.io | 8e77b3a9a6a484696678f5b937b12f5742c05e99 | [
"MIT"
] | null | null | null | ipython/How_Naive_AB_Testing_Goes_Wrong/abstract_abtest.py | ewulczyn/ewulczyn.github.io | 8e77b3a9a6a484696678f5b937b12f5742c05e99 | [
"MIT"
] | null | null | null | ipython/How_Naive_AB_Testing_Goes_Wrong/abstract_abtest.py | ewulczyn/ewulczyn.github.io | 8e77b3a9a6a484696678f5b937b12f5742c05e99 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from abtest_util import SimStream
from abc import ABCMeta, abstractmethod
class ABTest(object):
"""
This is the base class for dynamically
terminating AB tests. The idea is that you define
a stopping crietion and evaluate it every n... | 34.216867 | 105 | 0.637793 | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from abtest_util import SimStream
from abc import ABCMeta, abstractmethod
class ABTest(object):
__metaclass__ = ABCMeta
def __init__(self, a_stream, b_stream, test_interval, max_run):
self.a_stream = a_stream self... | true | true |
1c0e9c27ffd25e18ebc754554afb33583a09769e | 1,007 | py | Python | turbotutorial/chat/migrations/0001_initial.py | vitaliimelnychuk/django-hotwire-playground | 38ed5f50d643d3e42ef450a3acd15cf9cd2679d4 | [
"MIT"
] | null | null | null | turbotutorial/chat/migrations/0001_initial.py | vitaliimelnychuk/django-hotwire-playground | 38ed5f50d643d3e42ef450a3acd15cf9cd2679d4 | [
"MIT"
] | null | null | null | turbotutorial/chat/migrations/0001_initial.py | vitaliimelnychuk/django-hotwire-playground | 38ed5f50d643d3e42ef450a3acd15cf9cd2679d4 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2021-12-30 17:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Room',
fields=[
... | 31.46875 | 130 | 0.584906 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Room',
fields=[
('id', models.BigAutoField(auto_created=Tr... | true | true |
1c0e9c61bcb22bcfaccae0d6e99779a1ff695081 | 22,276 | py | Python | tests/governance_js.py | fritzalder/CCF | a156bbf51dfa60bbcab28a1c9de0c4a85187751d | [
"Apache-2.0"
] | 1 | 2021-05-10T10:10:24.000Z | 2021-05-10T10:10:24.000Z | tests/governance_js.py | fritzalder/CCF | a156bbf51dfa60bbcab28a1c9de0c4a85187751d | [
"Apache-2.0"
] | null | null | null | tests/governance_js.py | fritzalder/CCF | a156bbf51dfa60bbcab28a1c9de0c4a85187751d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.network
import infra.path
import infra.proc
import infra.net
import infra.e2e_args
import suite.test_requirements as reqs
import os
from loguru import logger as LOG
def action(name, **args):
return {"... | 34.970173 | 118 | 0.608906 | import infra.network
import infra.path
import infra.proc
import infra.net
import infra.e2e_args
import suite.test_requirements as reqs
import os
from loguru import logger as LOG
def action(name, **args):
return {"name": name, "args": args}
def proposal(*actions):
return {"actions": list(actions)}
def merg... | true | true |
1c0e9e2ce13e6501f2e0229792a7eb57795b373e | 5,380 | py | Python | hardware/tests/test_benchmark_mem.py | mail2nsrajesh/hardware | f6492106beca1ba4c2f824e7fc816e917f989aa1 | [
"Apache-2.0"
] | null | null | null | hardware/tests/test_benchmark_mem.py | mail2nsrajesh/hardware | f6492106beca1ba4c2f824e7fc816e917f989aa1 | [
"Apache-2.0"
] | null | null | null | hardware/tests/test_benchmark_mem.py | mail2nsrajesh/hardware | f6492106beca1ba4c2f824e7fc816e917f989aa1 | [
"Apache-2.0"
] | 1 | 2019-10-05T13:19:25.000Z | 2019-10-05T13:19:25.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2015 Red Hat, 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... | 41.705426 | 78 | 0.584387 |
import subprocess
import unittest
import mock
from hardware.benchmark import mem
from hardware.benchmark import utils
SYSBENCH_OUTPUT = """Operations performed: 1957354 (391412.04 ops/sec)
1911.48 MB transferred (382.24 MB/sec)
Test execution summary:
total time: 5.0008s
total n... | true | true |
1c0e9f23854a3a71006d8921c740f3b70b5758cf | 44,606 | py | Python | radiam.py | axfelix/radiam-agent | 7cb972e6ad081277b7c001b53b3f5be5b9d54ebe | [
"MIT"
] | null | null | null | radiam.py | axfelix/radiam-agent | 7cb972e6ad081277b7c001b53b3f5be5b9d54ebe | [
"MIT"
] | 1 | 2020-07-21T19:49:38.000Z | 2020-07-21T19:49:38.000Z | radiam.py | axfelix/radiam-agent | 7cb972e6ad081277b7c001b53b3f5be5b9d54ebe | [
"MIT"
] | 1 | 2020-07-15T19:22:38.000Z | 2020-07-15T19:22:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Usage:
radiam.py [--projectname=<pro>] [--mtime=<mt>] [--minsize=<ms>] [--hostname=<host>] [--username=<user>] [--password=<pass>] [--rootdir=<DIR>] [--quitafter] [--logout] [--loglevel=<loglevel>] ...
Options:
-d --rootdir=<DIR> Directory to start crawling from
... | 43.903543 | 215 | 0.604044 |
from docopt import docopt
from scandir import scandir
import os
import sys
import socket
import persistqueue
from persistqueue import Queue
from configobj import ConfigObj
import logging
import time
from datetime import datetime
import platform
from watchdog.observers import Observer
from watchdog.observers.polling im... | true | true |
1c0e9f538d348778cc635171c602584386e20230 | 520 | py | Python | tea_django/models/mixins/timestamped.py | alefnula/django-tea | 30c3fcb54828fe3d5f832cdd629ca53c78f8f930 | [
"Apache-2.0"
] | 1 | 2020-10-20T00:10:50.000Z | 2020-10-20T00:10:50.000Z | tea_django/models/mixins/timestamped.py | alefnula/tea-django | 30c3fcb54828fe3d5f832cdd629ca53c78f8f930 | [
"Apache-2.0"
] | null | null | null | tea_django/models/mixins/timestamped.py | alefnula/tea-django | 30c3fcb54828fe3d5f832cdd629ca53c78f8f930 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class TimestampedMixin(models.Model):
"""Mixin for models with created_on and updated_on fields.
Fields:
created_on: DateTime field.
updated_on: DateTime field.
"""
created_on = models.DateTimeField(
auto_now_add=True, blank=False, null=False, edi... | 23.636364 | 66 | 0.663462 | from django.db import models
class TimestampedMixin(models.Model):
created_on = models.DateTimeField(
auto_now_add=True, blank=False, null=False, editable=False
)
updated_on = models.DateTimeField(
auto_now=True, blank=False, null=False, editable=False
)
class Meta:
app_l... | true | true |
1c0e9fe433f97c82fae0231d39e42978a493b3bc | 65,822 | py | Python | state_of_sparsity/sparse_transformer/models/sparse_transformer.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | state_of_sparsity/sparse_transformer/models/sparse_transformer.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | state_of_sparsity/sparse_transformer/models/sparse_transformer.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 39.461631 | 91 | 0.68743 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import range
from tensor2tensor.layers import common_attention
from tensor2tensor.layers import common_hparams
from tensor2tensor.layers import common_layers
from tensor2tensor.layers import m... | true | true |
1c0ea12e2311a64bc4e5985c6dbb9bd84eb4749f | 11,142 | py | Python | langerhansGUI/view.py | janzmazek/langerhansGUI | aa0f3f1636f96964f2172383aadb734a71bc4885 | [
"MIT"
] | null | null | null | langerhansGUI/view.py | janzmazek/langerhansGUI | aa0f3f1636f96964f2172383aadb734a71bc4885 | [
"MIT"
] | null | null | null | langerhansGUI/view.py | janzmazek/langerhansGUI | aa0f3f1636f96964f2172383aadb734a71bc4885 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import messagebox
from tkinter import filedialog
from tkinter.ttk import Progressbar
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import copy
import webbrowser
# Window parameters
WIDTH = 1000
HEIGHT = 600
WHITE = "white"
TEXT = "white"
# BG = "#2d2f37"
BG = "#3E4... | 39.094737 | 79 | 0.51813 | import tkinter as tk
from tkinter import messagebox
from tkinter import filedialog
from tkinter.ttk import Progressbar
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import copy
import webbrowser
WIDTH = 1000
HEIGHT = 600
WHITE = "white"
TEXT = "white"
BG = "#3E4149"
WELCOME_TEXT = "WELCOME\n \
To ... | true | true |
1c0ea1a5235ed858bd9b0c08d8c1657ec4672b15 | 2,874 | py | Python | tests/performance/run_env.py | mrbermell/ffai | b035ccc1413744211c95bc85a33c084b6d75f92e | [
"Apache-2.0"
] | 2 | 2020-11-08T21:27:21.000Z | 2020-12-23T15:27:34.000Z | tests/performance/run_env.py | ernestvmo/botbowl | 8b70faf615fc70eb40aa8b3519a7d2339872ea15 | [
"Apache-2.0"
] | 12 | 2020-12-29T15:29:08.000Z | 2021-10-04T20:34:59.000Z | tests/performance/run_env.py | ernestvmo/botbowl | 8b70faf615fc70eb40aa8b3519a7d2339872ea15 | [
"Apache-2.0"
] | 1 | 2022-03-18T10:02:28.000Z | 2022-03-18T10:02:28.000Z | #!/usr/bin/env python3
import gym
import numpy as np
import botbowl
from botbowl.core.game import Game
from botbowl.core.model import Agent
import cProfile
import io
import pstats
def profile_and_print_result(function, sortkey="tottime"):
"""
Choose sortkey from: 'ncalls', 'tottime', 'percall', 'cumtime', '... | 30.252632 | 116 | 0.687196 |
import gym
import numpy as np
import botbowl
from botbowl.core.game import Game
from botbowl.core.model import Agent
import cProfile
import io
import pstats
def profile_and_print_result(function, sortkey="tottime"):
pr = cProfile.Profile()
pr.enable()
function()
pr.disable()
s = io.StringIO()
... | true | true |
1c0ea21a13f24de4a1e320d1b1a3a5d7167f6dfe | 4,116 | py | Python | ryu/lib/netconf/constants.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | ryu/lib/netconf/constants.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | ryu/lib/netconf/constants.py | MrCocoaCat/ryu | 9e9571991a73380099b7ba7c6f37e0e587080a6a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# ... | 22.248649 | 70 | 0.701895 |
RPC = 'rpc'
MESSAGE_ID = 'message-id'
TRANSPORT = 'transport'
PROTOCOL = 'protocol'
APPLICATION = 'application'
IN_USE = 'in-use'
INVALID_VALUE = 'invalid-value'
TOO_BIG = 'too-big'
MISSING_ATTRIBUTE = 'missing-attribute'
BAD_ATTRIBUTE = 'bad-attribute'
UNKNOWN_ATTRIBUTE = 'unknown-attribute'
MIS... | true | true |
1c0ea296580fc2556b3bdc4e6534819c363bde71 | 1,009 | py | Python | sudoku.py | Krishnateja001/sudoku | 8da0b19ddb12df9bd84ec7e8d524b088d4a64a39 | [
"MIT"
] | null | null | null | sudoku.py | Krishnateja001/sudoku | 8da0b19ddb12df9bd84ec7e8d524b088d4a64a39 | [
"MIT"
] | null | null | null | sudoku.py | Krishnateja001/sudoku | 8da0b19ddb12df9bd84ec7e8d524b088d4a64a39 | [
"MIT"
] | null | null | null | sudo_map = [[0,0,0,0,0,4,0,9,0],[8,0,2,9,7,0,0,0,0],[9,0,1,2,0,0,3,0,0],
[0,0,0,0,4,9,1,5,7],[0,1,3,0,5,0,9,2,0],[5,7,9,1,2,0,0,0,0],
[0,0,7,0,0,2,6,0,3],
[0,0,0,0,3,8,2,0,5],
[0,2,0,5,0,0,0,0,0]]
#read row
#read column
#read box
def solve(row,column,number):
for i i... | 28.027778 | 72 | 0.435084 | sudo_map = [[0,0,0,0,0,4,0,9,0],[8,0,2,9,7,0,0,0,0],[9,0,1,2,0,0,3,0,0],
[0,0,0,0,4,9,1,5,7],[0,1,3,0,5,0,9,2,0],[5,7,9,1,2,0,0,0,0],
[0,0,7,0,0,2,6,0,3],
[0,0,0,0,3,8,2,0,5],
[0,2,0,5,0,0,0,0,0]]
def solve(row,column,number):
for i in range(0,9):
if number==... | true | true |
1c0ea2ae9cded99863aeca402885bb8e82e6ceac | 1,456 | py | Python | src/features/build_features.py | karun-r/pumpitup | abe696f2682512c76156a5534a6e59d7941f87b1 | [
"MIT"
] | 1 | 2020-02-06T16:32:19.000Z | 2020-02-06T16:32:19.000Z | src/features/build_features.py | oskinm/pumpitup | abe696f2682512c76156a5534a6e59d7941f87b1 | [
"MIT"
] | null | null | null | src/features/build_features.py | oskinm/pumpitup | abe696f2682512c76156a5534a6e59d7941f87b1 | [
"MIT"
] | 2 | 2018-10-30T20:58:16.000Z | 2020-02-06T16:31:36.000Z | import pandas as pd
import math
#import os
#print(os.getcwd())
#from src.data import make_dataset
def get_age_from_year(df, year_col_name):
if not (isinstance(df, pd.core.frame.DataFrame)):
type_rec = type(df)
error_msg = str.format("Type Exception occured. Expecting a dataframe. Received {0}", typ... | 48.533333 | 144 | 0.699863 | import pandas as pd
import math
def get_age_from_year(df, year_col_name):
if not (isinstance(df, pd.core.frame.DataFrame)):
type_rec = type(df)
error_msg = str.format("Type Exception occured. Expecting a dataframe. Received {0}", type_rec)
raise TypeError()
if year_col_name not in df:
... | true | true |
1c0ea40e46e3569a18eedde2eec2a93aa08fc68f | 4,563 | py | Python | rmgpy/tools/generate_reactions.py | pw0908/RMG-Py | 3846fcce701f2a5fd12dbfa429687e9fcd647298 | [
"MIT"
] | 1 | 2022-01-24T05:08:32.000Z | 2022-01-24T05:08:32.000Z | rmgpy/tools/generate_reactions.py | pw0908/RMG-Py | 3846fcce701f2a5fd12dbfa429687e9fcd647298 | [
"MIT"
] | 72 | 2016-06-06T18:18:49.000Z | 2019-11-17T03:21:10.000Z | rmgpy/tools/generate_reactions.py | pw0908/RMG-Py | 3846fcce701f2a5fd12dbfa429687e9fcd647298 | [
"MIT"
] | 3 | 2017-09-22T15:47:37.000Z | 2021-12-30T23:51:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 42.25 | 95 | 0.587771 |
import os.path
import logging
from rmgpy.rmg.main import initializeLog, RMG
from rmgpy.chemkin import ChemkinWriter
from rmgpy.rmg.output import OutputHTMLWriter
from rmg import parse_command_line_arguments
def main():
args = parse_command_line_arguments()
level = logging.INFO
if args.debug:
... | true | true |
1c0ea41a53f9012472d1dd560e6f6a21e8998408 | 797 | py | Python | bootstrapvz/common/fs/virtualharddisk.py | zeridon/bootstrap-vz | fcdc6993f59e521567fb101302b02312e741b88c | [
"Apache-2.0"
] | 207 | 2015-01-26T19:00:24.000Z | 2021-12-16T10:05:58.000Z | bootstrapvz/common/fs/virtualharddisk.py | zeridon/bootstrap-vz | fcdc6993f59e521567fb101302b02312e741b88c | [
"Apache-2.0"
] | 346 | 2015-01-01T08:56:09.000Z | 2019-06-10T08:03:05.000Z | bootstrapvz/common/fs/virtualharddisk.py | zeridon/bootstrap-vz | fcdc6993f59e521567fb101302b02312e741b88c | [
"Apache-2.0"
] | 124 | 2015-01-16T21:22:29.000Z | 2022-02-25T17:36:10.000Z | from .qemuvolume import QEMUVolume
from ..tools import log_check_call
class VirtualHardDisk(QEMUVolume):
extension = 'vhd'
qemu_format = 'vpc'
ovf_uri = 'http://go.microsoft.com/fwlink/?LinkId=137171'
# Azure requires the image size to be a multiple of 1 MiB.
# VHDs are dynamic by default, so we... | 33.208333 | 122 | 0.651192 | from .qemuvolume import QEMUVolume
from ..tools import log_check_call
class VirtualHardDisk(QEMUVolume):
extension = 'vhd'
qemu_format = 'vpc'
ovf_uri = 'http://go.microsoft.com/fwlink/?LinkId=137171'
def _before_create(self, e):
self.image_path = e.image_path
vol_size = ... | true | true |
1c0ea424c8b4216a91a119030e994cda811446b9 | 6,389 | py | Python | backend/app/utils/user_db.py | nokia-wroclaw/innovativeproject-wiki | 2216e5980255a3f3cac400966a986e79b7212e82 | [
"MIT"
] | 9 | 2021-04-08T17:20:10.000Z | 2021-06-04T09:05:49.000Z | backend/app/utils/user_db.py | nokia-wroclaw/innovativeproject-wiki | 2216e5980255a3f3cac400966a986e79b7212e82 | [
"MIT"
] | 90 | 2021-03-19T13:22:30.000Z | 2021-06-17T08:03:56.000Z | backend/app/utils/user_db.py | nokia-wroclaw/innovativeproject-wiki | 2216e5980255a3f3cac400966a986e79b7212e82 | [
"MIT"
] | 1 | 2021-06-16T20:46:40.000Z | 2021-06-16T20:46:40.000Z | """
TODO module docstring
"""
from pathlib import Path
from tinydb import TinyDB, where
from app.utils.message import Message, MsgStatus
from app.dependencies import is_non_empty_string
class UserDB:
"""
Interface for communication with the user database.
Attributes:
database (TinyDB): instance o... | 33.984043 | 100 | 0.601503 | from pathlib import Path
from tinydb import TinyDB, where
from app.utils.message import Message, MsgStatus
from app.dependencies import is_non_empty_string
class UserDB:
def __init__(self):
self.database = TinyDB(Path("./data/users/database.json").absolute())
def does_user_exist(self, username: str)... | true | true |
1c0ea47adf9f1cf92f609fd1daae608767c0e06f | 10,767 | py | Python | tensorpack/callbacks/inference_runner.py | zhengknight/tensorpack | 726747313fb2f189dd195d32087897b16a23be0a | [
"Apache-2.0"
] | 2 | 2018-07-03T12:57:57.000Z | 2018-07-03T13:03:41.000Z | tensorpack/callbacks/inference_runner.py | zhengknight/tensorpack | 726747313fb2f189dd195d32087897b16a23be0a | [
"Apache-2.0"
] | null | null | null | tensorpack/callbacks/inference_runner.py | zhengknight/tensorpack | 726747313fb2f189dd195d32087897b16a23be0a | [
"Apache-2.0"
] | 1 | 2018-08-09T23:28:26.000Z | 2018-08-09T23:28:26.000Z | # -*- coding: utf-8 -*-
# File: inference_runner.py
import sys
import tensorflow as tf
from tensorflow.python.training.monitored_session \
import _HookedSession as HookedSession
import itertools
from contextlib import contextmanager
import tqdm
from six.moves import range
from ..utils import logger
from ..utils... | 37.256055 | 118 | 0.63546 |
import sys
import tensorflow as tf
from tensorflow.python.training.monitored_session \
import _HookedSession as HookedSession
import itertools
from contextlib import contextmanager
import tqdm
from six.moves import range
from ..utils import logger
from ..utils.utils import get_tqdm_kwargs
from ..dataflow.base i... | true | true |
1c0ea4b4615c4b2220418468a30e9aa54eba4b23 | 3,368 | py | Python | isi_sdk_8_1_1/isi_sdk_8_1_1/models/settings_krb5_domain.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/settings_krb5_domain.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/isi_sdk_8_1_1/models/settings_krb5_domain.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class SettingsKrb5Domain(object)... | 28.302521 | 116 | 0.561758 |
import pprint
import re
import six
class SettingsKrb5Domain(object):
swagger_types = {
'realm': 'str'
}
attribute_map = {
'realm': 'realm'
}
def __init__(self, realm=None):
self._realm = None
self.discriminator = None
if realm is not None:
... | true | true |
1c0ea4d673b6124e196e8eaee9f2de0fc14ff4f6 | 437 | py | Python | flpresence/project_checker.py | frostysecurethebag/FLpresence | bb97467937628702640b5225af5065f76e230ae6 | [
"MIT"
] | null | null | null | flpresence/project_checker.py | frostysecurethebag/FLpresence | bb97467937628702640b5225af5065f76e230ae6 | [
"MIT"
] | null | null | null | flpresence/project_checker.py | frostysecurethebag/FLpresence | bb97467937628702640b5225af5065f76e230ae6 | [
"MIT"
] | null | null | null | from running import t_get
import pygetwindow as gw
from pypresence import Presence
import time
client_id = '(clientID)'
RPC = Presence(client_id,pipe=0)
RPC.connect()
tm=time.time()
def close():
RPC.close()
def rpc():
RPC.update(state="Cooking Beats",details=f"Working on {t_get()}",start=... | 14.096774 | 117 | 0.624714 | from running import t_get
import pygetwindow as gw
from pypresence import Presence
import time
client_id = '(clientID)'
RPC = Presence(client_id,pipe=0)
RPC.connect()
tm=time.time()
def close():
RPC.close()
def rpc():
RPC.update(state="Cooking Beats",details=f"Working on {t_get()}",start=... | true | true |
1c0ea50074efaa4d6cef65102876827259b3fcf8 | 6,045 | py | Python | swagger_client/models/search_user_resource_extension_response.py | rcbops/qtest-swagger-client | 28220aa95d878922ca4b35c325706932adabea4e | [
"Apache-2.0"
] | 1 | 2019-09-10T17:55:53.000Z | 2019-09-10T17:55:53.000Z | swagger_client/models/search_user_resource_extension_response.py | rcbops/qtest-swagger-client | 28220aa95d878922ca4b35c325706932adabea4e | [
"Apache-2.0"
] | null | null | null | swagger_client/models/search_user_resource_extension_response.py | rcbops/qtest-swagger-client | 28220aa95d878922ca4b35c325706932adabea4e | [
"Apache-2.0"
] | 2 | 2019-02-12T23:15:10.000Z | 2022-03-11T20:08:28.000Z | # coding: utf-8
"""
qTest Manager API Version 8.6 - 9.1
qTest Manager API Version 8.6 - 9.1
OpenAPI spec version: 8.6 - 9.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class SearchUserRe... | 27.477273 | 87 | 0.549876 |
from pprint import pformat
from six import iteritems
import re
class SearchUserResourceExtensionResponse(object):
def __init__(self, links=None, page=None, page_size=None, total=None, items=None):
self.swagger_types = {
'links': 'list[Link]',
'page': 'int',
... | true | true |
1c0ea59287cefb1bd09120263143a17789e5b002 | 4,333 | py | Python | contrib/seeds/generate-seeds.py | m42cx/JAMAICACOIN | ea1e622f3a17bbcfabc0e22ac10b209972c33ebc | [
"MIT"
] | 1 | 2019-07-30T08:44:49.000Z | 2019-07-30T08:44:49.000Z | contrib/seeds/generate-seeds.py | jamaicacoin/jamaicacoin | 0b4f469e9ea3fa8bb973406a84e3f889a379a865 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | jamaicacoin/jamaicacoin | 0b4f469e9ea3fa8bb973406a84e3f889a379a865 | [
"MIT"
] | 1 | 2021-02-12T12:20:02.000Z | 2021-02-12T12:20:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.172662 | 98 | 0.578814 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:-6], T... | true | true |
1c0ea5efe62c51e8c7e8ce7f54bebc598874caa7 | 3,843 | py | Python | nbconvertjkl/cli.py | nancynobody/tools_ipynb_to_jekyll | a5d158f35aaaf466cd3fc8fe0f7c964e7ae3b6dc | [
"MIT"
] | null | null | null | nbconvertjkl/cli.py | nancynobody/tools_ipynb_to_jekyll | a5d158f35aaaf466cd3fc8fe0f7c964e7ae3b6dc | [
"MIT"
] | 3 | 2020-03-24T18:08:35.000Z | 2021-02-02T22:28:21.000Z | nbconvertjkl/cli.py | nancynobody/tools_ipynb_to_jekyll | a5d158f35aaaf466cd3fc8fe0f7c964e7ae3b6dc | [
"MIT"
] | null | null | null | """ The command line interface for nbconvertjkl """
import click
import sys
import nbformat
from nbconvertjkl.log import configure_logger
from nbconvertjkl.config import get_config
from nbconvertjkl.converter import Converter
#TODO maybe add click.progressbar() for some things
@click.command()
def run():
""" Si... | 42.230769 | 143 | 0.566224 |
import click
import sys
import nbformat
from nbconvertjkl.log import configure_logger
from nbconvertjkl.config import get_config
from nbconvertjkl.converter import Converter
@click.command()
def run():
logger = configure_logger()
config_dict = get_config()
click.echo("Initializing converter and gather... | true | true |
1c0ea63f817e999b7ed22573a9369a875c230582 | 877 | py | Python | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/_base_/schedules/schedule_20e.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/_base_/schedules/schedule_20e.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/_base_/schedules/schedule_20e.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 agree... | 33.730769 | 74 | 0.738883 |
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=None)
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=0.001,
step=[16, 19])
total_epochs = 20
| true | true |
1c0ea803bd89cc08139901212c37afc9c60fd19f | 10,543 | py | Python | EditorsTopics.py | sunflower-zzn/EL_2018 | 41cbd8ca565c42e3f469c42b261683ebf8eae480 | [
"Apache-2.0"
] | 1 | 2020-11-04T07:44:22.000Z | 2020-11-04T07:44:22.000Z | EditorsTopics.py | sunflower-zzn/EL_2018 | 41cbd8ca565c42e3f469c42b261683ebf8eae480 | [
"Apache-2.0"
] | null | null | null | EditorsTopics.py | sunflower-zzn/EL_2018 | 41cbd8ca565c42e3f469c42b261683ebf8eae480 | [
"Apache-2.0"
] | null | null | null | #_*_coding:utf8_*_
import datetime
import re
import sys
import time
import requests
from bs4 import BeautifulSoup
from logger import Logger
from mongodb import Mongo, Mongo_1
from proxy_pool import get_IP
class EditorsTopics:
def __init__(self, fileNum):
self.user_id = None
self.user_url = 'htt... | 43.386831 | 174 | 0.437257 | import datetime
import re
import sys
import time
import requests
from bs4 import BeautifulSoup
from logger import Logger
from mongodb import Mongo, Mongo_1
from proxy_pool import get_IP
class EditorsTopics:
def __init__(self, fileNum):
self.user_id = None
self.user_url = 'https://www.zhihu.com/... | true | true |
1c0ea8be4dccf108b7bf9e198427cf934c208ccf | 1,288 | py | Python | tests/test_mix.py | ACTCollaboration/tilec | 11ed8d027ad6ffac09b3e291a047f33e97673f14 | [
"BSD-3-Clause"
] | 1 | 2021-01-04T14:51:44.000Z | 2021-01-04T14:51:44.000Z | tests/test_mix.py | ACTCollaboration/tilec | 11ed8d027ad6ffac09b3e291a047f33e97673f14 | [
"BSD-3-Clause"
] | 4 | 2019-09-03T22:19:16.000Z | 2020-07-13T12:38:08.000Z | tests/test_mix.py | ACTCollaboration/tilec | 11ed8d027ad6ffac09b3e291a047f33e97673f14 | [
"BSD-3-Clause"
] | 1 | 2020-08-10T14:51:11.000Z | 2020-08-10T14:51:11.000Z | from tilec import fg as tfg
import numpy as np
import glob
import pickle
import os
dirname = os.path.dirname(os.path.abspath(__file__))
version = dirname + "/data/MM_20200307"
def load_pickle(pickle_file):
try:
with open(pickle_file, 'rb') as f:
pickle_data = pickle.load(f)
except Unicode... | 29.953488 | 81 | 0.627329 | from tilec import fg as tfg
import numpy as np
import glob
import pickle
import os
dirname = os.path.dirname(os.path.abspath(__file__))
version = dirname + "/data/MM_20200307"
def load_pickle(pickle_file):
try:
with open(pickle_file, 'rb') as f:
pickle_data = pickle.load(f)
except Unicode... | true | true |
1c0eaae1b5ff8c19e13d3e3cfaea1eaf497e0dbd | 21,785 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/aio/operations/_express_route_circuit_peerings_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 may ... | 50.662791 | 220 | 0.675006 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
1c0eaaf4827f13d1a3ecaf327918c432cc02d433 | 4,352 | py | Python | tensorflow_probability/python/bijectors/weibull_test.py | trainorpj/probability | 944272707d352b12b91c419082fb3ec34b83b494 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/weibull_test.py | trainorpj/probability | 944272707d352b12b91c419082fb3ec34b83b494 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/weibull_test.py | trainorpj/probability | 944272707d352b12b91c419082fb3ec34b83b494 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.296296 | 115 | 0.702436 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import stats
import tensorflow.compat.v2 as tf
from tensorflow_probability.python import bijectors as tfb
from tensorflow_probability.python.bijectors import bijector_test_util
f... | true | true |
1c0eac0bd650e70ed245f5ceff9faa18e8d261f4 | 1,424 | py | Python | noticov/covidstats/india.py | srevinsaju/noticov | ae2e449ffb01509e705b8c30f911bd906567c175 | [
"MIT"
] | null | null | null | noticov/covidstats/india.py | srevinsaju/noticov | ae2e449ffb01509e705b8c30f911bd906567c175 | [
"MIT"
] | null | null | null | noticov/covidstats/india.py | srevinsaju/noticov | ae2e449ffb01509e705b8c30f911bd906567c175 | [
"MIT"
] | 1 | 2022-01-25T17:21:33.000Z | 2022-01-25T17:21:33.000Z | import requests
from noticov.covidstats.base import BaseCovidApi
from noticov.covidstats.countries import Countries
from noticov.covidstats.data import CovidDataList, CovidData
from noticov.covidstats.exceptions import ApiEndpointFailed
class IndiaDistrictsCovidApi(BaseCovidApi):
location = Countries.INDIA
c... | 33.116279 | 68 | 0.636236 | import requests
from noticov.covidstats.base import BaseCovidApi
from noticov.covidstats.countries import Countries
from noticov.covidstats.data import CovidDataList, CovidData
from noticov.covidstats.exceptions import ApiEndpointFailed
class IndiaDistrictsCovidApi(BaseCovidApi):
location = Countries.INDIA
c... | true | true |
1c0eacf7f7fb3b34865a755f9d39132b7b477eb1 | 3,576 | py | Python | rebench/model/benchmark_suite.py | reactorlabs/ReBench | 6cc90af1a7adb0ad62bbebd0dd8c86a6083f3012 | [
"MIT"
] | null | null | null | rebench/model/benchmark_suite.py | reactorlabs/ReBench | 6cc90af1a7adb0ad62bbebd0dd8c86a6083f3012 | [
"MIT"
] | null | null | null | rebench/model/benchmark_suite.py | reactorlabs/ReBench | 6cc90af1a7adb0ad62bbebd0dd8c86a6083f3012 | [
"MIT"
] | 1 | 2019-07-16T21:46:11.000Z | 2019-07-16T21:46:11.000Z | # Copyright (c) 2009-2014 Stefan Marr <http://www.stefan-marr.de/>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, cop... | 34.057143 | 100 | 0.692114 | import os
from .build_cmd import BuildCommand
from .exp_run_details import ExpRunDetails
from .exp_variables import ExpVariables
class BenchmarkSuite(object):
@classmethod
def compile(cls, suite_name, suite, executor, run_details, variables, build_commands):
gauge_adapter = suite.get('gauge_adapter'... | true | true |
1c0ead0a16d84055fe36cd31730b12ce287702d9 | 36,121 | py | Python | dataset.py | sebras/berkeman-ExpertmakerAccelerator | fd28ec85cc7d6786df97f6da0f46a334b078d5da | [
"Apache-2.0"
] | null | null | null | dataset.py | sebras/berkeman-ExpertmakerAccelerator | fd28ec85cc7d6786df97f6da0f46a334b078d5da | [
"Apache-2.0"
] | null | null | null | dataset.py | sebras/berkeman-ExpertmakerAccelerator | fd28ec85cc7d6786df97f6da0f46a334b078d5da | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# ... | 35.798811 | 245 | 0.674372 |
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
from keyword import kwlist
from collections import namedtuple
from itertools import compress
from functools import partial
from inspect import getargspec
from compat import unicode, uni, ifilter, ... | true | true |
1c0ead3efa364a8b393db251e9975162fe0409ab | 3,488 | py | Python | detection.py | nesl/DeepCEP_DAIS | 04dbfefe3c42d74836035a73bfbcd51eebc7992d | [
"MIT"
] | 1 | 2021-04-21T23:32:21.000Z | 2021-04-21T23:32:21.000Z | detection.py | nesl/DeepCEP_DAIS | 04dbfefe3c42d74836035a73bfbcd51eebc7992d | [
"MIT"
] | null | null | null | detection.py | nesl/DeepCEP_DAIS | 04dbfefe3c42d74836035a73bfbcd51eebc7992d | [
"MIT"
] | 1 | 2021-04-09T18:48:21.000Z | 2021-04-09T18:48:21.000Z | import os
import time
import cv2
import numpy as np
from yolo.yolo_model import YOLO
def process_image(img):
"""Resize, reduce and expand image.
# Argument:
img: original image.
# Returns
image: ndarray(64, 64, 3), processed image.
"""
image = cv2.resize(img, (416, 416), interpola... | 27.25 | 76 | 0.567087 | import os
import time
import cv2
import numpy as np
from yolo.yolo_model import YOLO
def process_image(img):
image = cv2.resize(img, (416, 416), interpolation=cv2.INTER_CUBIC)
image = np.array(image, dtype='float32')
image /= 255.
image = np.expand_dims(image, axis=0)
return image
def get_classe... | true | true |
1c0eada09b0dc2ff329fafca7b99b36dc013af96 | 1,383 | py | Python | arucochristmas/aruco.py | thompson318/arucochristmas | 0cf6e2f646ae4d0380aa1330b155418db2449ad1 | [
"CC0-1.0"
] | 1 | 2022-01-09T13:01:40.000Z | 2022-01-09T13:01:40.000Z | arucochristmas/aruco.py | thompson318/arucochristmas | 0cf6e2f646ae4d0380aa1330b155418db2449ad1 | [
"CC0-1.0"
] | null | null | null | arucochristmas/aruco.py | thompson318/arucochristmas | 0cf6e2f646ae4d0380aa1330b155418db2449ad1 | [
"CC0-1.0"
] | null | null | null | """ Module to provide the aruco tracking logic """
#pylint:disable=import-error
import numpy as np
from picamera import PiCamera
from picamera.array import PiRGBArray
from sksurgeryarucotracker.arucotracker import ArUcoTracker
def init_camera_and_tracker():
"""
Initialises an sksurgeryarucotracker object and
... | 27.66 | 63 | 0.679682 | import numpy as np
from picamera import PiCamera
from picamera.array import PiRGBArray
from sksurgeryarucotracker.arucotracker import ArUcoTracker
def init_camera_and_tracker():
config = {
"video source" : 'none',
"debug" : False,
"aruco dictionary" : "DICT_4X4_50"
}
artra... | true | true |
1c0eaeaa39c48d0fea17f8da0b7c3e97fd6353e9 | 2,054 | py | Python | transformer/main.py | alfa-th/lang-modeler-pytorch | a13e94841df9fc3996b33a93d0a58a99c0596359 | [
"Apache-2.0"
] | null | null | null | transformer/main.py | alfa-th/lang-modeler-pytorch | a13e94841df9fc3996b33a93d0a58a99c0596359 | [
"Apache-2.0"
] | null | null | null | transformer/main.py | alfa-th/lang-modeler-pytorch | a13e94841df9fc3996b33a93d0a58a99c0596359 | [
"Apache-2.0"
] | null | null | null | import time
import math
import copy
from torchtext.datasets import WikiText2
import torch.nn as nn
import torch
from functions import evaluate, train
from dataset import get_vocab, get_processed_data, get_tokenizer
from classes.transformer_model import TransformerModel
tokenizer = get_tokenizer("basic_english")
voca... | 28.929577 | 82 | 0.708374 | import time
import math
import copy
from torchtext.datasets import WikiText2
import torch.nn as nn
import torch
from functions import evaluate, train
from dataset import get_vocab, get_processed_data, get_tokenizer
from classes.transformer_model import TransformerModel
tokenizer = get_tokenizer("basic_english")
voca... | true | true |
1c0eaeb9c42f31db1bbcb7f74567f611c347a7ad | 3,049 | py | Python | AqSolDB_example.py | mcsorkun/Genetic-Selection-Cheminformatics | 6f85cd26ffc0aa00b8c34c6d482a2a5f4de149ae | [
"MIT"
] | 2 | 2020-11-18T06:26:58.000Z | 2021-08-30T04:27:48.000Z | AqSolDB_example.py | mcsorkun/Genetic-Selection-Cheminformatics | 6f85cd26ffc0aa00b8c34c6d482a2a5f4de149ae | [
"MIT"
] | null | null | null | AqSolDB_example.py | mcsorkun/Genetic-Selection-Cheminformatics | 6f85cd26ffc0aa00b8c34c6d482a2a5f4de149ae | [
"MIT"
] | 1 | 2021-08-14T05:48:11.000Z | 2021-08-14T05:48:11.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue May 26 18:35:38 2020
@author: Murat Cihan Sorkun
Feature Selection by Genetic Algorithm: An example on AqSolDB dataset (Aqueous Solubility)
"""
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPRegressor
import genetic
f... | 33.141304 | 156 | 0.716956 |
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPRegressor
import genetic
from rdkit import Chem
import pandas as pd
import mordred
from mordred import Calculator, descriptors
def get_mordred_descriptors(smiles_list):
calc = mordred.Calculator()
... | true | true |
1c0eb11433721daebf631e49b01df2001cd8b20d | 8,235 | py | Python | code/exp_bci_task.py | neurotechdk/fnirs-bci | fa7d757dad2060b8acc6e64a51968707b45aa120 | [
"MIT"
] | 5 | 2021-08-25T11:19:50.000Z | 2022-01-29T16:00:34.000Z | code/exp_bci_task.py | neurotechdk/fnirs-bci | fa7d757dad2060b8acc6e64a51968707b45aa120 | [
"MIT"
] | null | null | null | code/exp_bci_task.py | neurotechdk/fnirs-bci | fa7d757dad2060b8acc6e64a51968707b45aa120 | [
"MIT"
] | 2 | 2022-01-07T14:00:59.000Z | 2022-01-29T16:00:38.000Z | from sklearn.model_selection import KFold
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from helper_functions import *
from helper_functions import preprocess, visualize_loss, show_plot
import warnings
from icecream import ic
ic("Importing packages...")
with warnings.catch_wa... | 38.661972 | 233 | 0.587978 | from sklearn.model_selection import KFold
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from helper_functions import *
from helper_functions import preprocess, visualize_loss, show_plot
import warnings
from icecream import ic
ic("Importing packages...")
with warnings.catch_wa... | true | true |
1c0eb217acaf9e4a826c6575ed682531088fdd74 | 2,825 | py | Python | minterguard/txgenerator.py | dmitry-ee/minter-guard | 84696c687124241a705d327a40068a55b0423f35 | [
"MIT"
] | null | null | null | minterguard/txgenerator.py | dmitry-ee/minter-guard | 84696c687124241a705d327a40068a55b0423f35 | [
"MIT"
] | null | null | null | minterguard/txgenerator.py | dmitry-ee/minter-guard | 84696c687124241a705d327a40068a55b0423f35 | [
"MIT"
] | null | null | null | """
This script generates SetCandidateOn and SetCandidateOff transactions for node.
SetCandidateOff transaction is provided for guard.py to set candidate off,
if it starts to miss blocks. SetCandidateOn transaction is provided personally
for you to set candidate on, when everything is ok.
Script accepts 2 required arg... | 31.388889 | 79 | 0.604956 |
import sys
import getpass
import configparser
from mintersdk.minterapi import MinterAPI
from mintersdk.sdk.transactions import (MinterSetCandidateOnTx,
MinterSetCandidateOffTx)
from mintersdk.sdk.wallet import MinterWallet
if __name__ == '__main__':
if len(sys.argv) !=... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.