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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c393cccf5d22a80a4b220c3f9f9f8cbfaeb97cf | 15,241 | py | Python | api/authority/digicert.py | ziegeer/autocert | 285df181508573918e280948e51cdd7c65743281 | [
"MIT"
] | null | null | null | api/authority/digicert.py | ziegeer/autocert | 285df181508573918e280948e51cdd7c65743281 | [
"MIT"
] | null | null | null | api/authority/digicert.py | ziegeer/autocert | 285df181508573918e280948e51cdd7c65743281 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import zipfile
from attrdict import AttrDict
from pprint import pprint, pformat
from fnmatch import fnmatch
from datetime import timedelta #FIXME: do we import this here?
from whois import whois
from tld import get_tld
from authority.base import AuthorityBase
f... | 44.826471 | 159 | 0.660127 |
import io
import zipfile
from attrdict import AttrDict
from pprint import pprint, pformat
from fnmatch import fnmatch
from datetime import timedelta
from whois import whois
from tld import get_tld
from authority.base import AuthorityBase
from utils.dictionary import merge, body
from utils.format import fmt, pfmt
f... | true | true |
1c393d14ea8f30150efe552dc96b3b2564573ec3 | 1,489 | py | Python | one_one.py | hduliufan/work | 951a69aad5de3387c26fabe417a939349def3df6 | [
"Apache-2.0"
] | null | null | null | one_one.py | hduliufan/work | 951a69aad5de3387c26fabe417a939349def3df6 | [
"Apache-2.0"
] | null | null | null | one_one.py | hduliufan/work | 951a69aad5de3387c26fabe417a939349def3df6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from getlen_bit import getlen
from begain import getbegain
from x1x2 import x1_x2
from exchange_normal import variation
from fitvalue import fitvalue
#计算精度(人为设定)0.001
s=0.0001
a1=-3
a2=4.1
b1=12.1
b2=5.8
#种群规模
N=20
#-3<=x1<=12.1 4.1<=x2<=5.8
#二进制长度t1,t2
t1=getlen(a1,... | 21.271429 | 50 | 0.58227 | import numpy as np
import matplotlib.pyplot as plt
from getlen_bit import getlen
from begain import getbegain
from x1x2 import x1_x2
from exchange_normal import variation
from fitvalue import fitvalue
s=0.0001
a1=-3
a2=4.1
b1=12.1
b2=5.8
N=20
t1=getlen(a1,b1,s)
t2=getlen(a2,b2,s)
t=t1+t2
pop=getbegain(N,t)
x1,x... | true | true |
1c393e0e4e5cdb3c7b762f7c9e41dfc5893cdb33 | 4,396 | py | Python | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/log_utils.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/log_utils.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/log_utils.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | import logging
import sys
#-----------------------------------------------------------------------------------------------------------#
import re
class BColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033... | 34.34375 | 109 | 0.541401 | import logging
import sys
import re
class BColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
WHITE = '\033[37m'
YELLOW = '\033[33m'
GREEN = '\033[32m'
BLUE ... | true | true |
1c393e1d3e1f2aa16049a35c535565eaac8e73ec | 1,170 | py | Python | checkov/cloudformation/checks/resource/aws/IAMPolicyAttachedToGroupOrRoles.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/cloudformation/checks/resource/aws/IAMPolicyAttachedToGroupOrRoles.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/cloudformation/checks/resource/aws/IAMPolicyAttachedToGroupOrRoles.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | from typing import List, Any
from checkov.cloudformation.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck
from checkov.common.models.consts import ANY_VALUE
from checkov.common.models.enums import CheckCategories
class IAMPolicyAttachedToGroupOrRoles(BaseResourceNegativeValueC... | 40.344828 | 119 | 0.749573 | from typing import List, Any
from checkov.cloudformation.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck
from checkov.common.models.consts import ANY_VALUE
from checkov.common.models.enums import CheckCategories
class IAMPolicyAttachedToGroupOrRoles(BaseResourceNegativeValueC... | true | true |
1c393e95a6ee0086c9f4971d40918cf5dc494fc7 | 8,021 | py | Python | opendatatools/stock/stock_interface.py | buf1024/OpenData | 6268a5f7bee88cc943b3a05858b8ab6f371e8e3b | [
"Apache-2.0"
] | null | null | null | opendatatools/stock/stock_interface.py | buf1024/OpenData | 6268a5f7bee88cc943b3a05858b8ab6f371e8e3b | [
"Apache-2.0"
] | null | null | null | opendatatools/stock/stock_interface.py | buf1024/OpenData | 6268a5f7bee88cc943b3a05858b8ab6f371e8e3b | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import datetime
from .stock_agent import SHExAgent, SZExAgent, CSIAgent, XueqiuAgent, SinaAgent, CNInfoAgent, EastMoneyAgent
from opendatatools.common import get_current_day
shex_agent = SHExAgent()
szex_agent = SZExAgent()
csi_agent = CSIAgent()
xq_agent = XueqiuAgent()
sina_agent = S... | 29.488971 | 127 | 0.642688 |
import datetime
from .stock_agent import SHExAgent, SZExAgent, CSIAgent, XueqiuAgent, SinaAgent, CNInfoAgent, EastMoneyAgent
from opendatatools.common import get_current_day
shex_agent = SHExAgent()
szex_agent = SZExAgent()
csi_agent = CSIAgent()
xq_agent = XueqiuAgent()
sina_agent = SinaAgent()
cninfo... | true | true |
1c393f3ee967e72fff88acc2c2b88e798cda569b | 62,343 | py | Python | pypsg/psg.py | AWehrhahn/PyPSG | adaa1e50998b3366541e16143034d6acdc379bb3 | [
"MIT"
] | null | null | null | pypsg/psg.py | AWehrhahn/PyPSG | adaa1e50998b3366541e16143034d6acdc379bb3 | [
"MIT"
] | null | null | null | pypsg/psg.py | AWehrhahn/PyPSG | adaa1e50998b3366541e16143034d6acdc379bb3 | [
"MIT"
] | null | null | null | # ---------------------------------------------------
# Planet Spectrum Generator Interface
# PSG multiple-scattering model: https://psg.gsfc.nasa.gov/helpmodel.php
# PSG databases: https://psg.gsfc.nasa.gov/helpatm.php
# PSG API driver: https://psg.gsfc.nasa.gov/helpapi.php
# ------------------------------------------... | 50.480162 | 332 | 0.643055 |
from io import StringIO
from os.path import dirname, join
import subprocess
from datetime import datetime
import re
import hashlib
from tempfile import NamedTemporaryFile
import numpy as np
from astropy.utils.data import (
import_file_to_cache,
download_file,
clear_download_cache,
is_url_in_cach... | true | true |
1c39411b639150078841ad88a31b978e89f9da7c | 13,757 | py | Python | src/models/test.py | nybupt/athena | 2808f5060831382e603e5dc5ec6a9e9d8901a3b2 | [
"MIT"
] | null | null | null | src/models/test.py | nybupt/athena | 2808f5060831382e603e5dc5ec6a9e9d8901a3b2 | [
"MIT"
] | 8 | 2020-09-25T22:32:00.000Z | 2022-02-10T01:17:17.000Z | src/models/test.py | nybupt/athena | 2808f5060831382e603e5dc5ec6a9e9d8901a3b2 | [
"MIT"
] | 1 | 2021-08-12T12:48:51.000Z | 2021-08-12T12:48:51.000Z | import os
import sys
import time
import numpy as np
from utils.config import *
from utils.util import *
def usage():
print(
"====================================================================================================================")
print(
"python <this script> samplesDir experime... | 36.490716 | 127 | 0.63902 | import os
import sys
import time
import numpy as np
from utils.config import *
from utils.util import *
def usage():
print(
"====================================================================================================================")
print(
"python <this script> samplesDir experime... | true | true |
1c39415d2831c402bbcfd6fc9987ca728401fb5c | 333,094 | py | Python | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 337 | 2016-02-11T07:36:35.000Z | 2018-12-10T07:17:35.000Z | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 127 | 2016-07-06T15:43:14.000Z | 2018-12-11T18:46:27.000Z | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 29 | 2016-10-05T14:15:28.000Z | 2018-11-29T10:17:00.000Z | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import io
import difflib
import base64
from typing import Iterable
import os
import math
import time
import itertools
import functools
import collections
import sys
import platform
import warnings
import re
from functools import reduce
import threa... | 45.887037 | 307 | 0.595706 |
from __future__ import division, print_function
import io
import difflib
import base64
from typing import Iterable
import os
import math
import time
import itertools
import functools
import collections
import sys
import platform
import warnings
import re
from functools import reduce
import threading
import six
import ... | true | true |
1c39437443bb429a67763236a1f6ec0fef6ababf | 2,494 | py | Python | tests/riscv/address_solving/RVC_misaligned_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/address_solving/RVC_misaligned_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/address_solving/RVC_misaligned_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 34.164384 | 97 | 0.60826 |
from riscv.EnvRISCV import EnvRISCV
from riscv.GenThreadRISCV import GenThreadRISCV
from base.Sequence import Sequence
RVC_load_store_instructions = {
"C.FLD##RISCV": 10,
"C.LD##RISCV": 10,
"C.LW##RISCV": 10,
"C.FLDSP##RISCV": 10,
"C.LDSP##RISCV": 10,
"C.LWSP##RISCV": 10,
... | true | true |
1c394495ee78dcc6978a8c9ea7280ee260d6dedc | 296 | py | Python | ex085c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | ex085c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | ex085c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | lista = [[], []]
for cont in range(0, 4):
numero = int(input(f'Número {cont + 1}: '))
if numero % 2 == 0:
lista[0].append(numero)
else:
lista[1].append(numero)
lista[0].sort()
lista[1].sort()
print(f'Números pares: {lista[0]}')
print(f'Números ímpares: {lista[1]}') | 21.142857 | 47 | 0.564189 | lista = [[], []]
for cont in range(0, 4):
numero = int(input(f'Número {cont + 1}: '))
if numero % 2 == 0:
lista[0].append(numero)
else:
lista[1].append(numero)
lista[0].sort()
lista[1].sort()
print(f'Números pares: {lista[0]}')
print(f'Números ímpares: {lista[1]}') | true | true |
1c39457a03a863ae96ea4251a04280ff26a408c8 | 7,773 | py | Python | meditemp.py | phseiff/MediTemp | cdbcf5b42894f250caa39145fb4c2318247c6761 | [
"MIT"
] | null | null | null | meditemp.py | phseiff/MediTemp | cdbcf5b42894f250caa39145fb4c2318247c6761 | [
"MIT"
] | null | null | null | meditemp.py | phseiff/MediTemp | cdbcf5b42894f250caa39145fb4c2318247c6761 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
You gotta run this with sudo!!
optional arguments:
* supply with --no-notifs if you don't want to use telegram-sent to get notifications.
* supply with --no-logfile to disable printing.
* supply with --no-gnuplot to disable gnuplot.
For a full documentation on how to use this and how to set it... | 33.076596 | 117 | 0.586646 |
import sys
import os
import time
from datetime import datetime
import subprocess
import re
import urllib.parse
import shutil
import pwd
import getpass
import traceback
import warnings
import textwrap
import temper
if "--no-notifs" not in sys.argv:
import telegram_send
ALREADY_DETECTED_INFUNCTIONAL_GNUPLOT = ... | true | true |
1c39458530ceec542f15fe8ab7a396f63b750c45 | 1,210 | py | Python | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import setti... | 30.25 | 79 | 0.673554 | from __future__ import unicode_literals
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import settings, views
from wiki.pl... | true | true |
1c3945eae691de7baaef4774b2e28e69f9ac26a3 | 2,763 | py | Python | src/valiant/repositories/factory.py | pomes/valiant | 786d417a7903d40e54136f645fdbe51575612902 | [
"MIT"
] | 2 | 2020-11-11T00:13:32.000Z | 2021-04-26T08:31:28.000Z | src/valiant/repositories/factory.py | pomes/valiant | 786d417a7903d40e54136f645fdbe51575612902 | [
"MIT"
] | 10 | 2020-03-15T00:09:23.000Z | 2021-06-10T22:43:53.000Z | src/valiant/repositories/factory.py | pomes/valiant | 786d417a7903d40e54136f645fdbe51575612902 | [
"MIT"
] | null | null | null | """Works out which repo wrangler ya need.
Copyright (c) 2020 The Valiant Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
us... | 37.849315 | 95 | 0.706478 | from .config import RepositoryConfiguration
from .repository import BaseRepository
class RepositoryFactory:
def __init__(self):
from typing import Dict
self._cache: Dict[str, BaseRepository] = {}
def _instantiate_handler(self, conf: RepositoryConfiguration) -> BaseRepository:
from .... | true | true |
1c39460ba37951a4967580d366596462867ba20e | 8,653 | py | Python | plugins/modules/oci_mysql_analytics_cluster_memory_estimate_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_mysql_analytics_cluster_memory_estimate_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_mysql_analytics_cluster_memory_estimate_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 37.297414 | 156 | 0.585924 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_mysql_analytics_cluster_memory_estimate_facts
short_description: Fetches... | true | true |
1c39477d259e9ad716d99cbf82e58e6f3b87381e | 2,399 | py | Python | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | # 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 agreed to in writing, ... | 33.788732 | 74 | 0.689037 |
from absl.testing import absltest
from absl.testing import parameterized
from clif.testing.python import sequence_methods
try:
from clif.testing.python import sequence_methods_pybind11
except ImportError:
sequence_methods_pybind11 = None
@parameterized.named_parameters([
np for np in zip(('c... | true | true |
1c3948496ed8396ce882619ab8bb6c566ec5d7ec | 685 | py | Python | hardware/tests/firmware_integration/test_echo.py | y3rsh/opentrons | b446567910db218030fef40396ab2255cc074bba | [
"Apache-2.0"
] | 235 | 2017-10-27T20:37:27.000Z | 2022-03-30T14:09:49.000Z | hardware/tests/firmware_integration/test_echo.py | y3rsh/opentrons | b446567910db218030fef40396ab2255cc074bba | [
"Apache-2.0"
] | 8,425 | 2017-10-26T15:25:43.000Z | 2022-03-31T23:54:26.000Z | hardware/tests/firmware_integration/test_echo.py | y3rsh/opentrons | b446567910db218030fef40396ab2255cc074bba | [
"Apache-2.0"
] | 130 | 2017-11-09T21:02:37.000Z | 2022-03-15T18:01:24.000Z | """Test Echo firmware."""
import pytest
import asyncio
from typing import AsyncGenerator
from opentrons_hardware.drivers.can_bus import CanDriver, ArbitrationId, CanMessage
@pytest.fixture
async def driver(loop: asyncio.BaseEventLoop) -> AsyncGenerator[CanDriver, None]:
"""Create CanDriver connected to OT-3 Emula... | 29.782609 | 83 | 0.737226 | import pytest
import asyncio
from typing import AsyncGenerator
from opentrons_hardware.drivers.can_bus import CanDriver, ArbitrationId, CanMessage
@pytest.fixture
async def driver(loop: asyncio.BaseEventLoop) -> AsyncGenerator[CanDriver, None]:
driver = await CanDriver.from_env()
yield driver
driver.shutd... | true | true |
1c3948fdeaf5c6d61eddbba04d30e311127ec3f6 | 7,300 | py | Python | graphql/validation/validation.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 8 | 2020-03-23T21:34:02.000Z | 2021-11-12T11:27:45.000Z | graphql/validation/validation.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-14T22:22:29.000Z | 2022-03-16T19:26:37.000Z | graphql/validation/validation.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-23T12:06:23.000Z | 2022-02-13T05:33:32.000Z | from ..language.ast import FragmentDefinition, FragmentSpread, OperationDefinition
from ..language.visitor import ParallelVisitor, TypeInfoVisitor, Visitor, visit
from ..type import GraphQLSchema
from ..utils.type_info import TypeInfo
from .rules import specified_rules
# Necessary for static type checking
if False: #... | 36.138614 | 83 | 0.636849 | from ..language.ast import FragmentDefinition, FragmentSpread, OperationDefinition
from ..language.visitor import ParallelVisitor, TypeInfoVisitor, Visitor, visit
from ..type import GraphQLSchema
from ..utils.type_info import TypeInfo
from .rules import specified_rules
if False:
from typing import List, Union, ... | true | true |
1c3949beb5e0e8c7ba3be86949a81306113cad5c | 876 | py | Python | releasetools/releasetools.py | scto/android_device_samsung_sm8250-common | 912e07a86f4157f788833f7e65747e0a7e6d9882 | [
"Apache-2.0"
] | null | null | null | releasetools/releasetools.py | scto/android_device_samsung_sm8250-common | 912e07a86f4157f788833f7e65747e0a7e6d9882 | [
"Apache-2.0"
] | null | null | null | releasetools/releasetools.py | scto/android_device_samsung_sm8250-common | 912e07a86f4157f788833f7e65747e0a7e6d9882 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020 The LineageOS Project
import common
import re
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def AddImage(info, basename, dest):
path = "IMAGES/" + basename
if path not ... | 25.764706 | 81 | 0.734018 |
import common
import re
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def AddImage(info, basename, dest):
path = "IMAGES/" + basename
if path not in info.input_zip.namelist():
return
data = info.input_zip.read(path)
... | true | true |
1c394c7520609260e85412e55eb6764cf76dc1ad | 81,813 | py | Python | dojo/product/views.py | SPoint42/django-DefectDojo | ce386a5c9ae7405366109bf8faea8dce1ca2d8e6 | [
"BSD-3-Clause"
] | null | null | null | dojo/product/views.py | SPoint42/django-DefectDojo | ce386a5c9ae7405366109bf8faea8dce1ca2d8e6 | [
"BSD-3-Clause"
] | 275 | 2021-02-19T15:16:15.000Z | 2022-03-31T21:09:29.000Z | dojo/product/views.py | SPoint42/django-DefectDojo | ce386a5c9ae7405366109bf8faea8dce1ca2d8e6 | [
"BSD-3-Clause"
] | null | null | null | # # product
import calendar as tcalendar
import logging
import base64
from collections import OrderedDict
from datetime import datetime, date, timedelta
from math import ceil
from dateutil.relativedelta import relativedelta
from django.contrib import messages
from django.core.exceptions import PermissionDenied, Valida... | 46.803776 | 154 | 0.597741 | lendar as tcalendar
import logging
import base64
from collections import OrderedDict
from datetime import datetime, date, timedelta
from math import ceil
from dateutil.relativedelta import relativedelta
from django.contrib import messages
from django.core.exceptions import PermissionDenied, ValidationError
from django.... | true | true |
1c394cd42f5508ae906a8a9b784fa9c02b3ade1e | 33 | py | Python | web_app/shap4mmf/__init__.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | web_app/shap4mmf/__init__.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | web_app/shap4mmf/__init__.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | from ._explainer import Explainer | 33 | 33 | 0.878788 | from ._explainer import Explainer | true | true |
1c394dd6465c72408da41055c65ade522768351a | 1,198 | py | Python | finrl_meta/env_future_trading/wt4elegantrl/wtpy/wrapper/ContractLoader.py | eitin-infant/FinRL-Meta | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | [
"MIT"
] | 214 | 2021-11-08T17:06:11.000Z | 2022-03-31T18:29:48.000Z | finrl_meta/env_future_trading/wt4elegantrl/wtpy/wrapper/ContractLoader.py | eitin-infant/FinRL-Meta | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | [
"MIT"
] | 51 | 2021-11-14T19:11:02.000Z | 2022-03-30T20:23:08.000Z | finrl_meta/env_future_trading/wt4elegantrl/wtpy/wrapper/ContractLoader.py | eitin-infant/FinRL-Meta | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | [
"MIT"
] | 110 | 2021-11-03T07:41:40.000Z | 2022-03-31T03:23:38.000Z | '''
Descripttion: Automatically generated file comment
version:
Author: Wesley
Date: 2021-05-24 15:05:01
LastEditors: Wesley
LastEditTime: 2021-08-13 15:35:59
'''
from .PlatformHelper import PlatformHelper as ph
import os
from ctypes import cdll,c_char_p
from enum import Enum
class LoaderType(Enum):
'''
引擎类型
... | 24.958333 | 61 | 0.658598 | from .PlatformHelper import PlatformHelper as ph
import os
from ctypes import cdll,c_char_p
from enum import Enum
class LoaderType(Enum):
LT_CTP = 1
LT_CTPMini = 2
LT_CTPOpt = 3
def getModuleName(lType:LoaderType)->str:
if lType == LoaderType.LT_CTP:
filename = "CTPLoader"
elif lTy... | true | true |
1c394f272ec8618035bfe7e93a7a40d94808dc99 | 401 | py | Python | studydiscord/wsgi.py | cwhittaker123/django-blog | a89408a86434b0aeb3b179e5885de28740222880 | [
"MIT"
] | null | null | null | studydiscord/wsgi.py | cwhittaker123/django-blog | a89408a86434b0aeb3b179e5885de28740222880 | [
"MIT"
] | null | null | null | studydiscord/wsgi.py | cwhittaker123/django-blog | a89408a86434b0aeb3b179e5885de28740222880 | [
"MIT"
] | null | null | null | """
WSGI config for studydiscord project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studydiscord.settings')
application = get_wsgi_application()
| true | true |
1c395176e9e2ab1dac36b34689a73bf733882451 | 2,564 | py | Python | src/oci/cloud_guard/models/change_security_recipe_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/cloud_guard/models/change_security_recipe_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/cloud_guard/models/change_security_recipe_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 33.298701 | 245 | 0.691108 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ChangeSecurityRecipeCompartmentDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
... | true | true |
1c3951895d68db584912d0df9d55f2d91408dd34 | 24,475 | py | Python | scale/data/models.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 121 | 2015-11-18T18:15:33.000Z | 2022-03-10T01:55:00.000Z | scale/data/models.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 1,415 | 2015-12-23T23:36:04.000Z | 2022-01-07T14:10:09.000Z | scale/data/models.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 66 | 2015-12-03T20:38:56.000Z | 2020-07-27T15:28:11.000Z | """Defines the database models for datasets"""
from __future__ import absolute_import, unicode_literals
import copy
import logging
from collections import namedtuple
import django.contrib.postgres.fields
from django.db import models, transaction
from django.db.models import Q, Count
from data.data import data_util
f... | 41.134454 | 160 | 0.671175 | from __future__ import absolute_import, unicode_literals
import copy
import logging
from collections import namedtuple
import django.contrib.postgres.fields
from django.db import models, transaction
from django.db.models import Q, Count
from data.data import data_util
from data.data.json.data_v6 import convert_data_... | true | true |
1c395295389303bc1d6b9b1cf2f5f624ba63beff | 1,850 | py | Python | setup.py | maksyuki/TaichiGAME | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 37 | 2021-12-30T02:03:11.000Z | 2022-03-21T11:37:52.000Z | setup.py | maksyuki/TaichiGame | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 2 | 2022-01-09T13:04:04.000Z | 2022-01-11T06:47:43.000Z | setup.py | maksyuki/TaichiGame | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 2 | 2022-01-03T06:52:23.000Z | 2022-01-11T06:31:30.000Z | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="TaichiGAME",
version="0.0.3",
author="maksyuki",
author_email="maksyuki@126.com",
description="GPU Accelerated Motion Engine based on Taichi Lang",
long_description=l... | 40.217391 | 78 | 0.636216 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="TaichiGAME",
version="0.0.3",
author="maksyuki",
author_email="maksyuki@126.com",
description="GPU Accelerated Motion Engine based on Taichi Lang",
long_description=l... | true | true |
1c39529af27c755a11f591ced76bc5b85c5600df | 5,601 | py | Python | tests/mock_objects.py | jmuilwijk/DiscordBot | 63cbb3e96d473b24ecc2928fd5e65ab0e4fec4a8 | [
"MIT"
] | 3 | 2018-11-29T23:31:22.000Z | 2019-05-15T12:13:05.000Z | tests/mock_objects.py | jmuilwijk/DiscordBot | 63cbb3e96d473b24ecc2928fd5e65ab0e4fec4a8 | [
"MIT"
] | 1 | 2018-12-13T21:07:13.000Z | 2018-12-13T21:07:13.000Z | tests/mock_objects.py | jmuilwijk/DiscordBot | 63cbb3e96d473b24ecc2928fd5e65ab0e4fec4a8 | [
"MIT"
] | 2 | 2019-05-26T15:49:24.000Z | 2019-07-31T21:13:49.000Z | """
Module containing mocked objects of discord.py
"""
# Builtin
import collections
import itertools
import unittest.mock
from asyncio import AbstractEventLoop
from aiohttp import ClientSession
# pip
import discord
from discord.ext.commands import Context
# Locals
from KonekoBot import Koneko
class CustomMock:
... | 29.951872 | 99 | 0.636851 |
import collections
import itertools
import unittest.mock
from asyncio import AbstractEventLoop
from aiohttp import ClientSession
import discord
from discord.ext.commands import Context
from KonekoBot import Koneko
class CustomMock:
spec_set = None
discord_id = itertools.count(0)
def __init__(self,... | true | true |
1c3953de6c5b5802e6221ab2d6af6d68757d930e | 498 | py | Python | yardstick/service/__init__.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 28 | 2017-02-07T07:46:42.000Z | 2021-06-30T08:11:06.000Z | yardstick/service/__init__.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 6 | 2018-01-18T08:00:54.000Z | 2019-04-11T04:51:41.000Z | yardstick/service/__init__.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 46 | 2016-12-13T10:05:47.000Z | 2021-02-18T07:33:06.000Z | ##############################################################################
# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 38.307692 | 78 | 0.522088 | true | true | |
1c3955cfd469102938ead8fe91221387a47491ec | 1,087 | py | Python | tests/test_fluid_lists.py | portyanikhin/PyFluids | c570c6708f88d24fb3100d90b81271c3171cd87b | [
"MIT"
] | null | null | null | tests/test_fluid_lists.py | portyanikhin/PyFluids | c570c6708f88d24fb3100d90b81271c3171cd87b | [
"MIT"
] | null | null | null | tests/test_fluid_lists.py | portyanikhin/PyFluids | c570c6708f88d24fb3100d90b81271c3171cd87b | [
"MIT"
] | 1 | 2021-08-08T01:36:59.000Z | 2021-08-08T01:36:59.000Z | # PyFluids
# Copyright (c) 2021 Vladimir Portyanikhin
import pytest
from pyfluids import *
fluid_list = (
list(PureFluids)
+ list(IncompPureFluids)
+ list(IncompMixturesMF)
+ list(IncompMixturesVF)
)
class TestFluidLists:
@pytest.mark.parametrize("name", fluid_list)
def test_coolprop_name... | 27.871795 | 58 | 0.605336 |
import pytest
from pyfluids import *
fluid_list = (
list(PureFluids)
+ list(IncompPureFluids)
+ list(IncompMixturesMF)
+ list(IncompMixturesVF)
)
class TestFluidLists:
@pytest.mark.parametrize("name", fluid_list)
def test_coolprop_name(self, name):
try:
assert name.coo... | true | true |
1c39573626ef3ac70fdc9ac65ce63eb25e33fcf4 | 23,681 | py | Python | qcodes/data/hdf5_format.py | edumur/Qcodes | ac262035c299a872995cecd210f0e84b0b85d751 | [
"MIT"
] | null | null | null | qcodes/data/hdf5_format.py | edumur/Qcodes | ac262035c299a872995cecd210f0e84b0b85d751 | [
"MIT"
] | 62 | 2021-12-23T04:32:54.000Z | 2022-03-31T04:28:12.000Z | qcodes/data/hdf5_format.py | emartinez/Qcodes | 478af6e746f918a9e1dded7ec626484987f894d2 | [
"MIT"
] | null | null | null | import json
import logging
import os
from typing import TYPE_CHECKING
import h5py
import numpy as np
import qcodes as qc
from .data_array import DataArray
from .format import Formatter
if TYPE_CHECKING:
from .data_set import DataSet
class HDF5Format(Formatter):
"""
HDF5 formatter for saving qcodes data... | 41.839223 | 118 | 0.57164 | import json
import logging
import os
from typing import TYPE_CHECKING
import h5py
import numpy as np
import qcodes as qc
from .data_array import DataArray
from .format import Formatter
if TYPE_CHECKING:
from .data_set import DataSet
class HDF5Format(Formatter):
_format_tag = 'hdf5'
def close_file(sel... | true | true |
1c3957e91fba49529695f8315f9933a48df10e2d | 1,547 | py | Python | Kuka_examples/plot_monitor.py | zhigenzhao/stable-baselines3 | a69a4f0497849d9c20f6b77870ca77ae92f5c7bb | [
"MIT"
] | null | null | null | Kuka_examples/plot_monitor.py | zhigenzhao/stable-baselines3 | a69a4f0497849d9c20f6b77870ca77ae92f5c7bb | [
"MIT"
] | null | null | null | Kuka_examples/plot_monitor.py | zhigenzhao/stable-baselines3 | a69a4f0497849d9c20f6b77870ca77ae92f5c7bb | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
import numpy as np
import csv
def main():
filename = "/home/zhigen/code/stable-baselines3/Kuka_examples/saved_models/monitor (copy).csv"
with open(filename) as csvfile:
training_monitor = csv.reader(csvfile)
reward = []
for (i, row) in enum... | 29.75 | 110 | 0.548158 | from matplotlib import pyplot as plt
import numpy as np
import csv
def main():
filename = "/home/zhigen/code/stable-baselines3/Kuka_examples/saved_models/monitor (copy).csv"
with open(filename) as csvfile:
training_monitor = csv.reader(csvfile)
reward = []
for (i, row) in enum... | true | true |
1c395835516cc3cdac94a16be11eafdeeb9614e5 | 12,088 | py | Python | tscribe/__init__.py | craigmayhew/aws_transcribe_to_docx | 1aded9a7c0f14b8242991e564aec3275fc9f83f9 | [
"MIT"
] | null | null | null | tscribe/__init__.py | craigmayhew/aws_transcribe_to_docx | 1aded9a7c0f14b8242991e564aec3275fc9f83f9 | [
"MIT"
] | null | null | null | tscribe/__init__.py | craigmayhew/aws_transcribe_to_docx | 1aded9a7c0f14b8242991e564aec3275fc9f83f9 | [
"MIT"
] | null | null | null | """ Produce Word Document transcriptions using the automatic speech recognition from AWS Transcribe. """
from docx import Document
from docx.shared import Cm, Mm, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
import json, datetime
import matplotlib.pyplot as plt
import statistics
def convert_time_st... | 47.968254 | 184 | 0.558653 |
from docx import Document
from docx.shared import Cm, Mm, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
import json, datetime
import matplotlib.pyplot as plt
import statistics
def convert_time_stamp(n):
ts = datetime.timedelta(seconds=float(n))
ts = ts - datetime.timedelta(microseconds=ts.mi... | true | true |
1c39586ec92ace93580f38c62c9dc9d24e87e440 | 3,249 | py | Python | third-party/dool-1.0.0/plugins/dool_top_io_adv.py | rreye/bdev | 8ad775f8c14b9aa51e6813529c7022fbc2b297d7 | [
"MIT"
] | 34 | 2021-01-18T14:25:24.000Z | 2021-06-05T03:21:10.000Z | docker/dstat/plugins/dstat_top_io_adv.py | dbiir/WooKongDB | 2afe19ce291d786249f97d37094a26078ceb571c | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | docker/dstat/plugins/dstat_top_io_adv.py | dbiir/WooKongDB | 2afe19ce291d786249f97d37094a26078ceb571c | [
"PostgreSQL",
"Apache-2.0"
] | 2 | 2021-04-20T20:11:08.000Z | 2021-06-02T02:56:16.000Z | ### Dstat all I/O process plugin
### Displays all processes' I/O read/write stats and CPU usage
###
### Authority: Guillermo Cantu Luna
class dstat_plugin(dstat):
def __init__(self):
self.name = 'most expensive i/o process'
self.vars = ('process pid read write cpu',)
... | 42.75 | 311 | 0.495537 | pid read write cpu',)
self.type = 's'
self.width = 40
self.scale = 0
self.pidset1 = {}
def check(self):
if not os.access('/proc/self/io', os.R_OK):
raise Exception('Kernel has no per-process I/O accounting [CONFIG_TASK_IO_ACCOUNTING], use at least ... | true | true |
1c395899f2d06b79960dea76b6bff52cd5cf4895 | 6,573 | py | Python | playground.py | Fuad-Hellscream/PatternCNN | 917345c72d4cafa0b3dc824016ac1e38039beb86 | [
"Apache-2.0"
] | 64 | 2017-04-06T11:04:22.000Z | 2022-03-04T12:52:34.000Z | playground.py | Fuad-Hellscream/PatternCNN | 917345c72d4cafa0b3dc824016ac1e38039beb86 | [
"Apache-2.0"
] | 2 | 2019-02-23T18:54:22.000Z | 2019-11-09T01:30:32.000Z | playground.py | Fuad-Hellscream/PatternCNN | 917345c72d4cafa0b3dc824016ac1e38039beb86 | [
"Apache-2.0"
] | 35 | 2019-02-08T02:00:31.000Z | 2022-03-01T23:17:00.000Z | #%%
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import argparse
import sys
import scipy.misc
import numpy as np
import importlib
import matplotlib.pyplot as plt
import chainer
import chainer.training
import chain... | 22.131313 | 94 | 0.652974 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import argparse
import sys
import scipy.misc
import numpy as np
import importlib
import matplotlib.pyplot as plt
import chainer
import chainer.training
import chainer.... | false | true |
1c3959f5ce2f0e894ca1fdf9c1723ed860f7f4df | 3,267 | py | Python | Examples/EventProfiler/tutorial.py | romanbsd/QuantSoftwareToolkit | 6b7e15fa3c0ba483a30674ff5acf30c77b91b877 | [
"BSD-3-Clause"
] | 3 | 2018-03-03T02:03:18.000Z | 2020-07-31T23:10:03.000Z | Examples/EventProfiler/tutorial.py | romanbsd/QuantSoftwareToolkit | 6b7e15fa3c0ba483a30674ff5acf30c77b91b877 | [
"BSD-3-Clause"
] | null | null | null | Examples/EventProfiler/tutorial.py | romanbsd/QuantSoftwareToolkit | 6b7e15fa3c0ba483a30674ff5acf30c77b91b877 | [
"BSD-3-Clause"
] | 6 | 2018-03-04T15:39:01.000Z | 2021-12-30T13:26:22.000Z | '''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on January, 23, 2013
@author: Sourabh Bajaj
@contact: sourabhbajaj@gatech.edu
@summary: Event Profiler Tutori... | 33.680412 | 87 | 0.666361 |
import pandas as pd
import numpy as np
import math
import copy
import QSTK.qstkutil.qsdateutil as du
import datetime as dt
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkstudy.EventProfiler as ep
def find_events(ls_symbols, d_data):
df_close = d_data['close']
ts_ma... | true | true |
1c395a2bb49bfe09ed8c4a70a44d073ecd425a73 | 2,000 | py | Python | asgn09.py | qadeerassan/python-data-structures-I-a9 | 714bff87e22a2f7ef2b546a449e2bf90482d650a | [
"MIT"
] | null | null | null | asgn09.py | qadeerassan/python-data-structures-I-a9 | 714bff87e22a2f7ef2b546a449e2bf90482d650a | [
"MIT"
] | null | null | null | asgn09.py | qadeerassan/python-data-structures-I-a9 | 714bff87e22a2f7ef2b546a449e2bf90482d650a | [
"MIT"
] | null | null | null | """
----------------------------------------------------
asgn09.py
Holds functions for assignment 9.
----------------------------------------------------
Author: Qadeer Assan
ID: 160257370
Email: assa7370@mylaurier.ca
_updated_="2018-03-22"
----------------------------------------------------
"""
from word i... | 35.714286 | 81 | 0.466 | from word import Word
def insert_words(file_variable, hash_set):
for line in file_variable:
line = line.strip().split()
for word in line:
if word.isalpha():
obj = Word(word.lower())
hash_set.insert(obj)
def comparison_total(hash_set):
tota... | true | true |
1c395c05fd3ea21bc967978556d244ddb33ac6a5 | 12,086 | py | Python | aries_cloudagent/core/tests/test_conductor.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 2 | 2019-10-10T16:33:01.000Z | 2019-10-10T19:22:17.000Z | aries_cloudagent/core/tests/test_conductor.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 5 | 2019-10-13T01:28:48.000Z | 2019-10-21T20:10:47.000Z | aries_cloudagent/core/tests/test_conductor.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 4 | 2019-07-09T20:41:03.000Z | 2021-06-06T10:45:23.000Z | import asyncio
from io import StringIO
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from .. import conductor as test_module
from ...admin.base_server import BaseAdminServer
from ...config.base_context import ContextBuilder
from ...config.injection_context import InjectionCon... | 38.006289 | 87 | 0.684015 | import asyncio
from io import StringIO
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from .. import conductor as test_module
from ...admin.base_server import BaseAdminServer
from ...config.base_context import ContextBuilder
from ...config.injection_context import InjectionCon... | true | true |
1c395d7edb3f718bfdf9111d3fd63749240be388 | 811 | py | Python | python/523_Continuous_Subarray_Sum.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 17 | 2016-03-01T22:40:53.000Z | 2021-04-19T02:15:03.000Z | python/523_Continuous_Subarray_Sum.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | null | null | null | python/523_Continuous_Subarray_Sum.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 3 | 2019-03-07T03:48:43.000Z | 2020-04-05T01:11:36.000Z | class Solution:
def checkSubarraySum(self, nums: List[int], k: int) -> bool:
# the earliest index with the same module remaider of k
prefix_sum_indices = {}
# a virtual prefix sum index.
# for the test case of [0, 0] k = 0
prefix_sum = 0
prefix_sum_indi... | 30.037037 | 64 | 0.509248 | class Solution:
def checkSubarraySum(self, nums: List[int], k: int) -> bool:
prefix_sum_indices = {}
prefix_sum = 0
prefix_sum_indices[0] = -1
for index, num in enumerate(nums):
prefix_sum += num
... | true | true |
1c395dbab07719fc7ed142448f04c349ad8f54ca | 1,951 | py | Python | espnet/nets/tts_interface.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | 3 | 2019-10-11T11:41:27.000Z | 2020-05-21T09:08:44.000Z | espnet/nets/tts_interface.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | null | null | null | espnet/nets/tts_interface.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | 1 | 2021-04-07T09:47:44.000Z | 2021-04-07T09:47:44.000Z | import chainer
class Reporter(chainer.Chain):
def report(self, dicts):
for d in dicts:
chainer.reporter.report(d, self)
class TTSInterface(object):
"""TTS Interface for ESPnet model implementation"""
@staticmethod
def add_arguments(parser):
return parser
def __init_... | 30.968254 | 109 | 0.652486 | import chainer
class Reporter(chainer.Chain):
def report(self, dicts):
for d in dicts:
chainer.reporter.report(d, self)
class TTSInterface(object):
@staticmethod
def add_arguments(parser):
return parser
def __init__(self):
self.reporter = Reporter()
def for... | true | true |
1c395e81d0785fcb41d2e2daa5b42f97a6d910e7 | 1,672 | py | Python | neutron/tests/unit/linuxbridge/test_defaults.py | SnabbCo/neutron | a657c06d10f2171149c6b1863df36522bdc11cd7 | [
"Apache-2.0"
] | 3 | 2015-02-02T02:51:39.000Z | 2015-02-23T10:20:23.000Z | neutron/tests/unit/linuxbridge/test_defaults.py | SnabbCo/neutron | a657c06d10f2171149c6b1863df36522bdc11cd7 | [
"Apache-2.0"
] | 4 | 2015-02-23T10:21:11.000Z | 2015-03-04T09:28:20.000Z | neutron/tests/unit/linuxbridge/test_defaults.py | SnabbCo/neutron | a657c06d10f2171149c6b1863df36522bdc11cd7 | [
"Apache-2.0"
] | 4 | 2015-04-14T10:06:51.000Z | 2019-10-02T01:28:34.000Z | # Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.883721 | 69 | 0.660287 |
from oslo.config import cfg
from neutron.plugins.linuxbridge.common import config
from neutron.tests import base
class ConfigurationTest(base.BaseTestCase):
def test_defaults(self):
self.assertEqual(2,
cfg.CONF.AGENT.polling_interval)
self.assertEqual(Fa... | true | true |
1c395eb8b89c86ddd4fe3e5cf7c5322c461ea836 | 2,204 | py | Python | hypixelaPY/objects/quake.py | QuartzWarrior/hypixelaPY | cb6a96ce8b15ebd3f6fa0666df46bc6135f0afb0 | [
"MIT"
] | 3 | 2021-01-04T14:29:03.000Z | 2021-02-24T11:06:41.000Z | hypixelaPY/objects/quake.py | QuartzWarrior/hypixelaPY | cb6a96ce8b15ebd3f6fa0666df46bc6135f0afb0 | [
"MIT"
] | 2 | 2021-09-21T18:31:46.000Z | 2021-09-22T13:50:28.000Z | hypixelaPY/objects/quake.py | myerrr/hypixelaPY | 336ff2723a336142254b9e01b969adda98fa5f96 | [
"MIT"
] | 1 | 2021-05-01T02:16:36.000Z | 2021-05-01T02:16:36.000Z | """
MIT License
Copyright (c) 2020 Myer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... | 44.979592 | 132 | 0.670145 |
from .stats import KillsDeaths
class Quake:
def __init__(self, data):
self.name = "Quake"
self.coins = data.get("player", {}).get("stats", {}).get("Quake", {}).get("coins", 0)
self.kills = KillsDeaths(
data.get("player", {}).get("stats", {}).get("Quake", {}).get("kills", 0),
... | true | true |
1c395f2ce46aa11c29c30e7c60549fb45d8d9850 | 3,284 | py | Python | benchmark/startCirq3278.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3278.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3278.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=43
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 36.898876 | 77 | 0.678745 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[1]))
... | true | true |
1c39613a5d2cda13b72a9b04ba4f1fd6dbc8681a | 513 | py | Python | tests/conftest.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | tests/conftest.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | tests/conftest.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# pytest configuration
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC mod... | 28.5 | 72 | 0.442495 |
from noc.tests.fixtures.database import database
def pytest_terminal_summary(terminalreporter, exitstatus):
global _stats
_stats = terminalreporter.stats
_stats = None
| true | true |
1c39614200d31cea684c300a4b6b95cb99cf3842 | 12,696 | py | Python | django/contrib/admin/util.py | elreydetoda/feedsanitizer | 81a7cfc3f3d1312cd8c236b3e8cc9e84b0d72932 | [
"MIT"
] | 2 | 2019-03-10T03:34:14.000Z | 2020-06-09T22:53:32.000Z | django/contrib/admin/util.py | elreydetoda/feedsanitizer | 81a7cfc3f3d1312cd8c236b3e8cc9e84b0d72932 | [
"MIT"
] | null | null | null | django/contrib/admin/util.py | elreydetoda/feedsanitizer | 81a7cfc3f3d1312cd8c236b3e8cc9e84b0d72932 | [
"MIT"
] | 1 | 2020-10-16T04:11:58.000Z | 2020-10-16T04:11:58.000Z | from django.db import models
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import formats
from django.utils.html import escape
from django.utils.safestr... | 33.235602 | 94 | 0.609562 | from django.db import models
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.db.models.related import RelatedObject
from django.forms.forms import pretty_name
from django.utils import formats
from django.utils.html import escape
from django.utils.safestr... | false | true |
1c396179fdc1baf926d524a0f740d38daaa3bc17 | 20,506 | py | Python | main.py | FloWuenne/semi-auto-image-annotation-tool | f48f521c480a436bafb148b4ecaf9f2c4a898211 | [
"Apache-2.0"
] | null | null | null | main.py | FloWuenne/semi-auto-image-annotation-tool | f48f521c480a436bafb148b4ecaf9f2c4a898211 | [
"Apache-2.0"
] | null | null | null | main.py | FloWuenne/semi-auto-image-annotation-tool | f48f521c480a436bafb148b4ecaf9f2c4a898211 | [
"Apache-2.0"
] | null | null | null | """
Copyright {2018} {Viraj Mavani}
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
"""
from tkinter import *
from tkinter import filedia... | 43.629787 | 120 | 0.578611 |
from tkinter import *
from tkinter import filedialog
from PIL import Image, ImageTk
import keras
from keras_retinanet import models
from keras_retinanet.utils.image import preprocess_image
import os
import numpy as np
import tensorflow as tf
import config
import math
def get_session():
config = tf.compat.v1.... | true | true |
1c3961b70cb71bf46342e39b85de8960e6ba64c2 | 1,016 | py | Python | pajbot/web/routes/admin/moderators.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | null | null | null | pajbot/web/routes/admin/moderators.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | null | null | null | pajbot/web/routes/admin/moderators.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | null | null | null | import collections
from flask import render_template
from pajbot.managers.db import DBManager
from pajbot.models.user import User
from pajbot.web.utils import requires_level
def init(page):
@page.route("/moderators/")
@requires_level(500)
def moderators(**options):
with DBManager.create_session_... | 46.181818 | 113 | 0.698819 | import collections
from flask import render_template
from pajbot.managers.db import DBManager
from pajbot.models.user import User
from pajbot.web.utils import requires_level
def init(page):
@page.route("/moderators/")
@requires_level(500)
def moderators(**options):
with DBManager.create_session_... | true | true |
1c3961e9e30bcaa86704d30f24c9675d41c3d1bb | 362 | py | Python | omnik/users/apps.py | pygabo/omnik | 579b20671515d8a38b56df8c5bc837bd201ec7b0 | [
"MIT"
] | null | null | null | omnik/users/apps.py | pygabo/omnik | 579b20671515d8a38b56df8c5bc837bd201ec7b0 | [
"MIT"
] | null | null | null | omnik/users/apps.py | pygabo/omnik | 579b20671515d8a38b56df8c5bc837bd201ec7b0 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = "omnik.users"
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
try:
import users.signals # noqa F401
... | 21.294118 | 45 | 0.569061 | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = "omnik.users"
verbose_name = "Users"
def ready(self):
try:
import users.signals
except ImportError:
pass
| true | true |
1c3961f1f78f462d00857e47927e65b6a6d8eba1 | 141,178 | py | Python | lib/sqlalchemy/sql/expression.py | obeattie/sqlalchemy | 376007fed7746d494dcb0166b22e512bfece02cd | [
"MIT"
] | 2 | 2016-05-09T09:17:35.000Z | 2016-08-03T16:30:16.000Z | lib/sqlalchemy/sql/expression.py | clones/sqlalchemy | c9f08aa78a48ba53dd221d3c5de54e5956ecf806 | [
"MIT"
] | null | null | null | lib/sqlalchemy/sql/expression.py | clones/sqlalchemy | c9f08aa78a48ba53dd221d3c5de54e5956ecf806 | [
"MIT"
] | null | null | null | # expression.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines the base components of SQL expression trees.
All components are derived... | 33.734289 | 115 | 0.622817 |
import itertools, re
from operator import attrgetter
from sqlalchemy import util, exc
from sqlalchemy.sql import operators
from sqlalchemy.sql.visitors import Visitable, cloned_traverse
import operator
functions, schema, sql_util, sqltypes = None, None, None, None
DefaultDialect, ClauseAdapter, Annotated = No... | true | true |
1c3962023870626bf65e5b10720a0f2283523934 | 617 | py | Python | benchmarks/storage/insertions.py | OneManEquipe/thinkerino | 4b9508156371643f31d1d26608e42e3aafcb0153 | [
"MIT"
] | 1 | 2020-05-02T19:44:18.000Z | 2020-05-02T19:44:18.000Z | benchmarks/storage/insertions.py | OneManEquipe/aitools | 4b9508156371643f31d1d26608e42e3aafcb0153 | [
"MIT"
] | 29 | 2019-08-07T17:49:03.000Z | 2021-08-31T10:25:00.000Z | benchmarks/storage/insertions.py | OneManEquipe/thinkerino | 4b9508156371643f31d1d26608e42e3aafcb0153 | [
"MIT"
] | null | null | null | from typing import Callable, Iterable
from aitools.logic import LogicObject
from aitools.storage.base import LogicObjectStorage
def leave_storage_empty(
storage: LogicObjectStorage,
initial_distribution: Callable[[], Iterable[LogicObject]]
) -> LogicObjectStorage:
return storage
def make_insert_n... | 32.473684 | 106 | 0.750405 | from typing import Callable, Iterable
from aitools.logic import LogicObject
from aitools.storage.base import LogicObjectStorage
def leave_storage_empty(
storage: LogicObjectStorage,
initial_distribution: Callable[[], Iterable[LogicObject]]
) -> LogicObjectStorage:
return storage
def make_insert_n... | true | true |
1c39636ebf838cf141a618ce92264d7097ceb929 | 1,620 | py | Python | src-py/gen.py | vtad4f/partitioner | 13494a0fd486f2475c788300206171f6d8a7a897 | [
"MIT"
] | null | null | null | src-py/gen.py | vtad4f/partitioner | 13494a0fd486f2475c788300206171f6d8a7a897 | [
"MIT"
] | null | null | null | src-py/gen.py | vtad4f/partitioner | 13494a0fd486f2475c788300206171f6d8a7a897 | [
"MIT"
] | null | null | null |
import random
def Main(fpath, n_vertices, n_edges, v_range=10, e_range=10):
"""
BRIEF Main execution (all but cmd line parsing)
"""
# Create file with single graph
with open(fpath, 'w') as f:
f.write('# t 1\n')
# Add vertices
vertices = range(n_vertices)
for v i... | 28.928571 | 108 | 0.524691 |
import random
def Main(fpath, n_vertices, n_edges, v_range=10, e_range=10):
with open(fpath, 'w') as f:
f.write('# t 1\n')
vertices = range(n_vertices)
for v in vertices:
f.write('v {0} {1}\n'.format(v, random.choice(range(v_range))))
edges ... | true | true |
1c39645a0bc17b9cb1034ee80c11537442818baf | 5,014 | py | Python | bq_du/du.py | solution3o6s/bq-tools | 00e5f6714724bc4034fed8afd26c8eec34d4a560 | [
"Apache-2.0"
] | null | null | null | bq_du/du.py | solution3o6s/bq-tools | 00e5f6714724bc4034fed8afd26c8eec34d4a560 | [
"Apache-2.0"
] | null | null | null | bq_du/du.py | solution3o6s/bq-tools | 00e5f6714724bc4034fed8afd26c8eec34d4a560 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use du 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, software
# distributed under the Lic... | 25.451777 | 115 | 0.623454 |
import json
import argparse
from google.cloud import bigquery
class DuClient(object):
def __init__(self, legacy, bq_table_name):
self.client = bigquery.Client()
self.table_name = '[{}]'.format(bq_table_name) if legacy else '`{}`'.format(bq_table_name)
self.job_config = bigquer... | true | true |
1c39648bd9b3c766508517dd33c70d81bcea3cf4 | 677 | py | Python | backend/cloud-run-api/app/main.py | tuxedocat/fast-annotation-tool | 2e28e81bf5b383ac033eeae847921d68ed302556 | [
"Apache-2.0"
] | 24 | 2021-06-08T06:20:55.000Z | 2022-03-24T07:27:08.000Z | backend/cloud-run-api/app/main.py | shunyooo/fast-annotation-tool | 0f7b23eb9e664daf33c6ada366ea550996d103b3 | [
"Apache-2.0"
] | null | null | null | backend/cloud-run-api/app/main.py | shunyooo/fast-annotation-tool | 0f7b23eb9e664daf33c6ada366ea550996d103b3 | [
"Apache-2.0"
] | 6 | 2021-06-08T02:39:31.000Z | 2022-01-08T15:10:01.000Z | from fastapi import FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException
from app.api.errors.http_error import http_error_handler
from app.api.errors.validation_error import http422_error_handler
from app.api.routes.api import router as api_router
from app.config... | 29.434783 | 76 | 0.82127 | from fastapi import FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException
from app.api.errors.http_error import http_error_handler
from app.api.errors.validation_error import http422_error_handler
from app.api.routes.api import router as api_router
from app.config... | true | true |
1c3964ad3ab8088a59258ab382cba7f9e14aea70 | 10,926 | bzl | Python | tools/build_rules/llvm/llvm.bzl | cushon/kythe | 1e1d70062adac6e28a3ecdd2b078784d970ff036 | [
"Apache-2.0"
] | null | null | null | tools/build_rules/llvm/llvm.bzl | cushon/kythe | 1e1d70062adac6e28a3ecdd2b078784d970ff036 | [
"Apache-2.0"
] | null | null | null | tools/build_rules/llvm/llvm.bzl | cushon/kythe | 1e1d70062adac6e28a3ecdd2b078784d970ff036 | [
"Apache-2.0"
] | null | null | null | load("@io_kythe//tools/build_rules/llvm:configure_file.bzl", "configure_file")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_skylib//lib:collections.bzl", "collections")
def _repo_path(path):
if native.repository_name() == "@":
return path
return paths.join("external", native.repository_na... | 33.722222 | 116 | 0.59244 | load("@io_kythe//tools/build_rules/llvm:configure_file.bzl", "configure_file")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_skylib//lib:collections.bzl", "collections")
def _repo_path(path):
if native.repository_name() == "@":
return path
return paths.join("external", native.repository_na... | true | true |
1c39654fddeef90c7cae5292359b0417674b4bab | 1,331 | py | Python | lib/utils/blob.py | czy779509408/text-detection-ctpn | e0cf757a33e83ead6dd6330ba47f5053de12c506 | [
"MIT"
] | 2,744 | 2018-04-13T09:51:22.000Z | 2022-03-29T03:07:19.000Z | lib/utils/blob.py | infinitisun/text-detection-ctpn | b94c3af3d5105b5a9ff4d4a00edf92b2d55ee4cf | [
"MIT"
] | 370 | 2018-04-17T05:36:53.000Z | 2022-02-22T02:54:10.000Z | lib/utils/blob.py | infinitisun/text-detection-ctpn | b94c3af3d5105b5a9ff4d4a00edf92b2d55ee4cf | [
"MIT"
] | 1,145 | 2018-04-13T09:52:49.000Z | 2022-03-29T02:21:13.000Z | """Blob helper functions."""
import numpy as np
import cv2
from ..fast_rcnn.config import cfg
def im_list_to_blob(ims):
"""Convert a list of images into a network input.
Assumes images are already prepared (means subtracted, BGR order, ...).
"""
max_shape = np.array([im.shape for im in ims]).max(axis=... | 34.128205 | 75 | 0.641623 | import numpy as np
import cv2
from ..fast_rcnn.config import cfg
def im_list_to_blob(ims):
max_shape = np.array([im.shape for im in ims]).max(axis=0)
num_images = len(ims)
blob = np.zeros((num_images, max_shape[0], max_shape[1], 3),
dtype=np.float32)
for i in range(num_images):
... | true | true |
1c3966ae8c19d2b47f51f085ab2346131c2fd72e | 1,679 | py | Python | classification/video/models/multi_column.py | liaojh1998/cross-modal-concept2robot | 2a00937eb2ac02cbe3d5d5fa0f5868e85d194f6e | [
"MIT"
] | 4 | 2021-08-04T08:14:36.000Z | 2022-03-14T05:59:46.000Z | classification/video/models/multi_column.py | liaojh1998/cross-modal-concept2robot | 2a00937eb2ac02cbe3d5d5fa0f5868e85d194f6e | [
"MIT"
] | null | null | null | classification/video/models/multi_column.py | liaojh1998/cross-modal-concept2robot | 2a00937eb2ac02cbe3d5d5fa0f5868e85d194f6e | [
"MIT"
] | 2 | 2021-08-28T13:19:31.000Z | 2021-09-17T17:48:41.000Z | import torch.nn as nn
import torch as th
class MultiColumn(nn.Module):
def __init__(self, num_classes, conv_column, column_units, clf_layers=None):
"""
- Example multi-column network
- Useful when a video sample is too long and has to be split into
multiple clips
- Processes 3D-CNN on each cli... | 31.679245 | 91 | 0.670042 | import torch.nn as nn
import torch as th
class MultiColumn(nn.Module):
def __init__(self, num_classes, conv_column, column_units, clf_layers=None):
super(MultiColumn,self).__init__()
self.num_classes = num_classes
self.column_units = column_units
self.conv_column = conv_column(column_units)
self.... | true | true |
1c3966d1c3bf00b34857f8cdb57221aed0476bac | 2,833 | py | Python | stellar_sdk/xdr/data_entry.py | MartinThoma/py-stellar-base | 07ab28cde7a7040f2262b224f9af8a3416c0e5ab | [
"Apache-2.0"
] | 341 | 2015-10-06T20:56:19.000Z | 2022-03-23T15:58:54.000Z | stellar_sdk/xdr/data_entry.py | MartinThoma/py-stellar-base | 07ab28cde7a7040f2262b224f9af8a3416c0e5ab | [
"Apache-2.0"
] | 479 | 2015-11-09T18:39:40.000Z | 2022-03-16T06:46:58.000Z | stellar_sdk/xdr/data_entry.py | MartinThoma/py-stellar-base | 07ab28cde7a7040f2262b224f9af8a3416c0e5ab | [
"Apache-2.0"
] | 181 | 2015-10-01T23:00:59.000Z | 2022-03-05T13:42:19.000Z | # This is an automatically generated file.
# DO NOT EDIT or your changes may be overwritten
import base64
from xdrlib import Packer, Unpacker
from .account_id import AccountID
from .data_entry_ext import DataEntryExt
from .data_value import DataValue
from .string64 import String64
__all__ = ["DataEntry"]
class Data... | 27.504854 | 68 | 0.56689 |
import base64
from xdrlib import Packer, Unpacker
from .account_id import AccountID
from .data_entry_ext import DataEntryExt
from .data_value import DataValue
from .string64 import String64
__all__ = ["DataEntry"]
class DataEntry:
def __init__(
self,
account_id: AccountID,
data_name: ... | true | true |
1c3966eb786a38df5ac338b4127d1c9e4ab97ea4 | 2,016 | py | Python | modmail/__init__.py | Salvi0/modmail-2 | d47e09784d6c9c063ec4083a1a4f40ecb275bdab | [
"MIT"
] | 23 | 2021-05-17T06:07:55.000Z | 2021-05-23T00:57:39.000Z | modmail/__init__.py | Salvi0/modmail-2 | d47e09784d6c9c063ec4083a1a4f40ecb275bdab | [
"MIT"
] | 19 | 2021-11-01T07:21:11.000Z | 2022-01-14T04:59:34.000Z | modmail/__init__.py | Salvi0/modmail-2 | d47e09784d6c9c063ec4083a1a4f40ecb275bdab | [
"MIT"
] | null | null | null | import asyncio
import logging
import logging.handlers
import os
from pathlib import Path
import coloredlogs
from modmail.log import ModmailLogger
# On windows aiodns's asyncio support relies on APIs like add_reader (which aiodns uses)
# are not guaranteed to be available, and in particular are not available when us... | 29.217391 | 92 | 0.764881 | import asyncio
import logging
import logging.handlers
import os
from pathlib import Path
import coloredlogs
from modmail.log import ModmailLogger
# are not guaranteed to be available, and in particular are not available when using the
# ProactorEventLoop on Windows, this method is only supported with Windows Selec... | true | true |
1c3966f40eff3e4c45413f5ea232dbbe2997a3ca | 879 | py | Python | petidlookup/__main__.py | puremourning/petidlookup | d436895146cdc76325d48e417b286acd50f787d7 | [
"Apache-2.0"
] | 1 | 2020-08-08T07:56:32.000Z | 2020-08-08T07:56:32.000Z | petidlookup/__main__.py | puremourning/petidlookup | d436895146cdc76325d48e417b286acd50f787d7 | [
"Apache-2.0"
] | null | null | null | petidlookup/__main__.py | puremourning/petidlookup | d436895146cdc76325d48e417b286acd50f787d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Ben Jackson
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 35.16 | 77 | 0.734926 |
from . import lookup
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument( '--file', '-f', type=str, help='Input file name' )
parser.add_argument( '--outfile', '-o', type=str, help='Output file name' )
args = parser.parse_args()
lookup.run( args )
| true | true |
1c3967230e860dd0c7209ef55cc6ca22ad497729 | 160 | py | Python | food/urls.py | evangelos1990/firsttry | c782a58cca636a81da0102e4e4294fd5c9e86d8a | [
"Unlicense"
] | null | null | null | food/urls.py | evangelos1990/firsttry | c782a58cca636a81da0102e4e4294fd5c9e86d8a | [
"Unlicense"
] | 2 | 2020-06-14T12:36:35.000Z | 2021-06-10T23:03:13.000Z | food/urls.py | evangelos1990/firsttry | c782a58cca636a81da0102e4e4294fd5c9e86d8a | [
"Unlicense"
] | null | null | null | # food/urls.py
from django.conf.urls import url
from django.urls import path
from food import views
urlpatterns = [
path('', views.index, name='index'),
] | 17.777778 | 40 | 0.7125 |
from django.conf.urls import url
from django.urls import path
from food import views
urlpatterns = [
path('', views.index, name='index'),
] | true | true |
1c396842a02555f4ec3e88322fd8a6786b41cd9f | 3,508 | py | Python | test/scripts/test_restart.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_restart.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_restart.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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:
# * Redistributions of source code must retain the above copyright
# not... | 34.732673 | 106 | 0.670182 |
import sys, ecto, ecto_test
def makeplasm(N):
plasm = ecto.Plasm()
gen = ecto_test.Generate(start=1, step=1)
quitter = ecto_test.QuitAfter(N=N)
plasm.connect(gen[:] >> quitter[:])
return (quitter, gen, plasm)
tto, " nthreads=", nthreads, "niter=", niter)
(quitter... | true | true |
1c396bf46db83c817eec77146fc8d8af2b14f3f1 | 63 | py | Python | learn_python/learn_pytest_and_allure/tests/utils/help_functions.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | 2 | 2019-08-04T17:30:53.000Z | 2020-09-21T08:39:55.000Z | learn_python/learn_pytest_and_allure/tests/utils/help_functions.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | 5 | 2019-10-31T14:55:58.000Z | 2022-02-26T04:06:39.000Z | learn_python/learn_pytest_and_allure/tests/utils/help_functions.py | yehonadav/yonadav_tutorials | e797fdaeaea4c5d85392f724442645afb9391f15 | [
"Apache-2.0"
] | null | null | null | def f():
raise SystemExit(1)
def inc(x):
return x + 1 | 10.5 | 23 | 0.555556 | def f():
raise SystemExit(1)
def inc(x):
return x + 1 | true | true |
1c396d96ba17524bb112d648221bced5c3b70181 | 1,061 | py | Python | repos/system_upgrade/el7toel8/actors/rpmscanner/actor.py | Jakuje/leapp-repository | 580540f68bd4f89152c28935f775f660c2db0839 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/rpmscanner/actor.py | Jakuje/leapp-repository | 580540f68bd4f89152c28935f775f660c2db0839 | [
"Apache-2.0"
] | 1 | 2020-06-15T18:32:21.000Z | 2020-06-15T18:32:21.000Z | repos/system_upgrade/el7toel8/actors/rpmscanner/actor.py | kubco2/leapp-repository | ad98ad91d06d0adfe945566a414c95df862c4172 | [
"Apache-2.0"
] | null | null | null | from leapp.actors import Actor
from leapp.libraries.common.rpms import get_installed_rpms
from leapp.models import InstalledRPM, RPM
from leapp.tags import IPUWorkflowTag, FactsPhaseTag
class RpmScanner(Actor):
"""
Provides data about installed RPM Packages.
After collecting data from RPM query, a messag... | 28.675676 | 88 | 0.598492 | from leapp.actors import Actor
from leapp.libraries.common.rpms import get_installed_rpms
from leapp.models import InstalledRPM, RPM
from leapp.tags import IPUWorkflowTag, FactsPhaseTag
class RpmScanner(Actor):
name = 'rpm_scanner'
consumes = ()
produces = (InstalledRPM,)
tags = (IPUWorkflowTag, Fact... | true | true |
1c396dc98cc3b66a53dfb013d2b11bad8dc6be3c | 14,742 | py | Python | simulate/parse/_system_topology.py | charles9li/simulate-openmm | cfc76294dd4b00147769fc83c7673fce5bd499cc | [
"MIT"
] | null | null | null | simulate/parse/_system_topology.py | charles9li/simulate-openmm | cfc76294dd4b00147769fc83c7673fce5bd499cc | [
"MIT"
] | null | null | null | simulate/parse/_system_topology.py | charles9li/simulate-openmm | cfc76294dd4b00147769fc83c7673fce5bd499cc | [
"MIT"
] | null | null | null | """
_system_topology.py: Parses topology information for a system.
Copyright (c) 2020 Charles Li // UCSB, Department of Chemical Engineering
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software withou... | 43.358824 | 131 | 0.592593 | from __future__ import absolute_import
__author__ = "Charles Li"
__version__ = "1.0"
import os
from ast import literal_eval
import numpy as np
from simtk.openmm.app import Element, ForceField, NoCutoff, Topology
from simtk.unit import nanometer
from ._options import _Options
from ._system_topology_chain import Chain... | true | true |
1c396ef7bd19ebc1898c3ce8edba54d4d9b77dfc | 424 | py | Python | tests/src/year2017/test_day09b.py | lancelote/advent_of_code | 06dda6ca034bc1e86addee7798bb9b2a34ff565b | [
"Unlicense"
] | 10 | 2017-12-11T17:54:52.000Z | 2021-12-09T20:16:30.000Z | tests/src/year2017/test_day09b.py | lancelote/advent_of_code | 06dda6ca034bc1e86addee7798bb9b2a34ff565b | [
"Unlicense"
] | 260 | 2015-12-09T11:03:03.000Z | 2021-12-12T14:32:23.000Z | tests/src/year2017/test_day09b.py | lancelote/advent_of_code | 06dda6ca034bc1e86addee7798bb9b2a34ff565b | [
"Unlicense"
] | null | null | null | """2017 - Day 9 Part 2: Stream Processing tests."""
import pytest
from src.year2017.day09b import solve
@pytest.mark.parametrize(
("stream", "expected"),
[
("<>", 0),
("<random characters>", 17),
("<<<<>", 3),
("<{!>}>", 2),
("<!!>", 0),
("<!!!>>", 0),
... | 20.190476 | 51 | 0.459906 | import pytest
from src.year2017.day09b import solve
@pytest.mark.parametrize(
("stream", "expected"),
[
("<>", 0),
("<random characters>", 17),
("<<<<>", 3),
("<{!>}>", 2),
("<!!>", 0),
("<!!!>>", 0),
('<{o"i!a,<{i<a>', 10),
],
)
def test_solve(stre... | true | true |
1c396efc3cf4df445e482ec254bd83587ce2d238 | 519 | py | Python | backend/backend/asgi.py | Dokeey/flexchat | 1e62f8ea054bd526cd5bf1c0db12f986b12ed559 | [
"MIT"
] | 1 | 2020-09-30T10:15:05.000Z | 2020-09-30T10:15:05.000Z | backend/backend/asgi.py | Dokeey/flexchat | 1e62f8ea054bd526cd5bf1c0db12f986b12ed559 | [
"MIT"
] | 7 | 2020-08-31T09:56:26.000Z | 2021-03-01T14:53:00.000Z | backend/backend/asgi.py | Dokeey/flexchat | 1e62f8ea054bd526cd5bf1c0db12f986b12ed559 | [
"MIT"
] | null | null | null | """
ASGI config for backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
import django
from channels.routing import get_default_application
from django.core.as... | 25.95 | 78 | 0.801541 |
import os
import django
from channels.routing import get_default_application
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings.prod')
django.setup()
application = get_default_application() | true | true |
1c396f24dcb59ef5b6b1524ecddeb41ddb5c93bd | 172 | py | Python | api/urls.py | MECKEM-COV-19/backend | c0686f32f98b3acd5dc028d8a054089694654a07 | [
"MIT"
] | null | null | null | api/urls.py | MECKEM-COV-19/backend | c0686f32f98b3acd5dc028d8a054089694654a07 | [
"MIT"
] | 4 | 2020-03-22T12:27:45.000Z | 2021-06-10T22:44:00.000Z | api/urls.py | MECKEM-COV-19/backend | c0686f32f98b3acd5dc028d8a054089694654a07 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
from graphene_django.views import GraphQLView
urlpatterns = [
path('graphql/', GraphQLView.as_view(graphiql=True)),
] | 21.5 | 57 | 0.767442 | from django.urls import path
from . import views
from graphene_django.views import GraphQLView
urlpatterns = [
path('graphql/', GraphQLView.as_view(graphiql=True)),
] | true | true |
1c396fe42c1941a4fdbd1abdeeb2b7d8bceff0c2 | 14,588 | py | Python | keras_applications/inception_v3_nadee.py | nadee13/keras_applications | 65ca5b17c71b3b3f0191576c03353cc26af9c289 | [
"MIT"
] | null | null | null | keras_applications/inception_v3_nadee.py | nadee13/keras_applications | 65ca5b17c71b3b3f0191576c03353cc26af9c289 | [
"MIT"
] | null | null | null | keras_applications/inception_v3_nadee.py | nadee13/keras_applications | 65ca5b17c71b3b3f0191576c03353cc26af9c289 | [
"MIT"
] | null | null | null | """Inception V3 model for Keras.
Note that the input image format for this model is different than for
the VGG16 and ResNet models (299x299 instead of 224x224),
and that the input preprocessing function is also different (same as Xception).
# Reference
- [Rethinking the Inception Architecture for Computer Vision](
... | 35.754902 | 80 | 0.603304 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from . import get_submodules_from_kwargs
from . import imagenet_utils
from .imagenet_utils import decode_predictions
from .imagenet_utils import _obtain_input_shape
WEIGHTS_PATH = (
'https://gi... | true | true |
1c3972136fc6ff85b47ef462a1a1317f6bf42fed | 717 | py | Python | setup.py | CIIRC-ISI/PyAutomationML | 19272934dfbb15a2665b8c55058f94b0e55d2879 | [
"BSD-3-Clause"
] | null | null | null | setup.py | CIIRC-ISI/PyAutomationML | 19272934dfbb15a2665b8c55058f94b0e55d2879 | [
"BSD-3-Clause"
] | null | null | null | setup.py | CIIRC-ISI/PyAutomationML | 19272934dfbb15a2665b8c55058f94b0e55d2879 | [
"BSD-3-Clause"
] | null | null | null | import pathlib
from setuptools import setup
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
setup(
name='pyautomationml',
description='Library for processing AutomationML files in python',
long_description=README,
long_description_content_type="text/markdown",
url="h... | 27.576923 | 70 | 0.658298 | import pathlib
from setuptools import setup
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
setup(
name='pyautomationml',
description='Library for processing AutomationML files in python',
long_description=README,
long_description_content_type="text/markdown",
url="h... | true | true |
1c3972452c8a9c15f17df7204dfd01c76b40005d | 1,344 | py | Python | to_images.py | qhjqhj00/ConV2020 | 680c4b8eb9e9568471e414f6e763e838bca0025e | [
"Apache-2.0"
] | null | null | null | to_images.py | qhjqhj00/ConV2020 | 680c4b8eb9e9568471e414f6e763e838bca0025e | [
"Apache-2.0"
] | null | null | null | to_images.py | qhjqhj00/ConV2020 | 680c4b8eb9e9568471e414f6e763e838bca0025e | [
"Apache-2.0"
] | null | null | null | import matplotlib
matplotlib.use('Agg')
import pandas as pd
from matplotlib import pyplot as plt
import os
from pypinyin import lazy_pinyin
from matplotlib.ticker import MaxNLocator
import re
target_dir = './res/'
picture = './images/'
func = lambda z:dict([(x, y) for y, x in z.items()])
def plot(x,y,t,a):
ax ... | 24.436364 | 73 | 0.570685 | import matplotlib
matplotlib.use('Agg')
import pandas as pd
from matplotlib import pyplot as plt
import os
from pypinyin import lazy_pinyin
from matplotlib.ticker import MaxNLocator
import re
target_dir = './res/'
picture = './images/'
func = lambda z:dict([(x, y) for y, x in z.items()])
def plot(x,y,t,a):
ax ... | true | true |
1c39726e349a0005641f4c91d20c9491a42311a3 | 62,089 | py | Python | nipype/interfaces/freesurfer/model.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/freesurfer/model.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/freesurfer/model.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The freesurfer module provides basic functions for interfacing with
freesurfer tools.
"""
from __future__ import (print_function, division, unicode_literals,
... | 37.698239 | 239 | 0.598914 |
from __future__ import (print_function, division, unicode_literals,
absolute_import)
import os
from ...utils.filemanip import fname_presuffix, split_filename
from ..base import (TraitedSpec, File, traits, InputMultiPath, OutputMultiPath,
Directory, isdefined)
from .base ... | true | true |
1c3973532340e2fde1f06a6cd7564ce5420b57a7 | 1,701 | py | Python | lenstronomy/GalKin/aperture.py | jiwoncpark/lenstronomy | c1d12580f8d8cf1d065d80568a58c0694e23945a | [
"MIT"
] | 1 | 2020-07-31T07:55:17.000Z | 2020-07-31T07:55:17.000Z | lenstronomy/GalKin/aperture.py | jiwoncpark/lenstronomy | c1d12580f8d8cf1d065d80568a58c0694e23945a | [
"MIT"
] | null | null | null | lenstronomy/GalKin/aperture.py | jiwoncpark/lenstronomy | c1d12580f8d8cf1d065d80568a58c0694e23945a | [
"MIT"
] | 2 | 2020-10-26T10:45:11.000Z | 2021-03-04T12:25:19.000Z | __author__ = 'sibirrer'
from lenstronomy.GalKin.aperture_types import Shell, Slit, IFUShells, Frame
"""
class that defines the aperture of the measurement (e.g. slit, integral field spectroscopy regions etc)
Available aperture types:
-------------------------
'slit': length, width, center_ra, center_dec, angle
'sh... | 32.711538 | 127 | 0.650794 | __author__ = 'sibirrer'
from lenstronomy.GalKin.aperture_types import Shell, Slit, IFUShells, Frame
class Aperture(object):
def __init__(self, aperture_type, **kwargs_aperture):
if aperture_type == 'slit':
self._aperture = Slit(**kwargs_aperture)
elif aperture_type == 'shell':
... | true | true |
1c3974a1211e3f805b943edfec236b31e43b98b3 | 176,984 | py | Python | mne_qt_browser/_pg_figure.py | cbrnr/mne-qt-browser | 8ed661d2317d0bfc4c25fdbcabcdf2ea581d2f1c | [
"BSD-3-Clause"
] | null | null | null | mne_qt_browser/_pg_figure.py | cbrnr/mne-qt-browser | 8ed661d2317d0bfc4c25fdbcabcdf2ea581d2f1c | [
"BSD-3-Clause"
] | null | null | null | mne_qt_browser/_pg_figure.py | cbrnr/mne-qt-browser | 8ed661d2317d0bfc4c25fdbcabcdf2ea581d2f1c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Base classes and functions for 2D browser backends."""
# Author: Martin Schulz <dev@earthman-music.de>
#
# License: BSD-3-Clause
import datetime
import functools
import gc
import math
import platform
import sys
from ast import literal_eval
from collections import OrderedDict
from contextlib... | 39.043459 | 79 | 0.563492 |
import datetime
import functools
import gc
import math
import platform
import sys
from ast import literal_eval
from collections import OrderedDict
from contextlib import contextmanager
from copy import copy
from functools import partial
from os.path import getsize
import numpy as np
from PyQt5.QtCore import (QEv... | true | true |
1c39772396aa4a5b2ffc82f65daf4a0da685acbb | 1,081 | py | Python | Datasets/NumpyGenerator/NumpyRandomNormalDriftGenerator.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | 4 | 2021-09-16T05:50:25.000Z | 2021-12-31T07:04:55.000Z | Datasets/NumpyGenerator/NumpyRandomNormalDriftGenerator.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | null | null | null | Datasets/NumpyGenerator/NumpyRandomNormalDriftGenerator.py | Lucciola111/stream_autoencoder_windowing | 5456b07bd20220c987598db2cdb832d8195e1575 | [
"MIT"
] | 1 | 2021-12-16T06:53:08.000Z | 2021-12-16T06:53:08.000Z | from Datasets.NumpyGenerator.NumpyRandomNormalStreamGenerator import numpy_random_normal_stream_generator
def numpy_random_normal_drift_generator(
data_stream, mean_broken, var_broken, n_dimensions_broken, start_dimensions_broken):
"""
Parameters
----------
data_stream: data stream where drif... | 37.275862 | 111 | 0.779833 | from Datasets.NumpyGenerator.NumpyRandomNormalStreamGenerator import numpy_random_normal_stream_generator
def numpy_random_normal_drift_generator(
data_stream, mean_broken, var_broken, n_dimensions_broken, start_dimensions_broken):
n_instances = len(data_stream)
dimensions_broken = numpy_random_... | true | true |
1c3979aeaf8ca52f2b4e129cade43c4fe8b17290 | 1,730 | py | Python | table_enforcer/utils/validate/decorators.py | xguse/table_enforcer | f3137839574bf8ea933a14ea16a8acba45e3e0c3 | [
"MIT"
] | 13 | 2017-11-16T23:24:17.000Z | 2021-05-28T01:05:31.000Z | table_enforcer/utils/validate/decorators.py | xguse/table_enforcer | f3137839574bf8ea933a14ea16a8acba45e3e0c3 | [
"MIT"
] | 1 | 2019-09-26T18:34:21.000Z | 2021-10-12T17:18:24.000Z | table_enforcer/utils/validate/decorators.py | xguse/table_enforcer | f3137839574bf8ea933a14ea16a8acba45e3e0c3 | [
"MIT"
] | 1 | 2017-11-17T17:18:31.000Z | 2017-11-17T17:18:31.000Z | """Provide decoration functions to augment the behavior of validator functions."""
import functools
def minmax(low, high):
"""Test that the data items fall within range: low <= x <= high."""
def decorator(function):
"""Decorate a function with args."""
@functools.wraps(function)
def wr... | 28.360656 | 82 | 0.569942 | import functools
def minmax(low, high):
def decorator(function):
@functools.wraps(function)
def wrapper(*args, **kwargs):
series = function(*args, **kwargs)
lo_pass = low <= series
hi_pass = series <= high
return lo_pass & hi_pass
return wr... | true | true |
1c397c1c2056b008156c3000c97255a269a556fd | 3,543 | py | Python | index.py | AaryanSinhaRoy/link-saver | 1970c3d1733d76891b59e3527662d0502456e379 | [
"MIT"
] | null | null | null | index.py | AaryanSinhaRoy/link-saver | 1970c3d1733d76891b59e3527662d0502456e379 | [
"MIT"
] | null | null | null | index.py | AaryanSinhaRoy/link-saver | 1970c3d1733d76891b59e3527662d0502456e379 | [
"MIT"
] | null | null | null | from flask import Flask, render_template,url_for, request, session, redirect
import sqlite3
import requests
from bs4 import BeautifulSoup
app = Flask(__name__)
app.secret_key='voat'
create_table="create table if not exists users ( username varchar(255), password varchar(255))"
conn=sqlite3.connect("database.... | 31.633929 | 130 | 0.62433 | from flask import Flask, render_template,url_for, request, session, redirect
import sqlite3
import requests
from bs4 import BeautifulSoup
app = Flask(__name__)
app.secret_key='voat'
create_table="create table if not exists users ( username varchar(255), password varchar(255))"
conn=sqlite3.connect("database.... | true | true |
1c397ccaa82943aaaf39168260a36d7c20628590 | 487 | py | Python | interview/leet/189_Rotate_Array.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2020-10-12T13:33:29.000Z | 2020-10-12T13:33:29.000Z | interview/leet/189_Rotate_Array.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | null | null | null | interview/leet/189_Rotate_Array.py | eroicaleo/LearningPython | 297d46eddce6e43ce0c160d2660dff5f5d616800 | [
"MIT"
] | 1 | 2016-11-09T07:28:45.000Z | 2016-11-09T07:28:45.000Z | #!/usr/bin/env python3
import math
class Solution:
def rotate(self, nums, k):
l = len(nums)
d = math.gcd(k, l)
for i in range(d):
p, q, prev = i, (i+k)%l, nums[i]
while q != i:
tmp = nums[q]
nums[q] = prev
p, q, prev ... | 20.291667 | 44 | 0.439425 |
import math
class Solution:
def rotate(self, nums, k):
l = len(nums)
d = math.gcd(k, l)
for i in range(d):
p, q, prev = i, (i+k)%l, nums[i]
while q != i:
tmp = nums[q]
nums[q] = prev
p, q, prev = q, (q+k)%l, tmp
... | true | true |
1c397d5a4701f90d305728e12748e4baba35860c | 151 | py | Python | SystemyMultimedialne/Lab07/tempCodeRunnerFile.py | arte00/informatyka | 642574f7c235d016b7a143a9957b26ddcaa09bee | [
"MIT"
] | null | null | null | SystemyMultimedialne/Lab07/tempCodeRunnerFile.py | arte00/informatyka | 642574f7c235d016b7a143a9957b26ddcaa09bee | [
"MIT"
] | null | null | null | SystemyMultimedialne/Lab07/tempCodeRunnerFile.py | arte00/informatyka | 642574f7c235d016b7a143a9957b26ddcaa09bee | [
"MIT"
] | null | null | null | sd.play(data[0:_max], samplerate=freq, blocking=True)
# sd.play(data1, samplerate=freq, blocking=True)
# sd.play(data2, samplerate=freq, blocking=True) | 50.333333 | 53 | 0.761589 | sd.play(data[0:_max], samplerate=freq, blocking=True)
| true | true |
1c397d6a6a1b5cda7f74f03891a7c53f87684eb5 | 52,992 | py | Python | pandas/tests/frame/test_reductions.py | k-fillmore/pandas | 67d4cae17bec45e84b9cf51bcf4fb5bbe293b26f | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 13 | 2015-04-09T06:21:18.000Z | 2021-02-06T05:08:09.000Z | pandas/tests/frame/test_reductions.py | k-fillmore/pandas | 67d4cae17bec45e84b9cf51bcf4fb5bbe293b26f | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2016-01-15T13:49:34.000Z | 2016-07-04T20:52:50.000Z | pandas/tests/frame/test_reductions.py | k-fillmore/pandas | 67d4cae17bec45e84b9cf51bcf4fb5bbe293b26f | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 9 | 2015-04-06T06:35:47.000Z | 2019-07-10T23:53:29.000Z | from datetime import timedelta
from decimal import Decimal
from dateutil.tz import tzlocal
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Index,
MultiIndex,
S... | 35.446154 | 88 | 0.553744 | from datetime import timedelta
from decimal import Decimal
from dateutil.tz import tzlocal
import numpy as np
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical,
DataFrame,
Index,
MultiIndex,
S... | true | true |
1c397d8363d117e09f5dbcb061e7fc8351cacae5 | 1,040 | py | Python | mys/transpiler/variables.py | Dogeek/mys | 193259a634c3ab1d9058b9ff79a0462ae86274b7 | [
"MIT"
] | null | null | null | mys/transpiler/variables.py | Dogeek/mys | 193259a634c3ab1d9058b9ff79a0462ae86274b7 | [
"MIT"
] | null | null | null | mys/transpiler/variables.py | Dogeek/mys | 193259a634c3ab1d9058b9ff79a0462ae86274b7 | [
"MIT"
] | null | null | null | class Variables:
"""A class that keeps track of which variables that are defined in all
branches, so that they can be used once they converges.
"""
def __init__(self):
self._first_add = True
self._local_variables = {}
def add_branch(self, variables):
"""Add all variables d... | 26 | 75 | 0.573077 | class Variables:
def __init__(self):
self._first_add = True
self._local_variables = {}
def add_branch(self, variables):
if self._first_add:
for name, info in variables.items():
self._local_variables[name] = info
self._first_add = False
... | true | true |
1c397ea5dd0698ae77e20b40aa0bbd6c2324ff82 | 245 | py | Python | dataformats/server_data.py | uuu0614/discordpy_util_bot | 56a3bae2caf1b351d91b5515c9052a4cc716f832 | [
"MIT"
] | 2 | 2021-08-13T07:06:50.000Z | 2021-08-13T07:23:48.000Z | dataformats/server_data.py | uuu0614/discordpy_util_bot | 56a3bae2caf1b351d91b5515c9052a4cc716f832 | [
"MIT"
] | null | null | null | dataformats/server_data.py | uuu0614/discordpy_util_bot | 56a3bae2caf1b351d91b5515c9052a4cc716f832 | [
"MIT"
] | 2 | 2020-10-31T13:52:54.000Z | 2021-08-13T07:07:25.000Z | class ServerData:
def __init__(self):
self._prefixes = ["u!"]
# サーバープレフィックス
@property
def prefixes(self):
return self._prefixes
@prefixes.setter
def prefixes(self, prefs):
self._prefixes = prefs
| 18.846154 | 31 | 0.608163 | class ServerData:
def __init__(self):
self._prefixes = ["u!"]
@property
def prefixes(self):
return self._prefixes
@prefixes.setter
def prefixes(self, prefs):
self._prefixes = prefs
| true | true |
1c397eae11cd62664355034206a4949502e8204d | 528 | py | Python | readthedocs/core/permissions.py | phoenixflyinghigh/readthedocs.org | 2dc1615c674b08c8b681ac3543fee913c9d90a11 | [
"MIT"
] | 2 | 2019-11-19T20:50:25.000Z | 2021-04-26T21:59:29.000Z | readthedocs/core/permissions.py | phoenixflyinghigh/readthedocs.org | 2dc1615c674b08c8b681ac3543fee913c9d90a11 | [
"MIT"
] | 12 | 2019-12-05T04:47:01.000Z | 2022-01-09T00:56:58.000Z | readthedocs/core/permissions.py | phoenixflyinghigh/readthedocs.org | 2dc1615c674b08c8b681ac3543fee913c9d90a11 | [
"MIT"
] | 1 | 2020-01-09T02:35:45.000Z | 2020-01-09T02:35:45.000Z | # -*- coding: utf-8 -*-
"""Objects for User permission checks."""
from readthedocs.core.utils.extend import SettingsOverrideObject
class AdminPermissionBase:
@classmethod
def is_admin(cls, user, project):
return user in project.users.all() or user.is_superuser
@classmethod
def is_member(cl... | 24 | 64 | 0.729167 |
from readthedocs.core.utils.extend import SettingsOverrideObject
class AdminPermissionBase:
@classmethod
def is_admin(cls, user, project):
return user in project.users.all() or user.is_superuser
@classmethod
def is_member(cls, user, obj):
return user in obj.users.all() or user.is_... | true | true |
1c39805d7419a7ede6f1776c4adedcbf1d902a22 | 10,756 | py | Python | qa/rpc-tests/maxuploadtarget.py | BitcoinSolution/CryptoGauleDash | d6bce32f4f1f85bc3efe3c9d96455a0e02a0e0f4 | [
"MIT"
] | null | null | null | qa/rpc-tests/maxuploadtarget.py | BitcoinSolution/CryptoGauleDash | d6bce32f4f1f85bc3efe3c9d96455a0e02a0e0f4 | [
"MIT"
] | null | null | null | qa/rpc-tests/maxuploadtarget.py | BitcoinSolution/CryptoGauleDash | d6bce32f4f1f85bc3efe3c9d96455a0e02a0e0f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
'''... | 40.43609 | 140 | 0.655448 |
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
'''
Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
if uploadtarget has been reached.
* Verify that getdata req... | false | true |
1c39817ceccba276386ffd7d3aeb8077d03f72dd | 12,588 | py | Python | wazimap/geo.py | CodeForAfricaLabs/wazimap | f3a756590f8067a48c5f3af7f848517053d859d8 | [
"MIT"
] | null | null | null | wazimap/geo.py | CodeForAfricaLabs/wazimap | f3a756590f8067a48c5f3af7f848517053d859d8 | [
"MIT"
] | 7 | 2018-08-21T12:38:30.000Z | 2019-02-26T06:21:54.000Z | wazimap/geo.py | CodeForAfricaLabs/wazimap | f3a756590f8067a48c5f3af7f848517053d859d8 | [
"MIT"
] | 1 | 2019-08-06T09:12:43.000Z | 2019-08-06T09:12:43.000Z | import os.path
import json
import logging
from itertools import chain
from django.conf import settings
from django.utils.module_loading import import_string
from django.db.models import Q
from django.contrib.staticfiles.storage import staticfiles_storage
from wazimap.models import Geography
log = logging.getLogger(_... | 37.688623 | 155 | 0.582936 | import os.path
import json
import logging
from itertools import chain
from django.conf import settings
from django.utils.module_loading import import_string
from django.db.models import Q
from django.contrib.staticfiles.storage import staticfiles_storage
from wazimap.models import Geography
log = logging.getLogger(_... | true | true |
1c3981d57b8b5192e94ebcd87abd51f7a5b55f8d | 1,289 | py | Python | autorooms/bot.py | alanissak320/autorooms | a4ff150ba263382e0bfc9849bed847f862ff996c | [
"MIT"
] | null | null | null | autorooms/bot.py | alanissak320/autorooms | a4ff150ba263382e0bfc9849bed847f862ff996c | [
"MIT"
] | null | null | null | autorooms/bot.py | alanissak320/autorooms | a4ff150ba263382e0bfc9849bed847f862ff996c | [
"MIT"
] | 1 | 2020-06-09T16:29:08.000Z | 2020-06-09T16:29:08.000Z | import logging
import discord
from discord.ext import commands
from discord.voice_client import VoiceClient
VoiceClient.warn_nacl = False
class ARBot(commands.AutoShardedBot):
"""
Autorooms bot
"""
def __init__(self, *args, initial_exts: tuple = None, **kwargs):
self.uptime = None
s... | 30.690476 | 81 | 0.643134 | import logging
import discord
from discord.ext import commands
from discord.voice_client import VoiceClient
VoiceClient.warn_nacl = False
class ARBot(commands.AutoShardedBot):
def __init__(self, *args, initial_exts: tuple = None, **kwargs):
self.uptime = None
self.initial_extensions = initial_e... | true | true |
1c3981ecbc3eb2c8ace42b9728f0a7df9a138614 | 237,626 | py | Python | tensorflow/python/ops/array_ops.py | mathemakitten/tensorflow | e62a6a8be2f9cfb79913bdb64f99efb5e88df0df | [
"Apache-2.0"
] | 1 | 2021-03-09T04:12:46.000Z | 2021-03-09T04:12:46.000Z | tensorflow/python/ops/array_ops.py | mathemakitten/tensorflow | e62a6a8be2f9cfb79913bdb64f99efb5e88df0df | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/array_ops.py | mathemakitten/tensorflow | e62a6a8be2f9cfb79913bdb64f99efb5e88df0df | [
"Apache-2.0"
] | 1 | 2021-10-15T06:37:59.000Z | 2021-10-15T06:37:59.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... | 35.514273 | 129 | 0.633125 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import common_shapes
from tensorflow.python.framework import composite_tensor
from... | true | true |
1c39835f2d752bd68ffb9c9f399f30231b3bf30e | 8,399 | py | Python | client_state_machine.py | hypedguy/Chat-System | 445e8967133ec9affd31cf3a0178d949be85347d | [
"MIT"
] | null | null | null | client_state_machine.py | hypedguy/Chat-System | 445e8967133ec9affd31cf3a0178d949be85347d | [
"MIT"
] | null | null | null | client_state_machine.py | hypedguy/Chat-System | 445e8967133ec9affd31cf3a0178d949be85347d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 5 00:00:32 2015
@author: zhengzhang
"""
from chat_utils import *
from configuredraycaster import dorender
import encoder
import json
import hashlib
from PIL import Image
class DummyThread:
def is_alive(self):
return False
def dostuff(socket, config, num, st... | 39.247664 | 101 | 0.434218 |
from chat_utils import *
from configuredraycaster import dorender
import encoder
import json
import hashlib
from PIL import Image
class DummyThread:
def is_alive(self):
return False
def dostuff(socket, config, num, start, end):
comment, result= dorender(config, start=start,end=end)
print (result)... | true | true |
1c398573bc12664f86422bc24fced85238c963a6 | 435 | py | Python | clean_db.json.py | usc-isi-i2/mydig-webservice | 9628f72fed9f33d0fe341c3d8c3324cb198aae74 | [
"MIT"
] | 2 | 2018-12-19T16:41:50.000Z | 2021-11-11T20:52:25.000Z | clean_db.json.py | research-software-company/mydig-webservice | 9628f72fed9f33d0fe341c3d8c3324cb198aae74 | [
"MIT"
] | 55 | 2017-06-09T15:53:56.000Z | 2018-04-16T23:53:30.000Z | clean_db.json.py | research-software-company/mydig-webservice | 9628f72fed9f33d0fe341c3d8c3324cb198aae74 | [
"MIT"
] | 12 | 2017-08-06T19:49:44.000Z | 2020-02-16T07:12:09.000Z | import json
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
(c_options, args) = parser.parse_args()
input_path = args[0]
tld_to_remove = args[1]
db = json.load(open(input_path, 'r'))
dbo = open('db.json', 'w')
out = dict()
for k in db.keys():
... | 24.166667 | 43 | 0.593103 | import json
from optparse import OptionParser
if __name__ == '__main__':
parser = OptionParser()
(c_options, args) = parser.parse_args()
input_path = args[0]
tld_to_remove = args[1]
db = json.load(open(input_path, 'r'))
dbo = open('db.json', 'w')
out = dict()
for k in db.keys():
... | true | true |
1c39867a254f6ffc0d1528f327164f96587a0b71 | 9,697 | py | Python | EPImix_analysis/epimix_functions.py | frantisekvasa/epimix_rapid_processing | b4bc3cc8b2f473fd8f9538376b4ffbd6a5e9374f | [
"MIT"
] | null | null | null | EPImix_analysis/epimix_functions.py | frantisekvasa/epimix_rapid_processing | b4bc3cc8b2f473fd8f9538376b4ffbd6a5e9374f | [
"MIT"
] | null | null | null | EPImix_analysis/epimix_functions.py | frantisekvasa/epimix_rapid_processing | b4bc3cc8b2f473fd8f9538376b4ffbd6a5e9374f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 13 10:38:35 2020
@author: Frantisek Vasa (fdv247@gmail.com)
Additional functions for manuscript "Rapid processing and quantitative evaluation of multicontrast EPImix scans for adaptive multimodal imaging"
"""
# Additional functions to run EPImix ... | 43.290179 | 269 | 0.643189 |
from wbplot import pscalar
import numpy as np
from matplotlib import cm, lines
import nibabel as nb
import nilearn as nl
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy as sp
10_fmt(p):
if p < 1e-10:
return 'P < $10^{-10}$'
elif p > 0.001:
return 'P = '+str... | true | true |
1c39873b51a9cef0ed9bb39b182792eaa9448ecd | 4,767 | py | Python | src/dev/hashing-algorithms.py | momacs/pram | d2de43ea447d13a65d814f781ec86889754f76fe | [
"BSD-3-Clause"
] | 10 | 2019-01-18T19:11:54.000Z | 2022-03-16T08:39:36.000Z | src/dev/hashing-algorithms.py | momacs/pram | d2de43ea447d13a65d814f781ec86889754f76fe | [
"BSD-3-Clause"
] | 2 | 2019-02-19T15:10:44.000Z | 2019-02-26T04:26:24.000Z | src/dev/hashing-algorithms.py | momacs/pram | d2de43ea447d13a65d814f781ec86889754f76fe | [
"BSD-3-Clause"
] | 3 | 2019-02-19T15:11:08.000Z | 2021-08-20T11:51:04.000Z | '''
Resources
Algorithms
https://github.com/ifduyue/python-xxhash
https://pypi.org/project/cityhash/
https://pypi.org/project/mmh3/
https://docs.python.org/3/library/zlib.html
Other
http://slidedeck.io/LawnGnome/non-cryptographic-hashing
'''
import cityhash,dill,inspect,... | 33.808511 | 120 | 0.57898 |
import cityhash,dill,inspect,json,mmh3,pickle,time,xxhash,zlib
import os,sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from pram.entity import Site
N = 100_000
attr = { 'flu': 's', 'age_group': '10_19', 'is_migrating': True, 't-migration': 3, 'history': [2,4,8.0] }
rel = { 'home': Site('ho... | true | true |
1c3987a79dd744f9b321256a697b4990832a9bcf | 6,977 | py | Python | model.py | jessicapetrochuk/Detectron_2_Image_Segmentation | 67ab6fb03b90a298367c86eab0d89a2d8438169a | [
"MIT"
] | null | null | null | model.py | jessicapetrochuk/Detectron_2_Image_Segmentation | 67ab6fb03b90a298367c86eab0d89a2d8438169a | [
"MIT"
] | null | null | null | model.py | jessicapetrochuk/Detectron_2_Image_Segmentation | 67ab6fb03b90a298367c86eab0d89a2d8438169a | [
"MIT"
] | null | null | null | import torch
import natsort
import numpy as np
import pycocotools
from PIL import Image
import os, cv2, random
import torchvision.ops as ops
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.structures import BoxMode
from detectron2.engine import DefaultTrainer
from detectron2.engin... | 44.724359 | 210 | 0.662606 | import torch
import natsort
import numpy as np
import pycocotools
from PIL import Image
import os, cv2, random
import torchvision.ops as ops
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.structures import BoxMode
from detectron2.engine import DefaultTrainer
from detectron2.engin... | true | true |
1c39885591456c32596c53902fb5486d9dfc348f | 3,719 | py | Python | lib/modules/powershell/situational_awareness/network/reverse_dns.py | jimshew/Empire | a7413869849b2c3c521eb50bed61e00ede107688 | [
"BSD-3-Clause"
] | 4 | 2019-03-11T02:40:13.000Z | 2021-01-29T06:45:21.000Z | lib/modules/powershell/situational_awareness/network/reverse_dns.py | jimshew/Empire | a7413869849b2c3c521eb50bed61e00ede107688 | [
"BSD-3-Clause"
] | 20 | 2020-03-11T03:58:21.000Z | 2020-03-12T03:59:38.000Z | lib/modules/powershell/situational_awareness/network/reverse_dns.py | jimshew/Empire | a7413869849b2c3c521eb50bed61e00ede107688 | [
"BSD-3-Clause"
] | 1 | 2020-01-15T06:46:16.000Z | 2020-01-15T06:46:16.000Z | from __future__ import print_function
from builtins import str
from builtins import object
from lib.common import helpers
class Module(object):
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-ReverseDNSLookup',
'Author': ['DarkOperator'],
'Desc... | 36.821782 | 287 | 0.534015 | from __future__ import print_function
from builtins import str
from builtins import object
from lib.common import helpers
class Module(object):
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-ReverseDNSLookup',
'Author': ['DarkOperator'],
'Desc... | true | true |
1c398a7a4236e27807795af5ede3b107f993b6d7 | 2,593 | py | Python | uncertainty_baselines/models/vit_batchensemble_gp_test.py | dvdzhang/uncertainty-baselines | 8ce0d7494e5cae0719c1b750da4b61564e536636 | [
"Apache-2.0"
] | null | null | null | uncertainty_baselines/models/vit_batchensemble_gp_test.py | dvdzhang/uncertainty-baselines | 8ce0d7494e5cae0719c1b750da4b61564e536636 | [
"Apache-2.0"
] | null | null | null | uncertainty_baselines/models/vit_batchensemble_gp_test.py | dvdzhang/uncertainty-baselines | 8ce0d7494e5cae0719c1b750da4b61564e536636 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... | 36.521127 | 79 | 0.650212 |
from absl.testing import absltest
from absl.testing import parameterized
import jax
import uncertainty_baselines as ub
class PatchTransformerBEGPTest(parameterized.TestCase):
@parameterized.parameters(
((4, 4), None, 10, None, (32, 32), "token"),
(None, (4, 4), 100, 64, (32, 64), "token"... | true | true |
1c398ab1ab8ac3cbd9c97a4f6f62bf4d989e441d | 1,181 | py | Python | eve_db/migrations/0002_system_check_fixes.py | EVE-Tools/django-eve-db | 1b588ed789a785d9243c2f2cd2ba0c965d36ba77 | [
"BSD-3-Clause"
] | 3 | 2015-03-05T20:49:27.000Z | 2017-05-27T17:53:00.000Z | eve_db/migrations/0002_system_check_fixes.py | EVE-Tools/django-eve-db | 1b588ed789a785d9243c2f2cd2ba0c965d36ba77 | [
"BSD-3-Clause"
] | 1 | 2018-01-20T10:06:05.000Z | 2018-01-20T10:08:58.000Z | eve_db/migrations/0002_system_check_fixes.py | EVE-Tools/django-eve-db | 1b588ed789a785d9243c2f2cd2ba0c965d36ba77 | [
"BSD-3-Clause"
] | 1 | 2015-02-27T17:18:42.000Z | 2015-02-27T17:18:42.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('eve_db', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='invmetatype',
name='ty... | 33.742857 | 143 | 0.635902 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('eve_db', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='invmetatype',
name='type',
field=... | true | true |
1c398b26894a66dfc4bc630632f55b9f9bc52638 | 186 | py | Python | src/generator/hide.py | lambdacasserole/zero-width-js | 27aee94612afcebabc4db08b0b4d0a89661493ad | [
"Unlicense"
] | 4 | 2019-09-02T03:45:15.000Z | 2022-03-19T01:20:38.000Z | src/generator/hide.py | lambdacasserole/zero-width-js | 27aee94612afcebabc4db08b0b4d0a89661493ad | [
"Unlicense"
] | null | null | null | src/generator/hide.py | lambdacasserole/zero-width-js | 27aee94612afcebabc4db08b0b4d0a89661493ad | [
"Unlicense"
] | null | null | null | import sys
# Convert binary to zero-width string.
binary = sys.stdin.read()
lookup = {'0': '\u200b', '1': '\u200c', ' ': '\u200d'}
for char in binary:
print(lookup[char], end = '')
| 23.25 | 54 | 0.607527 | import sys
binary = sys.stdin.read()
lookup = {'0': '\u200b', '1': '\u200c', ' ': '\u200d'}
for char in binary:
print(lookup[char], end = '')
| true | true |
1c398c64bee725e08491bc10a6721b75e46eeae2 | 1,207 | py | Python | k8s/k8splugin/exceptions.py | onap/dcaegen2-platform-plugins | 64131311ba1d01ff7d20bca0c14d30a006b2e712 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2020-07-14T14:22:04.000Z | 2020-07-14T14:22:04.000Z | k8s/k8splugin/exceptions.py | alex-sh2020/dcaegen2-platform-plugins | c5abb9b34468400bdcdd3ce23595af41ac03cd80 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | k8s/k8splugin/exceptions.py | alex-sh2020/dcaegen2-platform-plugins | c5abb9b34468400bdcdd3ce23595af41ac03cd80 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2020-07-14T19:02:05.000Z | 2020-07-14T19:02:05.000Z | # ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
# =============================================================... | 41.62069 | 82 | 0.570008 |
class DockerPluginDeploymentError(RuntimeError):
pass
class DockerPluginDependencyNotReadyError(RuntimeError):
pass
| true | true |
1c398c98d6cc4b33e1513064236da5cbc6ee025a | 3,643 | py | Python | pymongo/ismaster.py | llvtt/mongo-python-driver | 725f8342188e823ba90ab7d26e60e7a6bc43516a | [
"Apache-2.0"
] | null | null | null | pymongo/ismaster.py | llvtt/mongo-python-driver | 725f8342188e823ba90ab7d26e60e7a6bc43516a | [
"Apache-2.0"
] | null | null | null | pymongo/ismaster.py | llvtt/mongo-python-driver | 725f8342188e823ba90ab7d26e60e7a6bc43516a | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 30.107438 | 78 | 0.653033 |
import itertools
from bson.py3compat import imap
from pymongo import common
from pymongo.server_type import SERVER_TYPE
def _get_server_type(doc):
if not doc.get('ok'):
return SERVER_TYPE.Unknown
if doc.get('isreplicaset'):
return SERVER_TYPE.RSGhost
elif doc.get('setName'... | true | true |
1c398d11e3763438d71bc763f8054aa15e33c5a5 | 13,392 | py | Python | dask/array/tests/test_ufunc.py | Juanlu001/dask | ba29ba377ae71e5a90fa5ef5198c7d317b45c06a | [
"BSD-3-Clause"
] | 1 | 2021-11-02T18:53:23.000Z | 2021-11-02T18:53:23.000Z | dask/array/tests/test_ufunc.py | Juanlu001/dask | ba29ba377ae71e5a90fa5ef5198c7d317b45c06a | [
"BSD-3-Clause"
] | 1 | 2021-10-07T09:57:58.000Z | 2021-10-07T09:57:58.000Z | dask/array/tests/test_ufunc.py | Juanlu001/dask | ba29ba377ae71e5a90fa5ef5198c7d317b45c06a | [
"BSD-3-Clause"
] | 1 | 2022-02-26T15:15:40.000Z | 2022-02-26T15:15:40.000Z | import pickle
from functools import partial
from operator import add
import pytest
np = pytest.importorskip("numpy")
import dask.array as da
from dask.array.ufunc import da_frompyfunc
from dask.array.utils import assert_eq
from dask.base import tokenize
DISCLAIMER = """
This docstring was copied from numpy.{name}.
... | 27.1643 | 85 | 0.62052 | import pickle
from functools import partial
from operator import add
import pytest
np = pytest.importorskip("numpy")
import dask.array as da
from dask.array.ufunc import da_frompyfunc
from dask.array.utils import assert_eq
from dask.base import tokenize
DISCLAIMER = """
This docstring was copied from numpy.{name}.
... | true | true |
1c398f576460ce9f02cb2595cad614379587e215 | 419 | py | Python | quantifiedcode/plugins/example/backend/tasks/test.py | marcinguy/scanmycode-ce | 4a5fa1e5e9c8450f5c84164f9fa1524115f65c8b | [
"BSD-3-Clause"
] | 138 | 2022-02-02T15:38:29.000Z | 2022-03-30T21:23:33.000Z | quantifiedcode/plugins/example/backend/tasks/test.py | bbbfkl/scanmycode-ce | 786ae9a83a0839b70ac773a673a3ac69a0484ee4 | [
"BSD-3-Clause"
] | 4 | 2022-02-07T04:51:55.000Z | 2022-03-31T03:40:10.000Z | quantifiedcode/plugins/example/backend/tasks/test.py | bbbfkl/scanmycode-ce | 786ae9a83a0839b70ac773a673a3ac69a0484ee4 | [
"BSD-3-Clause"
] | 16 | 2022-01-31T14:48:18.000Z | 2022-03-28T07:12:04.000Z | """
Contains tasks and helper functions to send notifications.
"""
import logging
import requests
import json
from quantifiedcode.settings import settings
from quantifiedcode.backend.worker import celery
logger = logging.getLogger(__name__)
@celery.task(time_limit=120, queue="email", ignore_result=False)
... | 16.115385 | 64 | 0.735084 |
import logging
import requests
import json
from quantifiedcode.settings import settings
from quantifiedcode.backend.worker import celery
logger = logging.getLogger(__name__)
@celery.task(time_limit=120, queue="email", ignore_result=False)
def test(webhook, template, template_context=None):
pass
| true | true |
1c39908d91c9003fdc6a0c1eba0de122ac737542 | 4,954 | py | Python | sam/utils/creds.py | stephanpieterse/sam-iam | 7c7c1a8fe8577f63fc6b91f7b8b1dbbaa88cf7a9 | [
"MIT"
] | null | null | null | sam/utils/creds.py | stephanpieterse/sam-iam | 7c7c1a8fe8577f63fc6b91f7b8b1dbbaa88cf7a9 | [
"MIT"
] | null | null | null | sam/utils/creds.py | stephanpieterse/sam-iam | 7c7c1a8fe8577f63fc6b91f7b8b1dbbaa88cf7a9 | [
"MIT"
] | 1 | 2021-08-06T07:48:46.000Z | 2021-08-06T07:48:46.000Z |
class AWSCreds:
def __init__(self, access_key, secret_key, session) -> None:
super().__init__()
self.session = session
self.secret_key = secret_key
self.access_key = access_key
def __get_act_from_arn(inp):
return inp.split(":")[4]
def __click_output(debug, echo_env, respon... | 38.703125 | 105 | 0.633024 |
class AWSCreds:
def __init__(self, access_key, secret_key, session) -> None:
super().__init__()
self.session = session
self.secret_key = secret_key
self.access_key = access_key
def __get_act_from_arn(inp):
return inp.split(":")[4]
def __click_output(debug, echo_env, respon... | true | true |
1c3990bf204221ef25520cc6750736b1380d5478 | 2,551 | py | Python | tests/test_rsvd.py | eldrin/aarms | bdd5455ac8dcfc1fe91a12fdd132b74e6c37609d | [
"MIT"
] | null | null | null | tests/test_rsvd.py | eldrin/aarms | bdd5455ac8dcfc1fe91a12fdd132b74e6c37609d | [
"MIT"
] | 3 | 2020-11-05T08:44:46.000Z | 2020-11-10T17:25:15.000Z | tests/test_rsvd.py | eldrin/aarms | bdd5455ac8dcfc1fe91a12fdd132b74e6c37609d | [
"MIT"
] | null | null | null | import unittest
import os
os.environ['NUMBA_NUM_THREADS'] = '1'
import numpy as np
from scipy import sparse as sp
from aarms.models.rsvd import RSVD, RSVDSPPMI
from aarms.models.transform import sppmi
from base_test import TestAARMS
class TestRSVD(TestAARMS):
"""
"""
def test_rsvd_factorize(self):
... | 33.12987 | 83 | 0.454332 | import unittest
import os
os.environ['NUMBA_NUM_THREADS'] = '1'
import numpy as np
from scipy import sparse as sp
from aarms.models.rsvd import RSVD, RSVDSPPMI
from aarms.models.transform import sppmi
from base_test import TestAARMS
class TestRSVD(TestAARMS):
def test_rsvd_factorize(self):
X = sp.csr_... | true | true |
1c3990d6a79fb17cb6131442f7acbe06d709de7e | 2,798 | py | Python | picoCTF-web/tests/integration/test_teams.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 280 | 2016-03-23T05:16:07.000Z | 2022-03-25T10:45:33.000Z | picoCTF-web/tests/integration/test_teams.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 384 | 2016-03-22T05:14:47.000Z | 2021-09-13T23:46:14.000Z | picoCTF-web/tests/integration/test_teams.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 142 | 2016-03-15T16:27:21.000Z | 2022-02-23T23:41:28.000Z | """Tests for the /api/v1/teams routes."""
from pytest_mongo import factories
from pytest_redis import factories
from .common import ( # noqa (fixture)
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHIC... | 32.534884 | 88 | 0.630808 | from pytest_mongo import factories
from pytest_redis import factories
from .common import (
ADMIN_DEMOGRAPHICS,
clear_db,
client,
decode_response,
get_csrf_token,
register_test_accounts,
TEACHER_DEMOGRAPHICS,
STUDENT_DEMOGRAPHICS,
get_conn,
)
def test_create_team(mongo_proc, redi... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.