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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7490b74d909203010c28f98f6bda1f10ca9f88a | 13,657 | py | Python | flink-ai-flow/lib/airflow/airflow/contrib/jobs/dagrun_event_manager.py | kwohting/flink-ai-extended | 406b0d01c7400769f2d68e103ae59b159b06a71f | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | flink-ai-flow/lib/airflow/airflow/contrib/jobs/dagrun_event_manager.py | kwohting/flink-ai-extended | 406b0d01c7400769f2d68e103ae59b159b06a71f | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | flink-ai-flow/lib/airflow/airflow/contrib/jobs/dagrun_event_manager.py | kwohting/flink-ai-extended | 406b0d01c7400769f2d68e103ae59b159b06a71f | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.281734 | 119 | 0.654243 |
import threading
from concurrent.futures import Future
from concurrent.futures.thread import ThreadPoolExecutor
from queue import Queue, Empty
from typing import Optional, Set, Dict, cast
from notification_service.base_notification import BaseEvent
from airflow.contrib.jobs.background_service import B... | true | true |
f7490bf81c9bc3ae6dacb9cc0c3518ef3193c163 | 2,602 | py | Python | pydl/conftest.py | jhennawi/pydl | 3926aab6fd57c27e13d571156077de41343881c1 | [
"BSD-3-Clause"
] | null | null | null | pydl/conftest.py | jhennawi/pydl | 3926aab6fd57c27e13d571156077de41343881c1 | [
"BSD-3-Clause"
] | null | null | null | pydl/conftest.py | jhennawi/pydl | 3926aab6fd57c27e13d571156077de41343881c1 | [
"BSD-3-Clause"
] | null | null | null | # This file is used to configure the behavior of pytest when using the Astropy
# test infrastructure.
from astropy.version import version as astropy_version
if astropy_version < '3.0':
# With older versions of Astropy, we actually need to import the pytest
# plugins themselves in order to make them discoverabl... | 40.030769 | 84 | 0.746733 |
from astropy.version import version as astropy_version
if astropy_version < '3.0':
from astropy.tests.pytest_plugins import *
else:
# not necessary to import them here, but we still need to import global
# variables that are used for configuration.
from astropy.tests.plugins.displ... | true | true |
f7490d4792552583a1ed5528e747d2df7d821e7a | 522 | py | Python | tests/fake_packages/FakeApp/setup.py | huntcsg/plaster_pastedeploy | 411db74fd5155061e7990b674458d856a2c543d9 | [
"MIT"
] | null | null | null | tests/fake_packages/FakeApp/setup.py | huntcsg/plaster_pastedeploy | 411db74fd5155061e7990b674458d856a2c543d9 | [
"MIT"
] | null | null | null | tests/fake_packages/FakeApp/setup.py | huntcsg/plaster_pastedeploy | 411db74fd5155061e7990b674458d856a2c543d9 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="FakeApp",
version="1.0",
packages=find_packages(),
entry_points={
'paste.app_factory': """
basic_app=fakeapp.apps:make_basic_app
other=fakeapp.apps:make_basic_app2
configed=fakeapp.configapps:SimpleApp.make_app
... | 24.857143 | 54 | 0.609195 | from setuptools import setup, find_packages
setup(
name="FakeApp",
version="1.0",
packages=find_packages(),
entry_points={
'paste.app_factory': """
basic_app=fakeapp.apps:make_basic_app
other=fakeapp.apps:make_basic_app2
configed=fakeapp.configapps:SimpleApp.make_app
... | true | true |
f7490e1fe1d0c8051803e187c805954ce4221a14 | 47,898 | py | Python | tests/gclient_scm_test.py | superisaac/depot_tools | ea1884b651e69975e897b15cf2063f36317538a4 | [
"BSD-3-Clause"
] | null | null | null | tests/gclient_scm_test.py | superisaac/depot_tools | ea1884b651e69975e897b15cf2063f36317538a4 | [
"BSD-3-Clause"
] | null | null | null | tests/gclient_scm_test.py | superisaac/depot_tools | ea1884b651e69975e897b15cf2063f36317538a4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env vpython3
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for gclient_scm.py."""
# pylint: disable=E1103
from __future__ import unicode_literals
from subprocess import P... | 35.771471 | 80 | 0.648086 |
from __future__ import unicode_literals
from subprocess import Popen, PIPE, STDOUT
import json
import logging
import os
import re
import sys
import tempfile
import unittest
if sys.version_info.major == 2:
from cStringIO import StringIO
else:
from io import StringIO
sys.path.insert(0, os.path.dirname(os... | true | true |
f7490f354598f97c817adf34d81b730bd50a827a | 12,172 | py | Python | localstack/config.py | BisratYalew/localstack | 8c69fbe314fd69abc76371e8f9b7b0b49da24ded | [
"Apache-2.0"
] | 1 | 2020-03-25T17:33:37.000Z | 2020-03-25T17:33:37.000Z | localstack/config.py | BisratYalew/localstack | 8c69fbe314fd69abc76371e8f9b7b0b49da24ded | [
"Apache-2.0"
] | null | null | null | localstack/config.py | BisratYalew/localstack | 8c69fbe314fd69abc76371e8f9b7b0b49da24ded | [
"Apache-2.0"
] | null | null | null | import re
import os
import socket
import logging
import platform
import tempfile
import subprocess
from os.path import expanduser
import six
from boto3 import Session
from localstack.constants import (
DEFAULT_SERVICE_PORTS, LOCALHOST, DEFAULT_PORT_WEB_UI, TRUE_STRINGS, FALSE_STRINGS,
DEFAULT_LAMBDA_CONTAINER_R... | 39.519481 | 120 | 0.714427 | import re
import os
import socket
import logging
import platform
import tempfile
import subprocess
from os.path import expanduser
import six
from boto3 import Session
from localstack.constants import (
DEFAULT_SERVICE_PORTS, LOCALHOST, DEFAULT_PORT_WEB_UI, TRUE_STRINGS, FALSE_STRINGS,
DEFAULT_LAMBDA_CONTAINER_R... | true | true |
f7490f8cfae22ab31bfdae744cc90bcc98a2fd1c | 2,684 | py | Python | tests/dataset/bdv/test_bdv.py | thhsieh00/utoolbox-core | e46704348d60985c205a16f41788d2c185e11fb6 | [
"Apache-2.0"
] | 3 | 2020-08-21T02:34:32.000Z | 2021-04-06T06:56:46.000Z | tests/dataset/bdv/test_bdv.py | liuyenting/utoolbox-core | d1430967458204b99780c547eaca60d066490946 | [
"Apache-2.0"
] | null | null | null | tests/dataset/bdv/test_bdv.py | liuyenting/utoolbox-core | d1430967458204b99780c547eaca60d066490946 | [
"Apache-2.0"
] | null | null | null | import logging
import os
from pprint import pprint
from shutil import rmtree
import pandas as pd
from dask.distributed import Client
from prompt_toolkit.shortcuts import button_dialog
from utoolbox.io import open_dataset
from utoolbox.io.dataset import BigDataViewerDataset, TiledDatasetIterator
logger = ... | 30.5 | 87 | 0.621088 | import logging
import os
from pprint import pprint
from shutil import rmtree
import pandas as pd
from dask.distributed import Client
from prompt_toolkit.shortcuts import button_dialog
from utoolbox.io import open_dataset
from utoolbox.io.dataset import BigDataViewerDataset, TiledDatasetIterator
logger = ... | true | true |
f7491103f4de3223deb966e7c67993f1497ee69b | 15,271 | py | Python | datasets.py | fepegar/resseg-ijcars | 963e5548fb02c777038ef550c969149377071cfc | [
"MIT"
] | 5 | 2021-02-23T03:31:32.000Z | 2022-03-26T08:59:59.000Z | datasets.py | fepegar/resseg-ijcars | 963e5548fb02c777038ef550c969149377071cfc | [
"MIT"
] | 1 | 2022-03-28T12:12:08.000Z | 2022-03-31T05:34:51.000Z | datasets.py | fepegar/resseg-ijcars | 963e5548fb02c777038ef550c969149377071cfc | [
"MIT"
] | 2 | 2021-02-23T03:31:33.000Z | 2021-08-06T11:24:32.000Z | import hashlib
from pathlib import Path
import torch
import pandas as pd
import torchio as tio
from tqdm import tqdm
from resector import RandomResection
from sklearn.model_selection import KFold
from utils import sglob, get_stem
class DataModule:
def __init__(
self,
datasets_dir,
... | 36.101655 | 118 | 0.66086 | import hashlib
from pathlib import Path
import torch
import pandas as pd
import torchio as tio
from tqdm import tqdm
from resector import RandomResection
from sklearn.model_selection import KFold
from utils import sglob, get_stem
class DataModule:
def __init__(
self,
datasets_dir,
... | true | true |
f749118fb7808910c4fc9e58c1737136a1ab13ca | 8,779 | py | Python | resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtGui/QTreeView.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | 1 | 2020-04-20T02:27:20.000Z | 2020-04-20T02:27:20.000Z | resources/dot_PyCharm/system/python_stubs/cache/8cdc475d469a13122bc4bc6c3ac1c215d93d5f120f5cc1ef33a8f3088ee54d8e/PySide/QtGui/QTreeView.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | resources/dot_PyCharm/system/python_stubs/cache/8cdc475d469a13122bc4bc6c3ac1c215d93d5f120f5cc1ef33a8f3088ee54d8e/PySide/QtGui/QTreeView.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | # encoding: utf-8
# module PySide.QtGui
# from C:\Python27\lib\site-packages\PySide\QtGui.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
from QAbstractItemView import QAbstractItemView
class QTreeView(QAbstractItemView):
# no doc
def allColu... | 28.228296 | 106 | 0.640506 |
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
from QAbstractItemView import QAbstractItemView
class QTreeView(QAbstractItemView):
def allColumnsShowFocus(self, *args, **kwargs):
pass
def autoExpandDelay(self, *args, **kwargs):
pass
def collapse(self... | true | true |
f74911a71d5ad4437ee668dbca4a1ac0f37a2a0e | 2,041 | py | Python | .venv/lib/python3.7/site-packages/prompt_toolkit/contrib/regular_languages/validation.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 17 | 2020-06-10T23:33:11.000Z | 2021-01-02T20:38:25.000Z | .venv/lib/python3.7/site-packages/prompt_toolkit/contrib/regular_languages/validation.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 24 | 2020-03-25T19:35:43.000Z | 2022-02-10T11:46:50.000Z | .venv/lib/python3.7/site-packages/prompt_toolkit/contrib/regular_languages/validation.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 11 | 2019-01-21T17:51:48.000Z | 2021-08-10T07:04:33.000Z | """
Validator for a regular language.
"""
from typing import Dict
from prompt_toolkit.document import Document
from prompt_toolkit.validation import ValidationError, Validator
from .compiler import _CompiledGrammar
__all__ = [
"GrammarValidator",
]
class GrammarValidator(Validator):
"""
Validator which... | 33.459016 | 87 | 0.609505 | from typing import Dict
from prompt_toolkit.document import Document
from prompt_toolkit.validation import ValidationError, Validator
from .compiler import _CompiledGrammar
__all__ = [
"GrammarValidator",
]
class GrammarValidator(Validator):
def __init__(
self, compiled_grammar: _CompiledGrammar, ... | true | true |
f74911ff7be4b8723a8e7b646dbf7963fccfdaf0 | 5,732 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/opsahlpowergrid.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/opsahlpowergrid.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/opsahlpowergrid.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph opsahl-powergrid.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime:... | 32.022346 | 94 | 0.686671 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def OpsahlPowergrid(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/networkrepository",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:... | true | true |
f7491200ded9f69ce77625818b12c9f79275ffac | 3,501 | py | Python | django/contrib/gis/gdal/prototypes/srs.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 2 | 2016-09-27T09:30:19.000Z | 2016-10-17T01:47:43.000Z | django/contrib/gis/gdal/prototypes/srs.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 10 | 2019-12-26T17:31:31.000Z | 2022-03-21T22:17:33.000Z | django/contrib/gis/gdal/prototypes/srs.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T08:23:34.000Z | 2020-10-01T08:23:34.000Z | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, int_output, srs_output, string_output, void_output)
## Shortcut generation for routines with known parame... | 47.310811 | 130 | 0.789489 | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, int_output, srs_output, string_output, void_output)
, POINTER(c_int)], errcheck=True)
def units_func(f)... | true | true |
f749130115c3085cf5561b57d5d6892b767eceee | 69,059 | py | Python | text/src/autogluon/text/text_prediction/mx/models.py | rxjx/autogluon | 648c19b8b76a6d663a2a8b42b9f3463e60c63e2c | [
"Apache-2.0"
] | null | null | null | text/src/autogluon/text/text_prediction/mx/models.py | rxjx/autogluon | 648c19b8b76a6d663a2a8b42b9f3463e60c63e2c | [
"Apache-2.0"
] | null | null | null | text/src/autogluon/text/text_prediction/mx/models.py | rxjx/autogluon | 648c19b8b76a6d663a2a8b42b9f3463e60c63e2c | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy.special
import os
import math
import logging
import pandas as pd
import warnings
import time
import json
import pickle
import functools
import tqdm
from typing import Tuple
from autogluon.core.scheduler.scheduler_factory import scheduler_factory
from autogluon.core.utils import set_logg... | 45.704169 | 198 | 0.600125 | import numpy as np
import scipy.special
import os
import math
import logging
import pandas as pd
import warnings
import time
import json
import pickle
import functools
import tqdm
from typing import Tuple
from autogluon.core.scheduler.scheduler_factory import scheduler_factory
from autogluon.core.utils import set_logg... | true | true |
f74913568217f69ced12a5bafdcff5b583fec2ba | 5,432 | py | Python | db_worker.py | customr/retranslator | c5ccebe9784e4c804c48c27cffbab7a5d60311a2 | [
"MIT"
] | null | null | null | db_worker.py | customr/retranslator | c5ccebe9784e4c804c48c27cffbab7a5d60311a2 | [
"MIT"
] | null | null | null | db_worker.py | customr/retranslator | c5ccebe9784e4c804c48c27cffbab7a5d60311a2 | [
"MIT"
] | null | null | null | import pymysql
import time
import os
import socket
import threading
from time import sleep
from copy import deepcopy
from contextlib import closing
from json import loads
from queue import Queue
from datetime import datetime
from binascii import hexlify
from src.retranslators import Wialon, EGTS, WialonIPS, GalileoSk... | 29.68306 | 211 | 0.653166 | import pymysql
import time
import os
import socket
import threading
from time import sleep
from copy import deepcopy
from contextlib import closing
from json import loads
from queue import Queue
from datetime import datetime
from binascii import hexlify
from src.retranslators import Wialon, EGTS, WialonIPS, GalileoSk... | true | true |
f7491364ac84e44a87cb479b5551e325712ae014 | 16,445 | py | Python | pypy/module/pypyjit/test_pypy_c/test_ffi.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/pypyjit/test_pypy_c/test_ffi.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/pypyjit/test_pypy_c/test_ffi.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import sys, py
from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
class Test__ffi(BaseTestPyPyC):
def test__ffi_call(self):
from rpython.rlib.test.test_clibffi import get_libm_name
def main(libm_name):
try:
from _rawffi.alt import CDLL, types
... | 37.631579 | 117 | 0.522894 | import sys, py
from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC
class Test__ffi(BaseTestPyPyC):
def test__ffi_call(self):
from rpython.rlib.test.test_clibffi import get_libm_name
def main(libm_name):
try:
from _rawffi.alt import CDLL, types
... | true | true |
f749154db0685f00145a372b55c4f47f72f52655 | 24,982 | py | Python | python/tests/test_getitem.py | HDembinski/aghast | f3d45a6960033f48fb8f6b7e906cb36b9d9d8e95 | [
"BSD-3-Clause"
] | 18 | 2019-04-15T14:39:35.000Z | 2021-12-21T15:01:02.000Z | python/tests/test_getitem.py | HDembinski/aghast | f3d45a6960033f48fb8f6b7e906cb36b9d9d8e95 | [
"BSD-3-Clause"
] | 27 | 2019-04-12T20:24:00.000Z | 2021-12-03T08:51:56.000Z | python/tests/test_getitem.py | diana-hep/stagg | ed97e9abc870e729d300622253aa7e9c870f77ec | [
"BSD-3-Clause"
] | 11 | 2019-04-15T14:41:00.000Z | 2021-11-16T13:28:10.000Z | #!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/aghast/blob/master/LICENSE
import sys
import unittest
import numpy
from aghast import *
class Test(unittest.TestCase):
def runTest(self):
pass
def test_getitem_twodim(self):
a = Histogram(
[Axis(In... | 32.151866 | 115 | 0.376151 |
import sys
import unittest
import numpy
from aghast import *
class Test(unittest.TestCase):
def runTest(self):
pass
def test_getitem_twodim(self):
a = Histogram(
[Axis(IntegerBinning(0, 3)), Axis(IntegerBinning(0, 2))],
UnweightedCounts(
Interpret... | true | true |
f7491617103f0f3d95f104cfed0631924220cd1e | 4,644 | py | Python | corehq/apps/data_dictionary/models.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/data_dictionary/models.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/data_dictionary/models.py | akashkj/commcare-hq | b00a62336ec26cea1477dfb8c048c548cc462831 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
from dimagi.utils.couch import CriticalSection
from dimagi.utils.parsing import ISO_DATE_FORMAT
from corehq.apps.case_importer import exceptions
PROPERTY_TYPE_CHOICES = (
('date', _('Date')),
('pla... | 34.917293 | 100 | 0.650301 | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
from dimagi.utils.couch import CriticalSection
from dimagi.utils.parsing import ISO_DATE_FORMAT
from corehq.apps.case_importer import exceptions
PROPERTY_TYPE_CHOICES = (
('date', _('Date')),
('pla... | true | true |
f74918b8270c4095a692ef14c09d678c0e4deff6 | 951 | py | Python | pythia/pyre/parsing/locators/SimpleFileLocator.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 1 | 2015-11-30T08:01:39.000Z | 2015-11-30T08:01:39.000Z | pythia/pyre/parsing/locators/SimpleFileLocator.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 27 | 2018-05-24T18:31:25.000Z | 2021-10-16T03:57:52.000Z | pythia/pyre/parsing/locators/SimpleFileLocator.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 7 | 2019-07-19T02:30:56.000Z | 2021-06-02T22:00:01.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | 19.8125 | 80 | 0.460568 |
class SimpleFileLocator(object):
def __init__(self, source):
self.source = source
return
def __str__(self):
return "{file=%r}" % (self.source)
def __getstate__(self):
return dict(source = self.source)
def __setstate__(self, dict):
self.s... | true | true |
f74918f4eaf6e565c703c13c000be419ce00eea1 | 325 | py | Python | test/data/compile_error/halfling.py | aloebs29/halfling | b8b21b8167a9e77dcad4c1f46ab89fbb758587e4 | [
"MIT"
] | null | null | null | test/data/compile_error/halfling.py | aloebs29/halfling | b8b21b8167a9e77dcad4c1f46ab89fbb758587e4 | [
"MIT"
] | null | null | null | test/data/compile_error/halfling.py | aloebs29/halfling | b8b21b8167a9e77dcad4c1f46ab89fbb758587e4 | [
"MIT"
] | null | null | null | from pathlib import Path
import halfling
build_options = halfling.builders.CxxBuildOptions(
executable_name="compile_error.out",
compiler="clang++",
build_dir=Path(__file__).parent / "build",
sources=["main.cpp"],
)
halfling.shortcuts.add_build_and_clean_tasks(halfling.builders.CxxBuilder(build_optio... | 25 | 89 | 0.769231 | from pathlib import Path
import halfling
build_options = halfling.builders.CxxBuildOptions(
executable_name="compile_error.out",
compiler="clang++",
build_dir=Path(__file__).parent / "build",
sources=["main.cpp"],
)
halfling.shortcuts.add_build_and_clean_tasks(halfling.builders.CxxBuilder(build_optio... | true | true |
f7491af7dc0f1369a4008ffc1e6bb00a2a329634 | 600 | py | Python | tests/test.py | pyarnold/term2048 | 37747c1319f39fc8a0461d5d0a8210cbb69e9e09 | [
"MIT"
] | 1 | 2020-12-18T01:07:58.000Z | 2020-12-18T01:07:58.000Z | tests/test.py | pyarnold/term2048 | 37747c1319f39fc8a0461d5d0a8210cbb69e9e09 | [
"MIT"
] | null | null | null | tests/test.py | pyarnold/term2048 | 37747c1319f39fc8a0461d5d0a8210cbb69e9e09 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import sys
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
from os.path import dirname
import keypress_mock as kp
if __name__ == '__main__':
here = dirname(__file__)
sys.path.insert(0, here + '/..')
# keypress mock
... | 23.076923 | 53 | 0.675 |
import sys
import platform
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
from os.path import dirname
import keypress_mock as kp
if __name__ == '__main__':
here = dirname(__file__)
sys.path.insert(0, here + '/..')
import term2048.keypress
_kp = ... | true | true |
f7491b41315d9c2c71673c898f20193fd00bd672 | 461 | py | Python | env/Lib/site-packages/plotly/validators/treemap/marker/colorbar/tickformatstop/_name.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/treemap/marker/colorbar/tickformatstop/_name.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/treemap/marker/colorbar/tickformatstop/_name.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="name",
parent_name="treemap.marker.colorbar.tickformatstop",
**kwargs
):
super(NameValidator, self).__init__(
plotly_name=... | 27.117647 | 66 | 0.631236 | import _plotly_utils.basevalidators
class NameValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="name",
parent_name="treemap.marker.colorbar.tickformatstop",
**kwargs
):
super(NameValidator, self).__init__(
plotly_name=... | true | true |
f7491b75b915ae5c5dfc0fc561a493a768ef9c79 | 427 | py | Python | mailer/sendmail/migrations/0004_auto_20190820_1430.py | konrad43/Mailer | 3eaa0a417bbf1bca27d7c1de28659b6fe079e38d | [
"MIT"
] | null | null | null | mailer/sendmail/migrations/0004_auto_20190820_1430.py | konrad43/Mailer | 3eaa0a417bbf1bca27d7c1de28659b6fe079e38d | [
"MIT"
] | 8 | 2020-02-12T01:44:11.000Z | 2022-02-10T12:19:23.000Z | mailer/sendmail/migrations/0004_auto_20190820_1430.py | konrad43/Mailer | 3eaa0a417bbf1bca27d7c1de28659b6fe079e38d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-08-20 14:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sendmail', '0003_auto_20190820_1420'),
]
operations = [
migrations.AlterField(
model_name='email',
name='reply_to',
... | 22.473684 | 89 | 0.615925 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sendmail', '0003_auto_20190820_1420'),
]
operations = [
migrations.AlterField(
model_name='email',
name='reply_to',
field=models.EmailField(blank=True,... | true | true |
f7491b988b2e750357271dd872967c48a3ce6544 | 1,846 | py | Python | 4course/inf_protection/course/client.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | 10 | 2021-08-28T08:44:57.000Z | 2022-03-06T16:29:51.000Z | 4course/inf_protection/course/client.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | null | null | null | 4course/inf_protection/course/client.py | soul-catcher/sibsutis | 5d7d88ffabbe445052927eb6c6097697df672997 | [
"WTFPL"
] | 6 | 2021-09-06T07:26:18.000Z | 2021-12-16T16:11:10.000Z | import random
import socket
import sys
import crypto
class Client:
def __init__(self, name: str):
self.name = name
def register(self):
sock = socket.socket()
sock.connect(('localhost', 8081))
n = int.from_bytes(sock.recv(16), sys.byteorder)
sock.send('register'.encode... | 31.288136 | 85 | 0.576923 | import random
import socket
import sys
import crypto
class Client:
def __init__(self, name: str):
self.name = name
def register(self):
sock = socket.socket()
sock.connect(('localhost', 8081))
n = int.from_bytes(sock.recv(16), sys.byteorder)
sock.send('register'.encode... | true | true |
f7491bba13375be1bc902c2504812322bb56920d | 13,316 | py | Python | Lib/site-packages/win32comext/directsound/test/ds_test.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2022-02-25T13:46:54.000Z | 2022-02-25T13:46:54.000Z | Lib/site-packages/win32comext/directsound/test/ds_test.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/win32comext/directsound/test/ds_test.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2022-02-25T13:47:47.000Z | 2022-02-25T13:47:47.000Z | import unittest
import struct
import sys
import os
import pywintypes
import win32event, win32api
import os
from pywin32_testutil import TestSkipped
import win32com.directsound.directsound as ds
import pythoncom
# next two lines are for for debugging:
# import win32com
# import directsound as ds
WAV_FORMAT_PCM = 1
WAV... | 32.320388 | 83 | 0.631796 | import unittest
import struct
import sys
import os
import pywintypes
import win32event, win32api
import os
from pywin32_testutil import TestSkipped
import win32com.directsound.directsound as ds
import pythoncom
WAV_FORMAT_PCM = 1
WAV_HEADER_SIZE = struct.calcsize("<4sl4s4slhhllhh4sl")
def wav_header_unpack(data)... | true | true |
f7491c3c2ed0a25d56229a24c03fb301365e341c | 1,823 | py | Python | molecule/default/tests/test_default.py | cisagov/ansible-role-docker | 03454415e8e0f9d90b5f5cbe540a5a3371b0e2e9 | [
"CC0-1.0"
] | 2 | 2020-12-31T23:23:04.000Z | 2021-07-14T14:50:35.000Z | molecule/default/tests/test_default.py | cisagov/ansible-role-docker | 03454415e8e0f9d90b5f5cbe540a5a3371b0e2e9 | [
"CC0-1.0"
] | 10 | 2020-03-02T03:50:40.000Z | 2022-03-07T11:02:35.000Z | molecule/default/tests/test_default.py | cisagov/ansible-role-docker | 03454415e8e0f9d90b5f5cbe540a5a3371b0e2e9 | [
"CC0-1.0"
] | null | null | null | """Module containing the tests for the default scenario."""
# Standard Python Libraries
import os
# Third-Party Libraries
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_package... | 31.431034 | 81 | 0.690071 |
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_packages(host):
distribution = host.system_info.distribution
codename = host.system_info.codename
i... | true | true |
f7491c9c9ca69881bd231ea13c99a8ae451da5d9 | 2,012 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/GetHdfsCapacityStatisticInfoRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/GetHdfsCapacityStatisticInfoRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/GetHdfsCapacityStatisticInfoRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.928571 | 81 | 0.772863 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkemr.endpoint import endpoint_data
class GetHdfsCapacityStatisticInfoRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'GetHdfsCapacityStatisticInfo')
self.set_method('POST')
if hasattr(self, "en... | true | true |
f7491e4db586564a8d12642011a6c8225e3ddf5d | 3,330 | py | Python | NatLink/SampleMacros/_globals.py | sboosali/commands-frontends-dragon13 | a0ea989bcfc70d0531e8d6aca76639f600fab807 | [
"MIT"
] | null | null | null | NatLink/SampleMacros/_globals.py | sboosali/commands-frontends-dragon13 | a0ea989bcfc70d0531e8d6aca76639f600fab807 | [
"MIT"
] | null | null | null | NatLink/SampleMacros/_globals.py | sboosali/commands-frontends-dragon13 | a0ea989bcfc70d0531e8d6aca76639f600fab807 | [
"MIT"
] | null | null | null | #
# Python Macro Language for Dragon NaturallySpeaking
# (c) Copyright 1999 by Joel Gould
# Portions (c) Copyright 1999 by Dragon Systems, Inc.
#
# _glogals.py
# Sample macro file which is active all the time (not application specific).
#
# April 25, 1999
# - packaged for external release
#
# March 3, 1999
# ... | 33.636364 | 78 | 0.683784 | true | true | |
f7491e4f0cff52453a2c48ec06d985cab574c2ca | 1,818 | py | Python | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/DescribeUpBpsPeakDataRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/DescribeUpBpsPeakDataRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/DescribeUpBpsPeakDataRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.666667 | 82 | 0.761276 |
from aliyunsdkcore.request import RpcRequest
class DescribeUpBpsPeakDataRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'live', '2016-11-01', 'DescribeUpBpsPeakData','live')
def get_DomainName(self):
return self.get_query_params().get('DomainName')
def set_DomainName... | true | true |
f7491f373e7284c82cba48d61cb06036509092eb | 87 | py | Python | demeter/__init__.py | shemic/demeter | 01f91aac43c325c48001dda86af17da43fb8d6fe | [
"MIT"
] | 1 | 2017-12-05T08:17:53.000Z | 2017-12-05T08:17:53.000Z | demeter/__init__.py | shemic/demeter | 01f91aac43c325c48001dda86af17da43fb8d6fe | [
"MIT"
] | null | null | null | demeter/__init__.py | shemic/demeter | 01f91aac43c325c48001dda86af17da43fb8d6fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
demeter init
author:rabin
"""
__version__ = '1.0.0' | 14.5 | 23 | 0.528736 |
__version__ = '1.0.0' | true | true |
f7491fa91c1a888febc71d2e8f6358f14215a93b | 1,759 | py | Python | python/slack_types/rtm_api/group_joined_event.py | warrenseine/slack-types | 19e280aa43186ab4b9126ac6891f43cac22d3aaf | [
"MIT"
] | null | null | null | python/slack_types/rtm_api/group_joined_event.py | warrenseine/slack-types | 19e280aa43186ab4b9126ac6891f43cac22d3aaf | [
"MIT"
] | null | null | null | python/slack_types/rtm_api/group_joined_event.py | warrenseine/slack-types | 19e280aa43186ab4b9126ac6891f43cac22d3aaf | [
"MIT"
] | null | null | null | # To use this code, make sure you
#
# import json
#
# and then, to convert JSON from a string, do
#
# result = group_joined_event_from_dict(json.loads(json_string))
from dataclasses import dataclass
from typing import Any, Optional, TypeVar, Type, cast
T = TypeVar("T")
def from_str(x: Any) -> str:
asse... | 22.265823 | 97 | 0.642979 |
from dataclasses import dataclass
from typing import Any, Optional, TypeVar, Type, cast
T = TypeVar("T")
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def from_none(x: Any) -> Any:
assert x is None
return x
def from_union(fs, x):
for f in fs:
try:
... | true | true |
f74920b72124648639170d88c88814ba22b40319 | 3,715 | py | Python | optimizer/_internals/common/linneq.py | Andy-math/optimizer | a65f5ee54a0ae4e02aefb008d47c2d551d071ef0 | [
"Apache-2.0"
] | 1 | 2021-06-29T10:05:05.000Z | 2021-06-29T10:05:05.000Z | optimizer/_internals/common/linneq.py | Andy-math/optimizer | a65f5ee54a0ae4e02aefb008d47c2d551d071ef0 | [
"Apache-2.0"
] | null | null | null | optimizer/_internals/common/linneq.py | Andy-math/optimizer | a65f5ee54a0ae4e02aefb008d47c2d551d071ef0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Optional, Tuple
import numpy
from overloads import bind_checker, dyn_typing
from overloads.shortcuts import assertNoInfNaN, assertNoNaN
from overloads.typedefs import ndarray
def noCheck(_: bool) -> None:
pass
def constraint_check(
constraints: Tuple[ndarray, n... | 27.316176 | 87 | 0.581427 |
from typing import Optional, Tuple
import numpy
from overloads import bind_checker, dyn_typing
from overloads.shortcuts import assertNoInfNaN, assertNoNaN
from overloads.typedefs import ndarray
def noCheck(_: bool) -> None:
pass
def constraint_check(
constraints: Tuple[ndarray, ndarray, ndarray, ndarra... | true | true |
f7492208fdd5ae55c2e4d7f31d7c6da10b99bace | 51,580 | py | Python | pymc3/tests/test_distributions_random.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_distributions_random.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_distributions_random.py | cowirihy/pymc3 | f0b95773047af12f3c0ded04d707f02ddc4d4f6b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PyMC Developers
#
# 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 ag... | 38.694674 | 123 | 0.550388 |
import pytest
import numpy as np
import numpy.testing as npt
import scipy.stats as st
from scipy.special import expit
from scipy import linalg
import numpy.random as nr
import theano
import pymc3 as pm
from pymc3.distributions.dist_math import clipped_beta_rvs
from pymc3.distributions.distribution import... | true | true |
f7492263553766afd231582e001fbca345b7538a | 7,934 | py | Python | tests/test_file_utils.py | netinvent/ofunctions | 868352ed26f219b9a91654eccf93c69578a1b4fa | [
"BSD-3-Clause"
] | 3 | 2021-03-08T01:51:32.000Z | 2021-08-02T15:31:07.000Z | tests/test_file_utils.py | netinvent/ofunctions | 868352ed26f219b9a91654eccf93c69578a1b4fa | [
"BSD-3-Clause"
] | 2 | 2021-05-12T19:39:58.000Z | 2022-03-11T15:12:24.000Z | tests/test_file_utils.py | netinvent/ofunctions | 868352ed26f219b9a91654eccf93c69578a1b4fa | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of command_runner module
"""
Versioning semantics:
Major version: backward compatibility breaking changes
Minor version: New functionality
Patch version: Backwards compatible bug fixes
"""
__intname__ = 'tests.ofunctions.file_utils'
__... | 39.083744 | 125 | 0.706075 |
__intname__ = 'tests.ofunctions.file_utils'
__author__ = 'Orsiris de Jong'
__copyright__ = 'Copyright (C) 2020-2021 Orsiris de Jong'
__licence__ = 'BSD 3 Clause'
__build__ = '2021052601'
import sys
from time import sleep
from ofunctions.file_utils import *
from ofunctions.random import random_string
def test_... | true | true |
f74922b941e509d18a8f8d7a53229dc424e61425 | 10,229 | py | Python | doc/source/conf.py | pertoft/openstack-ansible-os_keystone | da371656000596802f7bc364d4442eea264f3b63 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | pertoft/openstack-ansible-os_keystone | da371656000596802f7bc364d4442eea264f3b63 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | pertoft/openstack-ansible-os_keystone | da371656000596802f7bc364d4442eea264f3b63 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# 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, software... | 32.996774 | 118 | 0.714048 |
import openstackdocstheme
extensions = [
'openstackdocstheme',
'sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinxcontrib.rsvgconverter',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
author = 'OpenStack-Ansible Contribu... | true | true |
f74922ca39a253d92a9c87dae1b6068ed0dd843c | 4,766 | py | Python | eland/ml/_model_serializer.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | null | null | null | eland/ml/_model_serializer.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | null | null | null | eland/ml/_model_serializer.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
import base64
import gzip
import json
from abc import ABC
from typing import Sequence, Dict, Any, Optional
def add_... | 35.303704 | 87 | 0.648342 |
import base64
import gzip
import json
from abc import ABC
from typing import Sequence, Dict, Any, Optional
def add_if_exists(d: Dict[str, Any], k: str, v: Any) -> None:
if v is not None:
d[k] = v
class ModelSerializer(ABC):
def __init__(
self,
feature_names: Sequence[str],
... | true | true |
f74923a147c9fa9ba102d3b5c186d86bfdd1eb1d | 11,888 | py | Python | tests/test_matrix.py | tresoldi/malign | dad7f2585db3b12f2edbf587f591463aed7c98f5 | [
"MIT"
] | null | null | null | tests/test_matrix.py | tresoldi/malign | dad7f2585db3b12f2edbf587f591463aed7c98f5 | [
"MIT"
] | 1 | 2020-08-07T13:01:29.000Z | 2020-08-07T13:01:29.000Z | tests/test_matrix.py | tresoldi/malign | dad7f2585db3b12f2edbf587f591463aed7c98f5 | [
"MIT"
] | null | null | null | """
test_matrix
===========
Tests for the scoring matrices of the `malign` package.
"""
# TODO: add test for identity matrix
# TODO: add test for initialization only from sparse subdomain
# TODO: add test providing domains
# TODO: add, in general, tests where there is disagreement between scores/subm/domain
# TODO: r... | 27.518519 | 86 | 0.430518 |
import math
import pytest
import malign
PAIRWISE_TEST_VECTORS = {
("-", "-"): 0.0,
("-", "X"): -3.0,
("-", "Y"): -9.0,
("a", "-"): -3.0,
("a", "X"): 0.0,
("a", "Y"): 8.0,
("b", "-"): -5.0,
("b", "X"): 4.0,
("b", "Y"): 4.0,
("c", "-"): 2.0,
("c", "X"): -1.0,
("... | true | true |
f749240ef4048c9d20303218eb99c0d0f161f049 | 2,026 | py | Python | tools/cqt_diff/cqt_diff_vgg16.py | natsutan/cocytus | 53840021eb5a84ab197d96fa37e8b43b0b255566 | [
"MIT"
] | 8 | 2017-04-21T14:55:42.000Z | 2020-03-17T14:11:34.000Z | tools/cqt_diff/cqt_diff_vgg16.py | natsutan/cocytus | 53840021eb5a84ab197d96fa37e8b43b0b255566 | [
"MIT"
] | 5 | 2017-06-21T03:09:23.000Z | 2020-05-08T00:31:36.000Z | tools/cqt_diff/cqt_diff_vgg16.py | natsutan/cocytus | 53840021eb5a84ab197d96fa37e8b43b0b255566 | [
"MIT"
] | 4 | 2017-07-06T12:34:54.000Z | 2018-12-23T13:34:24.000Z | import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import sys
keras_dir = '../../example/vgg16/keras/output/'
cqt_dir = '../../example/vgg16/c_fix/output/'
qp_file = '../../examplevgg16/c_fix/weight/'
fix16mode = True
def layer_dump(i, q, fnum = 3):
"""
引数で指定されたレイヤーの、Keras出力と、コキュートス出... | 25.012346 | 68 | 0.580454 | import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import sys
keras_dir = '../../example/vgg16/keras/output/'
cqt_dir = '../../example/vgg16/c_fix/output/'
qp_file = '../../examplevgg16/c_fix/weight/'
fix16mode = True
def layer_dump(i, q, fnum = 3):
for f in range(fnum):
plt.fig... | true | true |
f7492456fb41ec3fb3e165d2a4415b1ab08a2133 | 3,266 | py | Python | setup.py | eknoes/threema-msgapi-sdk-python | cbe35f54614d1fa89c612d24e1a247507f44db56 | [
"MIT"
] | 36 | 2015-11-08T12:07:36.000Z | 2022-01-08T01:50:37.000Z | setup.py | eknoes/threema-msgapi-sdk-python | cbe35f54614d1fa89c612d24e1a247507f44db56 | [
"MIT"
] | 51 | 2015-10-24T15:45:13.000Z | 2021-12-12T10:22:26.000Z | setup.py | eknoes/threema-msgapi-sdk-python | cbe35f54614d1fa89c612d24e1a247507f44db56 | [
"MIT"
] | 13 | 2016-01-04T17:57:15.000Z | 2022-01-08T01:50:40.000Z | import ast
import os
import sys
from setuptools import (
find_packages,
setup,
)
def get_version():
path = os.path.join(os.path.dirname(__file__), 'threema', 'gateway', '__init__.py')
with open(path) as file:
for line in file:
if line.startswith('__version__'):
_, ... | 30.240741 | 87 | 0.594917 | import ast
import os
import sys
from setuptools import (
find_packages,
setup,
)
def get_version():
path = os.path.join(os.path.dirname(__file__), 'threema', 'gateway', '__init__.py')
with open(path) as file:
for line in file:
if line.startswith('__version__'):
_, ... | true | true |
f74924791f0ace3a664fd6066690b0a111458a75 | 23,684 | py | Python | android_env/components/adb_controller.py | majacQ/android_env | 3703c9883aa445e93f151dad9332aa6b8f32eea4 | [
"Apache-2.0"
] | 1 | 2021-06-07T13:58:24.000Z | 2021-06-07T13:58:24.000Z | android_env/components/adb_controller.py | smbale/android_env | 5ecfbfe56bb5843b298791d3c8c73b01a79e864a | [
"Apache-2.0"
] | null | null | null | android_env/components/adb_controller.py | smbale/android_env | 5ecfbfe56bb5843b298791d3c8c73b01a79e864a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 DeepMind Technologies Limited.
#
# 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 applic... | 39.473333 | 80 | 0.62633 |
import os
import pathlib
import re
import subprocess
import threading
import time
from typing import List, Optional, Sequence, Tuple
from absl import logging
from android_env.components import errors
from android_env.proto import task_pb2
import pexpect
_MAX_INIT_RETRIES = 20
_INIT_RETRY_SLEEP_SEC = 2... | true | true |
f74924c353b4ef02e9be7a4dcc252995006cceaa | 26,692 | py | Python | tensorflow/classes/bilm/model.py | utahnlp/therapist-observer | 31eaf9a5c82c6d0f9a62427ac5df030d81547472 | [
"Apache-2.0"
] | 7 | 2019-07-02T19:32:05.000Z | 2022-01-23T19:11:55.000Z | tensorflow/classes/bilm/model.py | utahnlp/therapist-observer | 31eaf9a5c82c6d0f9a62427ac5df030d81547472 | [
"Apache-2.0"
] | 1 | 2020-10-06T05:14:16.000Z | 2020-11-05T22:39:19.000Z | tensorflow/classes/bilm/model.py | utahnlp/therapist-observer | 31eaf9a5c82c6d0f9a62427ac5df030d81547472 | [
"Apache-2.0"
] | 6 | 2019-06-29T23:34:41.000Z | 2022-03-16T22:19:39.000Z |
import numpy as np
import tensorflow as tf
import h5py
import json
import re
from .data import UnicodeCharsVocabulary, Batcher
DTYPE = 'float32'
DTYPE_INT = 'int64'
class BidirectionalLanguageModel(object):
def __init__(
self,
options_file,
weight_file,
use_chara... | 39.426883 | 80 | 0.538214 |
import numpy as np
import tensorflow as tf
import h5py
import json
import re
from .data import UnicodeCharsVocabulary, Batcher
DTYPE = 'float32'
DTYPE_INT = 'int64'
class BidirectionalLanguageModel(object):
def __init__(
self,
options_file,
weight_file,
use_chara... | true | true |
f74926277668ed57b5594ccedb76bcda25a5037e | 2,693 | py | Python | syslinkats/stand_alone/front_loaded_data/data_repo/_template/uploader.py | stick152/SystemLink-Python-ATS | 82b0fac9bae22b808ba519fa4425a931ff3c77aa | [
"MIT"
] | null | null | null | syslinkats/stand_alone/front_loaded_data/data_repo/_template/uploader.py | stick152/SystemLink-Python-ATS | 82b0fac9bae22b808ba519fa4425a931ff3c77aa | [
"MIT"
] | null | null | null | syslinkats/stand_alone/front_loaded_data/data_repo/_template/uploader.py | stick152/SystemLink-Python-ATS | 82b0fac9bae22b808ba519fa4425a931ff3c77aa | [
"MIT"
] | null | null | null | """
.. codeauthor:: Your Name <your.name@ni.com>
This module is responsible for uploading data and/or files to a given SystemLink service via
HTTP operations.
**Instructions**
* If you're reading this from the template:
* Create a copy of the _template folder and rename it to the name of your ... | 38.471429 | 96 | 0.691422 | from typing import Any, Dict
from syslinkats.framework.network_utils.http_verb_ops import HttpVerbOps
from syslinkats.framework.validators.validate_args import validate_args_for_value
def upload(ats_config_data: Dict[str, Any] = None, first_url_node: str = None) -> None:
validate_args_for_value(
ats_conf... | true | true |
f74926919c280663167588db9345643ad889c1bc | 11,639 | py | Python | keystone/token/persistence/backends/sql.py | trananhkma/keystone | 1d34614121cbe694bfd107f1ce7a9c402d6a30b4 | [
"Apache-2.0"
] | null | null | null | keystone/token/persistence/backends/sql.py | trananhkma/keystone | 1d34614121cbe694bfd107f1ce7a9c402d6a30b4 | [
"Apache-2.0"
] | null | null | null | keystone/token/persistence/backends/sql.py | trananhkma/keystone | 1d34614121cbe694bfd107f1ce7a9c402d6a30b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 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 in... | 40.554007 | 79 | 0.618782 |
import copy
import functools
from oslo_log import log
from oslo_utils import timeutils
from keystone.common import sql
import keystone.conf
from keystone import exception
from keystone.i18n import _LI
from keystone import token
from keystone.token import provider
CONF = keystone.conf.CONF
LOG = log.ge... | true | true |
f7492692f70678f0806506625b6c8196369a76a9 | 7,502 | py | Python | 4K2Taiko.py | jakads/4K2Taiko | 8286a98ce27e3236c6394d11ef7c54699c8860ac | [
"MIT"
] | 2 | 2020-03-10T12:29:22.000Z | 2020-04-09T07:14:21.000Z | 4K2Taiko.py | jakads/4K2Taiko | 8286a98ce27e3236c6394d11ef7c54699c8860ac | [
"MIT"
] | null | null | null | 4K2Taiko.py | jakads/4K2Taiko | 8286a98ce27e3236c6394d11ef7c54699c8860ac | [
"MIT"
] | null | null | null | from os.path import splitext
import sys
from msvcrt import getch
import traceback
class InvalidPatternException(Exception):
def __init__(self, msg):
super().__init__(msg)
print('4K2Taiko v1.0.1')
print('by Jakads\n')
# need exactly one .osu file dragged in
if len(sys.argv) != 2:
print('drag single fi... | 32.197425 | 93 | 0.556785 | from os.path import splitext
import sys
from msvcrt import getch
import traceback
class InvalidPatternException(Exception):
def __init__(self, msg):
super().__init__(msg)
print('4K2Taiko v1.0.1')
print('by Jakads\n')
if len(sys.argv) != 2:
print('drag single file into this program.')
getch()
... | true | true |
f74926aaadaa83ae324cfa97d909a628b884b81e | 7,675 | py | Python | rllib/utils/tf_ops.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 3 | 2020-12-03T17:48:45.000Z | 2022-01-22T08:09:46.000Z | rllib/utils/tf_ops.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 6 | 2022-03-18T14:06:24.000Z | 2022-03-26T07:13:16.000Z | rllib/utils/tf_ops.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | import gym
from gym.spaces import Discrete, MultiDiscrete
import numpy as np
import tree
from ray.rllib.utils.framework import try_import_tf
tf1, tf, tfv = try_import_tf()
def convert_to_non_tf_type(stats):
"""Converts values in `stats` to non-Tensor numpy or python types.
Args:
stats (any): Any (p... | 35.206422 | 78 | 0.54671 | import gym
from gym.spaces import Discrete, MultiDiscrete
import numpy as np
import tree
from ray.rllib.utils.framework import try_import_tf
tf1, tf, tfv = try_import_tf()
def convert_to_non_tf_type(stats):
def mapping(item):
if isinstance(item, (tf.Tensor, tf.Variable)):
return item.n... | true | true |
f74926c9bced65b3bb48cf9375a076a31304287e | 2,500 | py | Python | skidl/tools/__init__.py | vkleen/skidl | f09200c978a39c127e292ef71b8ff89c1a3c0f5a | [
"MIT"
] | 700 | 2016-08-16T21:12:50.000Z | 2021-10-10T02:15:18.000Z | skidl/tools/__init__.py | 0dvictor/skidl | 458709a10b28a864d25ae2c2b44c6103d4ddb291 | [
"MIT"
] | 118 | 2016-08-16T20:51:05.000Z | 2021-10-10T08:07:18.000Z | skidl/tools/__init__.py | 0dvictor/skidl | 458709a10b28a864d25ae2c2b44c6103d4ddb291 | [
"MIT"
] | 94 | 2016-08-25T14:02:28.000Z | 2021-09-12T05:17:08.000Z | # -*- coding: utf-8 -*-
# The MIT License (MIT) - Copyright (c) 2016-2021 Dave Vandenbout.
"""
This package contains the handler functions for various EDA tools.
"""
from __future__ import ( # isort:skip
absolute_import,
division,
print_function,
unicode_literals,
)
import os
import os.path
import ... | 28.409091 | 84 | 0.6672 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import os
import os.path
import sys
from future import standard_library
from .. import circuit, net, part, schlib
standard_library.install_aliases()
this_module = sys.modules[__name__]
ALL_TOOLS = []
... | true | true |
f749288aa44095a5e75698959ab60f3999973549 | 386 | py | Python | python/qitest/test/projects/testme/test/test_bar.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qitest/test/projects/testme/test/test_bar.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | python/qitest/test/projects/testme/test/test_bar.py | PrashantKumar-sudo/qibuild | a16ce425cf25127ceff29507feeeeca37af23351 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test Bar """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import prin... | 27.571429 | 84 | 0.725389 |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
def test_bar():
assert True
| true | true |
f749293bbee5a0cd44d724e37c29b60f1f321f8c | 12,168 | py | Python | wbb/__main__.py | MirrorDevelopers/WilliamButcherBot | 5b21d47c264fd717ac15647b8be3b92ea639429f | [
"MIT"
] | null | null | null | wbb/__main__.py | MirrorDevelopers/WilliamButcherBot | 5b21d47c264fd717ac15647b8be3b92ea639429f | [
"MIT"
] | null | null | null | wbb/__main__.py | MirrorDevelopers/WilliamButcherBot | 5b21d47c264fd717ac15647b8be3b92ea639429f | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 TheHamkerCat
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, ... | 32.105541 | 79 | 0.560733 | import asyncio
import importlib
import re
import uvloop
from pyrogram import filters, idle
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from wbb import (BOT_NAME, BOT_USERNAME, LOG_GROUP_ID, USERBOT_NAME,
aiohttpsession, app)
from wbb.modules import ALL_MODULES
from wbb.modul... | true | true |
f7492a1d038076f7a07ae418e2e3336c1554b453 | 46,689 | py | Python | scripts/lvl_genvk.py | kthangudu-nv/Vulkan-ValidationLayers | f8f145df59a7c2675b0aa7e5c4590f2a5f0070de | [
"Apache-2.0"
] | null | null | null | scripts/lvl_genvk.py | kthangudu-nv/Vulkan-ValidationLayers | f8f145df59a7c2675b0aa7e5c4590f2a5f0070de | [
"Apache-2.0"
] | null | null | null | scripts/lvl_genvk.py | kthangudu-nv/Vulkan-ValidationLayers | f8f145df59a7c2675b0aa7e5c4590f2a5f0070de | [
"Apache-2.0"
] | 1 | 2021-04-27T00:01:17.000Z | 2021-04-27T00:01:17.000Z | #!/usr/bin/python3
#
# Copyright (c) 2013-2019 The Khronos Group 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... | 42.833945 | 125 | 0.556919 |
import argparse, cProfile, pdb, string, sys, time, os
startTime = None
def startTimer(timeit):
global startTime
if timeit:
startTime = time.process_time()
def endTimer(timeit, msg):
global startTime
if timeit:
endTime = time.process_time()
write(msg, endTime -... | true | true |
f7492b1c25bad496a6d60744d37e8aa46a1da3b0 | 1,952 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_policy_client_enums.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_policy_client_enums.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_policy_client_enums.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 39.04 | 109 | 0.660348 |
from enum import Enum, EnumMeta
from six import with_metaclass
class _CaseInsensitiveEnumMeta(EnumMeta):
def __getitem__(self, name):
return super().__getitem__(name.upper())
def __getattr__(cls, name):
try:
return cls._member_map_[name.upper()]
except KeyError:
... | true | true |
f7492c879d83c966316d29e634ba76afcd0adfd0 | 8,587 | py | Python | isofit/radiative_transfer/look_up_tables.py | winstonolson/isofit_imgspec | 4bc2faa192cabc1e8fd817c98373f6c5b47f5569 | [
"Apache-2.0"
] | null | null | null | isofit/radiative_transfer/look_up_tables.py | winstonolson/isofit_imgspec | 4bc2faa192cabc1e8fd817c98373f6c5b47f5569 | [
"Apache-2.0"
] | 2 | 2020-05-15T15:03:20.000Z | 2020-10-08T13:42:37.000Z | isofit/radiative_transfer/look_up_tables.py | serbinsh/isofit | b6a56ba1abade7e08f14aa9264e6984a77e40a79 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
#
# Copyright 2018 California Institute of Technology
#
# 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
#
# Unle... | 40.126168 | 132 | 0.650518 |
import os
import numpy as np
import logging
import ray
from collections import OrderedDict
import subprocess
import time
import atexit
from isofit.core import common
from isofit.configs import Config
from isofit.configs.sections.radiative_transfer_config import RadiativeTransferEngineConfig
from is... | true | true |
f7492cba39f87b9128a52ca3831fd299d8a99c31 | 215,374 | py | Python | pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxr/tests/ospf_output.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxr/tests/ospf_output.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/ops-pkg/src/genie/libs/ops/ospf/iosxr/tests/ospf_output.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | '''
OSPF Genie Ops Object Outputs for IOSXR.
'''
class OspfOutput(object):
############################################################################
# OSPF INFO OUTPUTS
############################################################################
# 'show protocols afi-al... | 72.565364 | 129 | 0.170471 |
class OspfOutput(object):
'database_control':
{'max_lsa': 123},
'external_flood_list_length': 0,
'flags':
{'abr': True,
'as... | true | true |
f7492dfc0be5f608665bfde5696f18770396dc13 | 2,095 | py | Python | backend/data_export/models.py | arcada-uas/doccano | c29aece3dd4504eeaaa3466af0663bfe18b90dc1 | [
"MIT"
] | 2,082 | 2018-05-09T07:16:21.000Z | 2019-12-01T16:41:50.000Z | backend/data_export/models.py | arcada-uas/doccano | c29aece3dd4504eeaaa3466af0663bfe18b90dc1 | [
"MIT"
] | 365 | 2018-07-31T13:49:05.000Z | 2019-11-29T11:25:17.000Z | backend/data_export/models.py | arcada-uas/doccano | c29aece3dd4504eeaaa3466af0663bfe18b90dc1 | [
"MIT"
] | 476 | 2018-08-17T06:43:57.000Z | 2019-12-01T09:47:08.000Z | from typing import Any, Dict, Protocol, Tuple
from django.db import models
from examples.models import Example
from labels.models import Category, Relation, Span, TextLabel
from projects.models import Project
DATA = "data"
class ExportedExampleManager(models.Manager):
def confirmed(self, project: Project, user... | 25.54878 | 106 | 0.66253 | from typing import Any, Dict, Protocol, Tuple
from django.db import models
from examples.models import Example
from labels.models import Category, Relation, Span, TextLabel
from projects.models import Project
DATA = "data"
class ExportedExampleManager(models.Manager):
def confirmed(self, project: Project, user... | true | true |
f7492e49c9c1c46f2df91362feee8c4fc02288c8 | 27,205 | py | Python | docs/beta/code/Tracking.py | leonbett/debuggingbook | ae1fa940c306160429232fbc93a7a7f14b44efb7 | [
"MIT"
] | null | null | null | docs/beta/code/Tracking.py | leonbett/debuggingbook | ae1fa940c306160429232fbc93a7a7f14b44efb7 | [
"MIT"
] | null | null | null | docs/beta/code/Tracking.py | leonbett/debuggingbook | ae1fa940c306160429232fbc93a7a7f14b44efb7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# "Tracking Bugs" - a chapter of "The Debugging Book"
# Web site: https://www.debuggingbook.org/html/Tracking.html
# Last change: 2021-05-12 17:37:52+02:00
#
# Copyright (c) 2021 CISPA Helmholtz Center for Information Security
# Copyright (c) 2018-2020 Saarland University... | 27.675483 | 131 | 0.671972 |
if __name__ == '__main__' and __package__ is None:
__package__ = 'debuggingbook'
if __name__ == '__main__':
print('# Tracking Bugs')
if __name__ == '__main__':
from .bookutils import YouTubeVideo
YouTubeVideo("bJzHYzvxHm8")
if __name__ == '__main__':
imp... | true | true |
f7492fff3cbb47da6d248f5bb099eb43a04b9079 | 2,588 | py | Python | attacut/utils.py | huak95/attacut | 100333931023cd009daeddec0cba4cdfce3d0b68 | [
"MIT"
] | 54 | 2019-08-28T20:44:02.000Z | 2022-03-10T08:58:35.000Z | attacut/utils.py | huak95/attacut | 100333931023cd009daeddec0cba4cdfce3d0b68 | [
"MIT"
] | 23 | 2019-08-29T06:08:48.000Z | 2021-08-08T18:30:01.000Z | attacut/utils.py | huak95/attacut | 100333931023cd009daeddec0cba4cdfce3d0b68 | [
"MIT"
] | 15 | 2019-08-30T02:59:56.000Z | 2022-03-06T04:27:36.000Z | # -*- coding: utf-8 -*-
import json
import os
import time
from typing import Callable, Dict, NamedTuple, Union
import yaml
from attacut import logger
log = logger.get_logger(__name__)
class ModelParams(NamedTuple):
name: str
params: str
class Timer:
def __init__(self, name: str):
self.name = ... | 23.315315 | 80 | 0.611669 |
import json
import os
import time
from typing import Callable, Dict, NamedTuple, Union
import yaml
from attacut import logger
log = logger.get_logger(__name__)
class ModelParams(NamedTuple):
name: str
params: str
class Timer:
def __init__(self, name: str):
self.name = name
def __enter__... | true | true |
f749312f98968857c072e76be3062d997f47b622 | 2,956 | py | Python | keybow/jitsi-keys.py | pixlwave/Pico | 04c7a5864aae06f1a0ad9edd739c2e932d7114b1 | [
"MIT"
] | 44 | 2021-02-10T06:04:10.000Z | 2022-03-30T14:01:56.000Z | keybow/jitsi-keys.py | pixlwave/Pico | 04c7a5864aae06f1a0ad9edd739c2e932d7114b1 | [
"MIT"
] | 1 | 2021-05-15T21:18:45.000Z | 2021-05-15T21:49:40.000Z | keybow/jitsi-keys.py | pixlwave/Pico | 04c7a5864aae06f1a0ad9edd739c2e932d7114b1 | [
"MIT"
] | 5 | 2021-02-10T12:34:14.000Z | 2021-12-15T02:05:38.000Z | # jitsi shortcuts for keybow 2040
# based on the hid-keys-simple.py example by Sandy Macdonald
# drop the keybow2040.py file into your `lib` folder on your `CIRCUITPY` drive.
# NOTE! requires the adafruit_hid CircuitPython library also!
import board
from keybow2040 import Keybow2040
import usb_hid
from adafruit_hid... | 28.152381 | 79 | 0.592355 |
import board
from keybow2040 import Keybow2040
import usb_hid
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
from adafruit_hid.keycode import Keycode
i2c = board.I2C()
keybow = Keybow2040(i2c)
keys = keybow.keys
keyboard = Keyboard(usb_hid.devices)
la... | true | true |
f7493168fd8a996c4ade388f899f7fdb64f1aa27 | 794 | py | Python | azure_com.py | joelosw/Telegram_Bot | c1c60280eac0f67324806c31bf0fba44705da7f9 | [
"MIT"
] | null | null | null | azure_com.py | joelosw/Telegram_Bot | c1c60280eac0f67324806c31bf0fba44705da7f9 | [
"MIT"
] | 1 | 2019-11-06T18:08:50.000Z | 2019-11-06T18:08:50.000Z | azure_com.py | joelosw/Telegram_Bot | c1c60280eac0f67324806c31bf0fba44705da7f9 | [
"MIT"
] | null | null | null | import requests
import stickerify
from credentials import CREDENTIALS
from errors import NoFace
AZURE_LINK = CREDENTIALS["AZURE_LINK"]
def get_image_info(url):
r = requests.post(AZURE_LINK + url)
return r.json()
def get_sticker_from_photo(url):
image_info = get_image_info(url)
if ('emotion' in imag... | 22.685714 | 63 | 0.63602 | import requests
import stickerify
from credentials import CREDENTIALS
from errors import NoFace
AZURE_LINK = CREDENTIALS["AZURE_LINK"]
def get_image_info(url):
r = requests.post(AZURE_LINK + url)
return r.json()
def get_sticker_from_photo(url):
image_info = get_image_info(url)
if ('emotion' in imag... | true | true |
f749344916d3a6866a9f482b4544c405a63033c9 | 1,099 | py | Python | djangocms_frontend/contrib/utilities/frameworks/bootstrap5.py | fsbraun/djangocms-bootstrap5 | 368f736fa1ce264086493153a256eb90dd8c4df0 | [
"BSD-3-Clause"
] | 7 | 2022-01-28T14:21:14.000Z | 2022-03-29T20:07:11.000Z | djangocms_frontend/contrib/utilities/frameworks/bootstrap5.py | marksweb/djangocms-frontend | c74130cbd15cfacb588933bb4adaf1a7d780daaf | [
"BSD-3-Clause"
] | 13 | 2022-02-23T21:10:07.000Z | 2022-03-30T08:33:20.000Z | djangocms_frontend/contrib/utilities/frameworks/bootstrap5.py | marksweb/djangocms-frontend | c74130cbd15cfacb588933bb4adaf1a7d780daaf | [
"BSD-3-Clause"
] | 2 | 2022-02-07T14:48:11.000Z | 2022-02-23T23:55:18.000Z | class SpacingRenderMixin:
def render(self, context, instance, placeholder):
if not instance.space_device or instance.space_device == "xs":
instance.add_classes(
f"{instance.space_property}{instance.space_sides}-{instance.space_size}"
)
else:
instan... | 40.703704 | 114 | 0.679709 | class SpacingRenderMixin:
def render(self, context, instance, placeholder):
if not instance.space_device or instance.space_device == "xs":
instance.add_classes(
f"{instance.space_property}{instance.space_sides}-{instance.space_size}"
)
else:
instan... | true | true |
f749360f26a716b8b8b0f9e9468ea6667b3d3a63 | 13,958 | py | Python | scripts/bert/data/classification.py | PatriciaXiao/gluon-nlp | 3373469d4cca3a82af1c5f3eceefbcc711ef6342 | [
"Apache-2.0"
] | null | null | null | scripts/bert/data/classification.py | PatriciaXiao/gluon-nlp | 3373469d4cca3a82af1c5f3eceefbcc711ef6342 | [
"Apache-2.0"
] | null | null | null | scripts/bert/data/classification.py | PatriciaXiao/gluon-nlp | 3373469d4cca3a82af1c5f3eceefbcc711ef6342 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and DMLC.
#
# 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 req... | 35.336709 | 90 | 0.61377 |
from __future__ import absolute_import
__all__ = [
'MRPCTask', 'QQPTask', 'QNLITask', 'RTETask', 'STSBTask',
'CoLATask', 'MNLITask', 'WNLITask', 'SSTTask', 'XNLITask'
]
import os
from mxnet.metric import Accuracy, F1, MCC, PearsonCorrelation, CompositeEvalMetric
from gluonnlp.base import get_ho... | true | true |
f74936170a51c40b7ca039f94743696e30213541 | 172 | py | Python | rudra/inventory/admin.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | rudra/inventory/admin.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | rudra/inventory/admin.py | nerddesire/django-practice | bb9c626941240b7ee0fdc22cbc4e762ff422d30f | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Item
class ItemAdmin(admin.ModelAdmin):
list_display = ['title', 'amount']
admin.site.register(Item, ItemAdmin)
| 19.111111 | 38 | 0.755814 | from django.contrib import admin
from .models import Item
class ItemAdmin(admin.ModelAdmin):
list_display = ['title', 'amount']
admin.site.register(Item, ItemAdmin)
| true | true |
f749362225570354a032f55fc9bf43bb0e46af0b | 3,047 | py | Python | poseestimation/poseestimation.py | B-tronics/KinemAutomation | 853e9ad2c9e702e1830571152393172960c0d055 | [
"MIT"
] | null | null | null | poseestimation/poseestimation.py | B-tronics/KinemAutomation | 853e9ad2c9e702e1830571152393172960c0d055 | [
"MIT"
] | null | null | null | poseestimation/poseestimation.py | B-tronics/KinemAutomation | 853e9ad2c9e702e1830571152393172960c0d055 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import argparse
import csv
import os
import glob
ap = argparse.ArgumentParser()
ap.add_argument("-c", "--csv", help="Path to the CSV file holding the 2D data for the video.")
ap.add_argument("-v", "--video", help="Path to the video file.")
args = vars(ap.parse_args())
dir_name = args["cs... | 35.847059 | 105 | 0.48277 | import cv2
import numpy as np
import argparse
import csv
import os
import glob
ap = argparse.ArgumentParser()
ap.add_argument("-c", "--csv", help="Path to the CSV file holding the 2D data for the video.")
ap.add_argument("-v", "--video", help="Path to the video file.")
args = vars(ap.parse_args())
dir_name = args["cs... | true | true |
f749363d5c81bb636fddf1578d7e2a42f7c2e0d3 | 414 | py | Python | RaspberryPi/code1_1.py | DTK-Creaters/Course | eb6518306482d21cc6e5848a783ffc0820b017fd | [
"Apache-2.0"
] | 3 | 2020-05-15T15:14:17.000Z | 2021-04-05T11:39:53.000Z | RaspberryPi/code1_1.py | DTK-Creaters/Course | eb6518306482d21cc6e5848a783ffc0820b017fd | [
"Apache-2.0"
] | null | null | null | RaspberryPi/code1_1.py | DTK-Creaters/Course | eb6518306482d21cc6e5848a783ffc0820b017fd | [
"Apache-2.0"
] | 1 | 2020-05-17T02:48:13.000Z | 2020-05-17T02:48:13.000Z | # -*- coding: utf-8 -*-
'''
1つのLEDを点滅させるプログラム
'''
import RPi.GPIO as GPIO
import time
PIN=10
#毎回するおまじない
GPIO.setmode(GPIO.BCM) #GPIOのセットアップをBCMモード
GPIO.setup(PIN,GPIO.OUT) #ピン10を出力するように設定
GPIO.output(PIN,GPIO.HIGH) # ピン10に電流を流す(HIGH)
time.sleep(2) # 2秒待つ
GPIO.output(PIN,GPIO.LOW) # ピン10に流れる電流を0にする(LOW... | 18 | 60 | 0.71256 |
import RPi.GPIO as GPIO
import time
PIN=10
GPIO.setmode(GPIO.BCM)
GPIO.setup(PIN,GPIO.OUT)
GPIO.output(PIN,GPIO.HIGH)
time.sleep(2)
GPIO.output(PIN,GPIO.LOW)
GPIO.cleanup()
| true | true |
f749370ceeceaf81bcbbc2dc247ab9e17918774b | 2,116 | py | Python | code/cal.py | jordankeener/ncaa_rosters | 12e66e9ef7502ab6869e7352ae673c46680eedd0 | [
"MIT"
] | null | null | null | code/cal.py | jordankeener/ncaa_rosters | 12e66e9ef7502ab6869e7352ae673c46680eedd0 | [
"MIT"
] | null | null | null | code/cal.py | jordankeener/ncaa_rosters | 12e66e9ef7502ab6869e7352ae673c46680eedd0 | [
"MIT"
] | null | null | null | from urllib.request import urlopen
from urllib.request import FancyURLopener
from bs4 import BeautifulSoup
import pandas as pd
import os
import _proj_functions as proj
import _lookups as lookups
import re
outdir = '../output'
##### cal #################
school = 'cal'
url_template = 'http://calbears.com/roster.aspx?p... | 33.0625 | 64 | 0.710302 | from urllib.request import urlopen
from urllib.request import FancyURLopener
from bs4 import BeautifulSoup
import pandas as pd
import os
import _proj_functions as proj
import _lookups as lookups
import re
outdir = '../output'
sports_dict['football'] = ['football']
sports_dict['mens soccer'] = ['msoc']
sports_dict['w... | true | true |
f7493720db3ac9ae823faa17aec63b72e27637b3 | 22 | py | Python | epo_ops/__version__.py | BeneCollyridam/python-epo-ops-client | 2606f3ce822c4ad2edadf7bbfd45777cd8910427 | [
"Apache-2.0"
] | null | null | null | epo_ops/__version__.py | BeneCollyridam/python-epo-ops-client | 2606f3ce822c4ad2edadf7bbfd45777cd8910427 | [
"Apache-2.0"
] | null | null | null | epo_ops/__version__.py | BeneCollyridam/python-epo-ops-client | 2606f3ce822c4ad2edadf7bbfd45777cd8910427 | [
"Apache-2.0"
] | null | null | null | __version__ = "3.1.3"
| 11 | 21 | 0.636364 | __version__ = "3.1.3"
| true | true |
f749377558acfa3c256a1c4bee788eada33baf23 | 1,695 | py | Python | vaccibot/render.py | fsoubelet/vaccibot | f0956ddbf9f0ac712d3e6e10d9fb5f3edb3dda11 | [
"MIT"
] | null | null | null | vaccibot/render.py | fsoubelet/vaccibot | f0956ddbf9f0ac712d3e6e10d9fb5f3edb3dda11 | [
"MIT"
] | null | null | null | vaccibot/render.py | fsoubelet/vaccibot | f0956ddbf9f0ac712d3e6e10d9fb5f3edb3dda11 | [
"MIT"
] | null | null | null | from typing import List
from rich import box
from rich.panel import Panel
from rich.table import Table
from vaccibot.models import AppointmentMatch
# ----- Data ----- #
COLUMNS_SETTINGS = {
"CENTER": dict(
justify="left",
header_style="bold",
style="bold",
), # no_wrap=True),
"C... | 31.388889 | 109 | 0.659587 | from typing import List
from rich import box
from rich.panel import Panel
from rich.table import Table
from vaccibot.models import AppointmentMatch
COLUMNS_SETTINGS = {
"CENTER": dict(
justify="left",
header_style="bold",
style="bold",
),
"CITY": dict(justify="center", header_s... | true | true |
f74939316bcda398f4a58cc0fbf28cc6d37d2727 | 449 | py | Python | keyframes.py | tp7/Sushi | 908c0ff228734059aebb914a8d10f8e4ce2e868c | [
"MIT"
] | 470 | 2015-01-02T21:38:56.000Z | 2022-03-19T13:10:37.000Z | keyframes.py | Kadantte/Sushi | 908c0ff228734059aebb914a8d10f8e4ce2e868c | [
"MIT"
] | 36 | 2015-01-03T05:41:56.000Z | 2021-04-01T02:11:26.000Z | keyframes.py | Kadantte/Sushi | 908c0ff228734059aebb914a8d10f8e4ce2e868c | [
"MIT"
] | 45 | 2015-04-10T12:31:37.000Z | 2022-01-23T21:16:38.000Z | from common import SushiError, read_all_text
def parse_scxvid_keyframes(text):
return [i-3 for i,line in enumerate(text.splitlines()) if line and line[0] == 'i']
def parse_keyframes(path):
text = read_all_text(path)
if '# XviD 2pass stat file' in text:
frames = parse_scxvid_keyframes(text)
el... | 28.0625 | 86 | 0.683742 | from common import SushiError, read_all_text
def parse_scxvid_keyframes(text):
return [i-3 for i,line in enumerate(text.splitlines()) if line and line[0] == 'i']
def parse_keyframes(path):
text = read_all_text(path)
if '# XviD 2pass stat file' in text:
frames = parse_scxvid_keyframes(text)
el... | true | true |
f7493994ee8ea4d0f0d0686e25d33051198a6b6c | 2,142 | py | Python | apps/search/src/search/dashboard_api.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | apps/search/src/search/dashboard_api.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 1 | 2019-05-06T15:32:21.000Z | 2019-05-06T15:32:21.000Z | apps/search/src/search/dashboard_api.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 2 | 2019-12-05T17:24:36.000Z | 2021-11-22T21:21:32.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 34 | 82 | 0.749767 |
import logging
from dashboard.dashboard_api import DashboardApi
from dashboard.models import augment_solr_response
from libsolr.api import SolrApi
from indexer.solr_client import SolrClient
from search.conf import SOLR_URL
LOG = logging.getLogger(__name__)
class SearchApi(DashboardApi):
def __... | true | true |
f7493a737622947aaa1034e56d240038c623eede | 2,763 | py | Python | toolchain/riscv/MSYS/riscv64-unknown-elf/lib/rv32emac/ilp32e/libstdc++.a-gdb.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | null | null | null | toolchain/riscv/MSYS/riscv64-unknown-elf/lib/rv32emac/ilp32e/libstdc++.a-gdb.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | null | null | null | toolchain/riscv/MSYS/riscv64-unknown-elf/lib/rv32emac/ilp32e/libstdc++.a-gdb.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | null | null | null | # -*- python -*-
# Copyright (C) 2009-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | 44.564516 | 230 | 0.735433 |
import sys
import gdb
import os
import os.path
pythondir = '/scratch/jenkins/workspace/tpp-freedom-tools/tpp03--build-binary-packages--parameterized/obj/x86_64-w64-mingw32/install/riscv64-unknown-elf-gcc-10.2.0-2020.12.8-x86_64-w64-mingw32/share/gcc-10.2.0/python'
libdir = '/scratch/jenkins/workspace/t... | true | true |
f7493af8c9a15568a60fbf570618ab19a71c321c | 9,064 | py | Python | tests/dml/test_line.py | databook1/python-pptx | 87ca6bf34f9ced17cc4f3c94cf141069429e7583 | [
"MIT"
] | null | null | null | tests/dml/test_line.py | databook1/python-pptx | 87ca6bf34f9ced17cc4f3c94cf141069429e7583 | [
"MIT"
] | 12 | 2021-01-22T16:53:51.000Z | 2022-02-23T13:57:43.000Z | tests/dml/test_line.py | databook1/python-pptx | 87ca6bf34f9ced17cc4f3c94cf141069429e7583 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
Test suite for pptx.dml.line module
"""
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from pptx.dml.color import ColorFormat
from pptx.dml.fill import FillFormat
from pptx.dml.line import LineFormat, LineStyle
from pptx.enum.dml import MSO_FILL, MSO_LIN... | 32.722022 | 88 | 0.62511 |
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from pptx.dml.color import ColorFormat
from pptx.dml.fill import FillFormat
from pptx.dml.line import LineFormat, LineStyle
from pptx.enum.dml import MSO_FILL, MSO_LINE
from pptx.oxml.shapes.shared import CT_LineProperties
from ... | true | true |
f7493b3246603157771b36810bc4b1b16107984c | 862 | bzl | Python | java/extract_header.bzl | ashwinisharma234/tdigestc | a77e60a60f3b0b7ad76d8a5d1e0217b1207a1aca | [
"MIT"
] | 10 | 2019-04-14T16:45:47.000Z | 2021-11-25T12:05:03.000Z | java/extract_header.bzl | ashwinisharma234/tdigestc | a77e60a60f3b0b7ad76d8a5d1e0217b1207a1aca | [
"MIT"
] | 6 | 2019-04-04T00:15:38.000Z | 2021-01-02T20:49:52.000Z | java/extract_header.bzl | ashwinisharma234/tdigestc | a77e60a60f3b0b7ad76d8a5d1e0217b1207a1aca | [
"MIT"
] | 5 | 2019-03-02T18:15:52.000Z | 2020-06-01T14:07:28.000Z | def _impl(ctx):
# https://github.com/bazelbuild/rules_scala/pull/286/files
ctx.actions.run(
inputs = [ctx.attr.lib.java.outputs.native_headers],
tools = [ctx.executable._zipper],
outputs = ctx.outputs.outs,
executable = ctx.executable._zipper.path,
arguments = ["vxf", ctx... | 33.153846 | 110 | 0.612529 | def _impl(ctx):
ctx.actions.run(
inputs = [ctx.attr.lib.java.outputs.native_headers],
tools = [ctx.executable._zipper],
outputs = ctx.outputs.outs,
executable = ctx.executable._zipper.path,
arguments = ["vxf", ctx.attr.lib.java.outputs.native_headers.path, "-d", ctx.outp... | true | true |
f7493bc919dcdf4bf284805adea454573de20565 | 25,504 | py | Python | python/ray/util/sgd/tests/test_torch.py | ThomasLecat/ray | eb025ea8cb27583e8ef6287f5654f23d1ab270ef | [
"Apache-2.0"
] | null | null | null | python/ray/util/sgd/tests/test_torch.py | ThomasLecat/ray | eb025ea8cb27583e8ef6287f5654f23d1ab270ef | [
"Apache-2.0"
] | null | null | null | python/ray/util/sgd/tests/test_torch.py | ThomasLecat/ray | eb025ea8cb27583e8ef6287f5654f23d1ab270ef | [
"Apache-2.0"
] | null | null | null | from unittest.mock import patch
import numpy as np
import os
import pytest
import time
import torch
import torch.nn as nn
import torch.distributed as dist
from torch.utils.data import DataLoader
import ray
from ray import tune
from ray.util.sgd.torch import TorchTrainer
from ray.util.sgd.torch.training_operator import... | 33.646438 | 79 | 0.643546 | from unittest.mock import patch
import numpy as np
import os
import pytest
import time
import torch
import torch.nn as nn
import torch.distributed as dist
from torch.utils.data import DataLoader
import ray
from ray import tune
from ray.util.sgd.torch import TorchTrainer
from ray.util.sgd.torch.training_operator import... | true | true |
f7493be221c2e55b15f1d303c87502bb56713bc3 | 7,790 | py | Python | src/python/m5/util/__init__.py | taomiao/gem5 | 4effe34f94b599add133357473e1b120b54719ab | [
"BSD-3-Clause"
] | 135 | 2016-10-21T03:31:49.000Z | 2022-03-25T01:22:20.000Z | src/python/m5/util/__init__.py | taomiao/gem5 | 4effe34f94b599add133357473e1b120b54719ab | [
"BSD-3-Clause"
] | 35 | 2017-03-10T17:57:46.000Z | 2022-02-18T17:34:16.000Z | src/python/m5/util/__init__.py | taomiao/gem5 | 4effe34f94b599add133357473e1b120b54719ab | [
"BSD-3-Clause"
] | 48 | 2016-12-08T12:03:13.000Z | 2022-02-16T09:16:13.000Z | # Copyright (c) 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | 36.064815 | 79 | 0.686136 |
from __future__ import print_function
import os
import re
import sys
from . import convert
from . import jobfile
from .attrdict import attrdict, multiattrdict, optiondict
from .code_formatter import code_formatter
from .multidict import multidict
from .smartdict import SmartD... | true | true |
f7493c0c372624572b8447718045b9235da47059 | 2,228 | py | Python | venv/Lib/site-packages/comtypes/test/test_client.py | cvangheem/Twitchbot | 48bb065951e88e4d2e9ef8d0c1a3afb0150a5eb5 | [
"MIT"
] | 64 | 2020-07-22T06:24:18.000Z | 2022-03-27T10:48:15.000Z | venv/Lib/site-packages/comtypes/test/test_client.py | AsterLaoWhy/Navi | 819e4cc9e70721d65da5979e0c7a6fead9eb9d6e | [
"MIT"
] | 9 | 2021-08-14T01:27:36.000Z | 2021-08-24T18:10:18.000Z | venv/Lib/site-packages/comtypes/test/test_client.py | AsterLaoWhy/Navi | 819e4cc9e70721d65da5979e0c7a6fead9eb9d6e | [
"MIT"
] | 17 | 2020-09-14T02:46:41.000Z | 2022-03-01T09:52:33.000Z | import unittest as ut
import comtypes.client
from comtypes import COSERVERINFO
from ctypes import POINTER, byref
# create the typelib wrapper and import it
comtypes.client.GetModule("scrrun.dll")
from comtypes.gen import Scripting
import comtypes.test
comtypes.test.requires("ui")
class Test(ut.TestCase):
def tes... | 35.935484 | 75 | 0.664722 | import unittest as ut
import comtypes.client
from comtypes import COSERVERINFO
from ctypes import POINTER, byref
comtypes.client.GetModule("scrrun.dll")
from comtypes.gen import Scripting
import comtypes.test
comtypes.test.requires("ui")
class Test(ut.TestCase):
def test_progid(self):
obj = com... | true | true |
f7493c1636a0f85eeec4a5501782a66e62698e68 | 1,992 | py | Python | tests/test_substract.py | tasptz/py-touchingperimeter | b581a1ad477629c5ee5fcbe6a9d5747af6f9183b | [
"MIT"
] | null | null | null | tests/test_substract.py | tasptz/py-touchingperimeter | b581a1ad477629c5ee5fcbe6a9d5747af6f9183b | [
"MIT"
] | 1 | 2020-08-12T22:59:14.000Z | 2020-08-13T08:01:51.000Z | tests/test_substract.py | tasptz/py-touchingperimeter | b581a1ad477629c5ee5fcbe6a9d5747af6f9183b | [
"MIT"
] | null | null | null | from touchingperimeter import Rect
def test_tl_inside():
assert sorted(Rect(2, 5, 12, 8).substracted(Rect(7, 6, 12, 8))) == [
Rect(2, 5, 12, 1),
Rect(2, 5, 5, 8),
]
def test_tr_inside():
assert sorted(Rect(5, 7, 13, 8).substracted(Rect(3, 9, 6, 18))) == [
Rect(5, 7, 13, 2),
... | 26.210526 | 75 | 0.499498 | from touchingperimeter import Rect
def test_tl_inside():
assert sorted(Rect(2, 5, 12, 8).substracted(Rect(7, 6, 12, 8))) == [
Rect(2, 5, 12, 1),
Rect(2, 5, 5, 8),
]
def test_tr_inside():
assert sorted(Rect(5, 7, 13, 8).substracted(Rect(3, 9, 6, 18))) == [
Rect(5, 7, 13, 2),
... | true | true |
f7493c87665d1fb35ff3e584ae6c833160f14685 | 480 | py | Python | mindapp/migrations/0031_auto_20200403_1636.py | isha27255/mindersnatch | 9c775141327d17f09518da5227763da45bf8ce4f | [
"BSD-3-Clause"
] | 5 | 2020-04-01T14:40:06.000Z | 2020-10-22T19:13:13.000Z | mindapp/migrations/0031_auto_20200403_1636.py | rishav4101/mindersnatch | afb2be1830106175e1317ea6596ec28bdbf20df4 | [
"BSD-3-Clause"
] | 8 | 2021-03-19T09:28:07.000Z | 2022-03-12T00:21:11.000Z | mindapp/migrations/0031_auto_20200403_1636.py | rishav4101/mindersnatch | afb2be1830106175e1317ea6596ec28bdbf20df4 | [
"BSD-3-Clause"
] | 9 | 2020-04-01T09:12:58.000Z | 2021-08-07T11:59:29.000Z | # Generated by Django 2.2.10 on 2020-04-03 11:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mindapp', '0030_auto_20200403_1527'),
]
operations = [
migrations.AlterField(
model_name='situ... | 24 | 102 | 0.645833 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mindapp', '0030_auto_20200403_1527'),
]
operations = [
migrations.AlterField(
model_name='situationtimer',
name='player',
... | true | true |
f7493c8ce07473cfbe8d017aca7805cd56fba72f | 10,749 | py | Python | yys/YuHunModule.py | yangxu0110/yysScript | 079101f57fb1a64b871924c988760d9e74063a71 | [
"Apache-2.0"
] | 62 | 2019-09-28T14:07:22.000Z | 2022-02-25T05:54:47.000Z | yys/YuHunModule.py | fishtank666/yysScript | 079101f57fb1a64b871924c988760d9e74063a71 | [
"Apache-2.0"
] | 6 | 2019-11-12T11:08:36.000Z | 2020-11-25T10:40:52.000Z | yys/YuHunModule.py | fishtank666/yysScript | 079101f57fb1a64b871924c988760d9e74063a71 | [
"Apache-2.0"
] | 24 | 2019-10-12T02:21:39.000Z | 2021-11-13T07:32:25.000Z | # -*- coding: utf-8 -*-
import datetime
import logging
import os
import random
import time
from tkinter import END
import cv2
import numpy
import numpy as np
import pyautogui
from PIL import ImageGrab
from matplotlib import pyplot as plt
pyautogui.FAILSAFE = False
logging.basicConfig(format="%(asctime)s :%(levelname)... | 34.562701 | 121 | 0.451577 |
import datetime
import logging
import os
import random
import time
from tkinter import END
import cv2
import numpy
import numpy as np
import pyautogui
from PIL import ImageGrab
from matplotlib import pyplot as plt
pyautogui.FAILSAFE = False
logging.basicConfig(format="%(asctime)s :%(levelname)s:%(message)s", datefmt... | true | true |
f7493cf05f629c195ada5598d7c784bb267e66c2 | 4,447 | py | Python | Model/utility/parser.py | lambiond/knowledge_graph_attention_network | 7bc487276467f13c26cbac2885580d8a15cd8d22 | [
"MIT"
] | null | null | null | Model/utility/parser.py | lambiond/knowledge_graph_attention_network | 7bc487276467f13c26cbac2885580d8a15cd8d22 | [
"MIT"
] | null | null | null | Model/utility/parser.py | lambiond/knowledge_graph_attention_network | 7bc487276467f13c26cbac2885580d8a15cd8d22 | [
"MIT"
] | null | null | null | '''
Created on Dec 18, 2018
Tensorflow Implementation of Knowledge Graph Attention Network (KGAT) model in:
Wang Xiang et al. KGAT: Knowledge Graph Attention Network for Recommendation. In KDD 2019.
@author: Xiang Wang (xiangwang@u.nus.edu)
'''
import argparse
def parse_args():
parser = argparse.ArgumentParser(des... | 54.231707 | 135 | 0.589386 | import argparse
def parse_args():
parser = argparse.ArgumentParser(description="Run KGAT.")
parser.add_argument('--weights_path', nargs='?', default='',
help='Store model path.')
parser.add_argument('--data_path', nargs='?', default='../Data/',
help='Input da... | true | true |
f7493d21a08f9a8545467664d5390361bf0f4355 | 2,788 | py | Python | txtfile.py | ochrus/ochrus | a543ec0b7e420dfd232a1a797ced7191ba48aa7e | [
"MIT"
] | null | null | null | txtfile.py | ochrus/ochrus | a543ec0b7e420dfd232a1a797ced7191ba48aa7e | [
"MIT"
] | 1 | 2019-01-02T20:14:09.000Z | 2019-01-02T20:14:09.000Z | txtfile.py | ochrus/ochrus | a543ec0b7e420dfd232a1a797ced7191ba48aa7e | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2017 Roni Eliezer
"""
import logger
import json
import yaml
class File(object):
"""
Implement a text file methods
e.g.: read, write, etc...
Args:
file_path: full path to file
"""
#==========================================================... | 29.041667 | 84 | 0.325323 |
import logger
import json
import yaml
class File(object):
def __init__(self, file_path):
self.file = file_path
def read(self):
try:
with open(self.file, 'r') as f:
try:
return f.read()
except Excepti... | true | true |
f7493e0c31da24397f94ec2b212bff8c1a588ebf | 490 | py | Python | _net/http.py | devsetup/devsetup_framework | 6ccd59dab83bc4305e8ff18321bfc14a4e7e79ca | [
"BSD-3-Clause"
] | null | null | null | _net/http.py | devsetup/devsetup_framework | 6ccd59dab83bc4305e8ff18321bfc14a4e7e79ca | [
"BSD-3-Clause"
] | null | null | null | _net/http.py | devsetup/devsetup_framework | 6ccd59dab83bc4305e8ff18321bfc14a4e7e79ca | [
"BSD-3-Clause"
] | null | null | null | import os
import time
import urllib
import dsf
def download_file(url, target_file, cwd=None, cache=360):
with dsf.core.fs.pushd(cwd):
# is the file too new to download?
if os.path.isfile(target_file):
details = os.stat(target_file)
if details.st_mtime > time.time() - cache:
return
# download the fil... | 25.789474 | 70 | 0.718367 | import os
import time
import urllib
import dsf
def download_file(url, target_file, cwd=None, cache=360):
with dsf.core.fs.pushd(cwd):
if os.path.isfile(target_file):
details = os.stat(target_file)
if details.st_mtime > time.time() - cache:
return
dsf.dslog.log_command_start(["HTTP", "GET", url, ... | true | true |
f7493e620f0243e71eb1a70348a89111a459e3d8 | 10,457 | py | Python | apps/addons/tests/test_cron.py | clouserw/olympia | 1d5755b08a526372ec66e6bc64ab636018181969 | [
"BSD-3-Clause"
] | null | null | null | apps/addons/tests/test_cron.py | clouserw/olympia | 1d5755b08a526372ec66e6bc64ab636018181969 | [
"BSD-3-Clause"
] | null | null | null | apps/addons/tests/test_cron.py | clouserw/olympia | 1d5755b08a526372ec66e6bc64ab636018181969 | [
"BSD-3-Clause"
] | null | null | null | import os
import datetime
from nose.exc import SkipTest
from nose.tools import eq_
import mock
from django.conf import settings
import amo
import amo.tests
from addons import cron
from addons.models import Addon, AppSupport
from django.core.management.base import CommandError
from files.models import File, Platform
... | 41.661355 | 79 | 0.652482 | import os
import datetime
from nose.exc import SkipTest
from nose.tools import eq_
import mock
from django.conf import settings
import amo
import amo.tests
from addons import cron
from addons.models import Addon, AppSupport
from django.core.management.base import CommandError
from files.models import File, Platform
... | true | true |
f7493edba56633abc1bf8cfdd67a7fa3b734b2d1 | 36,154 | py | Python | tests/system/action/user/test_create.py | peb-adr/openslides-backend | f885105446760413f1bce3bde33241f7cb1205ac | [
"MIT"
] | null | null | null | tests/system/action/user/test_create.py | peb-adr/openslides-backend | f885105446760413f1bce3bde33241f7cb1205ac | [
"MIT"
] | 19 | 2021-11-22T16:25:54.000Z | 2021-11-25T13:38:13.000Z | tests/system/action/user/test_create.py | peb-adr/openslides-backend | f885105446760413f1bce3bde33241f7cb1205ac | [
"MIT"
] | null | null | null | from openslides_backend.permissions.management_levels import (
CommitteeManagementLevel,
OrganizationManagementLevel,
)
from tests.system.action.base import BaseActionTestCase
class UserCreateActionTest(BaseActionTestCase):
def permission_setup(self) -> None:
self.create_meeting()
self.use... | 36.891837 | 197 | 0.533413 | from openslides_backend.permissions.management_levels import (
CommitteeManagementLevel,
OrganizationManagementLevel,
)
from tests.system.action.base import BaseActionTestCase
class UserCreateActionTest(BaseActionTestCase):
def permission_setup(self) -> None:
self.create_meeting()
self.use... | true | true |
f7493f32ad39bfc5c942b1a45d223a6253019d43 | 1,257 | py | Python | bindings/python/examples/test/SLUHandsOn_test.py | KeDengMS/CNTK | fce86cd9581e7ba746d1ec75bbd67dd35d35d11c | [
"RSA-MD"
] | 1 | 2021-05-09T01:37:49.000Z | 2021-05-09T01:37:49.000Z | bindings/python/examples/test/SLUHandsOn_test.py | KeDengMS/CNTK | fce86cd9581e7ba746d1ec75bbd67dd35d35d11c | [
"RSA-MD"
] | null | null | null | bindings/python/examples/test/SLUHandsOn_test.py | KeDengMS/CNTK | fce86cd9581e7ba746d1ec75bbd67dd35d35d11c | [
"RSA-MD"
] | null | null | null | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
# TODO: This does not work yet, need to figure out the right pattern.
import numpy... | 36.970588 | 117 | 0.721559 |
import numpy as np
from cntk import DeviceDescriptor
from examples.SLUHandsOn.SLUHandsOn import *
from examples.SLUHandsOn.SLUHandsOn import _Infer
def slu_hands_on():
reader = create_reader(data_dir + "/atis.train.ctf")
model = create_model(_inf=_Infer(shape=input_dim, axis=[Axis.default_batch_axis... | true | true |
f7493f3adc6456cc6c4bc70a697300923169af1e | 597 | py | Python | main/migrations/0006_auto_20200822_0116.py | doc22940/playlistor | 9feb18a13db2a4c09e52a025182f78e8d5f9103f | [
"MIT"
] | 206 | 2019-07-04T05:28:42.000Z | 2022-03-30T03:27:05.000Z | main/migrations/0006_auto_20200822_0116.py | doc22940/playlistor | 9feb18a13db2a4c09e52a025182f78e8d5f9103f | [
"MIT"
] | 11 | 2019-10-18T21:52:53.000Z | 2021-11-30T09:45:29.000Z | main/migrations/0006_auto_20200822_0116.py | doc22940/playlistor | 9feb18a13db2a4c09e52a025182f78e8d5f9103f | [
"MIT"
] | 16 | 2019-07-17T08:52:30.000Z | 2022-03-17T08:34:45.000Z | # Generated by Django 2.2.15 on 2020-08-22 01:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0005_auto_20200822_0053'),
]
operations = [
migrations.AlterField(
model_name='track',
name='apple_music_id... | 24.875 | 75 | 0.59464 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0005_auto_20200822_0053'),
]
operations = [
migrations.AlterField(
model_name='track',
name='apple_music_id',
field=models.CharField(max_length... | true | true |
f7493f960c009e8c990af9aa7d6c1bedfc33656e | 2,229 | py | Python | gui_main.py | zypangpang/mmdict_client | aac7fcba21cfbf40a949ad5c121a9b5bd43b0095 | [
"Apache-2.0"
] | 2 | 2020-08-30T07:12:38.000Z | 2020-09-08T02:01:31.000Z | gui_main.py | zypangpang/mmdict_client | aac7fcba21cfbf40a949ad5c121a9b5bd43b0095 | [
"Apache-2.0"
] | 4 | 2020-09-13T15:00:16.000Z | 2020-09-17T13:07:18.000Z | gui_main.py | zypangpang/mmdict_client | aac7fcba21cfbf40a949ad5c121a9b5bd43b0095 | [
"Apache-2.0"
] | 2 | 2020-08-30T07:40:43.000Z | 2020-09-12T18:22:47.000Z | from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication
from gui_client.gui import MainWindow
import constants
import fire
from gui_client.current_state import CurrentState
from gui_client.gui_utils import ProgressDialog,show_info_dialog
from gui_client.work_thread import InitDictThread
from gui_client.gui... | 30.121622 | 98 | 0.692239 | from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication
from gui_client.gui import MainWindow
import constants
import fire
from gui_client.current_state import CurrentState
from gui_client.gui_utils import ProgressDialog,show_info_dialog
from gui_client.work_thread import InitDictThread
from gui_client.gui... | true | true |
f74940505ae3ef5a21a1b99e86a68e2b4ca91e82 | 211 | py | Python | tests/test_config.py | syllogio/syllogio-identifyPropositions | 3d29b750129381629ad8598acd309f9e50d05050 | [
"MIT"
] | null | null | null | tests/test_config.py | syllogio/syllogio-identifyPropositions | 3d29b750129381629ad8598acd309f9e50d05050 | [
"MIT"
] | null | null | null | tests/test_config.py | syllogio/syllogio-identifyPropositions | 3d29b750129381629ad8598acd309f9e50d05050 | [
"MIT"
] | null | null | null | from identifyPropositions import config
def test_config_get_existing():
assert config.get("model_name") == "en_core_web_sm"
def test_config_get_missing():
assert config.get("i_do_not_exist") is None
| 21.1 | 55 | 0.772512 | from identifyPropositions import config
def test_config_get_existing():
assert config.get("model_name") == "en_core_web_sm"
def test_config_get_missing():
assert config.get("i_do_not_exist") is None
| true | true |
f74940774759d64a85f79cb06fe04419f5dcf521 | 27,717 | py | Python | autotest/gdrivers/netcdf_cf.py | chambbj/gdal | 3d56aecb5b8e9890dae8f560acd099992e707d12 | [
"MIT"
] | 1 | 2015-02-16T16:51:38.000Z | 2015-02-16T16:51:38.000Z | autotest/gdrivers/netcdf_cf.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | autotest/gdrivers/netcdf_cf.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test NetCDF driver support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
###############################################################################
# Co... | 41.001479 | 488 | 0.599307 | true | true | |
f74940a561120343b778444a5b00e9dbd60cfe56 | 3,191 | py | Python | imagededup/utils/data_generator.py | backwardn/imagededup | 81d383ec0774d62439eb34ca1fab21b23d83bacd | [
"Apache-2.0"
] | 2 | 2020-06-12T11:20:46.000Z | 2020-06-18T15:54:28.000Z | imagededup/utils/data_generator.py | monkeyfx/imagededup | 38ce34c35187ec33bd996d833293f8ee95ff8202 | [
"Apache-2.0"
] | null | null | null | imagededup/utils/data_generator.py | monkeyfx/imagededup | 38ce34c35187ec33bd996d833293f8ee95ff8202 | [
"Apache-2.0"
] | 1 | 2020-10-07T12:33:16.000Z | 2020-10-07T12:33:16.000Z | from pathlib import PurePath
from typing import Tuple, List, Callable
import numpy as np
from tensorflow.keras.utils import Sequence
from imagededup.utils.image_utils import load_image
class DataGenerator(Sequence):
"""Class inherits from Keras Sequence base object, allows to use multiprocessing in .fit_generat... | 31.91 | 103 | 0.609213 | from pathlib import PurePath
from typing import Tuple, List, Callable
import numpy as np
from tensorflow.keras.utils import Sequence
from imagededup.utils.image_utils import load_image
class DataGenerator(Sequence):
def __init__(
self,
image_dir: PurePath,
batch_size: int,
basen... | true | true |
f7494132ddb6d0cdda44e0e6b0c89a4210c00068 | 2,924 | py | Python | Python-codes/Make-Controls/core/catlr.py | johnnv1/compensator_projects | 96efc80ba33ba3e3f0f543bbf601e6792d082906 | [
"MIT"
] | 1 | 2019-06-24T13:34:38.000Z | 2019-06-24T13:34:38.000Z | Python-codes/Make-Controls/core/catlr.py | johnnv1/compensator_projects | 96efc80ba33ba3e3f0f543bbf601e6792d082906 | [
"MIT"
] | null | null | null | Python-codes/Make-Controls/core/catlr.py | johnnv1/compensator_projects | 96efc80ba33ba3e3f0f543bbf601e6792d082906 | [
"MIT"
] | 1 | 2019-06-24T13:34:52.000Z | 2019-06-24T13:34:52.000Z | # -*- coding: utf-8 -*-
from .misc import *
def catlr(e_esp, Mp_esp, Mp_folga, ts_esp, polos_MA, zeros_MA, Kp_MA, gaindc, pos_polo_c=-0.01):
"""
e_esp : erro esperado em regime permanente
Mp_esp : Overshoot máximo esperado
Mp_folga : Folga dada ao overshoot maximo esperado ->... | 40.611111 | 150 | 0.534884 |
from .misc import *
def catlr(e_esp, Mp_esp, Mp_folga, ts_esp, polos_MA, zeros_MA, Kp_MA, gaindc, pos_polo_c=-0.01):
Kp, Kc = get_kc_lr(e_esp, gaindc)
psi = get_psi(Mp_esp, Mp_folga)
Wn = get_wn(ts_esp, psi)
sigma, Wd = get_paramOrd2(psi,Wn)
print(f"K... | true | true |
f749419c977c65c1f83f9e95cb76d2155af5bf72 | 6,277 | py | Python | test_pytest/test_sys/test_client.py | hat-open/hat-event | 30dffe67a565ff4ff9871d5666e363f97194d2c8 | [
"Apache-2.0"
] | 1 | 2022-02-01T13:43:02.000Z | 2022-02-01T13:43:02.000Z | test_pytest/test_sys/test_client.py | hat-open/hat-event | 30dffe67a565ff4ff9871d5666e363f97194d2c8 | [
"Apache-2.0"
] | null | null | null | test_pytest/test_sys/test_client.py | hat-open/hat-event | 30dffe67a565ff4ff9871d5666e363f97194d2c8 | [
"Apache-2.0"
] | null | null | null | import asyncio
import pytest
from hat.event import common
import hat.event.client
@pytest.mark.asyncio
async def test_connect(create_event_server):
backend_conf = {'module': 'hat.event.server.backends.dummy'}
modules_conf = []
with create_event_server(backend_conf, modules_conf) as srv:
srv.wait... | 34.489011 | 78 | 0.639796 | import asyncio
import pytest
from hat.event import common
import hat.event.client
@pytest.mark.asyncio
async def test_connect(create_event_server):
backend_conf = {'module': 'hat.event.server.backends.dummy'}
modules_conf = []
with create_event_server(backend_conf, modules_conf) as srv:
srv.wait... | true | true |
f74941a57e4009767e0846455748b4584d31fb5c | 11,268 | py | Python | code/semantic.py | dendisuhubdy/flow_synthesizer | 1561e8ce2520258acb3d228beebbb626a8abc04f | [
"MIT"
] | 93 | 2019-07-04T06:33:35.000Z | 2022-02-07T07:21:26.000Z | code/semantic.py | DBraun/flow_synthesizer | 7df51b574765c7834ebdda8a8936b2c0d363a93a | [
"MIT"
] | 4 | 2020-02-06T12:53:05.000Z | 2022-01-17T19:10:05.000Z | code/semantic.py | DBraun/flow_synthesizer | 7df51b574765c7834ebdda8a8936b2c0d363a93a | [
"MIT"
] | 17 | 2019-07-02T09:30:08.000Z | 2022-01-16T13:36:44.000Z | #!/usr/bin/env python3
#%% Plotting
import matplotlib
matplotlib.use('agg')
import os
import time
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
# Internal imports
from utils.data import load_dataset, meta_pairs
from models.basic import GatedMLP, GatedCNN, construct_e... | 44.714286 | 141 | 0.597089 |
import matplotlib
matplotlib.use('agg')
import os
import time
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from utils.data import load_dataset, meta_pairs
from models.basic import GatedMLP, GatedCNN, construct_encoder_decoder, construct_flow, construct_regressor
... | true | true |
f74941fde606e2c0fe79a8fdc3d1a63d437e4628 | 1,600 | py | Python | Puzzles/Easy/TheDart101.py | Naheuldark/Codingame | 1ded71fad8386f3dda74f9b57ff1c056146206c3 | [
"MIT"
] | null | null | null | Puzzles/Easy/TheDart101.py | Naheuldark/Codingame | 1ded71fad8386f3dda74f9b57ff1c056146206c3 | [
"MIT"
] | null | null | null | Puzzles/Easy/TheDart101.py | Naheuldark/Codingame | 1ded71fad8386f3dda74f9b57ff1c056146206c3 | [
"MIT"
] | null | null | null | import sys
import math
TARGET_SCORE = 101
def simulate(shoots):
rounds, throws, misses, score = 1, 0, 0, 0
prev_round_score = 0
prev_shot = ''
for shot in shoots.split():
throws += 1
if 'X' in shot:
misses += 1
score -= 20
if prev_shot == 'X': scor... | 23.880597 | 52 | 0.458125 | import sys
import math
TARGET_SCORE = 101
def simulate(shoots):
rounds, throws, misses, score = 1, 0, 0, 0
prev_round_score = 0
prev_shot = ''
for shot in shoots.split():
throws += 1
if 'X' in shot:
misses += 1
score -= 20
if prev_shot == 'X': scor... | true | true |
f74942f339a99b8ee2926d22ac41632469817c78 | 5,520 | py | Python | benchmarks_FEM_active/C/diffusion/Diff_HTO_test.py | GeoStat-Framework/ogs5py_benchmarks | 0b6db19b87cfad36459757f99ce2458f8e12b20b | [
"BSD-4-Clause"
] | 3 | 2019-01-15T17:38:11.000Z | 2020-01-07T23:44:12.000Z | benchmarks_FEM_active/C/diffusion/Diff_HTO_test.py | GeoStat-Framework/ogs5py_benchmarks | 0b6db19b87cfad36459757f99ce2458f8e12b20b | [
"BSD-4-Clause"
] | 1 | 2020-05-12T09:18:09.000Z | 2020-05-12T10:48:32.000Z | benchmarks/C/diffusion/Diff_HTO_test.py | GeoStat-Framework/ogs5py_benchmarks | 0b6db19b87cfad36459757f99ce2458f8e12b20b | [
"BSD-4-Clause"
] | 1 | 2020-01-08T13:28:50.000Z | 2020-01-08T13:28:50.000Z | # -*- coding: utf-8 -*-
from ogs5py import OGS
model = OGS(
task_root='Diff_HTO_test_root',
task_id='Diff_HTO_test',
output_dir='out',
)
model.msh.read_file('Diff_HTO_test.msh')
model.gli.read_file('Diff_HTO_test.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='LIQUID_FLOW',
NUM_TYPE='N... | 22.904564 | 49 | 0.638225 |
from ogs5py import OGS
model = OGS(
task_root='Diff_HTO_test_root',
task_id='Diff_HTO_test',
output_dir='out',
)
model.msh.read_file('Diff_HTO_test.msh')
model.gli.read_file('Diff_HTO_test.gli')
model.pcs.add_block(
main_key='PROCESS',
PCS_TYPE='LIQUID_FLOW',
NUM_TYPE='NEW',
)
model.pcs.add_bl... | true | true |
f749438247e08664779f5b66b78b0a9912fa89d1 | 381 | py | Python | class6/collateral/ssh_keys_agent.py | twin-bridges/netmiko_course | 31943e4f6f66dbfe523d62d5a2f03285802a8c56 | [
"Apache-2.0"
] | 11 | 2020-09-16T06:53:16.000Z | 2021-08-24T21:27:37.000Z | class6/collateral/ssh_keys_agent.py | twin-bridges/netmiko_course | 31943e4f6f66dbfe523d62d5a2f03285802a8c56 | [
"Apache-2.0"
] | null | null | null | class6/collateral/ssh_keys_agent.py | twin-bridges/netmiko_course | 31943e4f6f66dbfe523d62d5a2f03285802a8c56 | [
"Apache-2.0"
] | 5 | 2020-10-18T20:25:59.000Z | 2021-10-20T16:27:00.000Z | from netmiko import ConnectHandler
# Key file is now encrypted
cisco3 = {
"device_type": "cisco_ios",
"host": "cisco3.lasthop.io",
"username": "testuser",
"use_keys": True,
"key_file": "~/.ssh/test_rsa_encr",
"allow_agent": True,
}
with ConnectHandler(**cisco3) as net_connect:
output = net... | 22.411765 | 52 | 0.664042 | from netmiko import ConnectHandler
cisco3 = {
"device_type": "cisco_ios",
"host": "cisco3.lasthop.io",
"username": "testuser",
"use_keys": True,
"key_file": "~/.ssh/test_rsa_encr",
"allow_agent": True,
}
with ConnectHandler(**cisco3) as net_connect:
output = net_connect.send_command("show... | true | true |
f74944d24649ab461ca9d09d1bd1327e50c4dddd | 4,326 | py | Python | liar/public/views.py | JesseTG/Liar | a952ebc99fe1907e0f40ec4b40a725c75e25ac01 | [
"BSD-3-Clause"
] | 1 | 2017-05-12T20:34:03.000Z | 2017-05-12T20:34:03.000Z | liar/public/views.py | JesseTG/Liar | a952ebc99fe1907e0f40ec4b40a725c75e25ac01 | [
"BSD-3-Clause"
] | null | null | null | liar/public/views.py | JesseTG/Liar | a952ebc99fe1907e0f40ec4b40a725c75e25ac01 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Public section, including homepage and signup."""
from collections import Counter, defaultdict
import operator
import re
import itertools
import math
from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask import current_app
from nltk.corpus import stopwo... | 27.909677 | 117 | 0.644244 |
from collections import Counter, defaultdict
import operator
import re
import itertools
import math
from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask import current_app
from nltk.corpus import stopwords
import nltk
from liar.utils import flash_errors
from liar.extensions im... | true | true |
f74945608486280bd6e90e6ae50a85d01b57d309 | 10,058 | py | Python | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/generator_test.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 2,661 | 2017-03-20T22:12:50.000Z | 2022-03-30T09:43:19.000Z | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/generator_test.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 1,531 | 2017-03-24T17:20:32.000Z | 2022-03-16T18:11:14.000Z | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/generator_test.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 990 | 2017-03-24T11:54:28.000Z | 2022-03-22T11:51:47.000Z | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | 41.221311 | 80 | 0.752834 |
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# 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... | true | true |
f74945bca33741cf32a90c2dc189274e53f90ff6 | 405 | py | Python | src/video/main_insertor.py | juniardiakbar/if4020-steganografi | b8e2f27b77557e83ee3885fa076b7f594345e384 | [
"MIT"
] | null | null | null | src/video/main_insertor.py | juniardiakbar/if4020-steganografi | b8e2f27b77557e83ee3885fa076b7f594345e384 | [
"MIT"
] | null | null | null | src/video/main_insertor.py | juniardiakbar/if4020-steganografi | b8e2f27b77557e83ee3885fa076b7f594345e384 | [
"MIT"
] | 2 | 2021-03-08T12:29:41.000Z | 2022-03-30T02:38:17.000Z | from src.video.insertor import Inserter
from src.helper.video_file import *
if (__name__== "__main__" ):
path = 'sample/video/ex3.avi'
message_path = 'sample/text/short.txt'
key = 'irfan'
insert = Inserter(path, message_path, key)
inserted_frames = insert.insert_message(
is_encry... | 28.928571 | 47 | 0.649383 | from src.video.insertor import Inserter
from src.helper.video_file import *
if (__name__== "__main__" ):
path = 'sample/video/ex3.avi'
message_path = 'sample/text/short.txt'
key = 'irfan'
insert = Inserter(path, message_path, key)
inserted_frames = insert.insert_message(
is_encry... | true | true |
f7494873a0828b172b11c43c361d4c5fb669bc6d | 18,696 | py | Python | handler.py | birkoff/cloud-instances | cbf80523b210bd3e932bd5c933146f446550f0f4 | [
"MIT"
] | 1 | 2019-11-18T23:31:13.000Z | 2019-11-18T23:31:13.000Z | handler.py | birkoff/cloud-instances | cbf80523b210bd3e932bd5c933146f446550f0f4 | [
"MIT"
] | null | null | null | handler.py | birkoff/cloud-instances | cbf80523b210bd3e932bd5c933146f446550f0f4 | [
"MIT"
] | null | null | null | import json
import os
from botocore.exceptions import ClientError
from config.settings import Settings
from modules.entities.account import Account
from modules.entities.instance import Instance
from modules.exceptions import exception
from modules.models.instances import Instances
from modules.models.owners import O... | 30.75 | 91 | 0.592159 | import json
import os
from botocore.exceptions import ClientError
from config.settings import Settings
from modules.entities.account import Account
from modules.entities.instance import Instance
from modules.exceptions import exception
from modules.models.instances import Instances
from modules.models.owners import O... | true | true |
f74948b3164d8b9f65a3ad26596e3bad03e605e0 | 93 | py | Python | lib/JumpScale/baselib/netconfig/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | 1 | 2015-10-26T10:38:13.000Z | 2015-10-26T10:38:13.000Z | lib/JumpScale/baselib/netconfig/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | lib/JumpScale/baselib/netconfig/__init__.py | Jumpscale/jumpscale6_core | 0502ddc1abab3c37ed982c142d21ea3955d471d3 | [
"BSD-2-Clause"
] | null | null | null | from JumpScale import j
from .Netconfig import Netconfig
j.system.netconfig=Netconfig()
| 10.333333 | 32 | 0.784946 | from JumpScale import j
from .Netconfig import Netconfig
j.system.netconfig=Netconfig()
| true | true |
f7494904769ee25ccb089ce8adcbe328d527300e | 2,933 | py | Python | wandb/vendor/pygments/lexers/resource.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | wandb/vendor/pygments/lexers/resource.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | wandb/vendor/pygments/lexers/resource.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.resource
~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for resource definition files.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from ... | 34.104651 | 83 | 0.457211 |
import re
from pygments.lexer import RegexLexer, bygroups, words
from pygments.token import Comment, String, Number, Operator, Text, \
Keyword, Name
__all__ = ['ResourceLexer']
class ResourceLexer(RegexLexer):
name = 'ResourceBundle'
aliases = ['resource', 'resourcebundle']
filenames = ['*.txt']
... | true | true |
f749493433abc742ca6be1519b7e7db5d00ca444 | 14,175 | py | Python | keras_tuner/engine/base_tuner.py | Jet132/keras-tuner | be682573c6f6be1e3f3e6dcac786a34ccac19d3b | [
"Apache-2.0"
] | 1 | 2022-03-01T06:13:17.000Z | 2022-03-01T06:13:17.000Z | keras_tuner/engine/base_tuner.py | maxpark/keras-tuner | be682573c6f6be1e3f3e6dcac786a34ccac19d3b | [
"Apache-2.0"
] | 1 | 2022-03-28T09:14:42.000Z | 2022-03-28T09:14:42.000Z | keras_tuner/engine/base_tuner.py | maxpark/keras-tuner | be682573c6f6be1e3f3e6dcac786a34ccac19d3b | [
"Apache-2.0"
] | 1 | 2022-02-28T20:10:53.000Z | 2022-02-28T20:10:53.000Z | # Copyright 2019 The KerasTuner 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 36.818182 | 83 | 0.626596 |
import copy
import os
import warnings
import tensorflow as tf
from keras_tuner import utils
from keras_tuner.distribute import oracle_chief
from keras_tuner.distribute import oracle_client
from keras_tuner.distribute import utils as dist_utils
from keras_tuner.engine import hypermodel as hm_module
from... | true | true |
f74949d50802a3bb05bb679177749803d1a839f7 | 857 | py | Python | raspberry-server/src/api_celery_scripts.py | EmilyTripoul/WeedDetection | 81959d536c1a7722e41ef3c4dd19c3e376b7d758 | [
"MIT"
] | 2 | 2018-09-13T14:27:25.000Z | 2019-03-21T03:32:34.000Z | raspberry-server/src/api_celery_scripts.py | EmilyTripoul/WeedDetection | 81959d536c1a7722e41ef3c4dd19c3e376b7d758 | [
"MIT"
] | null | null | null | raspberry-server/src/api_celery_scripts.py | EmilyTripoul/WeedDetection | 81959d536c1a7722e41ef3c4dd19c3e376b7d758 | [
"MIT"
] | 2 | 2020-02-26T11:38:29.000Z | 2020-02-29T06:59:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 23 2018
@author: Emily
"""
import http.server as https
import logging
import json
import api_token
def parseCeleryScript(contentDict):
return None
def apiHandleCeleryScript(httpHandler):
requestContent = httpHandler.getRequestContent()
logging.getLogger(... | 25.969697 | 129 | 0.732789 |
import http.server as https
import logging
import json
import api_token
def parseCeleryScript(contentDict):
return None
def apiHandleCeleryScript(httpHandler):
requestContent = httpHandler.getRequestContent()
logging.getLogger('celery_scripts').info('Celery script request from %s'%(httpHandler.addres... | true | true |
f7494aaf4941230e2ecc3ed8f004cdc64d4666b1 | 239 | py | Python | fallball/fallballapp/pagination.py | jazz-jack/fallball-service | 12c91bc0162a8d3d2d103acd66df6e72cdf6a8d2 | [
"Apache-2.0"
] | null | null | null | fallball/fallballapp/pagination.py | jazz-jack/fallball-service | 12c91bc0162a8d3d2d103acd66df6e72cdf6a8d2 | [
"Apache-2.0"
] | null | null | null | fallball/fallballapp/pagination.py | jazz-jack/fallball-service | 12c91bc0162a8d3d2d103acd66df6e72cdf6a8d2 | [
"Apache-2.0"
] | 1 | 2020-06-19T05:00:43.000Z | 2020-06-19T05:00:43.000Z | from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
class PageNumberPaginationDataOnly(PageNumberPagination):
def get_paginated_response(self, data):
return Response(data)
| 26.555556 | 58 | 0.828452 | from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
class PageNumberPaginationDataOnly(PageNumberPagination):
def get_paginated_response(self, data):
return Response(data)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.