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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7459e0109e6d70c5524d3795e26e3e3135442f0 | 3,414 | py | Python | tests/python/pants_test/reporting/test_linkify.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2020-06-13T22:01:39.000Z | 2020-06-13T22:01:39.000Z | tests/python/pants_test/reporting/test_linkify.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/reporting/test_linkify.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import shutil
import tempfile
import unittest
from pants.reporting.linkify import linkify
def ensure_dir_exists(path):
os.makedirs(path)
def ensure_file_exists(path):
... | 34.484848 | 81 | 0.676919 |
import os
import shutil
import tempfile
import unittest
from pants.reporting.linkify import linkify
def ensure_dir_exists(path):
os.makedirs(path)
def ensure_file_exists(path):
ensure_dir_exists(os.path.dirname(path))
open(path, "a").close()
class LinkifyTest(unittest.TestCase):
def setUp(self... | true | true |
f7459e23ecfa9445703e370e3303045a6b9e434b | 559 | py | Python | tests/unit/endpoints/test_scoring.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | 1 | 2021-07-27T12:45:48.000Z | 2021-07-27T12:45:48.000Z | tests/unit/endpoints/test_scoring.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | null | null | null | tests/unit/endpoints/test_scoring.py | finalelement/MONAILabel | 3f63ffd4f49161076e77b7c74c733f6ce5cce78c | [
"Apache-2.0"
] | 1 | 2021-07-27T12:45:38.000Z | 2021-07-27T12:45:38.000Z | import unittest
from .context import BasicEndpointTestSuite
class EndPointScoring(BasicEndpointTestSuite):
def test_dice(self):
response = self.client.post("/scoring/dice?run_sync=true")
assert response.status_code == 200
def test_sum(self):
response = self.client.post("/scoring/sum?... | 23.291667 | 66 | 0.676208 | import unittest
from .context import BasicEndpointTestSuite
class EndPointScoring(BasicEndpointTestSuite):
def test_dice(self):
response = self.client.post("/scoring/dice?run_sync=true")
assert response.status_code == 200
def test_sum(self):
response = self.client.post("/scoring/sum?... | true | true |
f7459f09d28d53655619039fbd85e042e3508d89 | 1,425 | py | Python | lib/nummath/deriv.py | TomLXXVI/pipe-network-sim | c2307aba3138bc87ebb24f48e5299149db893ea9 | [
"MIT"
] | 4 | 2020-05-26T01:11:08.000Z | 2021-09-15T20:24:31.000Z | source_code/nummath/deriv.py | robertspark/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | null | null | null | source_code/nummath/deriv.py | robertspark/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | 1 | 2022-01-19T20:26:11.000Z | 2022-01-19T20:26:11.000Z | import numpy as np
class Deriv:
"""
Calculate the derivative with given order of the function f(t) at point t.
"""
def __init__(self, f, dt, o=1):
"""
Initialize the differentiation solver.
Params:
- f the name of the function object ('def f(t):...')
... | 34.756098 | 82 | 0.485614 | import numpy as np
class Deriv:
def __init__(self, f, dt, o=1):
self.f = f
self.dt = dt
self.o = o
self.co = np.array([
[-3.0, 4.0, -1.0, 0.0, 0.0, 0.0],
[2.0, -5.0, 4.0, -1.0, 0.0, 0.0],
[-5.0, 18.0, -24.0, 14.0, -3.0, 0.0],
... | true | true |
f7459f1af25e817438b4fba683395a1e8cb315aa | 625 | py | Python | users/auth/token_cache.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | users/auth/token_cache.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | users/auth/token_cache.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | from django.core.cache import cache
def set_cache(user_no, token):
cache.set('token:userno:' + user_no, token, timeout=None)
cache.set('token:value:'+ token, user_no, timeout=None)
def get_token_from_cache(user_no):
try:
token = cache.get('token:userno:' + user_no)
except:
tok... | 26.041667 | 65 | 0.656 | from django.core.cache import cache
def set_cache(user_no, token):
cache.set('token:userno:' + user_no, token, timeout=None)
cache.set('token:value:'+ token, user_no, timeout=None)
def get_token_from_cache(user_no):
try:
token = cache.get('token:userno:' + user_no)
except:
tok... | true | true |
f745a037f608eeb5834f1ac769fac3bd69686f31 | 6,530 | py | Python | pybfbc2stats/packet.py | cetteup/pybfbc2stats | 584f1bf1bb066b8930776a6dac7d40f4e7676848 | [
"MIT"
] | 1 | 2022-02-10T08:42:44.000Z | 2022-02-10T08:42:44.000Z | pybfbc2stats/packet.py | cetteup/pybfbc2stats | 584f1bf1bb066b8930776a6dac7d40f4e7676848 | [
"MIT"
] | null | null | null | pybfbc2stats/packet.py | cetteup/pybfbc2stats | 584f1bf1bb066b8930776a6dac7d40f4e7676848 | [
"MIT"
] | null | null | null | from typing import List, Optional
from .constants import HEADER_LENGTH, VALID_HEADER_TYPES_FESL, VALID_HEADER_TYPES_THEATER, \
VALID_HEADER_ERROR_INDICATORS, HEADER_BYTE_ORDER
from .exceptions import Error
class Packet:
header: bytes
body: bytes
def __init__(self, header: bytes = b'', body: bytes = ... | 33.834197 | 118 | 0.613629 | from typing import List, Optional
from .constants import HEADER_LENGTH, VALID_HEADER_TYPES_FESL, VALID_HEADER_TYPES_THEATER, \
VALID_HEADER_ERROR_INDICATORS, HEADER_BYTE_ORDER
from .exceptions import Error
class Packet:
header: bytes
body: bytes
def __init__(self, header: bytes = b'', body: bytes = ... | true | true |
f745a11455a257cf26aaefd12f24da3c23d3f64c | 10,686 | py | Python | flowkit/tests/flowjo_wsp_tests.py | whitews/FlowK | d4e43a0488606ce5479b5110486dc3db128f6a87 | [
"BSD-3-Clause"
] | 73 | 2019-02-18T01:03:06.000Z | 2022-03-18T14:03:01.000Z | flowkit/tests/flowjo_wsp_tests.py | whitews/FlowK | d4e43a0488606ce5479b5110486dc3db128f6a87 | [
"BSD-3-Clause"
] | 90 | 2019-01-28T22:04:04.000Z | 2022-03-31T16:40:14.000Z | flowkit/tests/flowjo_wsp_tests.py | whitews/FlowK | d4e43a0488606ce5479b5110486dc3db128f6a87 | [
"BSD-3-Clause"
] | 8 | 2019-08-19T16:58:48.000Z | 2022-01-11T08:55:23.000Z | """
Tests for FlowJo 10 workspace files
"""
import copy
import unittest
import os
from io import BytesIO
import numpy as np
from flowkit import Session, gates, transforms
from .session_tests import test_samples_8c_full_set
class FlowJoWSPTestCase(unittest.TestCase):
def test_load_wsp_single_poly(self):
ws... | 38.717391 | 101 | 0.67565 | import copy
import unittest
import os
from io import BytesIO
import numpy as np
from flowkit import Session, gates, transforms
from .session_tests import test_samples_8c_full_set
class FlowJoWSPTestCase(unittest.TestCase):
def test_load_wsp_single_poly(self):
wsp_path = "examples/data/simple_line_example/... | true | true |
f745a135aedfdc0bdb3d5110cc6e6abe0ed264b9 | 610 | py | Python | pbr/__init__.py | citrix-openstack-build/pbr | 9f04dba0ecc07a33dc4b256bec4f860c30b2b500 | [
"Apache-2.0"
] | 8 | 2015-03-19T20:22:44.000Z | 2021-04-11T06:00:52.000Z | venv/lib/python2.7/site-packages/pbr/__init__.py | wbonack/witty-name | 07a4babed5b4ff4846c10268a65975c6c800de2b | [
"BSD-3-Clause"
] | 1 | 2015-07-21T23:05:23.000Z | 2016-03-16T08:11:54.000Z | venv/lib/python2.7/site-packages/pbr/__init__.py | wbonack/witty-name | 07a4babed5b4ff4846c10268a65975c6c800de2b | [
"BSD-3-Clause"
] | 5 | 2015-10-09T17:42:24.000Z | 2021-03-11T18:33:00.000Z | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.666667 | 69 | 0.760656 | true | true | |
f745a2afd2932c07137cfe348dbf71260825ba7e | 3,294 | py | Python | parser/team29/analizer/statement/instructions/create/create_index.py | AndreeAvalos/tytus | 7432c604bd1dddc9714443f44e0d498e6a005c5d | [
"MIT"
] | null | null | null | parser/team29/analizer/statement/instructions/create/create_index.py | AndreeAvalos/tytus | 7432c604bd1dddc9714443f44e0d498e6a005c5d | [
"MIT"
] | null | null | null | parser/team29/analizer/statement/instructions/create/create_index.py | AndreeAvalos/tytus | 7432c604bd1dddc9714443f44e0d498e6a005c5d | [
"MIT"
] | null | null | null | from analizer.abstract import instruction
from analizer.reports import Nodo
from analizer.typechecker.Metadata import File
from analizer.typechecker.Metadata import Struct
class CreateIndex(instruction.Instruction):
def __init__(self, unique, idIndex, idTable, usingMethod, whereCl, optList=[]):
self.uniqu... | 32.294118 | 109 | 0.497571 | from analizer.abstract import instruction
from analizer.reports import Nodo
from analizer.typechecker.Metadata import File
from analizer.typechecker.Metadata import Struct
class CreateIndex(instruction.Instruction):
def __init__(self, unique, idIndex, idTable, usingMethod, whereCl, optList=[]):
self.uniqu... | true | true |
f745a3ac80ecf6894c5c7b0df413e76eeea1441e | 4,799 | py | Python | fts_scripts/experimental/run_tutorial.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | fts_scripts/experimental/run_tutorial.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | fts_scripts/experimental/run_tutorial.py | nishadg246/stripstream-ivan-nishad | 9a275ae5836ee289cd09cbe6bc0ff6fd4a381135 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from stripstream.fts.constraint import Eq, ConType, Unconstrained
from stripstream.fts.variable import VarType, Par, Var, X, U, nX
from stripstream.fts.clause import Clause
from stripstream.fts.sampler import Sampler
from stripstream.fts.problem import FTSProblem
from stripstream.fts.stripstream... | 37.20155 | 117 | 0.653261 |
from stripstream.fts.constraint import Eq, ConType, Unconstrained
from stripstream.fts.variable import VarType, Par, Var, X, U, nX
from stripstream.fts.clause import Clause
from stripstream.fts.sampler import Sampler
from stripstream.fts.problem import FTSProblem
from stripstream.fts.stripstream_conversion import con... | false | true |
f745a3e1dd8614d2fabe0b6fc24cad56355cffd6 | 6,869 | py | Python | pyparse/core/data/query.py | sodastsai/pyparse | 17396083883a822050a3cf2cdda838e5e909c136 | [
"Apache-2.0"
] | null | null | null | pyparse/core/data/query.py | sodastsai/pyparse | 17396083883a822050a3cf2cdda838e5e909c136 | [
"Apache-2.0"
] | null | null | null | pyparse/core/data/query.py | sodastsai/pyparse | 17396083883a822050a3cf2cdda838e5e909c136 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Tickle Labs, 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 w... | 31.654378 | 120 | 0.588004 |
from copy import copy
import json
from pyparse.core.data.types import ParseConvertible
from pyparse.core.data.object import ObjectBase
from pyparse.request import request_parse
class Query(object):
def __init__(self, object_class=None, class_name=None):
assert bool(object_class) ^ bool(c... | true | true |
f745a495b467c428c4117186788fc4a07f26fa4d | 2,742 | py | Python | src/fsm/tests/python/fsm_tests/fsm_tests.py | c-piyushjhamb/opensync | e122cc4f1a7df1b05b054c40ec14251c11614285 | [
"BSD-3-Clause"
] | 67 | 2018-11-06T16:40:18.000Z | 2022-03-09T13:20:01.000Z | src/fsm/tests/python/fsm_tests/fsm_tests.py | c-piyushjhamb/opensync | e122cc4f1a7df1b05b054c40ec14251c11614285 | [
"BSD-3-Clause"
] | 18 | 2019-07-26T16:49:55.000Z | 2021-06-23T21:01:03.000Z | src/fsm/tests/python/fsm_tests/fsm_tests.py | c-piyushjhamb/opensync | e122cc4f1a7df1b05b054c40ec14251c11614285 | [
"BSD-3-Clause"
] | 77 | 2018-10-24T11:02:03.000Z | 2022-03-03T02:14:26.000Z | #!/usr/bin/env python3
import argparse
import configparser
import copy
import logging
import os
import stat
import sys
import lib.fsm_config as fsm_config
import lib.tags as tag
import lib.iface as tap
import lib.flows as flow
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLog... | 33.439024 | 106 | 0.645879 |
import argparse
import configparser
import copy
import logging
import os
import stat
import sys
import lib.fsm_config as fsm_config
import lib.tags as tag
import lib.iface as tap
import lib.flows as flow
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLogger(__file__)
def gen... | true | true |
f745a4d0d99c52372c7255a4ca1a7051224768bc | 1,604 | py | Python | swift/common/middleware/slo.py | IPVL/swift_test | 41d1ee3d575036a0788425b20da87aeee00bb605 | [
"MIT"
] | null | null | null | swift/common/middleware/slo.py | IPVL/swift_test | 41d1ee3d575036a0788425b20da87aeee00bb605 | [
"MIT"
] | null | null | null | swift/common/middleware/slo.py | IPVL/swift_test | 41d1ee3d575036a0788425b20da87aeee00bb605 | [
"MIT"
] | null | null | null | from swift.ipvl.inspect_custom import whoami, whosdaddy
pass # (WIS) print __name__
class StaticLargeObject(object):
"""docstring for StaticLargeObject"""
def __init__(self, app, conf):
pass # (WIS) print "%s %s (%s -> %s)" % (__name__, self.__class__.__name__, whosdaddy(), whoami())
self.... | 39.121951 | 107 | 0.592893 | from swift.ipvl.inspect_custom import whoami, whosdaddy
pass
class StaticLargeObject(object):
def __init__(self, app, conf):
pass
self.app = app
self.conf = conf
def __call__(self, env, start_response):
pass
start_response('200 OK', [('Content-Type', 'text/plai... | true | true |
f745a50e631e41afc6423a8d93a0cfbfc06dc3f7 | 4,407 | py | Python | userbot/modules/quotly.py | AngkasaBoy/SpaceMan | 578039395046ba7a987cf220ecfc4bee82b285d3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2021-05-02T22:01:34.000Z | 2021-06-20T08:25:41.000Z | userbot/modules/quotly.py | AngkasaBoy/SpaceMan | 578039395046ba7a987cf220ecfc4bee82b285d3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/quotly.py | AngkasaBoy/SpaceMan | 578039395046ba7a987cf220ecfc4bee82b285d3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2021-03-20T23:46:21.000Z | 2021-05-02T22:01:47.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Port From UniBorg to UserBot by MoveAngel
import random
import requests
from asyncio.exceptions import TimeoutError
... | 38.657895 | 95 | 0.6054 |
import random
import requests
from asyncio.exceptions import TimeoutError
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot import CMD_HELP, bot
from userbot.events import register
if 1 == 1:
strings = {
"name": "Quotes",
"api_token_cfg_do... | true | true |
f745a5be8e803ad34c9d4c9efd3a60dd05693d4b | 14,451 | py | Python | Python/DocStruct/ASAPI/Client.py | appcove/DocStruct | 16c15bb59f9aab29abb78b0aa9f2ab63c10b8da4 | [
"Apache-2.0"
] | 1 | 2015-06-18T07:30:02.000Z | 2015-06-18T07:30:02.000Z | Python/DocStruct/ASAPI/Client.py | appcove/DocStruct | 16c15bb59f9aab29abb78b0aa9f2ab63c10b8da4 | [
"Apache-2.0"
] | null | null | null | Python/DocStruct/ASAPI/Client.py | appcove/DocStruct | 16c15bb59f9aab29abb78b0aa9f2ab63c10b8da4 | [
"Apache-2.0"
] | null | null | null | # vim:fileencoding=utf-8:ts=2:sw=2:expandtab
import json
import mimetypes
import traceback
from datetime import datetime, timezone, timedelta
from collections import OrderedDict
from AppStruct.Util import aadict
from AppStruct.Security import RandomHex
from ..Base import GetSession, S3, SQS
from . import AWS
class... | 32.547297 | 146 | 0.620995 |
import json
import mimetypes
import traceback
from datetime import datetime, timezone, timedelta
from collections import OrderedDict
from AppStruct.Util import aadict
from AppStruct.Security import RandomHex
from ..Base import GetSession, S3, SQS
from . import AWS
class AWSConfig(object):
def __init__(self, Co... | true | true |
f745a5d407f47d5271029ccca1671bc66863a918 | 5,982 | py | Python | tensor2tensor/utils/multistep_optimizer.py | hushukai/tf-tensor2tensor | 6e685f57ed170bb7f887271d7bbd58cf57eb6af7 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/utils/multistep_optimizer.py | hushukai/tf-tensor2tensor | 6e685f57ed170bb7f887271d7bbd58cf57eb6af7 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/utils/multistep_optimizer.py | hushukai/tf-tensor2tensor | 6e685f57ed170bb7f887271d7bbd58cf57eb6af7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Tensor2Tensor 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... | 43.347826 | 80 | 0.703778 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v1 as tf
class MultistepAdamOptimizer(tf.compat.v1.train.AdamOptimizer):
def __init__(self, learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-8,
... | true | true |
f745a63ff0e16aed4fc17de6b74261ad9669dbe4 | 103,212 | py | Python | tests/unit/gapic/bigtable_v2/test_bigtable.py | mf2199/python-bigtable | ee3a6c4c5f810fab08671db3407195864ecc1972 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/bigtable_v2/test_bigtable.py | mf2199/python-bigtable | ee3a6c4c5f810fab08671db3407195864ecc1972 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/bigtable_v2/test_bigtable.py | mf2199/python-bigtable | ee3a6c4c5f810fab08671db3407195864ecc1972 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.598355 | 104 | 0.67278 |
import os
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from... | true | true |
f745a6c804ddd25ad1ebcf82383b2f450a5738e4 | 8,727 | py | Python | blindbackup/client.py | nagylzs/blindbackup | fa0c7a6ef42bb5aefec99eff69a3227c8695fdd9 | [
"Apache-2.0"
] | 1 | 2020-01-26T05:46:14.000Z | 2020-01-26T05:46:14.000Z | blindbackup/client.py | nagylzs/blindbackup | fa0c7a6ef42bb5aefec99eff69a3227c8695fdd9 | [
"Apache-2.0"
] | null | null | null | blindbackup/client.py | nagylzs/blindbackup | fa0c7a6ef42bb5aefec99eff69a3227c8695fdd9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import copy
import io
import json
import os.path
import pycurl
import urllib.parse
from blindbackup.util import localpath
def create_client(settings):
certfile = localpath(settings, "ssl_certfile", None)
return Client(
settings["server_url"], certfile,
settings["login"]... | 33.825581 | 133 | 0.58531 |
import copy
import io
import json
import os.path
import pycurl
import urllib.parse
from blindbackup.util import localpath
def create_client(settings):
certfile = localpath(settings, "ssl_certfile", None)
return Client(
settings["server_url"], certfile,
settings["login"], settings["password"]... | true | true |
f745a8efaa5ed62c6f00d0c3ebbcd28d06774854 | 850 | py | Python | armulator/armv6/opcodes/abstract_opcodes/and_immediate.py | matan1008/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 16 | 2018-01-22T14:36:49.000Z | 2021-12-17T15:39:52.000Z | armulator/armv6/opcodes/abstract_opcodes/and_immediate.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 3 | 2019-02-19T17:51:47.000Z | 2022-03-31T20:45:21.000Z | armulator/armv6/opcodes/abstract_opcodes/and_immediate.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 4 | 2020-06-18T23:51:03.000Z | 2022-02-09T17:43:13.000Z | from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
class AndImmediate(AbstractOpcode):
def __init__(self, setflags, d, n, imm32, carry):
super(AndImmediate, self).__init__()
self.setflags = setflags
self.d = d
self.n = n
self.imm32 = imm32
self.carry... | 35.416667 | 69 | 0.591765 | from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
class AndImmediate(AbstractOpcode):
def __init__(self, setflags, d, n, imm32, carry):
super(AndImmediate, self).__init__()
self.setflags = setflags
self.d = d
self.n = n
self.imm32 = imm32
self.carry... | true | true |
f745aa8573b2ce77ab8c424f4efb2c223b3a8c6e | 4,269 | py | Python | src/tests/ftest/aggregation/io_small.py | daos-stack/daos-core | 41fea89f5f63212ea43d9f1fc8974bb6ae875449 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/aggregation/io_small.py | daos-stack/daos-core | 41fea89f5f63212ea43d9f1fc8974bb6ae875449 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/aggregation/io_small.py | daos-stack/daos-core | 41fea89f5f63212ea43d9f1fc8974bb6ae875449 | [
"BSD-2-Clause-Patent"
] | null | null | null | #!/usr/bin/python
"""
(C) Copyright 2020-2022 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
from ior_test_base import IorTestBase
from general_utils import human_to_bytes
class DaosAggregationIOSmall(IorTestBase):
# pylint: disable=too-many-ancestors,too-few-public-methods
... | 38.459459 | 80 | 0.646053 |
import time
from ior_test_base import IorTestBase
from general_utils import human_to_bytes
class DaosAggregationIOSmall(IorTestBase):
def test_aggregation_io_small(self):
self.update_ior_cmd_with_pool()
scm_index = 0
ssd_index = 1
block_size = hu... | true | true |
f745aabe794cc25ba4b2b6225a3914d2e99e5882 | 9,709 | py | Python | data/params.py | liulisixin/unsupervised-learning-intrinsic-images | 0d4ad151d203885c87122bcc305c787210b28a5c | [
"MIT"
] | 61 | 2018-04-05T21:17:28.000Z | 2019-08-10T08:43:58.000Z | data/params.py | liulisixin/unsupervised-learning-intrinsic-images | 0d4ad151d203885c87122bcc305c787210b28a5c | [
"MIT"
] | 4 | 2018-07-06T13:38:27.000Z | 2019-08-03T09:37:10.000Z | data/params.py | liulisixin/unsupervised-learning-intrinsic-images | 0d4ad151d203885c87122bcc305c787210b28a5c | [
"MIT"
] | 13 | 2019-08-13T02:11:54.000Z | 2021-07-06T09:27:27.000Z | import copy
import json
import random
import hashlib
import numpy as np
class IntrinsicParameters():
""" Global parameter values for the algorithm """
def __init__(self):
#: if True, print progress to the console
self.logging = False
#: if True, use a fixed seed for k-means clusteri... | 31.21865 | 81 | 0.604697 | import copy
import json
import random
import hashlib
import numpy as np
class IntrinsicParameters():
def __init__(self):
self.logging = False
self.fixed_seed = False
self.n_iters = 25
self.n_crf_iters = 10
self.split_cluste... | true | true |
f745ab4824ac364b51758e6c3fb60a5679d210fb | 29,676 | py | Python | tensorflow/python/training/checkpoint_management.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 5 | 2018-07-04T22:14:02.000Z | 2018-07-04T22:21:43.000Z | tensorflow/python/training/checkpoint_management.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/checkpoint_management.py | wenming2014/tensorflow | a102a6a71844e194f3946f6318768c5367f1f16b | [
"Apache-2.0"
] | 2 | 2019-10-11T00:17:03.000Z | 2020-05-23T18:59:45.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.915254 | 80 | 0.720077 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os.path
import re
import time
from google.protobuf import text_format
from tensorflow.core.protobuf import saver_pb2
from tensorflow.python.eager import context
from ... | true | true |
f745ab6e57f48b737a0b5e00e3121d9dba5e352c | 1,628 | py | Python | lemonsoap/scent/impute_scent.py | Ekrekr/LemonSoap | 61b86b70a3788486235de2e8baeb7c68b80318a9 | [
"MIT"
] | null | null | null | lemonsoap/scent/impute_scent.py | Ekrekr/LemonSoap | 61b86b70a3788486235de2e8baeb7c68b80318a9 | [
"MIT"
] | 1 | 2019-08-23T18:30:31.000Z | 2019-08-23T18:32:23.000Z | lemonsoap/scent/impute_scent.py | Ekrekr/LemonSoap | 61b86b70a3788486235de2e8baeb7c68b80318a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
LemonSoap - impute scent.
Determines which columns have potentially sequential data, and if so offers to
estimate values.
* Missing completely at random (MCAR)
* Missing at random (MAR)
* Not missing at random (NMAR)
1. If numerical:
1. If constant, then fill in with same values.
... | 22 | 78 | 0.624079 |
import pandas as pd
import logging
from .scent_template import ScentTemplate
from ..lemon_bar import LemonBar
class ImputeScent(ScentTemplate):
def __init__(self, lf: LemonBar):
ScentTemplate.__init__(self, lf, "impute",
"impute_scent.ImputeScent")
def check(self) -> ... | true | true |
f745ac03a914918c2f01b2d0f56890719ca0ab7e | 11,520 | py | Python | afterglow_core/resources/data_provider_plugins/imaging_survey_provider.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 2 | 2021-05-24T15:12:07.000Z | 2022-02-17T19:58:16.000Z | afterglow_core/resources/data_provider_plugins/imaging_survey_provider.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 1 | 2022-02-27T03:01:06.000Z | 2022-02-27T03:01:06.000Z | afterglow_core/resources/data_provider_plugins/imaging_survey_provider.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 2 | 2021-06-08T18:16:40.000Z | 2021-07-09T14:19:49.000Z | """
Afterglow Core: imaging survey data provider plugin
"""
from typing import List as TList, Optional, Tuple, Union
from io import BytesIO
from threading import Lock
from astropy import units as u
from astropy.coordinates import Angle
from astroquery.skyview import SkyView
from ...models import DataProvider, DataP... | 37.770492 | 79 | 0.571962 |
from typing import List as TList, Optional, Tuple, Union
from io import BytesIO
from threading import Lock
from astropy import units as u
from astropy.coordinates import Angle
from astroquery.skyview import SkyView
from ...models import DataProvider, DataProviderAsset
from ...errors import MissingFieldError, Valida... | true | true |
f745ac54b738685c5e2840208907ee4e742a4f9e | 5,755 | py | Python | code/test_util.py | mantuoluozk/MFC | e296d7a8e345bc2ca404b5f0fb7f5048f9c5f0d3 | [
"MIT"
] | null | null | null | code/test_util.py | mantuoluozk/MFC | e296d7a8e345bc2ca404b5f0fb7f5048f9c5f0d3 | [
"MIT"
] | null | null | null | code/test_util.py | mantuoluozk/MFC | e296d7a8e345bc2ca404b5f0fb7f5048f9c5f0d3 | [
"MIT"
] | null | null | null | import h5py
import math
import nibabel as nib
import numpy as np
from medpy import metric
import torch
import torch.nn.functional as F
from tqdm import tqdm
from skimage.measure import label
def getLargestCC(segmentation):
labels = label(segmentation)
assert(labels.max() != 0) # assume at least 1 CC
larg... | 37.37013 | 181 | 0.575326 | import h5py
import math
import nibabel as nib
import numpy as np
from medpy import metric
import torch
import torch.nn.functional as F
from tqdm import tqdm
from skimage.measure import label
def getLargestCC(segmentation):
labels = label(segmentation)
assert(labels.max() != 0)
largestCC = labels == np.a... | true | true |
f745ad50c0969afae56e31759a8ede1624e56388 | 9,361 | py | Python | codesearch/__main__.py | chromium/codesearch-py | 41c53c1462b0f9c4031163d8927edafcc56c9659 | [
"BSD-3-Clause"
] | 26 | 2017-05-24T18:51:18.000Z | 2022-03-17T19:44:15.000Z | codesearch/__main__.py | chromium/codesearch-py | 41c53c1462b0f9c4031163d8927edafcc56c9659 | [
"BSD-3-Clause"
] | 10 | 2017-06-06T17:33:33.000Z | 2020-08-08T18:47:18.000Z | codesearch/__main__.py | QPC-database/codesearch-py | a4b74e597bc78ec9492efc8b741129a410af14a7 | [
"BSD-3-Clause"
] | 16 | 2017-06-02T10:36:56.000Z | 2021-07-03T22:41:09.000Z | # Copyright 2017 The Chromium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd.
"""Command line interface to Chromium Code Search.
Currently emits JSON formatted responses from the Chromium Cod... | 35.324528 | 80 | 0.591497 |
from __future__ import absolute_import
from __future__ import print_function
import os
import argparse
import sys
import json
import logging
from codesearch import \
CallGraphRequest, \
CodeSearch, \
CodeSearchProtoJsonEncoder, \
CodeSearchProtoJsonSymbolizedEncoder, \
CompoundRequest, \
... | true | true |
f745ad649c1a43fb1bb089f4fc14e5bb6e087001 | 997 | py | Python | create_tw.py | alexjj/wiki | ddafb2ea872118c75343d15b92e628c8a1eb6544 | [
"MIT"
] | null | null | null | create_tw.py | alexjj/wiki | ddafb2ea872118c75343d15b92e628c8a1eb6544 | [
"MIT"
] | null | null | null | create_tw.py | alexjj/wiki | ddafb2ea872118c75343d15b92e628c8a1eb6544 | [
"MIT"
] | null | null | null | #%%
import json
with open("meditations.json", "r") as read_file:
data = json.load(read_file)
#%%
book_names = [
"Book I",
"Book II",
"Book III",
"Book IV",
"Book V",
"Book VI",
"Book VII",
"Book VIII",
"Book IX",
"Book X",
"Book XI",
"Book XII",
]
result = []
... | 19.54902 | 59 | 0.531595 |
import json
with open("meditations.json", "r") as read_file:
data = json.load(read_file)
book_names = [
"Book I",
"Book II",
"Book III",
"Book IV",
"Book V",
"Book VI",
"Book VII",
"Book VIII",
"Book IX",
"Book X",
"Book XI",
"Book XII",
]
result = []
for b... | true | true |
f745adb4fda92474b18fc7b215ad072c3dbc4840 | 66,180 | py | Python | src/reg_masternode_dlg.py | walkjivefly/crown-masternode-tool | 8eb5969a2dce87221997b128f02c9c33f9deeafd | [
"MIT"
] | null | null | null | src/reg_masternode_dlg.py | walkjivefly/crown-masternode-tool | 8eb5969a2dce87221997b128f02c9c33f9deeafd | [
"MIT"
] | null | null | null | src/reg_masternode_dlg.py | walkjivefly/crown-masternode-tool | 8eb5969a2dce87221997b128f02c9c33f9deeafd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-11
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, Q... | 46.409537 | 201 | 0.614053 |
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import pyqtSlot, Qt, QTimerEvent, QTimer
from PyQt5.QtGui import... | true | true |
f745ae46260a7b31aa69f784ff95b4ad3bef4a74 | 573 | py | Python | riverstone_cli/commands/wireframe/__init__.py | dev-tooling/github-cli | a8b72d066b2e7e3e7046a4d2a06845d8fce9678c | [
"Apache-2.0"
] | null | null | null | riverstone_cli/commands/wireframe/__init__.py | dev-tooling/github-cli | a8b72d066b2e7e3e7046a4d2a06845d8fce9678c | [
"Apache-2.0"
] | null | null | null | riverstone_cli/commands/wireframe/__init__.py | dev-tooling/github-cli | a8b72d066b2e7e3e7046a4d2a06845d8fce9678c | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2018 Riverstone Software, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | 35.8125 | 72 | 0.78534 | true | true | |
f745ae9e849cf63571179e4fe9e7914971ceb3ec | 1,585 | py | Python | opentuner/driverbase.py | HansGiesen/opentuner | 6eabebd502ea46072d1a149826f5fbdaa4cf98ef | [
"MIT"
] | 1 | 2019-09-10T15:59:11.000Z | 2019-09-10T15:59:11.000Z | opentuner/driverbase.py | HansGiesen/opentuner | 6eabebd502ea46072d1a149826f5fbdaa4cf98ef | [
"MIT"
] | null | null | null | opentuner/driverbase.py | HansGiesen/opentuner | 6eabebd502ea46072d1a149826f5fbdaa4cf98ef | [
"MIT"
] | null | null | null | from opentuner.resultsdb.models import *
class DriverBase(object):
"""
shared base class between MeasurementDriver and SearchDriver
"""
def __init__(self,
session,
tuning_run,
objective,
tuning_run_main,
args,
**kwargs)... | 25.983607 | 62 | 0.615773 | from opentuner.resultsdb.models import *
class DriverBase(object):
def __init__(self,
session,
tuning_run,
objective,
tuning_run_main,
args,
**kwargs):
self.args = args
self.objective = objective
self.session = se... | true | true |
f745b15a500147dbdaeb050c729ae9f3009b5cb5 | 1,607 | py | Python | env/Lib/site-packages/plotly/validators/histogram/marker/__init__.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/histogram/marker/__init__.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/histogram/marker/__init__.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import sys
if sys.version_info < (3, 7):
from ._showscale import ShowscaleValidator
from ._reversescale import ReversescaleValidator
from ._pattern import PatternValidator
from ._opacitysrc import OpacitysrcValidator
from ._opacity import OpacityValidator
from ._line import LineValidator
fr... | 35.711111 | 56 | 0.676416 | import sys
if sys.version_info < (3, 7):
from ._showscale import ShowscaleValidator
from ._reversescale import ReversescaleValidator
from ._pattern import PatternValidator
from ._opacitysrc import OpacitysrcValidator
from ._opacity import OpacityValidator
from ._line import LineValidator
fr... | true | true |
f745b199eee72335c7787dff9d374a0157c928fd | 842 | py | Python | flaskr/db.py | jeckt/flask_official_tutorial | ca0f93d682bc9a0b372e537becde3a417af579f7 | [
"Apache-2.0"
] | null | null | null | flaskr/db.py | jeckt/flask_official_tutorial | ca0f93d682bc9a0b372e537becde3a417af579f7 | [
"Apache-2.0"
] | null | null | null | flaskr/db.py | jeckt/flask_official_tutorial | ca0f93d682bc9a0b372e537becde3a417af579f7 | [
"Apache-2.0"
] | null | null | null | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row
retu... | 21.589744 | 56 | 0.654394 | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row
retu... | true | true |
f745b1eb10a9577b2d6348c2e2aa76943081c95f | 4,905 | py | Python | retina_models/retinaface.py | zs7779/Pytorch_Retinaface | eeb92c28f3217da7439118ed89df8a83c75cc161 | [
"MIT"
] | null | null | null | retina_models/retinaface.py | zs7779/Pytorch_Retinaface | eeb92c28f3217da7439118ed89df8a83c75cc161 | [
"MIT"
] | null | null | null | retina_models/retinaface.py | zs7779/Pytorch_Retinaface | eeb92c28f3217da7439118ed89df8a83c75cc161 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from retina_models.net import MobileNetV1 as MobileNetV1
from retina_models.net import FPN as FPN
from r... | 38.622047 | 135 | 0.644241 | import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from retina_models.net import MobileNetV1 as MobileNetV1
from retina_models.net import FPN as FPN
from r... | true | true |
f745b21870591affce7dca38519560328f876fcc | 6,200 | py | Python | asteroid/models/demask.py | ldelebec/asteroid | d6390baca5409634f112ceed554ea66c4054cb54 | [
"MIT"
] | 722 | 2020-12-01T06:49:47.000Z | 2022-03-31T12:44:53.000Z | asteroid/models/demask.py | ldelebec/asteroid | d6390baca5409634f112ceed554ea66c4054cb54 | [
"MIT"
] | 235 | 2020-03-02T12:57:07.000Z | 2020-11-30T20:11:18.000Z | asteroid/models/demask.py | ldelebec/asteroid | d6390baca5409634f112ceed554ea66c4054cb54 | [
"MIT"
] | 176 | 2020-12-01T00:10:30.000Z | 2022-03-30T10:38:19.000Z | from torch import nn
from .base_models import BaseEncoderMaskerDecoder
from asteroid_filterbanks import make_enc_dec
from asteroid_filterbanks.transforms import mag, magreim
from ..masknn import norms, activations
from ..utils.torch_utils import pad_x_to_y
import warnings
class DeMask(BaseEncoderMaskerDecoder):
"... | 34.444444 | 115 | 0.609839 | from torch import nn
from .base_models import BaseEncoderMaskerDecoder
from asteroid_filterbanks import make_enc_dec
from asteroid_filterbanks.transforms import mag, magreim
from ..masknn import norms, activations
from ..utils.torch_utils import pad_x_to_y
import warnings
class DeMask(BaseEncoderMaskerDecoder):
... | true | true |
f745b244a94bea35e5ed9d42aa797470df8b0b77 | 24,728 | py | Python | sqlmodel/main.py | CaselIT/sqlmodel | b59d91ddd9e957a4cdf9dbb35704d7664de840f3 | [
"MIT"
] | 3 | 2021-09-13T18:20:23.000Z | 2022-02-07T16:13:07.000Z | sqlmodel/main.py | CaselIT/sqlmodel | b59d91ddd9e957a4cdf9dbb35704d7664de840f3 | [
"MIT"
] | 48 | 2021-08-30T14:17:14.000Z | 2022-02-14T14:54:16.000Z | sqlmodel/main.py | CaselIT/sqlmodel | b59d91ddd9e957a4cdf9dbb35704d7664de840f3 | [
"MIT"
] | 1 | 2021-10-30T12:06:42.000Z | 2021-10-30T12:06:42.000Z | import ipaddress
import uuid
import weakref
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from pathlib import Path
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
ClassVar,
Dict,
List,
Mapping,
Optional,
Seq... | 38.819466 | 88 | 0.629934 | import ipaddress
import uuid
import weakref
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from pathlib import Path
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
ClassVar,
Dict,
List,
Mapping,
Optional,
Seq... | true | true |
f745b28c3e2c67855346d9842cb0aa2802efb0a3 | 1,156 | py | Python | music/file_player.py | MaT1g3R/YasenBaka | c5ff3b0419801c2d37a86bac644d72ffff97d482 | [
"Apache-2.0"
] | 6 | 2017-04-08T15:16:17.000Z | 2019-06-22T20:14:39.000Z | music/file_player.py | MaT1g3R/YasenBaka | c5ff3b0419801c2d37a86bac644d72ffff97d482 | [
"Apache-2.0"
] | 8 | 2017-07-20T22:01:21.000Z | 2018-01-10T18:57:32.000Z | music/file_player.py | MaT1g3R/YasenBaka | c5ff3b0419801c2d37a86bac644d72ffff97d482 | [
"Apache-2.0"
] | 5 | 2017-11-23T21:25:51.000Z | 2019-06-22T20:14:46.000Z | from pathlib import Path
from random import shuffle
from discord import VoiceChannel
from music.abstract_music_player import AbstractMusicPlayer
from music.entry import Entry
class FilePlayer(AbstractMusicPlayer):
"""
Audio player for playing local files.
"""
__slots__ = ('default_path',)
def _... | 29.641026 | 77 | 0.654844 | from pathlib import Path
from random import shuffle
from discord import VoiceChannel
from music.abstract_music_player import AbstractMusicPlayer
from music.entry import Entry
class FilePlayer(AbstractMusicPlayer):
__slots__ = ('default_path',)
def __init__(self, logger, channel: VoiceChannel, default_path:... | true | true |
f745b321a9d0365fce2574ae9cb5b3a1ee8c62aa | 1,549 | py | Python | remme/ws/utils.py | REMME-ONU/remme-core-temp | 2d68f284c3cb8156b4c3742dd0104d8406bd87f6 | [
"Apache-2.0"
] | null | null | null | remme/ws/utils.py | REMME-ONU/remme-core-temp | 2d68f284c3cb8156b4c3742dd0104d8406bd87f6 | [
"Apache-2.0"
] | null | null | null | remme/ws/utils.py | REMME-ONU/remme-core-temp | 2d68f284c3cb8156b4c3742dd0104d8406bd87f6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 REMME
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 28.163636 | 74 | 0.650742 |
import ujson
from .constants import Status
def serialize(payload):
return ujson.dumps(payload)
def deserialize(payload):
return ujson.loads(payload)
def create_res_payload(status, data, id, type):
payload = {
'type': type,
'status': status.name.lower(),
}
if id:... | true | true |
f745b3db2aded6eafa3ced2618e23b101a84de22 | 18,416 | py | Python | cli/internal/commands/register.py | MasonAmerica/mason-cl | ac9ac5041b12090b94958ec41d2b5a294c4b61e6 | [
"Apache-2.0"
] | 9 | 2019-12-05T23:50:46.000Z | 2021-09-16T17:49:27.000Z | cli/internal/commands/register.py | MasonAmerica/mason-cl | ac9ac5041b12090b94958ec41d2b5a294c4b61e6 | [
"Apache-2.0"
] | 5 | 2018-03-19T21:00:15.000Z | 2021-07-24T08:35:13.000Z | cli/internal/commands/register.py | MasonAmerica/mason-cl | ac9ac5041b12090b94958ec41d2b5a294c4b61e6 | [
"Apache-2.0"
] | 3 | 2018-07-08T14:51:03.000Z | 2021-11-24T17:32:39.000Z | import abc
import copy
import os
import tempfile
from abc import abstractmethod
from threading import Lock
import click
import six
import yaml
from tqdm import tqdm
from cli.config import Config
from cli.internal.commands.command import Command
from cli.internal.models.apk import Apk
from cli.internal.models.artifact... | 35.689922 | 98 | 0.614411 | import abc
import copy
import os
import tempfile
from abc import abstractmethod
from threading import Lock
import click
import six
import yaml
from tqdm import tqdm
from cli.config import Config
from cli.internal.commands.command import Command
from cli.internal.models.apk import Apk
from cli.internal.models.artifact... | true | true |
f745b4541731685b3b5f7e59fb36223fca03f8f5 | 3,992 | py | Python | code/id53.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | code/id53.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | code/id53.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... | 28.719424 | 149 | 0.716683 | import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... | true | true |
f745b523845f855e4f2d6ea60b42cedae433aaa7 | 521 | py | Python | contest/20190303_ABC120/D.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | contest/20190303_ABC120/D.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | contest/20190303_ABC120/D.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | # Union-findを使う
# 論文検索には(Disjoint Set)
from scipy.special import comb
n, m = map(int, input().split())
a = []
b = []
for i in range(m):
a0, b0 = [int(i) for i in input().split()]
a.append(a0)
b.append(b0)
a.append(b)
l = len(a)
cmb = comb(m, 2, exact=True)
base = int(cmb / 2) + 1
for _ in range(m):
... | 16.28125 | 46 | 0.50096 |
from scipy.special import comb
n, m = map(int, input().split())
a = []
b = []
for i in range(m):
a0, b0 = [int(i) for i in input().split()]
a.append(a0)
b.append(b0)
a.append(b)
l = len(a)
cmb = comb(m, 2, exact=True)
base = int(cmb / 2) + 1
for _ in range(m):
l -= 2
if l > base:
prin... | true | true |
f745b599473b50abb86d819c3bfffe20c1566d3f | 2,798 | py | Python | test.py | drg0072/Assessment_25_jan_2020 | f4f68c04d006dc2da0335e3ad2c18ada20f936d2 | [
"MIT"
] | null | null | null | test.py | drg0072/Assessment_25_jan_2020 | f4f68c04d006dc2da0335e3ad2c18ada20f936d2 | [
"MIT"
] | null | null | null | test.py | drg0072/Assessment_25_jan_2020 | f4f68c04d006dc2da0335e3ad2c18ada20f936d2 | [
"MIT"
] | null | null | null | import unittest
from pathlib import Path
import mock
import requests_mock
def check_upload_to_aws_s3(csv_path, s3_bucket):
assert isinstance(csv_path, Path)
return True
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
import os
os.makedirs("test", exist_ok=True)
os... | 34.121951 | 105 | 0.617584 | import unittest
from pathlib import Path
import mock
import requests_mock
def check_upload_to_aws_s3(csv_path, s3_bucket):
assert isinstance(csv_path, Path)
return True
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
import os
os.makedirs("test", exist_ok=True)
os... | true | true |
f745b601bcdd8308aeb3d008f30e1617f958ab27 | 2,191 | py | Python | tools/process_images.py | kuralesache/kuralesache.github.io | 56b2587e794c41bd1fb7ffb64de736cd9e02a86c | [
"MIT"
] | null | null | null | tools/process_images.py | kuralesache/kuralesache.github.io | 56b2587e794c41bd1fb7ffb64de736cd9e02a86c | [
"MIT"
] | null | null | null | tools/process_images.py | kuralesache/kuralesache.github.io | 56b2587e794c41bd1fb7ffb64de736cd9e02a86c | [
"MIT"
] | null | null | null | from PIL import Image
import glob
import os.path
import re
import json
def get_frame(path):
return int(path.rpartition('.')[0].rpartition('\\')[2])
for character in glob.glob('.\\raw\\*'):
character_name = character.rpartition('\\')[2]
for move in glob.glob(character + '\\*'):
move_name = move.rp... | 32.220588 | 87 | 0.61068 | from PIL import Image
import glob
import os.path
import re
import json
def get_frame(path):
return int(path.rpartition('.')[0].rpartition('\\')[2])
for character in glob.glob('.\\raw\\*'):
character_name = character.rpartition('\\')[2]
for move in glob.glob(character + '\\*'):
move_name = move.rp... | true | true |
f745b625486c2526d215fcbcd929eafa82958fd3 | 801 | py | Python | src/001-constant.py | peterorum/ashrae | 6527eb71b2102565bb71b402db700b561cea138c | [
"MIT"
] | null | null | null | src/001-constant.py | peterorum/ashrae | 6527eb71b2102565bb71b402db700b561cea138c | [
"MIT"
] | null | null | null | src/001-constant.py | peterorum/ashrae | 6527eb71b2102565bb71b402db700b561cea138c | [
"MIT"
] | null | null | null | # baseline: constant 0
# local score 4.668
# kaggle score 4.69
import sys # pylint: disable=unused-import
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from time import time
import os
is_kaggle = os.environ['HOME'] == '/tmp'
zipext = '' if is_kaggle else '.zip'
# load data
... | 19.071429 | 87 | 0.699126 |
import sys
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from time import time
import os
is_kaggle = os.environ['HOME'] == '/tmp'
zipext = '' if is_kaggle else '.zip'
train = pd.read_csv(f'../input/train.csv{zipext}')
test = pd.read_csv(f'../input/test.csv{zipext}')
... | true | true |
f745b751c48a86131628aaf2764f06fc892b8802 | 1,065 | py | Python | irise/constants.py | LSaffin/iris-extensions | 95efe46c36874c387fa76135f0c75490e3398e45 | [
"MIT"
] | 3 | 2019-04-18T13:46:44.000Z | 2020-03-16T13:54:24.000Z | irise/constants.py | LSaffin/iris-extensions | 95efe46c36874c387fa76135f0c75490e3398e45 | [
"MIT"
] | 1 | 2021-06-10T12:48:43.000Z | 2021-06-10T12:48:44.000Z | irise/constants.py | LSaffin/iris-extensions | 95efe46c36874c387fa76135f0c75490e3398e45 | [
"MIT"
] | null | null | null | """
Useful scientific constants defined as iris cubes
Uses constants defined by metpy.constansts
"""
from scipy import constants
from metpy import constants as mpconst
from iris.cube import Cube
# Ratio of radians to degrees
radians_per_degree = Cube(constants.degree, units='radians degrees-1')
# Import all const... | 27.307692 | 70 | 0.6723 |
from scipy import constants
from metpy import constants as mpconst
from iris.cube import Cube
radians_per_degree = Cube(constants.degree, units='radians degrees-1')
for constant in mpconst.__all__:
x = mpconst.__dict__[constant]
units = str(x.units).replace(" ", "").replace("dimensionless", "")
exec(... | true | true |
f745b7860e4c9a74e7a0a34c0e5a848fd121383d | 2,936 | py | Python | pstests/models/deepfm_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | 2 | 2021-12-05T07:11:04.000Z | 2021-12-15T07:53:48.000Z | pstests/models/deepfm_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | null | null | null | pstests/models/deepfm_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | 3 | 2021-04-01T22:39:13.000Z | 2021-04-21T11:51:57.000Z | from athena import gpu_ops as ad
from athena import optimizer
from athena import initializers as init
from athena import dataloader as dl
from athena import ndarray
import numpy as np
import time
# https://zhuanlan.zhihu.com/p/109933924
def dfm_criteo(dense, sparse, labels):
batch_size = 128
feature_dimensio... | 41.942857 | 133 | 0.699591 | from athena import gpu_ops as ad
from athena import optimizer
from athena import initializers as init
from athena import dataloader as dl
from athena import ndarray
import numpy as np
import time
def dfm_criteo(dense, sparse, labels):
batch_size = 128
feature_dimension = 33762577
embedding_size = 128
... | true | true |
f745b7d7c5d380a1f4378ad4dca67236860126a9 | 1,750 | py | Python | regym/rl_algorithms/TQL/repeated_update_q_learning.py | Danielhp95/Regym | f0f0be0ad23bf1a3410ecd9ed9b8025947d6080a | [
"MIT"
] | 6 | 2019-12-03T21:07:12.000Z | 2021-03-25T13:09:39.000Z | regym/rl_algorithms/TQL/repeated_update_q_learning.py | Danielhp95/Generalized-RL-Self-Play-Framework | 64e02e143070ca6eb8bc8f898c431f59cd229341 | [
"MIT"
] | 1 | 2019-01-29T18:43:32.000Z | 2019-01-31T17:31:39.000Z | regym/rl_algorithms/TQL/repeated_update_q_learning.py | Danielhp95/Regym | f0f0be0ad23bf1a3410ecd9ed9b8025947d6080a | [
"MIT"
] | 4 | 2019-08-01T10:29:41.000Z | 2021-12-06T21:44:30.000Z | import numpy as np
class RepeatedUpdateQLearningAlgorithm():
'''
Repeated Update Q Learning (RUQL) as introduced in:
"Addressing the Policy Bias of Q-Learning by Repeating Updates" - Sherief Abdallah, Michael Kaisers
'''
def __init__(self, state_space_size, action_space_size, hashing_function, dis... | 50 | 123 | 0.696 | import numpy as np
class RepeatedUpdateQLearningAlgorithm():
def __init__(self, state_space_size, action_space_size, hashing_function, discount_factor, learning_rate, temperature):
self.Q_table = np.zeros((state_space_size, action_space_size), dtype=np.float64)
self.learning_rate = learning_rate
... | true | true |
f745b878767abc7d653af46e27f85e9fb9372c1a | 4,933 | py | Python | model/loss.py | PandoraLS/WG-WaveNet | 5f27e61cc4d3554af8c16fa35345831099b703e8 | [
"MIT"
] | 58 | 2020-11-09T13:23:00.000Z | 2022-02-10T05:59:17.000Z | model/loss.py | PandoraLS/WG-WaveNet | 5f27e61cc4d3554af8c16fa35345831099b703e8 | [
"MIT"
] | null | null | null | model/loss.py | PandoraLS/WG-WaveNet | 5f27e61cc4d3554af8c16fa35345831099b703e8 | [
"MIT"
] | 10 | 2020-11-16T08:29:09.000Z | 2022-03-10T20:03:15.000Z | import torch
import librosa
import numpy as np
import torch.nn.functional as F
from hparams import hparams as hps
from utils.util import to_arr, mode
class Loss(torch.nn.Module):
def __init__(self):
super(Loss, self).__init__()
self.d = 2*hps.sigma*hps.sigma
self.loss = MultiResolutionSTFTLoss(hps.fft_sizes, h... | 31.825806 | 100 | 0.675046 | import torch
import librosa
import numpy as np
import torch.nn.functional as F
from hparams import hparams as hps
from utils.util import to_arr, mode
class Loss(torch.nn.Module):
def __init__(self):
super(Loss, self).__init__()
self.d = 2*hps.sigma*hps.sigma
self.loss = MultiResolutionSTFTLoss(hps.fft_sizes, h... | true | true |
f745b8948b37f9e3a8233031c45194010d994862 | 1,451 | py | Python | keyfunctions/core.py | cugni/keyfunctions-python | 7236ec69a3c03cc7f7d4e26ebd90118781de4379 | [
"Apache-2.0"
] | null | null | null | keyfunctions/core.py | cugni/keyfunctions-python | 7236ec69a3c03cc7f7d4e26ebd90118781de4379 | [
"Apache-2.0"
] | null | null | null | keyfunctions/core.py | cugni/keyfunctions-python | 7236ec69a3c03cc7f7d4e26ebd90118781de4379 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
import keyfunctions.globals as consts
def create_key(values, depth):
"""
This function returns a Z-order key for any number of dimensions.
:param values: a list of floats - one of dimension - each of them with value between 0 and 1 [0,1)
:param depth: an strictly positi... | 31.543478 | 103 | 0.636113 | from functools import reduce
import keyfunctions.globals as consts
def create_key(values, depth):
mul = 1 << depth
val_casted = [int(value * mul) for value in values]
key = ""
for i in range(0, depth):
mask = 1 << i
last = reduce(
lambda x, y: x | y,
[((value & ... | true | true |
f745b97a89a464f937d48b13ccc441a8d0175d7f | 3,261 | py | Python | lspreader/nearest.py | noobermin/lspreader | b4989ba32507fdcf87cc226ba93422639ed5c5fb | [
"MIT"
] | null | null | null | lspreader/nearest.py | noobermin/lspreader | b4989ba32507fdcf87cc226ba93422639ed5c5fb | [
"MIT"
] | null | null | null | lspreader/nearest.py | noobermin/lspreader | b4989ba32507fdcf87cc226ba93422639ed5c5fb | [
"MIT"
] | 1 | 2015-12-28T20:17:22.000Z | 2015-12-28T20:17:22.000Z |
# Copyright (c) 2015, 2016 Gregory K. Ngirmang
# All rights reserved.
#
# Copyright (C) Pauli Virtanen, 2010.
# All rights reserved.
#
# Copyright (c) 2001, 2002 Enthought, Inc.
# All rights reserved.
#
# Copyright (c) 2003-2012 SciPy Developers.
# All rights reserved.
#
# Redistribution and use in source and binary ... | 38.364706 | 77 | 0.705918 |
def nearest_indices(xs, XS):
xs=_ndim_coords_from_arrays(xs);
XS = _ndim_coords_from_arrays(XS, ndim=xs.shape[1])
if XS.shape[-1] != xs.shape[1]:
raise ValueError("dimensions of the points don't the sample points")
#the magical kd-tree
_,i = cKDTree(xs).... | true | true |
f745ba35cb7f64d2d7a981637a6c2dac9d802f20 | 4,032 | py | Python | emulator/brainflow_emulator/galea_udp.py | Andrey1994/brainflow | 6b776859fba6a629b1acd471ae5d1320bffe9ca5 | [
"MIT"
] | 53 | 2018-12-11T13:35:47.000Z | 2020-04-21T00:08:13.000Z | emulator/brainflow_emulator/galea_udp.py | Andrey1994/brainflow | 6b776859fba6a629b1acd471ae5d1320bffe9ca5 | [
"MIT"
] | 14 | 2019-06-12T05:22:27.000Z | 2020-04-20T19:14:44.000Z | emulator/brainflow_emulator/galea_udp.py | Andrey1994/brainflow | 6b776859fba6a629b1acd471ae5d1320bffe9ca5 | [
"MIT"
] | 9 | 2019-04-13T19:03:16.000Z | 2020-04-07T16:42:20.000Z | import enum
import logging
import random
import socket
import struct
import subprocess
import sys
import threading
import time
from brainflow_emulator.emulate_common import TestFailureError, log_multilines
class State(enum.Enum):
wait = 'wait'
stream = 'stream'
class Message(enum.Enum):
start_stream = ... | 34.461538 | 116 | 0.59871 | import enum
import logging
import random
import socket
import struct
import subprocess
import sys
import threading
import time
from brainflow_emulator.emulate_common import TestFailureError, log_multilines
class State(enum.Enum):
wait = 'wait'
stream = 'stream'
class Message(enum.Enum):
start_stream = ... | true | true |
f745bb06721d82acc48d2e40450a3fc6445226d9 | 1,701 | py | Python | src/data/pokedex_reader.py | justingolden21/pogo | 5b7e3e3a4244a7e1a372e21e2e136f28d1b1122a | [
"MIT"
] | null | null | null | src/data/pokedex_reader.py | justingolden21/pogo | 5b7e3e3a4244a7e1a372e21e2e136f28d1b1122a | [
"MIT"
] | null | null | null | src/data/pokedex_reader.py | justingolden21/pogo | 5b7e3e3a4244a7e1a372e21e2e136f28d1b1122a | [
"MIT"
] | null | null | null | from urllib.request import urlopen
import json
url = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-json-pokedex/master/output/pokemon.json"
response = urlopen(url)
final_data = []
json_data = json.loads(response.read())
for p in json_data:
final_data.append({
'dex': p['dex'],
... | 35.4375 | 113 | 0.608466 | from urllib.request import urlopen
import json
url = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-json-pokedex/master/output/pokemon.json"
response = urlopen(url)
final_data = []
json_data = json.loads(response.read())
for p in json_data:
final_data.append({
'dex': p['dex'],
... | true | true |
f745bb1bfbb39502b4e78edca4f584761878e994 | 7,109 | py | Python | pyathena/util.py | kanga333/PyAthena | 487baa66ae203c3541d37191600f1f3219a2e1ac | [
"MIT"
] | null | null | null | pyathena/util.py | kanga333/PyAthena | 487baa66ae203c3541d37191600f1f3219a2e1ac | [
"MIT"
] | null | null | null | pyathena/util.py | kanga333/PyAthena | 487baa66ae203c3541d37191600f1f3219a2e1ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import threading
import re
import uuid
import tenacity
from past.builtins import xrange
from tenacity import (after_log, retry_if_exception,
stop_after_attempt, ... | 33.065116 | 90 | 0.61598 |
from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import threading
import re
import uuid
import tenacity
from past.builtins import xrange
from tenacity import (after_log, retry_if_exception,
stop_after_attempt, wait_exponential)
from... | true | true |
f745bb30ab7214a23de64755b51931ce39cdf9ca | 3,370 | py | Python | ZSSGAN/utils/svm.py | 1170300521/StyleGAN-nada | 1b6dc2d7dcbc37dd2e29af2f8b59d7635e6a26ec | [
"MIT"
] | null | null | null | ZSSGAN/utils/svm.py | 1170300521/StyleGAN-nada | 1b6dc2d7dcbc37dd2e29af2f8b59d7635e6a26ec | [
"MIT"
] | null | null | null | ZSSGAN/utils/svm.py | 1170300521/StyleGAN-nada | 1b6dc2d7dcbc37dd2e29af2f8b59d7635e6a26ec | [
"MIT"
] | null | null | null | import numpy as np
from sklearn import svm
def train_boundary(pos_codes, neg_codes, split_ratio=0.7):
pos_ids = np.arange(len(pos_codes))
np.random.shuffle(pos_ids)
train_pos_num = int(len(pos_ids) * split_ratio)
train_pos_codes = pos_codes[pos_ids[:train_pos_num]]
val_pos_codes = pos_codes[pos_id... | 48.142857 | 141 | 0.688427 | import numpy as np
from sklearn import svm
def train_boundary(pos_codes, neg_codes, split_ratio=0.7):
pos_ids = np.arange(len(pos_codes))
np.random.shuffle(pos_ids)
train_pos_num = int(len(pos_ids) * split_ratio)
train_pos_codes = pos_codes[pos_ids[:train_pos_num]]
val_pos_codes = pos_codes[pos_id... | true | true |
f745bb5229c790bd55517c632a803296f84c82c4 | 1,350 | py | Python | final/170401073/client.py | ismailaltayy/blm304 | c242abdc8fccdb9f9e20705157551d15fe1efbf1 | [
"Unlicense"
] | null | null | null | final/170401073/client.py | ismailaltayy/blm304 | c242abdc8fccdb9f9e20705157551d15fe1efbf1 | [
"Unlicense"
] | null | null | null | final/170401073/client.py | ismailaltayy/blm304 | c242abdc8fccdb9f9e20705157551d15fe1efbf1 | [
"Unlicense"
] | null | null | null | #Mehmet Salih Çelik 170401073
import socket
import datetime
import os
import time
import sys
ipiste=str(input("Sunucunun ip adresini giriniz :"))
HOST = ipiste
PORT = 142
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
a=time.time()
data = s.recv(1024)
... | 24.107143 | 95 | 0.67037 |
import socket
import datetime
import os
import time
import sys
ipiste=str(input("Sunucunun ip adresini giriniz :"))
HOST = ipiste
PORT = 142
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
a=time.time()
data = s.recv(1024)
b=time.time()
data=d... | true | true |
f745bc73c1d06793298bb84a8d39127380e53e66 | 280 | py | Python | pymarketstore/__init__.py | ncheikh/pymarketstore | bfac7883af7b13db460aa509f00ccf9102ead2e3 | [
"Apache-2.0"
] | null | null | null | pymarketstore/__init__.py | ncheikh/pymarketstore | bfac7883af7b13db460aa509f00ccf9102ead2e3 | [
"Apache-2.0"
] | null | null | null | pymarketstore/__init__.py | ncheikh/pymarketstore | bfac7883af7b13db460aa509f00ccf9102ead2e3 | [
"Apache-2.0"
] | null | null | null | from .client import Client # noqa
from .params import Params, ListSymbolsFormat # noqa
from .jsonrpc_client import MsgpackRpcClient # noqa
from .grpc_client import GRPCClient # noqa
# alias
Param = Params # noqa
from .stream import StreamConn # noqa
__version__ = '0.18'
| 23.333333 | 53 | 0.757143 | from .client import Client
from .params import Params, ListSymbolsFormat
from .jsonrpc_client import MsgpackRpcClient
from .grpc_client import GRPCClient
Param = Params
from .stream import StreamConn
__version__ = '0.18'
| true | true |
f745bcec8d593210c1b4d45842f761b0a279416a | 7,510 | py | Python | main.py | Giuseppe5/pytorch-ocr | f8e89295e911c7a3eec6e3aa13335c031cd3adfe | [
"Apache-2.0"
] | 33 | 2018-08-21T03:06:08.000Z | 2021-10-10T08:13:35.000Z | main.py | Giuseppe5/pytorch-ocr | f8e89295e911c7a3eec6e3aa13335c031cd3adfe | [
"Apache-2.0"
] | 4 | 2019-03-19T04:18:21.000Z | 2020-12-07T11:25:16.000Z | main.py | Giuseppe5/pytorch-ocr | f8e89295e911c7a3eec6e3aa13335c031cd3adfe | [
"Apache-2.0"
] | 14 | 2018-09-18T14:06:06.000Z | 2022-01-25T11:18:08.000Z | # Copyright (c) 2018, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | 45.792683 | 145 | 0.71518 |
import argparse
import json
import os
import torch
import numpy as np
from ocr import PytorchOCRTrainer
torch.backends.cudnn.enabled = False
torch.set_printoptions(precision=10)
class objdict(dict):
def __getattr__(self, name):
if name in self:
return self[name]
... | true | true |
f745bd562bd747d6576f8be43de326d57d3ec63f | 1,936 | py | Python | homeassistant/components/pocketcasts/sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/pocketcasts/sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/pocketcasts/sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for Pocket Casts."""
from datetime import timedelta
import logging
from pycketcasts import pocketcasts
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validati... | 28.057971 | 84 | 0.682851 | from datetime import timedelta
import logging
from pycketcasts import pocketcasts
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getL... | true | true |
f745bd6904723b2c6e66c28b1272301945670b33 | 1,900 | py | Python | display_hdf5.py | alsmeirelles/ResRep | abc8d221cfa153de577ca1bbba515cc7abb94378 | [
"MIT"
] | null | null | null | display_hdf5.py | alsmeirelles/ResRep | abc8d221cfa153de577ca1bbba515cc7abb94378 | [
"MIT"
] | null | null | null | display_hdf5.py | alsmeirelles/ResRep | abc8d221cfa153de577ca1bbba515cc7abb94378 | [
"MIT"
] | null | null | null | from utils.misc import read_hdf5
from utils.misc import extract_deps_from_weights_file
import sys
import numpy as np
wf = sys.argv[1]
deps = extract_deps_from_weights_file(wf)
di = read_hdf5(wf)
num_kernel_params = 0
conv_kernel_cnt = 0
matrix_param_cnt = 0
vec_param_cnt = 0
bias_cnt = 0
beta_cnt = 0
gamma_cnt = 0
m... | 32.758621 | 126 | 0.608947 | from utils.misc import read_hdf5
from utils.misc import extract_deps_from_weights_file
import sys
import numpy as np
wf = sys.argv[1]
deps = extract_deps_from_weights_file(wf)
di = read_hdf5(wf)
num_kernel_params = 0
conv_kernel_cnt = 0
matrix_param_cnt = 0
vec_param_cnt = 0
bias_cnt = 0
beta_cnt = 0
gamma_cnt = 0
m... | true | true |
f745bde6b0ea73a8714799c958929e7b29d1411b | 179 | py | Python | aalert/config.py | nravic/py-amber_alert | cbe0446e6bbc5c1bd02d02383779e4daad600db5 | [
"MIT"
] | 4 | 2016-07-02T09:12:42.000Z | 2016-12-08T13:41:30.000Z | aalert/config.py | nravic/py-amber_alert | cbe0446e6bbc5c1bd02d02383779e4daad600db5 | [
"MIT"
] | null | null | null | aalert/config.py | nravic/py-amber_alert | cbe0446e6bbc5c1bd02d02383779e4daad600db5 | [
"MIT"
] | null | null | null | DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://scire@localhost/testing_environ'
SECRET_KEY = 'something_secret'
BCRYPT_LOG_ROUNDS = 12
SQLALCHEMY_TRACK_MODIFICATIONS = True
| 29.833333 | 72 | 0.837989 | DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://scire@localhost/testing_environ'
SECRET_KEY = 'something_secret'
BCRYPT_LOG_ROUNDS = 12
SQLALCHEMY_TRACK_MODIFICATIONS = True
| true | true |
f745bea55be7bc50bd089f0de9013d3a4778b03b | 686 | py | Python | setup.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | setup.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | setup.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# Allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-wordcensor',
pa... | 28.583333 | 78 | 0.674927 |
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-wordcensor',
packages = find_packages(),
version='0.1',
description='D... | true | true |
f745bfdd3b42e18240e741339c0021135483a70b | 136,341 | py | Python | lingvo/tasks/car/input_preprocessors.py | xsppp/gpipe_with_Mnist | 4486e675c7b52c7519a6d39f97e9b22ed5461944 | [
"Apache-2.0"
] | 1 | 2020-10-19T06:14:06.000Z | 2020-10-19T06:14:06.000Z | lingvo/tasks/car/input_preprocessors.py | albertsh10/lingvo | 5cd8aff375e7f8fc3c6fb065ce3f40854eb6f31a | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/car/input_preprocessors.py | albertsh10/lingvo | 5cd8aff375e7f8fc3c6fb065ce3f40854eb6f31a | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 38.212164 | 80 | 0.678402 |
from lingvo import compat as tf
from lingvo.core import base_layer
from lingvo.core import py_utils
from lingvo.core import schedule
from lingvo.tasks.car import car_lib
from lingvo.tasks.car import detection_3d_lib
from lingvo.tasks.car import geometry
from lingvo.tasks.car import ops
import numpy as n... | true | true |
f745c19a8067d383c92cc57e87b4c864b16e58fb | 28,243 | py | Python | gdal/swig/python/samples/gdalpythonserver.py | trundev/gdal | d5777940975f2784980ef0b7561eeeb655fd0ab5 | [
"MIT"
] | 2 | 2018-03-22T22:31:00.000Z | 2021-07-16T01:34:47.000Z | gdal/swig/python/samples/gdalpythonserver.py | trundev/gdal | d5777940975f2784980ef0b7561eeeb655fd0ab5 | [
"MIT"
] | 3 | 2019-02-27T00:43:06.000Z | 2019-06-28T21:57:10.000Z | gdal/swig/python/samples/gdalpythonserver.py | trundev/gdal | d5777940975f2784980ef0b7561eeeb655fd0ab5 | [
"MIT"
] | 1 | 2021-04-26T14:47:38.000Z | 2021-04-26T14:47:38.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# *****************************************************************************
# $Id$
#
# Project: GDAL
# Purpose: GDAL API_PROXY server written in Python
# Author: Even Rouault, <even dot rouault at spatialys.com>
#
# ******************************************************... | 32.538018 | 153 | 0.589243 |
import os
import struct
import sys
from osgeo import gdal
class GDALPythonServerRasterBand(object):
def __init__(self, gdal_band):
self.gdal_band = gdal_band
self.XSize = gdal_band.XSize
self.YSize = gdal_band.YSize
self.Band = gdal_band.GetBand()... | true | true |
f745c26a5ab7e82031bae20a05540a6f438dbde8 | 27,371 | py | Python | lime/lime_tabular.py | thegalang/lime | a4cd83e20c838c782728c02f07e21ab01d17f3fa | [
"BSD-2-Clause"
] | null | null | null | lime/lime_tabular.py | thegalang/lime | a4cd83e20c838c782728c02f07e21ab01d17f3fa | [
"BSD-2-Clause"
] | null | null | null | lime/lime_tabular.py | thegalang/lime | a4cd83e20c838c782728c02f07e21ab01d17f3fa | [
"BSD-2-Clause"
] | null | null | null | """
Functions for explaining classifiers that use tabular data (matrices).
"""
import collections
import copy
from functools import partial
import json
import warnings
import numpy as np
import sklearn
import sklearn.preprocessing
from sklearn.utils import check_random_state
from lime.discretize import QuartileDiscre... | 46.079125 | 94 | 0.598955 | import collections
import copy
from functools import partial
import json
import warnings
import numpy as np
import sklearn
import sklearn.preprocessing
from sklearn.utils import check_random_state
from lime.discretize import QuartileDiscretizer
from lime.discretize import DecileDiscretizer
from lime.discretize import... | true | true |
f745c30e8e7360e2bd396aa1f4a8435eed98d99d | 3,167 | py | Python | tests/misc/non_compliant.py | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 3,010 | 2017-01-07T23:43:33.000Z | 2022-03-31T06:02:59.000Z | tests/misc/non_compliant.py | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 4,478 | 2017-01-06T01:35:02.000Z | 2022-03-31T23:03:27.000Z | tests/misc/non_compliant.py | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 1,149 | 2017-01-09T00:35:23.000Z | 2022-03-31T21:24:29.000Z | # tests for things that are not implemented, or have non-compliant behaviour
try:
import array
import struct
except ImportError:
print("SKIP")
raise SystemExit
# when super can't find self
try:
exec("def f(): super()")
except SyntaxError:
print("SyntaxError")
# store to exception attribute is... | 20.301282 | 80 | 0.693716 |
try:
import array
import struct
except ImportError:
print("SKIP")
raise SystemExit
try:
exec("def f(): super()")
except SyntaxError:
print("SyntaxError")
# store to exception attribute is not allowed
try:
ValueError().x = 0
except AttributeError:
print("AttributeError")
# array del... | true | true |
f745c33aad1483cfc5453d188bbb73a7e31cbdef | 26,956 | py | Python | BaseTools/Source/Python/Eot/CParser4/CListener.py | GlovePuppet/edk2 | 8028f03032182f2c72e7699e1d14322bb5586581 | [
"BSD-2-Clause"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | BaseTools/Source/Python/Eot/CParser4/CListener.py | HouQiming/edk2 | ba07eef98ec49068d6453aba2aed73f6e7d7f600 | [
"BSD-2-Clause"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | BaseTools/Source/Python/Eot/CParser4/CListener.py | HouQiming/edk2 | ba07eef98ec49068d6453aba2aed73f6e7d7f600 | [
"BSD-2-Clause"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Generated from C.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CParser import CParser
else:
from CParser import CParser
## @file
# The file defines the parser for C source files.
#
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
# This ... | 33.074847 | 80 | 0.699659 |
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CParser import CParser
else:
from CParser import CParser
import Ecc.CodeFragment as CodeFragment
import Ecc.FileProfile as FileProfile
class CListener(ParseTreeListener):
Translation_unit(self,ctx):
... | true | true |
f745c374238e85d02dabf3c7fdf366e8e85436c8 | 2,653 | py | Python | flask_security/babel.py | antlarr/flask-security | e60e089288bb563df3d66dd9ac27b4952506062b | [
"MIT"
] | null | null | null | flask_security/babel.py | antlarr/flask-security | e60e089288bb563df3d66dd9ac27b4952506062b | [
"MIT"
] | null | null | null | flask_security/babel.py | antlarr/flask-security | e60e089288bb563df3d66dd9ac27b4952506062b | [
"MIT"
] | null | null | null | """
flask_security.babel
~~~~~~~~~~~~~~~~~~~~
I18N support for Flask-Security.
As of Flask-Babel 2.0.0 - it supports the Flask-BabelEx Domain extension - and it
is maintained. (Flask-BabelEx is no longer maintained). So we start with that,
then fall back to Flask-BabelEx, then fall back to a N... | 28.836957 | 85 | 0.601206 |
from flask import current_app
from .utils import config_value as cv
def has_babel_ext():
return current_app and "babel" in current_app.extensions
_domain_cls = None
try:
from flask_babel import Domain
import babel.support
_domain_cls = Domain
_dir_keyword = "translation_directories"
e... | true | true |
f745c4db5b050df9ed1a130f567e8d1522951d44 | 36,514 | py | Python | dynamics/dynamics.py | OllieBoyne/dog-dynamics | c472f984cb04e6dea932be6a42f4daaf174fb44c | [
"Apache-2.0"
] | 1 | 2020-10-04T18:40:23.000Z | 2020-10-04T18:40:23.000Z | dynamics/dynamics.py | OllieBoyne/dog-dynamics | c472f984cb04e6dea932be6a42f4daaf174fb44c | [
"Apache-2.0"
] | null | null | null | dynamics/dynamics.py | OllieBoyne/dog-dynamics | c472f984cb04e6dea932be6a42f4daaf174fb44c | [
"Apache-2.0"
] | null | null | null | """DEFINES THE INVERSEDYNAMICS SOLVER, A Solver for solving the joint based model of a dog."""
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
f... | 36.920121 | 194 | 0.691899 |
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
from dynamics.footfall_detector import FootfallDetector
from tqdm import tqdm
g = 9.81
freq_fo... | true | true |
f745c68cb1628be5bb8685f132df4cbb3d3c320f | 6,432 | py | Python | utils/video.py | gosticks/body-pose-animation | eb1b5876a845f277d43bfc18dcd48c4a9c694c06 | [
"MIT"
] | null | null | null | utils/video.py | gosticks/body-pose-animation | eb1b5876a845f277d43bfc18dcd48c4a9c694c06 | [
"MIT"
] | null | null | null | utils/video.py | gosticks/body-pose-animation | eb1b5876a845f277d43bfc18dcd48c4a9c694c06 | [
"MIT"
] | null | null | null | from dataset import SMPLyDataset
import pickle
from typing import Tuple
from model import SMPLyModel
from renderer import DefaultRenderer
import cv2
from tqdm import tqdm
import numpy as np
from scipy import interpolate
def make_video(images, video_name: str, fps=30, ext: str = "mp4", post_process_frame=None):
im... | 32.649746 | 116 | 0.619403 | from dataset import SMPLyDataset
import pickle
from typing import Tuple
from model import SMPLyModel
from renderer import DefaultRenderer
import cv2
from tqdm import tqdm
import numpy as np
from scipy import interpolate
def make_video(images, video_name: str, fps=30, ext: str = "mp4", post_process_frame=None):
im... | true | true |
f745c7568983625b7139e72ff059c2efc819ba09 | 3,360 | py | Python | homeassistant/components/airly/config_flow.py | Kalypox/core | ffc4941968bf68acedb063c884f2e268398085fd | [
"Apache-2.0"
] | null | null | null | homeassistant/components/airly/config_flow.py | Kalypox/core | ffc4941968bf68acedb063c884f2e268398085fd | [
"Apache-2.0"
] | 43 | 2020-12-21T08:16:47.000Z | 2022-03-31T06:05:04.000Z | homeassistant/components/airly/config_flow.py | Kalypox/core | ffc4941968bf68acedb063c884f2e268398085fd | [
"Apache-2.0"
] | null | null | null | """Adds config flow for Airly."""
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
HTTP_UNAUTHORIZED,
)
fro... | 31.401869 | 88 | 0.592857 | from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
HTTP_UNAUTHORIZED,
)
from homeassistant.helpers.aiohttp_cl... | true | true |
f745c8361aa8651dc0d07db1a3dbf09ced98d04d | 10,119 | py | Python | airflow/providers/hashicorp/secrets/vault.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | airflow/providers/hashicorp/secrets/vault.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | airflow/providers/hashicorp/secrets/vault.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 44.187773 | 109 | 0.66558 |
from typing import Optional
from airflow.providers.hashicorp._internal_client.vault_client import _VaultClient
from airflow.secrets import BaseSecretsBackend
from airflow.utils.log.logging_mixin import LoggingMixin
class VaultBackend(BaseSecretsBackend, LoggingMixin):
def __init__(
... | true | true |
f745c86319472fc3e6986d507c51dabb15ef48a7 | 353 | py | Python | plugins/labels/__init__.py | deeponion/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | 3 | 2018-09-29T13:50:29.000Z | 2019-05-18T23:09:44.000Z | plugins/labels/__init__.py | truongdoithuong/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | null | null | null | plugins/labels/__init__.py | truongdoithuong/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | 5 | 2018-09-29T13:50:34.000Z | 2020-11-21T12:46:41.000Z | from electrum_deeponion.i18n import _
fullname = _('LabelSync')
description = ' '.join([
_("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."),
_("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.")
])... | 35.3 | 122 | 0.733711 | from electrum_deeponion.i18n import _
fullname = _('LabelSync')
description = ' '.join([
_("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."),
_("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.")
])... | true | true |
f745cb5e3c1333f0bab35aa4e43e5f25c04a1c04 | 634 | py | Python | GraphLearning/src/distributed/torch.py | caditi97/exatrkx-ctd2020 | ed090ddfcc9e2e623fb45000fca71d5ad6ccf3b9 | [
"BSD-3-Clause-LBNL"
] | 6 | 2020-07-10T14:33:46.000Z | 2021-06-01T10:40:13.000Z | GraphLearning/src/distributed/torch.py | caditi97/exatrkx-ctd2020 | ed090ddfcc9e2e623fb45000fca71d5ad6ccf3b9 | [
"BSD-3-Clause-LBNL"
] | null | null | null | GraphLearning/src/distributed/torch.py | caditi97/exatrkx-ctd2020 | ed090ddfcc9e2e623fb45000fca71d5ad6ccf3b9 | [
"BSD-3-Clause-LBNL"
] | 4 | 2020-07-30T14:25:55.000Z | 2021-04-21T03:47:01.000Z | """Utility code for running native pytorch distributed"""
import os
import torch.distributed as dist
def init_workers_file():
rank = int(os.environ['SLURM_PROCID'])
n_ranks = int(os.environ['SLURM_NTASKS'])
sync_file = 'file:///tmp/%s_%s_pytorch_sync' % (
os.environ['USER'], os.environ['SLURM_JOB... | 30.190476 | 74 | 0.678233 |
import os
import torch.distributed as dist
def init_workers_file():
rank = int(os.environ['SLURM_PROCID'])
n_ranks = int(os.environ['SLURM_NTASKS'])
sync_file = 'file:///tmp/%s_%s_pytorch_sync' % (
os.environ['USER'], os.environ['SLURM_JOB_ID'])
dist.init_process_group(backend='nccl', world_s... | true | true |
f745cbad287f45184e13a3f265f913749e94fc20 | 1,018 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxr/init_exec_commands.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxr/init_exec_commands.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxr/init_exec_commands.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | '''IOSXR implementation of InitExecCommands class'''
class InitExecCommands(object):
"""InitExecCommands class
`InitExecCommands` class provides the functionality to retrieve the
platform specific initiation executed commands.
"""
def get_commands(self):
"""Method to return the list of ... | 28.277778 | 79 | 0.636542 |
class InitExecCommands(object):
def get_commands(self):
init_commands = ['term length 0', 'term width 0']
return init_commands | true | true |
f745cd4946f48dd0fae6848f226b80a6166a1f5f | 21,621 | py | Python | riptable/tests/test_accum2.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 307 | 2020-08-27T20:25:11.000Z | 2022-03-08T15:51:19.000Z | riptable/tests/test_accum2.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 206 | 2020-08-17T19:07:15.000Z | 2022-03-18T11:53:55.000Z | riptable/tests/test_accum2.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 10 | 2020-08-28T00:22:05.000Z | 2021-04-30T20:22:28.000Z | import unittest
import pandas as pd
import pytest
import riptable as rt
# N.B. TL;DR We have to import the actual implementation module to override the module global
# variable "tm.N" and "tm.K".
# In pandas 1.0 they move the code from pandas/util/testing.py to pandas/_testing.py.
# The "import ... | 39.027076 | 175 | 0.542019 | import unittest
import pandas as pd
import pytest
import riptable as rt
# our attempt to override the "tm.N" and "tm.K" will not change the actual value for
# makeTimeDataFrame, which will produce data with different shape and make the test
# "test_accum_table" fail. Maybe we want to reconsid... | true | true |
f745cd518e5ade7224b34ff114b0d59e6f29ec35 | 630 | py | Python | test/actions-none/gyptest-none.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | null | null | null | test/actions-none/gyptest-none.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | null | null | null | test/actions-none/gyptest-none.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | 3 | 2018-11-20T12:04:16.000Z | 2019-07-01T02:52:04.000Z | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies actions can be in 'none' type targets with source files.
"""
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'xcod... | 22.5 | 74 | 0.733333 |
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'xcode-ninja':
test.skip(bug=527)
test.run_gyp('none_with_source_files.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.build('none_with_source_files.gyp', chdir='relocate/src')
file_content = 'foo.cc\n'
test.built_file_must_match('fak... | true | true |
f745cf54c64152649d39a0a8864cfc85bea5c75c | 667 | py | Python | django/apps/photo/migrations/0030_auto_20181027_0035.py | Haakenlid/tassen | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 16 | 2017-03-21T03:53:37.000Z | 2021-08-14T06:28:02.000Z | django/apps/photo/migrations/0030_auto_20181027_0035.py | universitas/universitas.no | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 104 | 2017-03-25T00:12:46.000Z | 2021-03-09T22:40:58.000Z | django/apps/photo/migrations/0030_auto_20181027_0035.py | Haakenlid/tassen | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 6 | 2017-03-21T03:53:40.000Z | 2020-06-07T14:15:38.000Z | # Generated by Django 2.1.2 on 2018-10-26 22:35
from django.db import migrations
import apps.photo.cropping.boundingbox
import utils.model_fields
class Migration(migrations.Migration):
dependencies = [
('photo', '0029_auto_20181023_0021'),
]
operations = [
migrations.AlterField(
... | 24.703704 | 70 | 0.601199 |
from django.db import migrations
import apps.photo.cropping.boundingbox
import utils.model_fields
class Migration(migrations.Migration):
dependencies = [
('photo', '0029_auto_20181023_0021'),
]
operations = [
migrations.AlterField(
model_name='imagefile',
name=... | true | true |
f745cf7fa3052b54d18145658082a6b9f42d183d | 23 | py | Python | instance/config.py | DancunManyinsa/Personal-Blog | 700c72b56caa7a79f00b9b716d84c5be877d8cdb | [
"MIT"
] | null | null | null | instance/config.py | DancunManyinsa/Personal-Blog | 700c72b56caa7a79f00b9b716d84c5be877d8cdb | [
"MIT"
] | null | null | null | instance/config.py | DancunManyinsa/Personal-Blog | 700c72b56caa7a79f00b9b716d84c5be877d8cdb | [
"MIT"
] | 2 | 2019-11-30T10:33:16.000Z | 2021-02-03T06:29:40.000Z | SECRET_KEY = 'mysecret' | 23 | 23 | 0.782609 | SECRET_KEY = 'mysecret' | true | true |
f745d04598a5e311d9143b28e67384959d1735d6 | 537 | py | Python | strategy/strategies/crystalball/cbsub.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | strategy/strategies/crystalball/cbsub.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | strategy/strategies/crystalball/cbsub.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | # @date 2019-01-19
# @author Frederic Scherma, All rights reserved without prejudices.
# @license Copyright (c) 2019 Dream Overflow
# Crystal Ball strategy sub-strategy base class.
from strategy.timeframebasedsub import TimeframeBasedSub
class CrystalBallStrategySub(TimeframeBasedSub):
"""
Bitcoin Alpha sub ... | 29.833333 | 106 | 0.739292 |
from strategy.timeframebasedsub import TimeframeBasedSub
class CrystalBallStrategySub(TimeframeBasedSub):
def __init__(self, strategy_trader, params):
super().__init__(strategy_trader, params['timeframe'], params['depth'], params['history'], params)
self.setup_indicators(params)
| true | true |
f745d1f0390903b007e90853e8d7137c3b405da7 | 2,592 | py | Python | push_data_to_ccos/push_data_via_git.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 14 | 2020-02-07T22:46:02.000Z | 2021-02-28T16:10:16.000Z | push_data_to_ccos/push_data_via_git.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 83 | 2020-02-07T15:57:23.000Z | 2022-02-14T16:04:33.000Z | push_data_to_ccos/push_data_via_git.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 32 | 2020-02-24T21:08:40.000Z | 2021-04-12T12:22:32.000Z | #!/usr/bin/env python3
# vim: set fileencoding=utf-8:
# Standard library
import json
import logging
import os
# Third-party
import git
# First-party/Local
import log
GIT_USER_NAME = "CC creativecommons.github.io Bot"
GIT_USER_EMAIL = "cc-creativecommons-github-io-bot@creativecommons.org"
GITHUB_USERNAME = "cc-crea... | 30.139535 | 79 | 0.724537 |
import json
import logging
import os
import git
import log
GIT_USER_NAME = "CC creativecommons.github.io Bot"
GIT_USER_EMAIL = "cc-creativecommons-github-io-bot@creativecommons.org"
GITHUB_USERNAME = "cc-creativecommons-github-io-bot"
GITHUB_ORGANIZATION = "creativecommons"
GITHUB_REPO_NAME = "creativecommons... | true | true |
f745d355db6932cdcb41af5ad3cfa1ebfbde2540 | 9,561 | py | Python | tests/python/unittest/test_io.py | ishandutta2007/incubator-mxnet | 54a3c58c49fdfac595a348301b6f0701db09d4ab | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_io.py | ishandutta2007/incubator-mxnet | 54a3c58c49fdfac595a348301b6f0701db09d4ab | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_io.py | ishandutta2007/incubator-mxnet | 54a3c58c49fdfac595a348301b6f0701db09d4ab | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.767273 | 150 | 0.594185 |
import mxnet as mx
from mxnet.test_utils import *
import numpy as np
import os, gzip
import pickle as pickle
import time
try:
import h5py
except ImportError:
h5py = None
import sys
from common import get_data
import unittest
def test_MNISTIter():
get_data.GetMNIST_ubyte()
batch... | true | true |
f745d4a9f9a19444a1c1a71f3efede1b708de820 | 735 | py | Python | Secao 3 - Pre-processamento com Pandas e scikit-learm/template_credit_data.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 7b8188b6e7003426ae3a6d46d91d61494135a2b7 | [
"MIT"
] | null | null | null | Secao 3 - Pre-processamento com Pandas e scikit-learm/template_credit_data.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 7b8188b6e7003426ae3a6d46d91d61494135a2b7 | [
"MIT"
] | null | null | null | Secao 3 - Pre-processamento com Pandas e scikit-learm/template_credit_data.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 7b8188b6e7003426ae3a6d46d91d61494135a2b7 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
base = pd.read_csv('credit_data.csv')
base.loc[base.age < 0, 'age'] = 40.92
previsores = base.iloc[:, 1:4].values
classe = base.iloc[:, 4].values
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values = np.nan, strategy = 'mean')
imputer ... | 35 | 145 | 0.761905 | import pandas as pd
import numpy as np
base = pd.read_csv('credit_data.csv')
base.loc[base.age < 0, 'age'] = 40.92
previsores = base.iloc[:, 1:4].values
classe = base.iloc[:, 4].values
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values = np.nan, strategy = 'mean')
imputer ... | true | true |
f745d5ddebe2b30246598f896777b20a69768059 | 879 | py | Python | train_test_split.py | tomvdon/lidar-bonnetal | 0bb78eb9a731e98e6f3b893d735b6c3ca96cb0e8 | [
"MIT"
] | null | null | null | train_test_split.py | tomvdon/lidar-bonnetal | 0bb78eb9a731e98e6f3b893d735b6c3ca96cb0e8 | [
"MIT"
] | null | null | null | train_test_split.py | tomvdon/lidar-bonnetal | 0bb78eb9a731e98e6f3b893d735b6c3ca96cb0e8 | [
"MIT"
] | null | null | null | import shutil
import os
import glob
import numpy as np
from sklearn.model_selection import train_test_split
import shutil
import re
clouds = glob.glob('range_images/point_cloud_*.pcd')
train, test = train_test_split(clouds, test_size=0.20, random_state=42)
for file in train:
shutil.copy(file, "simulated_data/seque... | 38.217391 | 77 | 0.662116 | import shutil
import os
import glob
import numpy as np
from sklearn.model_selection import train_test_split
import shutil
import re
clouds = glob.glob('range_images/point_cloud_*.pcd')
train, test = train_test_split(clouds, test_size=0.20, random_state=42)
for file in train:
shutil.copy(file, "simulated_data/seque... | true | true |
f745d61facecf176819f6e0b1334bf6b5d46de14 | 29,170 | py | Python | tests/unittests/test_network_install.py | cloudify-cosmo/cloudify-nsx-plugin | d7b2abbe384e55aaf47b2c8474ab07f622eb83b5 | [
"Apache-2.0"
] | 2 | 2017-03-08T21:44:54.000Z | 2019-01-16T06:00:16.000Z | tests/unittests/test_network_install.py | cloudify-cosmo/cloudify-nsx-plugin | d7b2abbe384e55aaf47b2c8474ab07f622eb83b5 | [
"Apache-2.0"
] | 3 | 2017-01-26T13:26:31.000Z | 2017-02-03T14:51:45.000Z | tests/unittests/test_network_install.py | cloudify-cosmo/cloudify-nsx-plugin | d7b2abbe384e55aaf47b2c8474ab07f622eb83b5 | [
"Apache-2.0"
] | 5 | 2016-12-28T15:26:02.000Z | 2017-01-30T08:46:10.000Z | # Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 37.63871 | 77 | 0.472335 |
import unittest
import library.test_nsx_base as test_nsx_base
import pytest
import mock
import copy
import cloudify_nsx.network.dhcp_bind as dhcp_bind
import cloudify_nsx.network.dhcp_pool as dhcp_pool
import cloudify_nsx.network.dlr_dgw as dlr_dgw
import cloudify_nsx.network.bgp_neighbour_filter as bgp_ne... | true | true |
f745d672c6c8846c0f310d6ee2c69fa724a275f0 | 2,342 | py | Python | aydin/util/nsi/demo/nearest_self_image.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/util/nsi/demo/nearest_self_image.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/util/nsi/demo/nearest_self_image.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | # flake8: noqa
import numpy as np
from skimage.data import camera
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import (
normalise,
add_noise,
dots,
lizard,
pollen,
characters,
cropped_newyork,
)
from aydin.it.fgr import ImageTranslatorFGR
from... | 30.025641 | 78 | 0.726302 |
import numpy as np
from skimage.data import camera
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import (
normalise,
add_noise,
dots,
lizard,
pollen,
characters,
cropped_newyork,
)
from aydin.it.fgr import ImageTranslatorFGR
from aydin.it.tran... | true | true |
f745d776fc18e571e903bb228b2471bc4e734ac6 | 4,746 | py | Python | build/PureCloudPlatformClientV2/models/validation_service_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | build/PureCloudPlatformClientV2/models/validation_service_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | build/PureCloudPlatformClientV2/models/validation_service_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 30.229299 | 139 | 0.599031 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class ValidationServiceRequest(object):
def __init__(self):
self.swagger_types = {
'date_import_ended': 'datetime',
'file_url': 'str'
}
self... | true | true |
f745d7a939a7a0b447f7b70b5cf5b95b31066f21 | 3,440 | py | Python | venv/Lib/site-packages/django_tables2/export/export.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/django_tables2/export/export.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/django_tables2/export/export.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | null | null | null | from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
try:
from tablib import Dataset
except ImportError: # pragma: no cover
raise ImproperlyConfigured(
"You must have tablib installed in order to use the django-tables2 export functionality"
)
class TableEx... | 32.45283 | 96 | 0.629942 | from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
try:
from tablib import Dataset
except ImportError:
raise ImproperlyConfigured(
"You must have tablib installed in order to use the django-tables2 export functionality"
)
class TableExport:
CSV = "... | true | true |
f745d7ae46fba7a5afcd08f46d3722c6e6d8dfb1 | 241 | py | Python | service-workers/service-worker/resources/subdir/import-scripts-echo.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | service-workers/service-worker/resources/subdir/import-scripts-echo.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 7,642 | 2018-05-28T09:38:03.000Z | 2022-03-31T20:55:48.000Z | service-workers/service-worker/resources/subdir/import-scripts-echo.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | def main(req, res):
return ([
(b'Cache-Control', b'no-cache, must-revalidate'),
(b'Pragma', b'no-cache'),
(b'Content-Type', b'application/javascript')],
b'echo_output = "%s (subdir/)";\n' % req.GET[b'msg'])
| 34.428571 | 59 | 0.551867 | def main(req, res):
return ([
(b'Cache-Control', b'no-cache, must-revalidate'),
(b'Pragma', b'no-cache'),
(b'Content-Type', b'application/javascript')],
b'echo_output = "%s (subdir/)";\n' % req.GET[b'msg'])
| true | true |
f745d7c7ffa63d00938ca01b5141bd3eae2a4609 | 9,892 | py | Python | tests/test_modeling_flax_vit.py | arunraja-hub/transformers | eb2e006b35938e7b6476d3bfc55343ebfe5ec501 | [
"Apache-2.0"
] | 101 | 2021-12-22T00:03:51.000Z | 2022-03-30T07:39:09.000Z | tests/test_modeling_flax_vit.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 13 | 2020-10-13T11:41:11.000Z | 2022-02-16T14:13:31.000Z | tests/test_modeling_flax_vit.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 13 | 2020-10-04T05:06:00.000Z | 2022-02-09T01:14:59.000Z | # Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 40.876033 | 117 | 0.676911 |
import inspect
import unittest
import numpy as np
from transformers import ViTConfig, is_flax_available
from transformers.testing_utils import require_flax, slow
from .test_configuration_common import ConfigTester
from .test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor
if is_flax_a... | true | true |
f745d819eb3e31a23392b891ea6e03082255202e | 697 | py | Python | commands/gay.py | DiscordHackers/BetterBot-1.0.2.2 | bf9b5b3368c654bcc4bf144572a7d331e154abe2 | [
"Apache-2.0"
] | null | null | null | commands/gay.py | DiscordHackers/BetterBot-1.0.2.2 | bf9b5b3368c654bcc4bf144572a7d331e154abe2 | [
"Apache-2.0"
] | null | null | null | commands/gay.py | DiscordHackers/BetterBot-1.0.2.2 | bf9b5b3368c654bcc4bf144572a7d331e154abe2 | [
"Apache-2.0"
] | null | null | null | import disnake as discord
import random
from disnake.ext import commands
from api.check import utils, block
from api.server import base, main
class Gay(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@block.block()
async def gay(self, ctx, user: discord.Me... | 27.88 | 172 | 0.680057 | import disnake as discord
import random
from disnake.ext import commands
from api.check import utils, block
from api.server import base, main
class Gay(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@block.block()
async def gay(self, ctx, user: discord.Me... | true | true |
f745d846d970f31dadaaae955208983cff0a8ca5 | 2,241 | py | Python | powerline_shell/segments/fossil.py | Dakedres/powerline-shell | 352d26846aa5d3beb6c92ee26588536bc399117c | [
"MIT"
] | 2,656 | 2017-11-28T05:11:53.000Z | 2022-03-31T14:10:18.000Z | powerline_shell/segments/fossil.py | jceaser/powerline-shell | a9b8c9bb39dbfb7ec3c639e497b5a76fa6dcb8cc | [
"MIT"
] | 193 | 2017-11-28T23:20:17.000Z | 2022-03-25T12:57:55.000Z | powerline_shell/segments/fossil.py | jceaser/powerline-shell | a9b8c9bb39dbfb7ec3c639e497b5a76fa6dcb8cc | [
"MIT"
] | 387 | 2017-11-29T22:33:39.000Z | 2022-03-31T18:24:35.000Z | import os
import subprocess
from ..utils import RepoStats, ThreadedSegment, get_subprocess_env
def _get_fossil_branch():
branches = os.popen("fossil branch 2>/dev/null").read().strip().split("\n")
return ''.join([
i.replace('*','').strip()
for i in branches
if i.startswith('*')
])
... | 31.125 | 79 | 0.594824 | import os
import subprocess
from ..utils import RepoStats, ThreadedSegment, get_subprocess_env
def _get_fossil_branch():
branches = os.popen("fossil branch 2>/dev/null").read().strip().split("\n")
return ''.join([
i.replace('*','').strip()
for i in branches
if i.startswith('*')
])
... | true | true |
f745dbb9b6d6eba54e7dced54edf0a1fc7b852d7 | 238 | py | Python | winton_kafka_streams/state/__init__.py | jkramarz/winton-kafka-streams | 22526da71454a8b9c7bba53e4f59f645535de602 | [
"Apache-2.0"
] | null | null | null | winton_kafka_streams/state/__init__.py | jkramarz/winton-kafka-streams | 22526da71454a8b9c7bba53e4f59f645535de602 | [
"Apache-2.0"
] | null | null | null | winton_kafka_streams/state/__init__.py | jkramarz/winton-kafka-streams | 22526da71454a8b9c7bba53e4f59f645535de602 | [
"Apache-2.0"
] | null | null | null | """
import state will import all possible pre-defined state classes
"""
from .simple import SimpleStore
from .in_memory_key_value_store import InMemoryKeyValueStore
from .change_logging_key_value_store import ChangeLoggingKeyValueStore
| 26.444444 | 70 | 0.852941 |
from .simple import SimpleStore
from .in_memory_key_value_store import InMemoryKeyValueStore
from .change_logging_key_value_store import ChangeLoggingKeyValueStore
| true | true |
f745dc4a7c1d0d482ce3a62777d7918a081b47d5 | 3,453 | py | Python | myproject/myproject/settings.py | scaraclette/WebBoard | e35cec96589063e75fcba52898fadfa4e3f961fd | [
"MIT"
] | 1 | 2019-12-14T20:32:17.000Z | 2019-12-14T20:32:17.000Z | myproject/myproject/settings.py | scaraclette/WebBoard | e35cec96589063e75fcba52898fadfa4e3f961fd | [
"MIT"
] | 5 | 2021-03-19T08:34:20.000Z | 2022-02-10T10:15:32.000Z | myproject/myproject/settings.py | scaraclette/WebBoard | e35cec96589063e75fcba52898fadfa4e3f961fd | [
"MIT"
] | null | null | null | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 25.389706 | 91 | 0.692152 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@s&a-qn-&2k$&=^hva*0j%1sku8=y*)pjr!p$)ociyb^m#czmp'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f745dcc43706f2a2de37f9e5ac7978230a1da325 | 607 | py | Python | part3_rclpy_basic/part3_3_py_original_msg_example/setup.py | Ar-Ray-code/rclpy_tutorial | be14741eb88154653c7c559ee3736a01f742a735 | [
"Apache-2.0"
] | 1 | 2021-06-08T06:53:21.000Z | 2021-06-08T06:53:21.000Z | part3_rclpy_basic/part3_3_py_original_msg_example/setup.py | Ar-Ray-code/rclpy_tutorial | be14741eb88154653c7c559ee3736a01f742a735 | [
"Apache-2.0"
] | null | null | null | part3_rclpy_basic/part3_3_py_original_msg_example/setup.py | Ar-Ray-code/rclpy_tutorial | be14741eb88154653c7c559ee3736a01f742a735 | [
"Apache-2.0"
] | null | null | null | import os
from glob import glob
from setuptools import setup, find_packages
package_name = 'part3_3_py_original_msg_example'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name])... | 26.391304 | 81 | 0.629325 | import os
from glob import glob
from setuptools import setup, find_packages
package_name = 'part3_3_py_original_msg_example'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name])... | true | true |
f745dcf95b41499211d2770245293430a21e9937 | 3,741 | py | Python | pmagpy/controlled_vocabularies2.py | yamamon75/PmagPy | fa5b189800a239683fc17c6b312cdfdd839a46c3 | [
"BSD-3-Clause"
] | null | null | null | pmagpy/controlled_vocabularies2.py | yamamon75/PmagPy | fa5b189800a239683fc17c6b312cdfdd839a46c3 | [
"BSD-3-Clause"
] | null | null | null | pmagpy/controlled_vocabularies2.py | yamamon75/PmagPy | fa5b189800a239683fc17c6b312cdfdd839a46c3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import json
import os
from builtins import object
import pandas as pd
from pandas import Series
from . import find_pmag_dir
pmag_dir = find_pmag_dir.get_pmag_dir()
data_model_dir = os.path.join(pmag_dir, 'pmagpy', 'dat... | 36.320388 | 105 | 0.660251 |
from __future__ import print_function
from __future__ import absolute_import
import json
import os
from builtins import object
import pandas as pd
from pandas import Series
from . import find_pmag_dir
pmag_dir = find_pmag_dir.get_pmag_dir()
data_model_dir = os.path.join(pmag_dir, 'pmagpy', 'data_model')
if not os... | true | true |
f745e12e75a47013f92b584a44b3eff975b6403c | 12,254 | py | Python | temporalio/api/operatorservice/v1/request_response_pb2.py | cretz/temporal-sdk-python | 431ca1967d365556a9cf5aa9aac00243b71059f8 | [
"MIT"
] | 55 | 2022-01-31T22:02:22.000Z | 2022-03-30T11:17:21.000Z | temporalio/api/operatorservice/v1/request_response_pb2.py | cretz/temporal-sdk-python | 431ca1967d365556a9cf5aa9aac00243b71059f8 | [
"MIT"
] | 7 | 2022-02-04T14:08:46.000Z | 2022-03-22T13:27:30.000Z | temporalio/api/operatorservice/v1/request_response_pb2.py | cretz/temporal-sdk-python | 431ca1967d365556a9cf5aa9aac00243b71059f8 | [
"MIT"
] | 4 | 2022-01-31T17:31:49.000Z | 2022-03-29T01:04:46.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: temporal/api/operatorservice/v1/request_response.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.prot... | 55.198198 | 1,958 | 0.798188 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Def... | true | true |
f745e13b65b12b3ad749b5364d4f3befcd02b56b | 10,762 | py | Python | tests/integration/states/pkg.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | 1 | 2015-08-20T21:55:17.000Z | 2015-08-20T21:55:17.000Z | tests/integration/states/pkg.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | tests/integration/states/pkg.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
tests for pkg state
'''
# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath,
requires_system_grains,
requires_salt_modules
)
ensure_in_syspath('../../')
# Import python libs
import os
import time
#... | 38.028269 | 81 | 0.630366 |
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath,
requires_system_grains,
requires_salt_modules
)
ensure_in_syspath('../../')
import os
import time
import integration
import salt.utils
_PKG_TARGETS = {
'Arch': ['python2-django', 'libpng'],
... | true | true |
f745e219c5457a73c962d6a32bfb8338d1280c50 | 5,644 | py | Python | backend/bot.py | loehnertz/telegram-voicemail-bot | bedd6a4c79b696a420d558258d92d3808b577c2f | [
"MIT"
] | 2 | 2020-03-18T11:28:36.000Z | 2020-09-14T07:27:00.000Z | backend/bot.py | loehnertz/telegram-voicemail-bot | bedd6a4c79b696a420d558258d92d3808b577c2f | [
"MIT"
] | null | null | null | backend/bot.py | loehnertz/telegram-voicemail-bot | bedd6a4c79b696a420d558258d92d3808b577c2f | [
"MIT"
] | 1 | 2020-09-14T07:27:03.000Z | 2020-09-14T07:27:03.000Z | import json
import logging
import os
from datetime import datetime
from pathlib import Path
from telegram import ParseMode
from telegram.ext import Updater, MessageHandler, Filters
from uploader import Uploader
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
log... | 34.206061 | 118 | 0.666194 | import json
import logging
import os
from datetime import datetime
from pathlib import Path
from telegram import ParseMode
from telegram.ext import Updater, MessageHandler, Filters
from uploader import Uploader
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
log... | true | true |
f745e2720a7225f670cdfc49f01e505bca12db6c | 1,742 | py | Python | school/simpleApi/tests.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | school/simpleApi/tests.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | school/simpleApi/tests.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from simpleApi.models import Teacher, Student, Gradeable
class TeacherTestCase(TestCase):
def setUp(self):
s = Student.objects.create(username="student1", password="student", first_name="student")
Teacher... | 34.156863 | 97 | 0.643513 | from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from simpleApi.models import Teacher, Student, Gradeable
class TeacherTestCase(TestCase):
def setUp(self):
s = Student.objects.create(username="student1", password="student", first_name="student")
Teacher... | true | true |
f745e32a7277a7e36a3941fc84916671c1bd82c7 | 520 | py | Python | ecweb/migrations/0011_auto_20180103_0243.py | jamesperes/EC | c887a1a9f08ce5432d129f2c526f21d1a140ffa6 | [
"MIT"
] | 12 | 2017-12-12T00:09:34.000Z | 2018-01-31T03:21:10.000Z | ecweb/migrations/0011_auto_20180103_0243.py | jamesperes/EC | c887a1a9f08ce5432d129f2c526f21d1a140ffa6 | [
"MIT"
] | 19 | 2017-12-10T01:34:09.000Z | 2018-01-06T13:52:15.000Z | ecweb/migrations/0011_auto_20180103_0243.py | jamesperes/EC | c887a1a9f08ce5432d129f2c526f21d1a140ffa6 | [
"MIT"
] | 11 | 2017-12-10T15:35:48.000Z | 2017-12-29T12:16:09.000Z | # Generated by Django 2.0 on 2018-01-03 02:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecweb', '0010_event'),
]
operations = [
migrations.AlterField(
model_name='event',
name='end_event',
field... | 21.666667 | 51 | 0.561538 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecweb', '0010_event'),
]
operations = [
migrations.AlterField(
model_name='event',
name='end_event',
field=models.DateTimeField(blank=True),
),... | true | true |
f745e37628159f202886150b0229fec79760fa3a | 47,122 | py | Python | src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py | akashsinghal/azure-cli | 8ab2f7604a834de790bdea849b3e83f2466428b9 | [
"MIT"
] | 1 | 2016-09-15T23:10:48.000Z | 2016-09-15T23:10:48.000Z | src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py | akashsinghal/azure-cli | 8ab2f7604a834de790bdea849b3e83f2466428b9 | [
"MIT"
] | 1 | 2021-06-02T02:37:12.000Z | 2021-06-02T02:37:12.000Z | src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py | akashsinghal/azure-cli | 8ab2f7604a834de790bdea849b3e83f2466428b9 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 48.182004 | 249 | 0.604855 |
import json
import os
import time
import mock
import unittest
from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, create_random_name, live_only, reco... | true | true |
f745e39c3de4cf3d888870a2720a680aa12e32d9 | 10,951 | py | Python | certipy/request.py | balance1libra/Certipy | 9933c9493fef7c43d95da5cdcf59cb40d237e858 | [
"MIT"
] | 2 | 2021-10-10T07:33:44.000Z | 2021-11-09T10:46:55.000Z | certipy/request.py | rootsecdev/Certipy | 70a94feccfacdb27b170394ee30ca91f5a9cab2c | [
"MIT"
] | 2 | 2021-10-10T07:33:54.000Z | 2021-11-08T10:10:30.000Z | certipy/request.py | nittaya1990/Certipy | 70a94feccfacdb27b170394ee30ca91f5a9cab2c | [
"MIT"
] | null | null | null | # Certipy - Active Directory certificate abuse
#
# Description:
# Request a new certificate
#
# Authors:
# @ollypwn (https://github.com/ollypwn)
#
# References:
# https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-icpr/d98e6cfb-87ba-4915-b3ec-a1b7c6129a53
# https://docs.microsoft.com/en-us/openspec... | 34.221875 | 115 | 0.604054 |
import argparse
import logging
from typing import Tuple
from asn1crypto import algos, core, csr, keys, x509
try:
from Cryptodome.Hash import SHA256
from Cryptodome.PublicKey import RSA
from Cryptodome.Signature import PKCS1_v1_5
except ImportError:
from Crypto.Hash import SHA256
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.