hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71f8d6b054c39b44978826f1f894a184c1e7cce | 212 | py | Python | social/__init__.py | Diolor/python-social-auth | ba4e30d4a11b2e188954770bae4df9426d61a470 | [
"BSD-3-Clause"
] | 1 | 2015-04-19T21:38:46.000Z | 2015-04-19T21:38:46.000Z | social/__init__.py | nvbn/python-social-auth | 3e0e99404f20e7b6847ca069e0844ba8c090415f | [
"BSD-3-Clause"
] | null | null | null | social/__init__.py | nvbn/python-social-auth | 3e0e99404f20e7b6847ca069e0844ba8c090415f | [
"BSD-3-Clause"
] | 1 | 2020-05-23T05:49:36.000Z | 2020-05-23T05:49:36.000Z | """
python-social-auth application, allows OpenId or OAuth user
registration/authentication just adding a few configurations.
"""
version = (0, 1, 13)
extra = ''
__version__ = '.'.join(map(str, version)) + extra
| 26.5 | 61 | 0.721698 | version = (0, 1, 13)
extra = ''
__version__ = '.'.join(map(str, version)) + extra
| true | true |
f71f8de993bce72bcbeae4db86fff99ba77edf5b | 324 | py | Python | AOJ/pra_intro/7-d.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | AOJ/pra_intro/7-d.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | AOJ/pra_intro/7-d.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | n, m, l = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
C = [[0]*l for _ in range(n)]
for i in range(n):
for j in range(l):
for k in range(m):
C[i][j] += a[i][k] * b[k][j]
for line in C:
print(*li... | 21.6 | 55 | 0.506173 | n, m, l = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
C = [[0]*l for _ in range(n)]
for i in range(n):
for j in range(l):
for k in range(m):
C[i][j] += a[i][k] * b[k][j]
for line in C:
print(*li... | true | true |
f71f8e826c91b8b02c825b8f93c01a539cdf6534 | 1,888 | py | Python | tsutils/cog_settings.py | kary5678/tsutils | ab6ecdcd2f0e10ba19092028909b3f74bf1708a9 | [
"MIT"
] | 1 | 2021-07-28T19:41:18.000Z | 2021-07-28T19:41:18.000Z | tsutils/cog_settings.py | kary5678/tsutils | ab6ecdcd2f0e10ba19092028909b3f74bf1708a9 | [
"MIT"
] | 19 | 2020-09-14T07:55:14.000Z | 2022-03-06T17:23:14.000Z | tsutils/cog_settings.py | kary5678/tsutils | ab6ecdcd2f0e10ba19092028909b3f74bf1708a9 | [
"MIT"
] | 3 | 2020-09-14T07:47:27.000Z | 2021-09-14T02:16:33.000Z | from redbot.core import data_manager
from .json_utils import *
class CogSettings(object):
SETTINGS_FILE_NAME = "legacy_settings.json"
def __init__(self, cog_name, bot=None):
self.folder = str(data_manager.cog_data_path(raw_name=cog_name))
self.file_path = os.path.join(self.folder, CogSetting... | 33.122807 | 110 | 0.603814 | from redbot.core import data_manager
from .json_utils import *
class CogSettings(object):
SETTINGS_FILE_NAME = "legacy_settings.json"
def __init__(self, cog_name, bot=None):
self.folder = str(data_manager.cog_data_path(raw_name=cog_name))
self.file_path = os.path.join(self.folder, CogSetting... | true | true |
f71f90277bdccfb77a66e3b8e60c836a40516eb8 | 4,991 | py | Python | preql/core/casts.py | otherJL0/Preql | 958a8dfd3a040f9c40fa394a8bfc3295f32a3019 | [
"MIT"
] | null | null | null | preql/core/casts.py | otherJL0/Preql | 958a8dfd3a040f9c40fa394a8bfc3295f32a3019 | [
"MIT"
] | null | null | null | preql/core/casts.py | otherJL0/Preql | 958a8dfd3a040f9c40fa394a8bfc3295f32a3019 | [
"MIT"
] | null | null | null | from . import pql_objects as objects
from . import sql
from .exceptions import Signal
from .interp_common import call_builtin_func
from .pql_types import ITEM_NAME, T, dp_type
from .types_impl import kernel_type
@dp_type
def _cast(inst_type, target_type, inst):
if inst_type <= target_type:
return inst
... | 28.19774 | 111 | 0.661992 | from . import pql_objects as objects
from . import sql
from .exceptions import Signal
from .interp_common import call_builtin_func
from .pql_types import ITEM_NAME, T, dp_type
from .types_impl import kernel_type
@dp_type
def _cast(inst_type, target_type, inst):
if inst_type <= target_type:
return inst
... | true | true |
f71f912ae78f467af2ef0d275e047683484c9024 | 132 | py | Python | clvm/EvalError.py | ChiaMineJP/clvm | 1a5cb17895d8707f784a85180bc97d3c6ebe71a0 | [
"Apache-2.0"
] | 83 | 2020-02-23T13:02:41.000Z | 2022-03-31T06:27:11.000Z | clvm/EvalError.py | ChiaMineJP/clvm | 1a5cb17895d8707f784a85180bc97d3c6ebe71a0 | [
"Apache-2.0"
] | 56 | 2020-01-30T00:28:33.000Z | 2022-03-29T10:38:14.000Z | venv/lib/python3.8/site-packages/clvm/EvalError.py | hu12305204/chia-analyze | 1c9e2104dbe340412e79051fad4cb5b591f6d1a3 | [
"Apache-2.0"
] | 31 | 2019-12-06T09:27:37.000Z | 2022-03-21T13:38:14.000Z | class EvalError(Exception):
def __init__(self, message: str, sexp):
super().__init__(message)
self._sexp = sexp
| 26.4 | 43 | 0.643939 | class EvalError(Exception):
def __init__(self, message: str, sexp):
super().__init__(message)
self._sexp = sexp
| true | true |
f71f91ba96fb0454f17f5b10798f2ab9bc54d086 | 7,164 | py | Python | src/socket_proxy/utils.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | 1 | 2021-05-18T02:28:37.000Z | 2021-05-18T02:28:37.000Z | src/socket_proxy/utils.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | null | null | null | src/socket_proxy/utils.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | null | null | null | import argparse
import ipaddress
import itertools
import logging
import os
import re
import secrets
import socket
import ssl
import sys
from random import shuffle
from typing import List, Tuple, Union
from urllib.parse import urlsplit
from . import base
_logger = logging.getLogger(__name__)
def configure_logging(lo... | 31.012987 | 87 | 0.630374 | import argparse
import ipaddress
import itertools
import logging
import os
import re
import secrets
import socket
import ssl
import sys
from random import shuffle
from typing import List, Tuple, Union
from urllib.parse import urlsplit
from . import base
_logger = logging.getLogger(__name__)
def configure_logging(lo... | true | true |
f71f91d24c0fd013e9b7c15807da9faf8ffce3f9 | 63 | py | Python | src/com/view/__init__.py | amzpiper/synchronize_data | a0ef983a6445ac5b793691dd3d4a86790c0581a7 | [
"Apache-2.0"
] | null | null | null | src/com/view/__init__.py | amzpiper/synchronize_data | a0ef983a6445ac5b793691dd3d4a86790c0581a7 | [
"Apache-2.0"
] | null | null | null | src/com/view/__init__.py | amzpiper/synchronize_data | a0ef983a6445ac5b793691dd3d4a86790c0581a7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env/python
# -*- coding:utf-8 -*-
# Author:guoyuhang | 21 | 22 | 0.634921 | true | true | |
f71f928563424af0b3d6d9d923982a0a08ad1255 | 910 | py | Python | nautilus/network/events/util.py | AlecAivazis/python | 70e2acef27a2f87355590be1a6ca60ce3ab4d09c | [
"MIT"
] | 9 | 2019-02-17T01:33:43.000Z | 2022-02-03T02:14:12.000Z | nautilus/network/events/util.py | AlecAivazis/python | 70e2acef27a2f87355590be1a6ca60ce3ab4d09c | [
"MIT"
] | 59 | 2016-03-14T15:55:50.000Z | 2016-07-17T15:22:56.000Z | nautilus/network/events/util.py | AlecAivazis/python | 70e2acef27a2f87355590be1a6ca60ce3ab4d09c | [
"MIT"
] | 3 | 2017-08-03T20:18:59.000Z | 2018-07-18T02:03:41.000Z | """
This module defines various utilities for dealing with the network.
"""
from asyncio import iscoroutinefunction, iscoroutine
def combine_action_handlers(*handlers):
"""
This function combines the given action handlers into a single function
which will call all of them.
"""
# make su... | 33.703704 | 81 | 0.668132 | from asyncio import iscoroutinefunction, iscoroutine
def combine_action_handlers(*handlers):
for handler in handlers:
if not (iscoroutinefunction(handler) or iscoroutine(handler)):
raise ValueError("Provided handler is not a coroutine: %s" % handler)
async d... | true | true |
f71f92cb89c3fdddcc269f270e17130bd0cea3de | 2,945 | py | Python | app/auth/forms.py | xdhuxc/xblog | ff0383140a5a0c1e8422223154cb98defee73121 | [
"W3C"
] | null | null | null | app/auth/forms.py | xdhuxc/xblog | ff0383140a5a0c1e8422223154cb98defee73121 | [
"W3C"
] | null | null | null | app/auth/forms.py | xdhuxc/xblog | ff0383140a5a0c1e8422223154cb98defee73121 | [
"W3C"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms import PasswordField
from wtforms import BooleanField
from wtforms import SubmitField
from wtforms.validators import DataRequired
from wtforms.validators import Length
from wtforms.validators imp... | 32.722222 | 112 | 0.696774 |
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms import PasswordField
from wtforms import BooleanField
from wtforms import SubmitField
from wtforms.validators import DataRequired
from wtforms.validators import Length
from wtforms.validators import Email
from wtforms.validators import Reg... | true | true |
f71f9324bc59454b4d777a1a8dfc0cbafae774e6 | 9,717 | py | Python | mbam/parsing/base.py | danebjork/AutomatedMBAM | 91183dcfef634ad9150ee187da8172cff6845fe3 | [
"MIT"
] | 2 | 2018-11-10T17:06:36.000Z | 2018-12-19T23:47:26.000Z | mbam/parsing/base.py | danebjork/AutomatedMBAM | 91183dcfef634ad9150ee187da8172cff6845fe3 | [
"MIT"
] | 6 | 2018-05-16T21:06:34.000Z | 2019-01-14T22:23:15.000Z | mbam/parsing/base.py | danebjork/AutomatedMBAM | 91183dcfef634ad9150ee187da8172cff6845fe3 | [
"MIT"
] | 2 | 2018-11-14T13:30:55.000Z | 2019-01-14T20:49:15.000Z | import os
from sympy.printing import julia_code
from sympy import Symbol
import json
import logging
import re
class BaseParser:
"""Parent class for all model parsers.
"""
def __init__(self, mbam_model, data_path):
"""
Parameters
----------
mbam_model : ``mbammodel``
... | 34.580071 | 137 | 0.529793 | import os
from sympy.printing import julia_code
from sympy import Symbol
import json
import logging
import re
class BaseParser:
def __init__(self, mbam_model, data_path):
self.logger = logging.getLogger("MBAM.BaseParser")
self.logger.debug("Initializing BaseParser")
self.mm = mbam_model
... | true | true |
f71f93774042467cdcd4ca52abc67522df7b11cf | 649 | py | Python | intro-python/part2/structure.py | cobeam/DevNetRepo | d824bb6ad7d21bcae03485b571e97fc2b6b61df9 | [
"MIT"
] | 90 | 2018-04-07T00:39:23.000Z | 2020-06-09T02:44:02.000Z | intro-python/part2/structure.py | cobeam/DevNetRepo | d824bb6ad7d21bcae03485b571e97fc2b6b61df9 | [
"MIT"
] | 38 | 2018-04-06T18:11:36.000Z | 2020-05-11T23:36:24.000Z | intro-python/part2/structure.py | cobeam/DevNetRepo | d824bb6ad7d21bcae03485b571e97fc2b6b61df9 | [
"MIT"
] | 143 | 2018-04-20T00:17:24.000Z | 2020-06-12T15:07:42.000Z | #!/usr/bin/env python
"""Module docstring."""
# Imports
import os
import sys
# Module Constants
START_MESSAGE = "CLI Inspection Script"
# Module "Global" Variables
location = os.path.abspath(__file__)
# Module Functions and Classes
def main(*args):
"""My main script function.
Displays the full patch to... | 19.088235 | 78 | 0.694915 |
import os
import sys
START_MESSAGE = "CLI Inspection Script"
location = os.path.abspath(__file__)
def main(*args):
print(START_MESSAGE)
print("Script Location:", location)
print("Arguments Passed:", args)
if __name__ == '__main__':
_, *script_args = sys.argv
main(*script_args)
| true | true |
f71f943b61674db1e41754a8a4cbc52954162b47 | 10,921 | py | Python | setup.py | dineshsonachalam/atheris | 7c96c70056478b29d81d634b197c356f479fb6d7 | [
"Apache-2.0"
] | null | null | null | setup.py | dineshsonachalam/atheris | 7c96c70056478b29d81d634b197c356f479fb6d7 | [
"Apache-2.0"
] | null | null | null | setup.py | dineshsonachalam/atheris | 7c96c70056478b29d81d634b197c356f479fb6d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
# Copyright 2021 Fraunhofer FKIE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.451104 | 228 | 0.672557 |
import os
import shutil
import subprocess
import sys
import tempfile
import setuptools
from setuptools import Extension
from setuptools import setup
from setuptools.command.build_ext import build_ext
__version__ = os.getenv("ATHERIS_VERSION", "1.0.11")
if len(sys.argv) > 1 and sys.argv[1] == "print_v... | true | true |
f71f94cc9ad067fb869ddb7fb431d9594d731530 | 361 | py | Python | fast_gui/core.py | asvcode/nbdev_test | e5bc1a1da28e7c5d87cbba0a207e016219644ee4 | [
"Apache-2.0"
] | 2 | 2020-06-04T08:38:00.000Z | 2020-07-15T15:42:13.000Z | fast_gui/core.py | asvcode/nbdev_test | e5bc1a1da28e7c5d87cbba0a207e016219644ee4 | [
"Apache-2.0"
] | 2 | 2021-09-28T03:23:17.000Z | 2022-02-26T08:14:46.000Z | fast_gui/core.py | asvcode/nbdev_test | e5bc1a1da28e7c5d87cbba0a207e016219644ee4 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['repeat_one']
# Cell
import ipywidgets as widgets
from fastai2.vision.all import*
from .dashboard_two import ds_choice
# Cell
def repeat_one(source, n=128):
"""Single image helper for displaying batch"""
return... | 27.769231 | 87 | 0.753463 |
__all__ = ['repeat_one']
import ipywidgets as widgets
from fastai2.vision.all import*
from .dashboard_two import ds_choice
def repeat_one(source, n=128):
return [get_image_files(ds_choice.source)[9]]*n | true | true |
f71f978be69f377fe3ca350b8404a8eecbbbb6b5 | 11,993 | py | Python | tests/contrib/falcon/test_suite.py | discord/dd-trace-py | 3f6bca078e751bf7459fd02b7aff7f96eff0eeb6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/falcon/test_suite.py | discord/dd-trace-py | 3f6bca078e751bf7459fd02b7aff7f96eff0eeb6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2022-02-16T09:35:37.000Z | 2022-03-04T16:48:45.000Z | tests/contrib/falcon/test_suite.py | goodspark/dd-trace-py | e2089c7b348e9d1a70e01f96927d85a643d6ae56 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2022-02-11T16:34:22.000Z | 2022-02-11T16:34:22.000Z | from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.constants import ERROR_TYPE
from ddtrace.contrib.falcon.patch import FALCON_VERSION
from ddtrace.ext import http as httpx
from tests.opentracer.utils import init_tracer
from tests.utils import assert_is_measured
from tests.u... | 41.071918 | 117 | 0.650546 | from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.constants import ERROR_TYPE
from ddtrace.contrib.falcon.patch import FALCON_VERSION
from ddtrace.ext import http as httpx
from tests.opentracer.utils import init_tracer
from tests.utils import assert_is_measured
from tests.u... | true | true |
f71f98aa12c458b74228cfac53a00bd4f6d9a013 | 11,247 | py | Python | tensorflow/python/ops/standard_ops.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | 5 | 2018-09-22T20:16:46.000Z | 2022-02-28T10:35:19.000Z | tensorflow/python/ops/standard_ops.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/standard_ops.py | noahl/tensorflow | b95d8cce7323d328565378e0d60d72603393f87d | [
"Apache-2.0"
] | 2 | 2019-08-14T09:04:37.000Z | 2022-02-02T20:08:02.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.163987 | 93 | 0.767049 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys as _sys
from tensorflow.python.ops import array_grad
from tensorflow.python.ops import cudnn_rnn_grad
from tensorflow.python.ops import data_flow_grad
from tensorflow.python.ops i... | true | true |
f71f992d007cb05563bc79a20eaf79c8910f3047 | 7,240 | py | Python | run_scripts/FreeSurfer/nipype_reconall_with_tracker.py | neurodatascience/watts_up_compute | 1ed41e62690f99f699b44180208689cc19616bb7 | [
"MIT"
] | null | null | null | run_scripts/FreeSurfer/nipype_reconall_with_tracker.py | neurodatascience/watts_up_compute | 1ed41e62690f99f699b44180208689cc19616bb7 | [
"MIT"
] | null | null | null | run_scripts/FreeSurfer/nipype_reconall_with_tracker.py | neurodatascience/watts_up_compute | 1ed41e62690f99f699b44180208689cc19616bb7 | [
"MIT"
] | null | null | null | # Import modules
import os
import sys
from os.path import join as opj
import pandas as pd
import time
from nipype.interfaces.freesurfer import ReconAll
from nipype.interfaces.utility import IdentityInterface
from nipype.pipeline.engine import Workflow, Node
from pypapi import events, papi_high as high
import argparse
... | 36.938776 | 171 | 0.642403 |
import os
import sys
from os.path import join as opj
import pandas as pd
import time
from nipype.interfaces.freesurfer import ReconAll
from nipype.interfaces.utility import IdentityInterface
from nipype.pipeline.engine import Workflow, Node
from pypapi import events, papi_high as high
import argparse
from exper... | true | true |
f71f9baff849e1b3e85a4e00a676e11b093d2eb9 | 7,777 | py | Python | examples/vae.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | examples/vae.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | examples/vae.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Example of an MLP in Myia.
Myia is still a work in progress, and this example may change in the future.
"""
import time
from dataclasses import dataclass
import numpy
import torch
from numpy.random import RandomState
from torchvision import datasets, transforms
import myia.public_api as pub
from myia import Arit... | 26.542662 | 80 | 0.626077 |
import time
from dataclasses import dataclass
import numpy
import torch
from numpy.random import RandomState
from torchvision import datasets, transforms
import myia.public_api as pub
from myia import ArithmeticData, myia, value_and_grad
from myia.api import to_device
from myia.debug import traceback
from myia.ope... | true | true |
f71f9c72961197bdb094aca591c521ff5e6e78f6 | 2,944 | py | Python | scripts/cfg/cfg.py | jepler/aocl-libm-ose | 4033e022da428125747e118ccd6fdd9cee21c470 | [
"BSD-3-Clause"
] | 66 | 2020-11-04T17:06:10.000Z | 2022-03-10T08:03:12.000Z | scripts/cfg/cfg.py | HollowMan6/aocl-libm-ose | 4033e022da428125747e118ccd6fdd9cee21c470 | [
"BSD-3-Clause"
] | 8 | 2021-04-18T18:37:53.000Z | 2022-03-11T12:49:31.000Z | scripts/cfg/cfg.py | HollowMan6/aocl-libm-ose | 4033e022da428125747e118ccd6fdd9cee21c470 | [
"BSD-3-Clause"
] | 8 | 2020-11-09T03:45:01.000Z | 2021-11-08T02:25:31.000Z | #
# Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... | 41.464789 | 94 | 0.686481 |
from SCons.Variables import Variables as SVariables
from SCons.Script import AddOption
class LocalOption:
def __init__(self):
self.__help_texts = ""
pass
def Add(self, *args, **kwargs):
col_width = 30
help = " " + ", ".join(args)
if "help" in ... | true | true |
f71f9c7e66717452a4ba40fb6f3d1934e7331d68 | 7,731 | py | Python | sadedegel/bblock/vocabulary.py | GlobalMaksimum/sadedegel | 8e28dbeabc3bf0d6f2222089ac5e3a849f9d3a6b | [
"MIT"
] | 100 | 2020-07-06T05:50:49.000Z | 2022-03-21T21:56:55.000Z | sadedegel/bblock/vocabulary.py | LyotardPostmodernizm/sadedegel | 8e28dbeabc3bf0d6f2222089ac5e3a849f9d3a6b | [
"MIT"
] | 244 | 2020-07-06T06:31:01.000Z | 2022-02-26T10:40:17.000Z | sadedegel/bblock/vocabulary.py | LyotardPostmodernizm/sadedegel | 8e28dbeabc3bf0d6f2222089ac5e3a849f9d3a6b | [
"MIT"
] | 23 | 2020-07-27T16:32:48.000Z | 2022-03-18T11:13:07.000Z | import warnings
from collections import defaultdict
from os.path import dirname
from pathlib import Path
import h5py
import numpy as np
from cached_property import cached_property
from rich.console import Console
from .util import tr_lower, normalize_tokenizer_name
console = Console()
class InvalidTokenizer(Except... | 32.078838 | 144 | 0.56073 | import warnings
from collections import defaultdict
from os.path import dirname
from pathlib import Path
import h5py
import numpy as np
from cached_property import cached_property
from rich.console import Console
from .util import tr_lower, normalize_tokenizer_name
console = Console()
class InvalidTokenizer(Except... | true | true |
f71f9cca7a4b7ebe90d9da227393163bb8dccc2f | 215 | py | Python | employee_management/employee_management/doctype/category_module_info/test_category_module_info.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/employee_management/doctype/category_module_info/test_category_module_info.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/employee_management/doctype/category_module_info/test_category_module_info.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Gopi and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestCategoryModuleInfo(unittest.TestCase):
pass
| 19.545455 | 48 | 0.767442 |
from __future__ import unicode_literals
import unittest
class TestCategoryModuleInfo(unittest.TestCase):
pass
| true | true |
f71f9d8b86afa01dd3ceaf3a886e43128a317c40 | 600 | py | Python | sources/t05/t05ej12.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | sources/t05/t05ej12.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | sources/t05/t05ej12.py | workready/pythonbasic | 59bd82caf99244f5e711124e1f6f4dec8de22141 | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser(description="Este programa calcula X^Y")
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
parser.add_argument("x", type=int, help="la base")
parser.add_argum... | 33.333333 | 73 | 0.695 | import argparse
parser = argparse.ArgumentParser(description="Este programa calcula X^Y")
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
parser.add_argument("x", type=int, help="la base")
parser.add_argum... | true | true |
f71f9dd0c9b57edc5e44757006a6fb2ad0870d9a | 8,176 | py | Python | open_spiel/python/examples/hearts_supervised_learning.py | xujing1994/open_spiel | 7663a2717f16ff84c0d6a6bfdf19a9c21b37b765 | [
"Apache-2.0"
] | null | null | null | open_spiel/python/examples/hearts_supervised_learning.py | xujing1994/open_spiel | 7663a2717f16ff84c0d6a6bfdf19a9c21b37b765 | [
"Apache-2.0"
] | 4 | 2020-11-13T18:59:55.000Z | 2022-02-10T02:08:27.000Z | open_spiel/python/examples/hearts_supervised_learning.py | xujing1994/open_spiel | 7663a2717f16ff84c0d6a6bfdf19a9c21b37b765 | [
"Apache-2.0"
] | 1 | 2020-12-25T03:01:37.000Z | 2020-12-25T03:01:37.000Z | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 34.209205 | 80 | 0.689946 |
import os
import pickle
from typing import Any, Tuple
from absl import app
from absl import flags
import haiku as hk
import jax
from jax import numpy as jnp
from jax.experimental import optix
import numpy as np
import pyspiel
OptState = Any
Params = Any
FLAGS = flags.FLAGS
GAME = pyspiel.load_game(... | true | true |
f71f9e454eb33061bb98dbbfbd0ff5e4e58bf745 | 38,248 | py | Python | conda_build/render.py | scopatz/conda-build | dd74b17f4e7cb4286fe9a403895f9d34feb8e071 | [
"BSD-3-Clause"
] | null | null | null | conda_build/render.py | scopatz/conda-build | dd74b17f4e7cb4286fe9a403895f9d34feb8e071 | [
"BSD-3-Clause"
] | null | null | null | conda_build/render.py | scopatz/conda-build | dd74b17f4e7cb4286fe9a403895f9d34feb8e071 | [
"BSD-3-Clause"
] | null | null | null | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
from collections import OrderedDict, ... | 43.912744 | 115 | 0.616189 |
from __future__ import absolute_import, division, print_function
from collections import OrderedDict, defaultdict
from locale import getpreferredencoding
import json
import os
from os.path import isdir, isfile, abspath
import random
import re
import shutil
import string
import subprocess
import sys
import tarfil... | true | true |
f71f9e495e3652fb8077b2a05bb9db9df47c5f74 | 8,148 | py | Python | addon-sdk-1.17/python-lib/cuddlefish/xpi.py | hankduan/firefoxExtension | a5fd86ef024a5ed21e039eb2f4b50fb6d0cf3567 | [
"MIT"
] | 102 | 2015-01-09T22:12:00.000Z | 2021-04-21T01:18:51.000Z | addon-sdk-1.17/python-lib/cuddlefish/xpi.py | hankduan/firefoxExtension | a5fd86ef024a5ed21e039eb2f4b50fb6d0cf3567 | [
"MIT"
] | 17 | 2015-01-24T22:30:47.000Z | 2020-11-19T01:13:32.000Z | addon-sdk-1.17/python-lib/cuddlefish/xpi.py | hankduan/firefoxExtension | a5fd86ef024a5ed21e039eb2f4b50fb6d0cf3567 | [
"MIT"
] | 33 | 2015-01-15T16:11:15.000Z | 2021-06-11T12:15:29.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import zipfile
import simplejson as json
from cuddlefish.util import filter_filenames, filter_dirnames
class ... | 42.4375 | 83 | 0.632793 |
import os
import zipfile
import simplejson as json
from cuddlefish.util import filter_filenames, filter_dirnames
class HarnessOptionAlreadyDefinedError(Exception):
"""You cannot use --harness-option on keys that already exist in
harness-options.json"""
ZIPSEP = "/"
def make_zipfile_path(localroot, local... | false | true |
f71fa02523d9f3e25a04474d5b9b67ff8827679a | 346 | py | Python | .history/routes_20200723125644.py | rkustas/taskmanager | 3218b277a235c4e8d30b1d548ba28be3ab3f628f | [
"MIT"
] | null | null | null | .history/routes_20200723125644.py | rkustas/taskmanager | 3218b277a235c4e8d30b1d548ba28be3ab3f628f | [
"MIT"
] | null | null | null | .history/routes_20200723125644.py | rkustas/taskmanager | 3218b277a235c4e8d30b1d548ba28be3ab3f628f | [
"MIT"
] | null | null | null | from app import app
from flask import render_template
import forms
# Basic route
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html', current_title= 'Custom Title')
@app.route('/about', methods=['GET','POST'])
def about():
form = forms.AddTaskForm()
return render_templat... | 23.066667 | 71 | 0.702312 | from app import app
from flask import render_template
import forms
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html', current_title= 'Custom Title')
@app.route('/about', methods=['GET','POST'])
def about():
form = forms.AddTaskForm()
return render_template('about.html... | true | true |
f71fa109caf8f0da6ce9758d0b1182b0c641a35c | 2,136 | py | Python | python/cuml/test/test_trustworthiness.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | 3 | 2019-10-17T21:46:07.000Z | 2019-10-22T20:13:55.000Z | python/cuml/test/test_trustworthiness.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | 1 | 2020-02-03T22:43:57.000Z | 2020-02-29T02:32:40.000Z | python/cuml/test/test_trustworthiness.py | efajardo-nv/cuml | bc86714836284ed4752c267513e5d447e884e1c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2019, NVIDIA CORPORATION.
#
# 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 agre... | 35.6 | 77 | 0.690543 |
import pytest
from sklearn.manifold.t_sne import trustworthiness as sklearn_trustworthiness
from cuml.metrics import trustworthiness as cuml_trustworthiness
from sklearn.datasets.samples_generator import make_blobs
from umap import UMAP
import cudf
import numpy as np
@pytest.mark.parametrize('input_ty... | true | true |
f71fa140056dc835bd2625ea657d951e01d571d7 | 7,163 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/socfbucsc68.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/socfbucsc68.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/socfbucsc68.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph socfb-UCSC68.
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: 202... | 31.835556 | 103 | 0.668993 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def SocfbUcsc68(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/networkrepository",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f71fa2527a6d8ee637811cf737524b29b2058b63 | 8,210 | py | Python | var/spack/repos/builtin/packages/graphviz/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/graphviz/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/graphviz/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
from spack.operating_systems.mac_os import macos_version
MACOS_VERSION = macos_... | 43.439153 | 155 | 0.637881 |
import os
import sys
from spack import *
from spack.operating_systems.mac_os import macos_version
MACOS_VERSION = macos_version() if sys.platform == 'darwin' else None
class Graphviz(AutotoolsPackage):
homepage = 'http://www.graphviz.org'
git = 'https://gitlab.com/graphviz/graphviz.git'
url ... | true | true |
f71fa28fe37d5ad73815c67dfd54a10cbdef33d0 | 84,349 | py | Python | python/src/chirpstack_api/as_pb/external/api/application_pb2_grpc.py | maxreb/chirpstack-api | c591dd556e70b384318cdf61de19c0350715d61d | [
"MIT"
] | 55 | 2019-11-05T15:46:49.000Z | 2022-03-23T14:31:33.000Z | python/src/chirpstack_api/as_pb/external/api/application_pb2_grpc.py | maxreb/chirpstack-api | c591dd556e70b384318cdf61de19c0350715d61d | [
"MIT"
] | 39 | 2019-11-08T21:03:45.000Z | 2022-03-01T12:40:36.000Z | python/src/chirpstack_api/as_pb/external/api/application_pb2_grpc.py | maxreb/chirpstack-api | c591dd556e70b384318cdf61de19c0350715d61d | [
"MIT"
] | 101 | 2019-11-22T13:59:59.000Z | 2022-03-14T09:52:46.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from chirpstack_api.as_pb.external.api import application_pb2 as chirpstack__api_dot_as__pb_dot_external_dot_api_dot_application__pb2
from google.protobuf import... | 56.195203 | 176 | 0.719013 |
import grpc
from chirpstack_api.as_pb.external.api import application_pb2 as chirpstack__api_dot_as__pb_dot_external_dot_api_dot_application__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class ApplicationServiceStub(object):
def __init__(self, channel):
self.Create = ... | true | true |
f71fa2a559498de7857b82dce82c2cf35e13d842 | 1,475 | py | Python | heterogeneous_client.py | samiul272/fed_ml_proj | 16b6ab0e8a5a5c8ca1a7c6636ec167238f63b31b | [
"MIT"
] | null | null | null | heterogeneous_client.py | samiul272/fed_ml_proj | 16b6ab0e8a5a5c8ca1a7c6636ec167238f63b31b | [
"MIT"
] | null | null | null | heterogeneous_client.py | samiul272/fed_ml_proj | 16b6ab0e8a5a5c8ca1a7c6636ec167238f63b31b | [
"MIT"
] | null | null | null | import logging
class HeterogeneousClient:
def __init__(self, client_idx, local_training_data, local_test_data, local_sample_number, args, device,
model_trainer):
self.client_idx = client_idx
self.local_training_data = local_training_data
self.local_test_data = local_test_... | 36.875 | 107 | 0.711864 | import logging
class HeterogeneousClient:
def __init__(self, client_idx, local_training_data, local_test_data, local_sample_number, args, device,
model_trainer):
self.client_idx = client_idx
self.local_training_data = local_training_data
self.local_test_data = local_test_... | true | true |
f71fa355b3f48d5c42b444b5071f36c04ba8f953 | 5,989 | py | Python | src/utils.py | SimonPerche/PersonalitiesWars | 495803a5be5e9fde572c3f39086d8a3510c75f58 | [
"MIT"
] | null | null | null | src/utils.py | SimonPerche/PersonalitiesWars | 495803a5be5e9fde572c3f39086d8a3510c75f58 | [
"MIT"
] | null | null | null | src/utils.py | SimonPerche/PersonalitiesWars | 495803a5be5e9fde572c3f39086d8a3510c75f58 | [
"MIT"
] | 1 | 2022-03-08T22:07:50.000Z | 2022-03-08T22:07:50.000Z | from typing import Dict, List, Optional, Union
import contextlib
import asyncio
import discord
from discord.ext import pages
from database import DatabasePersonality, DatabaseDeck
# Set authorized guilds for slash command (return [] for global command - might take up to 1h to register)
def get_authorized_guild_ids(... | 39.143791 | 152 | 0.688429 | from typing import Dict, List, Optional, Union
import contextlib
import asyncio
import discord
from discord.ext import pages
from database import DatabasePersonality, DatabaseDeck
def get_authorized_guild_ids():
return [550631040826343427]
async def personalities_name_searcher(ctx: discord.AutocompleteContex... | true | true |
f71fa39892b1a2c86c574196d784cf419690c32e | 449 | py | Python | app/commons/errorCodes.py | handdola/ai-chatbot | f0a336afb873db10b7a5f068b4e1eaa07bf62967 | [
"MIT"
] | 3 | 2017-12-27T19:29:27.000Z | 2018-01-07T02:51:44.000Z | app/commons/errorCodes.py | handdola/ai-chatbot | f0a336afb873db10b7a5f068b4e1eaa07bf62967 | [
"MIT"
] | 108 | 2018-03-26T05:44:22.000Z | 2020-12-14T15:08:38.000Z | app/commons/errorCodes.py | handdola/ai-chatbot | f0a336afb873db10b7a5f068b4e1eaa07bf62967 | [
"MIT"
] | 1 | 2019-05-30T10:50:49.000Z | 2019-05-30T10:50:49.000Z | emptyInput = {"errorCode": 601, "description": "empty input"}
InvalidInput = {"errorCode": 602, "description": "Invalid input"}
UnidentifiedIntent = {
"errorCode": 701,
"description": "Can't identify the intent"}
NotEnoughData = {
"errorCode": 702,
"description": "Not enough Training Data. Please Add m... | 34.538462 | 71 | 0.659243 | emptyInput = {"errorCode": 601, "description": "empty input"}
InvalidInput = {"errorCode": 602, "description": "Invalid input"}
UnidentifiedIntent = {
"errorCode": 701,
"description": "Can't identify the intent"}
NotEnoughData = {
"errorCode": 702,
"description": "Not enough Training Data. Please Add m... | true | true |
f71fa3cd63c33d94a24ea578cb181d5f2238b651 | 108,132 | py | Python | airflow/jobs.py | yujiantao/incubator-airflow | 97ac37d0b936fd565b113b79f418ff25b245de14 | [
"Apache-2.0"
] | 1 | 2020-05-03T04:34:08.000Z | 2020-05-03T04:34:08.000Z | airflow/jobs.py | yujiantao/incubator-airflow | 97ac37d0b936fd565b113b79f418ff25b245de14 | [
"Apache-2.0"
] | 4 | 2018-03-20T21:24:26.000Z | 2020-05-03T04:23:02.000Z | airflow/jobs.py | yujiantao/incubator-airflow | 97ac37d0b936fd565b113b79f418ff25b245de14 | [
"Apache-2.0"
] | 1 | 2018-10-23T08:58:10.000Z | 2018-10-23T08:58:10.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 41.47756 | 104 | 0.558447 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import getpass
import logging
import multiprocessing
import os
import signal
import sys
import threading
import time
from collections import defaultdic... | true | true |
f71fa3db4ff531443af2a92cd1b1a2d567ddaf8d | 188 | py | Python | lightningrun.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | lightningrun.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | lightningrun.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | import os
os.system("git clone https://github.com/justteen/BUZZ-USERBOT /root/userbot && mkdir /root/userbot/bin/ && cd /root/userbot/ && chmod +x /usr/local/bin/* && python3 -m userbot")
| 62.666667 | 177 | 0.702128 | import os
os.system("git clone https://github.com/justteen/BUZZ-USERBOT /root/userbot && mkdir /root/userbot/bin/ && cd /root/userbot/ && chmod +x /usr/local/bin/* && python3 -m userbot")
| true | true |
f71fa5c1c650d81c5044415e020b232623ab58c2 | 37,109 | py | Python | src/m1_Line.py | chenx15rose/10-MoreImplementingClasses | 2bce636c73e968111c22bc245d90a596276d4679 | [
"MIT"
] | null | null | null | src/m1_Line.py | chenx15rose/10-MoreImplementingClasses | 2bce636c73e968111c22bc245d90a596276d4679 | [
"MIT"
] | null | null | null | src/m1_Line.py | chenx15rose/10-MoreImplementingClasses | 2bce636c73e968111c22bc245d90a596276d4679 | [
"MIT"
] | null | null | null | """
A simple Line class.
NOTE: This is NOT rosegraphics -- it is your OWN Line class.
Authors: David Mutchler, Vibha Alangar, Dave Fisher, Amanda Stouder,
their colleagues and Xiaolong Chen.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
import math
import m1t_test_Line as m1t
########################... | 37.789206 | 97 | 0.487052 |
import math
import m1t_test_Line as m1t
| true | true |
f71fa5eb456e72440a4f739d0f3da6d1a8af1718 | 696 | py | Python | corrector/utils/cut_word/mm.py | mamachengcheng/corrector | e87c49f7dd7d9f236084e963906f414f72a884c9 | [
"MIT"
] | 4 | 2020-11-11T14:08:56.000Z | 2022-02-15T01:31:27.000Z | corrector/utils/cut_word/mm.py | mamachengcheng/corrector | e87c49f7dd7d9f236084e963906f414f72a884c9 | [
"MIT"
] | null | null | null | corrector/utils/cut_word/mm.py | mamachengcheng/corrector | e87c49f7dd7d9f236084e963906f414f72a884c9 | [
"MIT"
] | null | null | null |
def mm(word_dict, text):
result = list()
max_length =
return result
def mm(word_dict, token, window_size=5):
idxs = []
result = []
index = 0
text_size = len(token)
#print(token)
while text_size > index:
for size in range(window_size + index, index, -1):
#print(... | 26.769231 | 81 | 0.541667 |
def mm(word_dict, text):
result = list()
max_length =
return result
def mm(word_dict, token, window_size=5):
idxs = []
result = []
index = 0
text_size = len(token)
while text_size > index:
for size in range(window_size + index, index, -1):
]
... | false | true |
f71fa77e0d385cdca5a886aa27031fa0a8e90b0c | 1,251 | py | Python | canary-dedup-groomer.py | open-cluster-management/canary-reporting | d97d49fb83e8e8d5e56b937261928285303e475e | [
"Apache-2.0"
] | null | null | null | canary-dedup-groomer.py | open-cluster-management/canary-reporting | d97d49fb83e8e8d5e56b937261928285303e475e | [
"Apache-2.0"
] | 35 | 2021-03-24T14:57:42.000Z | 2021-09-23T18:37:58.000Z | canary-dedup-groomer.py | open-cluster-management/canary-reporting | d97d49fb83e8e8d5e56b937261928285303e475e | [
"Apache-2.0"
] | 1 | 2021-08-02T14:26:55.000Z | 2021-08-02T14:26:55.000Z | import os, sys, json, db_utils
import pymysql
from github import Github, UnknownObjectException
from datetime import datetime
# Aligns all defects recorded in database with their github status
TABLE_NAME = "canary_issues"
c = None
conn = None
github_token=os.getenv('GITHUB_TOKEN')
github_org=os.getenv('GITHUB_ORG')
g... | 24.529412 | 66 | 0.710631 | import os, sys, json, db_utils
import pymysql
from github import Github, UnknownObjectException
from datetime import datetime
TABLE_NAME = "canary_issues"
c = None
conn = None
github_token=os.getenv('GITHUB_TOKEN')
github_org=os.getenv('GITHUB_ORG')
github_repo=os.getenv('GITHUB_REPO')
def query_github_status(defec... | true | true |
f71fa7d89da3839e79f74760543e4ed894dcc3ac | 3,351 | py | Python | imagr_images/tests.py | sazlin/cfpydev-imagr | e34ac025e357694f40034ab1c02ed3be5294c2d8 | [
"MIT"
] | null | null | null | imagr_images/tests.py | sazlin/cfpydev-imagr | e34ac025e357694f40034ab1c02ed3be5294c2d8 | [
"MIT"
] | null | null | null | imagr_images/tests.py | sazlin/cfpydev-imagr | e34ac025e357694f40034ab1c02ed3be5294c2d8 | [
"MIT"
] | null | null | null | from django.test import TestCase
from models import Photo, Album
from imagr_users.models import ImagrUser
from imagr_images.models import get_file_owner_username
from admin import PhotoAdmin, AlbumAdmin, ImageSizeListFilter
from django.core.urlresolvers import reverse
from django.contrib.admin.sites import AdminSite
im... | 37.651685 | 101 | 0.64906 | from django.test import TestCase
from models import Photo, Album
from imagr_users.models import ImagrUser
from imagr_images.models import get_file_owner_username
from admin import PhotoAdmin, AlbumAdmin, ImageSizeListFilter
from django.core.urlresolvers import reverse
from django.contrib.admin.sites import AdminSite
im... | true | true |
f71fa83d6989172da3743eb9fd560fc906515688 | 10,607 | py | Python | tests/commandline/stubber_cli_test.py | Josverl/mipystubber | 504814224b38208e9886661b181a57d2b9077be1 | [
"MIT"
] | 1 | 2019-03-26T16:03:04.000Z | 2019-03-26T16:03:04.000Z | tests/commandline/stubber_cli_test.py | Josverl/mipystubber | 504814224b38208e9886661b181a57d2b9077be1 | [
"MIT"
] | null | null | null | tests/commandline/stubber_cli_test.py | Josverl/mipystubber | 504814224b38208e9886661b181a57d2b9077be1 | [
"MIT"
] | null | null | null | from typing import List
import pytest
from pytest_mock import MockerFixture
from mock import MagicMock
from pathlib import Path
from click.testing import CliRunner
# module under test :
import stubber.stubber as stubber
def test_stubber_help():
# check basic commandline sanity check
runner = CliRunner()
... | 42.258964 | 136 | 0.614217 | from typing import List
import pytest
from pytest_mock import MockerFixture
from mock import MagicMock
from pathlib import Path
from click.testing import CliRunner
import stubber.stubber as stubber
def test_stubber_help():
runner = CliRunner()
result = runner.invoke(stubber.stubber_cli, ["--help"])
... | true | true |
f71fa8aed93c8b08ae1ae6669c787edf3afcae3d | 12,641 | py | Python | python/ccxt/async_support/base/exchange.py | gabvladov/ccxt | c26ba54afe1617d7314bf6714427a4db6d0c6381 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | gabvladov/ccxt | c26ba54afe1617d7314bf6714427a4db6d0c6381 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | gabvladov/ccxt | c26ba54afe1617d7314bf6714427a4db6d0c6381 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.20.94'
# -----------------------------------------------------------------------------
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import a... | 41.719472 | 355 | 0.610316 |
__version__ = '1.20.94'
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttle import throttle
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Exchange... | true | true |
f71fa96f8684f8b86d25128c15599561e0aa97b2 | 11,711 | py | Python | fs_patches_of_hybrid_cloud/cherry_for_B038/nova_cascaded/nova/virt/vmwareapi/vmware_images.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 2 | 2015-06-15T02:16:33.000Z | 2022-02-23T07:10:38.000Z | patches_tool/vcloud_patch/code/nova/virt/vmwareapi/vmware_images.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 7 | 2016-05-13T06:39:45.000Z | 2016-05-20T02:55:31.000Z | fs_patches_of_hybrid_cloud/cherry_for_B038/nova_cascaded/nova/virt/vmwareapi/vmware_images.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 4 | 2015-11-02T04:02:50.000Z | 2021-05-13T17:06:00.000Z | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 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
#
# ... | 40.663194 | 80 | 0.61566 |
import os
from oslo.config import cfg
from nova import exception
from nova import image
from nova.openstack.common import log as logging
from nova.openstack.common import strutils
from nova.openstack.common import units
from nova.virt.vmwareapi import constants
from nova.virt.vmwareapi impo... | true | true |
f71fa9e010cfc60587fdfbd98f199c76f3a648ad | 30,587 | py | Python | mypyc/irbuild/expression.py | sileht/mypy | 334876a0cdb80d76333e4976238fd7f42fbaabf2 | [
"PSF-2.0"
] | 1 | 2021-09-25T16:12:01.000Z | 2021-09-25T16:12:01.000Z | mypyc/irbuild/expression.py | sileht/mypy | 334876a0cdb80d76333e4976238fd7f42fbaabf2 | [
"PSF-2.0"
] | 1 | 2021-08-21T07:40:45.000Z | 2021-08-21T07:40:45.000Z | mypyc/irbuild/expression.py | sileht/mypy | 334876a0cdb80d76333e4976238fd7f42fbaabf2 | [
"PSF-2.0"
] | 1 | 2021-08-21T07:39:57.000Z | 2021-08-21T07:39:57.000Z | """Transform mypy expression ASTs to mypyc IR (Intermediate Representation).
The top-level AST transformation logic is implemented in mypyc.irbuild.visitor
and mypyc.irbuild.builder.
"""
from typing import List, Optional, Union, Callable, cast
from mypy.nodes import (
Expression, NameExpr, MemberExpr, SuperExpr,... | 38.914758 | 96 | 0.639193 |
from typing import List, Optional, Union, Callable, cast
from mypy.nodes import (
Expression, NameExpr, MemberExpr, SuperExpr, CallExpr, UnaryExpr, OpExpr, IndexExpr,
ConditionalExpr, ComparisonExpr, IntExpr, FloatExpr, ComplexExpr, StrExpr,
BytesExpr, EllipsisExpr, ListExpr, TupleExpr, DictExpr, SetExpr,... | true | true |
f71fac3e2c7d6447e6fb71445d88074908c05f79 | 507 | py | Python | neighborapp/migrations/0005_auto_20220104_1254.py | Kips-alih/neighborhood | 216d81b352c0f7f61812280f3aa816f8450a61bc | [
"MIT"
] | null | null | null | neighborapp/migrations/0005_auto_20220104_1254.py | Kips-alih/neighborhood | 216d81b352c0f7f61812280f3aa816f8450a61bc | [
"MIT"
] | null | null | null | neighborapp/migrations/0005_auto_20220104_1254.py | Kips-alih/neighborhood | 216d81b352c0f7f61812280f3aa816f8450a61bc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.24 on 2022-01-04 09:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('neighborapp', '0004_neighborhood_description'),
]
operations = [
migrations.AlterField(
model_... | 25.35 | 119 | 0.658777 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('neighborapp', '0004_neighborhood_description'),
]
operations = [
migrations.AlterField(
model_name='neighborhood',
name='location'... | true | true |
f71fada5cf3ee5e227b5f46f44161960eda0e4a2 | 4,783 | py | Python | main.py | PiotrBosowski/prl-browser | eabfcc9307e0ff27d490841b80f9d1cdc06f022f | [
"MIT"
] | null | null | null | main.py | PiotrBosowski/prl-browser | eabfcc9307e0ff27d490841b80f9d1cdc06f022f | [
"MIT"
] | null | null | null | main.py | PiotrBosowski/prl-browser | eabfcc9307e0ff27d490841b80f9d1cdc06f022f | [
"MIT"
] | null | null | null | from bottle import *
import os
import settings
from domain.training_model import Training
from training_utils.combined_outputs import overview_csv
@get(f'/<session_name>/<model_name>/refresh')
def invalidate_cache(session_name, model_name):
global global_models
global_models = Training.load_all()
return r... | 29.708075 | 81 | 0.655237 | from bottle import *
import os
import settings
from domain.training_model import Training
from training_utils.combined_outputs import overview_csv
@get(f'/<session_name>/<model_name>/refresh')
def invalidate_cache(session_name, model_name):
global global_models
global_models = Training.load_all()
return r... | true | true |
f71fada6cd8a268a05f3827d0723a58a4d32aa28 | 9,366 | py | Python | MDSimsEval/pca_analysis.py | MikeXydas/MDSimsEval | 6c32bd8b74e421120beca18d18c3e58fc8f85247 | [
"MIT"
] | 1 | 2020-06-30T12:56:41.000Z | 2020-06-30T12:56:41.000Z | MDSimsEval/pca_analysis.py | MikeXydas/MDSimsEval | 6c32bd8b74e421120beca18d18c3e58fc8f85247 | [
"MIT"
] | 2 | 2021-06-08T21:53:33.000Z | 2021-12-13T20:43:42.000Z | MDSimsEval/pca_analysis.py | MikeXydas/MDSimsEval | 6c32bd8b74e421120beca18d18c3e58fc8f85247 | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from tqdm import tqdm
def scree_plot(analysis_actors_dict, dir_path, pcs_on_scree_plot=50, variance_ratio_line=0.75):
"""
Creates a plot with the scree plots for each ligand and saves it on the specified ... | 46.366337 | 120 | 0.69069 | import math
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from tqdm import tqdm
def scree_plot(analysis_actors_dict, dir_path, pcs_on_scree_plot=50, variance_ratio_line=0.75):
plot_cols = 3
plot_rows = math.ceil(len(analysis_actors_dict['Agonists']) + len(a... | true | true |
f71faed40fe9843e23daeb4a3ae28c21eb2bec96 | 1,395 | py | Python | tests/test_rand_spatial_crop_samples.py | sudohainguyen/MONAI | 89f8a39a1c0bc6f480522c443ee7813cea21df47 | [
"Apache-2.0"
] | 2 | 2020-06-23T16:03:45.000Z | 2020-06-25T05:30:45.000Z | tests/test_rand_spatial_crop_samples.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | null | null | null | tests/test_rand_spatial_crop_samples.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | 1 | 2020-09-14T13:16:01.000Z | 2020-09-14T13:16:01.000Z | # Copyright 2020 MONAI Consortium
# 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, s... | 34.875 | 74 | 0.712545 |
import unittest
import numpy as np
from parameterized import parameterized
from monai.transforms import RandSpatialCropSamples
TEST_CASE_1 = [
{"roi_size": [3, 3, 3], "num_samples": 4, "random_center": True},
np.random.randint(0, 2, size=[3, 3, 3, 3]),
(3, 3, 3, 3),
]
TEST_CASE_2 = [
{"roi_... | true | true |
f71fafdcdc00789924a0f65e4fdb20825b916e5f | 52,274 | py | Python | pymilvus/orm/collection.py | jingkl/pymilvus | f74b4741b7480d4e1740e1ea2d120c96f01bb56a | [
"Apache-2.0"
] | null | null | null | pymilvus/orm/collection.py | jingkl/pymilvus | f74b4741b7480d4e1740e1ea2d120c96f01bb56a | [
"Apache-2.0"
] | null | null | null | pymilvus/orm/collection.py | jingkl/pymilvus | f74b4741b7480d4e1740e1ea2d120c96f01bb56a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 43.309031 | 120 | 0.600318 |
import copy
import json
import pandas
from .connections import get_connection
from .schema import (
CollectionSchema,
FieldSchema,
parse_fields_from_data,
infer_dtype_bydata,
)
from .prepare import Prepare
from .partition import Partition
from .index import Index
from .search import SearchR... | true | true |
f71fb01cbdb1f124478ac2b092b7ac4885231833 | 119 | py | Python | examples/test_error.py | ak1ra24/pytest-md-report | 9d861a9237176e9dd1e6872c197f5bb5985ee049 | [
"MIT"
] | 9 | 2020-05-06T20:54:29.000Z | 2022-03-27T04:11:38.000Z | examples/test_error.py | solisa986/pytest-md-report | a6cdeda92ef8f1ab64c346a86a085ce9e1585880 | [
"MIT"
] | null | null | null | examples/test_error.py | solisa986/pytest-md-report | a6cdeda92ef8f1ab64c346a86a085ce9e1585880 | [
"MIT"
] | 3 | 2021-05-05T19:58:33.000Z | 2021-08-12T07:14:52.000Z | def test_error(invalid_fixture):
pass
class Test:
def test_error(self, invalid_fixture):
assert True
| 14.875 | 42 | 0.697479 | def test_error(invalid_fixture):
pass
class Test:
def test_error(self, invalid_fixture):
assert True
| true | true |
f71fb03c0051a7dd823c621bfe4bd61238f148c4 | 2,121 | py | Python | ciphers/rabin_miller.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 1,568 | 2019-04-25T11:54:45.000Z | 2022-03-31T23:35:23.000Z | ciphers/rabin_miller.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 58 | 2019-02-20T10:45:50.000Z | 2020-09-30T12:18:45.000Z | ciphers/rabin_miller.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 464 | 2019-04-17T04:57:16.000Z | 2022-03-31T04:12:57.000Z | from __future__ import print_function
# Primality Testing with the Rabin-Miller Algorithm
import random
def rabinMiller(num):
s = num - 1
t = 0
while s % 2 == 0:
s = s // 2
t += 1
for trials in range(5):
a = random.randrange(2, num - 1)
v = pow(a, s, num)
if v... | 32.630769 | 80 | 0.474305 | from __future__ import print_function
import random
def rabinMiller(num):
s = num - 1
t = 0
while s % 2 == 0:
s = s // 2
t += 1
for trials in range(5):
a = random.randrange(2, num - 1)
v = pow(a, s, num)
if v != 1:
i = 0
while v != (nu... | true | true |
f71fb0d49c3e93cb8477acd1a5f1a4062ffa2e9a | 25,304 | py | Python | qa/rpc-tests/fundrawtransaction.py | suncoin-network/suncoin-core | 0477040d12804678df90d65410052b1b80e786d8 | [
"MIT"
] | 7 | 2018-03-25T21:29:19.000Z | 2019-05-01T02:29:38.000Z | qa/rpc-tests/fundrawtransaction.py | suncoin-network/suncoin-core | 0477040d12804678df90d65410052b1b80e786d8 | [
"MIT"
] | 1 | 2018-12-17T22:52:45.000Z | 2018-12-19T10:40:02.000Z | qa/rpc-tests/fundrawtransaction.py | suncoin-network/suncoin-core | 0477040d12804678df90d65410052b1b80e786d8 | [
"MIT"
] | 5 | 2018-04-07T07:59:38.000Z | 2021-06-04T11:26:29.000Z | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... | 40.681672 | 214 | 0.557501 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class RawTransactionsTest(BitcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, 4)
def setup_net... | false | true |
f71fb110925949ff47a2cad996420b5abb79125c | 4,468 | py | Python | dimod/generators/chimera.py | pau557/dimod | d3c6d3abf23182b035e1100c46f7c947202edefb | [
"Apache-2.0"
] | null | null | null | dimod/generators/chimera.py | pau557/dimod | d3c6d3abf23182b035e1100c46f7c947202edefb | [
"Apache-2.0"
] | 24 | 2021-07-09T08:19:47.000Z | 2022-03-08T08:15:48.000Z | dimod/generators/chimera.py | pau557/dimod | d3c6d3abf23182b035e1100c46f7c947202edefb | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 29.012987 | 94 | 0.574754 |
from __future__ import absolute_import
import numpy as np
import numpy.random
from dimod.binary_quadratic_model import BinaryQuadraticModel
from dimod.decorators import graph_argument
from dimod.vartypes import SPIN
__all__ = ['chimera_anticluster']
@graph_argument('subgraph', allow_None=True)
def c... | true | true |
f71fb1734f8db11d01bd46d0696b2f6a7c2a050c | 1,845 | py | Python | mediagoblin/plugins/subtitles/models.py | mtlynch/mediagoblin | b5ee42aed44052de114c6e45edb56856d2868858 | [
"CC0-1.0"
] | 7 | 2020-05-27T03:57:21.000Z | 2021-04-21T02:17:39.000Z | mediagoblin/plugins/subtitles/models.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | null | null | null | mediagoblin/plugins/subtitles/models.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | 2 | 2019-05-13T14:42:34.000Z | 2021-08-28T10:36:46.000Z | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2016 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of... | 36.9 | 80 | 0.732249 |
from sqlalchemy import Column, Integer, Unicode, ForeignKey
from sqlalchemy.orm import relationship
from mediagoblin.db.models import User
from mediagoblin.db.base import Base,MediaEntry
class MediaSubtitleFile(Base):
__tablename__ = "core__subtitle_files"
id = Column(Integer, primary_key=True... | true | true |
f71fb1cc1129767d19d13b370609bf72cca258f1 | 1,830 | py | Python | scripts/agregar_empresas_gentor.py | edgarvalli/gentor_backend | 115cadfc802cb5130b62aba5c9b6050cb5f0a466 | [
"MIT"
] | null | null | null | scripts/agregar_empresas_gentor.py | edgarvalli/gentor_backend | 115cadfc802cb5130b62aba5c9b6050cb5f0a466 | [
"MIT"
] | null | null | null | scripts/agregar_empresas_gentor.py | edgarvalli/gentor_backend | 115cadfc802cb5130b62aba5c9b6050cb5f0a466 | [
"MIT"
] | null | null | null | from set_root_path import set_root_path
set_root_path()
import db.sql_server as db
empresas = [
{
"RazonSocial": "GENTOR, S.A. DE C.V.",
"RFC": "GEN760712EM0"
},
{
"RazonSocial": "SERVICIOS CORPORATIVOS GENTOR, S.A.",
"RFC": "SCG931026LW1"
},
{
"RazonSocial... | 24.4 | 84 | 0.519672 | from set_root_path import set_root_path
set_root_path()
import db.sql_server as db
empresas = [
{
"RazonSocial": "GENTOR, S.A. DE C.V.",
"RFC": "GEN760712EM0"
},
{
"RazonSocial": "SERVICIOS CORPORATIVOS GENTOR, S.A.",
"RFC": "SCG931026LW1"
},
{
"RazonSocial... | true | true |
f71fb21ddb1fedaa154d0f69fe5a945c4b945b9c | 13,241 | py | Python | scrapy/core/engine.py | lizhaoxing1/scrapy-comment-zh | 17c6279c63d9733598539589091c5a9551f341f6 | [
"BSD-3-Clause"
] | null | null | null | scrapy/core/engine.py | lizhaoxing1/scrapy-comment-zh | 17c6279c63d9733598539589091c5a9551f341f6 | [
"BSD-3-Clause"
] | null | null | null | scrapy/core/engine.py | lizhaoxing1/scrapy-comment-zh | 17c6279c63d9733598539589091c5a9551f341f6 | [
"BSD-3-Clause"
] | null | null | null | """
This is the Scrapy engine which controls the Scheduler, Downloader and Spiders.
For more information see docs/topics/architecture.rst
"""
import logging
from time import time
from twisted.internet import defer, task
from twisted.python.failure import Failure
from scrapy import signals
from scrapy.core.scraper i... | 37.939828 | 130 | 0.624726 | import logging
from time import time
from twisted.internet import defer, task
from twisted.python.failure import Failure
from scrapy import signals
from scrapy.core.scraper import Scraper
from scrapy.exceptions import DontCloseSpider
from scrapy.http import Response, Request
from scrapy.utils.misc import load_object
... | true | true |
f71fb24b1ca2ef3817592da8e3c5f8b5ac48df99 | 780 | py | Python | nicos_mlz/kws2/setups/uvspectro.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/kws2/setups/uvspectro.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/kws2/setups/uvspectro.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
description = 'controlling the UV-vis spectrometer and LEDs'
group = 'optional'
tango_base = 'tango://phys.kws2.frm2:10000/kws2/'
devices = dict(
OceanView = device('nicos.devices.entangle.DigitalOutput',
description = 'spectrometer trigger interval (0 to switch off)',
tan... | 33.913043 | 72 | 0.65641 |
description = 'controlling the UV-vis spectrometer and LEDs'
group = 'optional'
tango_base = 'tango://phys.kws2.frm2:10000/kws2/'
devices = dict(
OceanView = device('nicos.devices.entangle.DigitalOutput',
description = 'spectrometer trigger interval (0 to switch off)',
tangodevice = tango_base +... | true | true |
f71fb300004e91ff987107bb558165bb8d7b340e | 14,538 | py | Python | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | import pandas
from ..schema.schema_base import *
from .datastore_base import DataStore
from .odo_datastore import OdoDataStore
from ..config import config
from functools import lru_cache, partial
from sqlalchemy import Table, MetaData, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.automap import ... | 35.896296 | 155 | 0.623882 | import pandas
from ..schema.schema_base import *
from .datastore_base import DataStore
from .odo_datastore import OdoDataStore
from ..config import config
from functools import lru_cache, partial
from sqlalchemy import Table, MetaData, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.automap import ... | true | true |
f71fb3203ce46c39849c5a3bac229726738a23a1 | 4,139 | py | Python | src/core/network/llnms-scan-network.py | marvins/LLNMS | ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d | [
"MIT"
] | null | null | null | src/core/network/llnms-scan-network.py | marvins/LLNMS | ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d | [
"MIT"
] | null | null | null | src/core/network/llnms-scan-network.py | marvins/LLNMS | ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d | [
"MIT"
] | 1 | 2020-12-16T09:28:26.000Z | 2020-12-16T09:28:26.000Z | #!/usr/bin/env python
#
# File: llnms-scan-network.py
# Author: Marvin Smith
# Date: 6/13/2015
#
# Purpose: Scan LLNMS networks
#
__author__ = 'Marvin Smith'
# Python Libraries
import argparse, os, sys
# LLNMS Libraries
if os.environ['LLNMS_HOME'] is not None:
sys.path.append(os.environ['L... | 32.590551 | 132 | 0.530563 |
__author__ = 'Marvin Smith'
import argparse, os, sys
if os.environ['LLNMS_HOME'] is not None:
sys.path.append(os.environ['LLNMS_HOME'] + '/lib')
import llnms
def Parse_Command_Line():
parser = argparse.ArgumentParser( description='Scan an LLNMS network.' )
parser.add_argument('-v',... | true | true |
f71fb3d05a7fffde16b9485af0a723ccfc10ba6f | 16,760 | py | Python | maven_proj_graph/pkg1/mvnsortmod1.py | lg-alabris/swagger-ui | fdb06ad6dc3dd9c416b08c8f7909c37cfcf1ece4 | [
"Apache-2.0"
] | null | null | null | maven_proj_graph/pkg1/mvnsortmod1.py | lg-alabris/swagger-ui | fdb06ad6dc3dd9c416b08c8f7909c37cfcf1ece4 | [
"Apache-2.0"
] | null | null | null | maven_proj_graph/pkg1/mvnsortmod1.py | lg-alabris/swagger-ui | fdb06ad6dc3dd9c416b08c8f7909c37cfcf1ece4 | [
"Apache-2.0"
] | null | null | null | '''
======================================================================
Created on Jan 14, 2018
PURPOSE: this module provides classes to read Maven projects from git or other repos
specifically intended to create the graph of multiple project dependencies
ROADMAP: TODO -
1. review how properties ... | 36.514161 | 178 | 0.515752 | import os
import subprocess
import xml.etree.cElementTree as ET
import re
import urllib.request
class Util(object):
mvn_pom_ns = {"mvn":"http://maven.apache.org/POM/4.0.0"}
def __init__(self):
pass
@staticmethod
def get_tag_value(name, section):
s = ('mvn:%... | true | true |
f71fb4b548decad7d92f6c012d1d10217c8e029e | 2,063 | py | Python | Union_Find/1070.Accounts Merge/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 12 | 2019-05-04T04:21:27.000Z | 2022-03-02T07:06:57.000Z | Union_Find/1070.Accounts Merge/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 1 | 2019-07-24T18:43:53.000Z | 2019-07-24T18:43:53.000Z | Union_Find/1070.Accounts Merge/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 10 | 2019-07-01T04:03:04.000Z | 2022-03-09T03:57:37.000Z | from collections import defaultdict
class Solution:
"""
@param accounts: List[List[str]]
@return: return a List[List[str]]
"""
def accountsMerge(self, accounts):
# write your code here
merged = []
if not accounts or len(accounts) == 0:
return merged
s... | 27.506667 | 85 | 0.561318 | from collections import defaultdict
class Solution:
def accountsMerge(self, accounts):
merged = []
if not accounts or len(accounts) == 0:
return merged
self.forward_index = self.create_forward_index(accounts)
self.inverted_index = self.create_inverted_index(... | true | true |
f71fb575e9c0c22da60dd6194084df2483a9ba88 | 3,979 | py | Python | tests/test_detect_score.py | pgftennis/tennis_analysis_tool | 9f43545fa2b502930ec27a4de634ebc45e65cb19 | [
"MIT"
] | 1 | 2022-01-14T10:35:00.000Z | 2022-01-14T10:35:00.000Z | tests/test_detect_score.py | pgftennis/tennis_analysis_tool | 9f43545fa2b502930ec27a4de634ebc45e65cb19 | [
"MIT"
] | null | null | null | tests/test_detect_score.py | pgftennis/tennis_analysis_tool | 9f43545fa2b502930ec27a4de634ebc45e65cb19 | [
"MIT"
] | null | null | null | import unittest
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
sys.path.append(str(Path(__file__).parent.parent / "src/predict"))
import src.predict.detect_score as detect_score
class TestDetectScore(unittest.TestCase):
def setUp(self):#設定
self.ds=detect_score.Detect... | 32.08871 | 78 | 0.60191 | import unittest
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
sys.path.append(str(Path(__file__).parent.parent / "src/predict"))
import src.predict.detect_score as detect_score
class TestDetectScore(unittest.TestCase):
def setUp(self):
self.ds=detect_score.DetectSco... | true | true |
f71fb5d233f60d4940a1f40506e107449b9cb848 | 837 | py | Python | aql/connector.py | ryansb/aql | bc9f11aaf06caabe15981fb33b5ef37a60ce700a | [
"MIT"
] | 24 | 2020-07-16T11:47:28.000Z | 2021-12-02T20:38:52.000Z | aql/connector.py | ryansb/aql | bc9f11aaf06caabe15981fb33b5ef37a60ce700a | [
"MIT"
] | 37 | 2020-10-17T14:04:05.000Z | 2022-02-05T05:01:08.000Z | aql/connector.py | ryansb/aql | bc9f11aaf06caabe15981fb33b5ef37a60ce700a | [
"MIT"
] | 1 | 2019-10-26T03:45:16.000Z | 2019-10-26T03:45:16.000Z | # Copyright 2020 John Reese
# Licensed under the MIT license
import re
from typing import Any, Pattern, Union
from .engines.base import Connection
from .errors import InvalidURI
from .types import Location
_uri_regex: Pattern = re.compile(r"(?P<engine>\w+)://(?P<location>.+)")
def connect(location: Union[str, Loca... | 32.192308 | 85 | 0.688172 |
import re
from typing import Any, Pattern, Union
from .engines.base import Connection
from .errors import InvalidURI
from .types import Location
_uri_regex: Pattern = re.compile(r"(?P<engine>\w+)://(?P<location>.+)")
def connect(location: Union[str, Location], *args: Any, **kwargs: Any) -> Connection:
if isi... | true | true |
f71fb6028cbb2b09f79e06a91c06d14c015af377 | 2,712 | py | Python | utils.py | TNLC/pycalc | a60e996c5e4e1b6fdae5da124864cdf9a7178d19 | [
"Apache-2.0"
] | null | null | null | utils.py | TNLC/pycalc | a60e996c5e4e1b6fdae5da124864cdf9a7178d19 | [
"Apache-2.0"
] | null | null | null | utils.py | TNLC/pycalc | a60e996c5e4e1b6fdae5da124864cdf9a7178d19 | [
"Apache-2.0"
] | null | null | null | import math
from rply import LexerGenerator, ParserGenerator
def build_lexer():
# LEXERGENERATOR INSTANZIEREN
lexer_generator = LexerGenerator()
# WHITESPACES IGNORIEREN
lexer_generator.ignore(r'\s+')
# ZAHLEN ERKENNEN
# -? => ENTWEDER MINUS ODER NICHT
# \.? => ENTWEDER EIN PUNKT ODER NICH... | 32.674699 | 68 | 0.625369 | import math
from rply import LexerGenerator, ParserGenerator
def build_lexer():
lexer_generator = LexerGenerator()
lexer_generator.ignore(r'\s+')
lexer_generator.add('NUM', r'-?[0-9]*\.?[0-9]+')
lexer_generator.add('ADD', r'\+')
lexer_generator.... | true | true |
f71fb63636601da0239ffd402fc4be7612c8b4ab | 4,587 | py | Python | ca_municipalities/people.py | dogooderapp/scrapers-ca | 5e852eea93f05f3f397eec318d3094a3b1b0b458 | [
"MIT"
] | 19 | 2015-05-26T03:18:50.000Z | 2022-01-31T03:27:41.000Z | ca_municipalities/people.py | dogooderapp/scrapers-ca | 5e852eea93f05f3f397eec318d3094a3b1b0b458 | [
"MIT"
] | 119 | 2015-01-09T06:09:35.000Z | 2022-01-20T23:05:05.000Z | ca_municipalities/people.py | dogooderapp/scrapers-ca | 5e852eea93f05f3f397eec318d3094a3b1b0b458 | [
"MIT"
] | 17 | 2015-11-23T05:00:10.000Z | 2021-09-15T16:03:33.000Z | from utils import CSVScraper, CanadianPerson as Person
from pupa.scrape import Organization, Post
from collections import defaultdict
import re
class CanadaMunicipalitiesPersonScraper(CSVScraper):
csv_url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRrGXQy8qk16OhuTjlccoGB4jL5e8X1CEqRbg896ufLdh67DQk9nuGm-o... | 42.869159 | 176 | 0.514716 | from utils import CSVScraper, CanadianPerson as Person
from pupa.scrape import Organization, Post
from collections import defaultdict
import re
class CanadaMunicipalitiesPersonScraper(CSVScraper):
csv_url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRrGXQy8qk16OhuTjlccoGB4jL5e8X1CEqRbg896ufLdh67DQk9nuGm-o... | true | true |
f71fb66f5197af2f7a2dd9fb62e51560772987ee | 398 | py | Python | tests/connection/test_cursor.py | coverwallet/pysoni | 49d3a8acb101436ad0724749572be2ad9d86f3ae | [
"MIT"
] | 5 | 2019-07-08T15:38:06.000Z | 2022-03-24T20:36:19.000Z | tests/connection/test_cursor.py | coverwallet/pysoni | 49d3a8acb101436ad0724749572be2ad9d86f3ae | [
"MIT"
] | 2 | 2019-07-07T23:26:32.000Z | 2020-06-04T07:43:24.000Z | tests/connection/test_cursor.py | coverwallet/pysoni | 49d3a8acb101436ad0724749572be2ad9d86f3ae | [
"MIT"
] | 1 | 2019-05-31T09:11:22.000Z | 2019-05-31T09:11:22.000Z | def test_cursor_triggers_cursor_in_the_connection(open_connection):
open_connection.cursor()
open_connection._connection_handler.cursor.assert_called_once()
def test_cursor_returns_a_cursor_in_the_handler(open_connection, mocker):
cursor_mock = mocker.Mock()
open_connection._connection_handler.cursor.... | 39.8 | 73 | 0.831658 | def test_cursor_triggers_cursor_in_the_connection(open_connection):
open_connection.cursor()
open_connection._connection_handler.cursor.assert_called_once()
def test_cursor_returns_a_cursor_in_the_handler(open_connection, mocker):
cursor_mock = mocker.Mock()
open_connection._connection_handler.cursor.... | true | true |
f71fb695ceaa12f53778fae43e8d0268e9cde5f9 | 3,235 | py | Python | server/config/settings.py | sudosubin/playground-gunicorn | 770b2db062446e47a92b37fd3488f0e657157293 | [
"MIT"
] | null | null | null | server/config/settings.py | sudosubin/playground-gunicorn | 770b2db062446e47a92b37fd3488f0e657157293 | [
"MIT"
] | null | null | null | server/config/settings.py | sudosubin/playground-gunicorn | 770b2db062446e47a92b37fd3488f0e657157293 | [
"MIT"
] | null | null | null | """
Django settings for config project.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from pathlib ... | 26.08871 | 91 | 0.703246 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-n1vl4be=11s&5oo0^453rw&9(g3v0pjb6=t4ze@d_3j4i3)y+y'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
f71fb6ffafd818eedc205dc12f215cb79fa5ad0e | 680 | py | Python | sa/profiles/Vyatta/Vyatta/get_capabilities.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Vyatta/Vyatta/get_capabilities.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Vyatta/Vyatta/get_capabilities.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Vyatta.Vyatta.get_capabilities
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -------------------------------------------------... | 30.909091 | 73 | 0.457353 |
from noc.sa.profiles.Generic.get_capabilities import Script as BaseScript
class Script(BaseScript):
name = "Vyatta.Vyatta.get_capabilities"
def has_lldp_cli(self):
r = self.cli("show lldp neighbors")
return "LLDP not configured" not in r
| true | true |
f71fb8631c4b145396e2bba66374e05637da08a5 | 130 | py | Python | db_utils.py | bizmarcin/thefridge | 13bde29a57aea09fecf5ec2f28ce013adf6c4d08 | [
"MIT"
] | 1 | 2019-07-01T13:04:02.000Z | 2019-07-01T13:04:02.000Z | db_utils.py | bizmarcin/thefridge | 13bde29a57aea09fecf5ec2f28ce013adf6c4d08 | [
"MIT"
] | 2 | 2020-07-17T09:05:59.000Z | 2021-05-09T06:42:06.000Z | db_utils.py | bizmarcin/thefridge | 13bde29a57aea09fecf5ec2f28ce013adf6c4d08 | [
"MIT"
] | null | null | null | import sqlite3
def get_connection():
conn = sqlite3.connect('fridge.db')
conn.row_factory = sqlite3.Row
return conn
| 16.25 | 39 | 0.7 | import sqlite3
def get_connection():
conn = sqlite3.connect('fridge.db')
conn.row_factory = sqlite3.Row
return conn
| true | true |
f71fb9c25aa2d31e0378e8ac7911871707f58f10 | 6,328 | py | Python | tests/components/switch/test_command_line.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2016-07-14T05:20:54.000Z | 2016-07-14T05:20:54.000Z | tests/components/switch/test_command_line.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | tests/components/switch/test_command_line.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2018-11-22T13:55:23.000Z | 2018-11-22T13:55:23.000Z | """the tests for the Command line switch platform."""
import json
import os
import tempfile
import unittest
from homeassistant.const import STATE_ON, STATE_OFF
import homeassistant.components.switch as switch
import homeassistant.components.switch.command_line as command_line
from tests.common import get_test_home_as... | 35.751412 | 79 | 0.533028 | import json
import os
import tempfile
import unittest
from homeassistant.const import STATE_ON, STATE_OFF
import homeassistant.components.switch as switch
import homeassistant.components.switch.command_line as command_line
from tests.common import get_test_home_assistant
class TestCommandSwitch(unittest.TestCase):
... | true | true |
f71fb9e8ec48b2f9258997378e50488a34fc3cb5 | 2,033 | py | Python | scripts/utils/connection.py | CostaDiego/product-complaint-classification | 42d44210553577616dcf8ac4bf616b587fa02e8c | [
"MIT"
] | null | null | null | scripts/utils/connection.py | CostaDiego/product-complaint-classification | 42d44210553577616dcf8ac4bf616b587fa02e8c | [
"MIT"
] | null | null | null | scripts/utils/connection.py | CostaDiego/product-complaint-classification | 42d44210553577616dcf8ac4bf616b587fa02e8c | [
"MIT"
] | null | null | null | import psycopg2
from getpass import getpass
class DatabaseConection(object):
"""
"""
def __init__(self, host: str, database: str, user: str):
self._con = None
self._host = host
self._database = database
self._user = user
self.connected = False
try:
... | 26.064103 | 65 | 0.484506 | import psycopg2
from getpass import getpass
class DatabaseConection(object):
def __init__(self, host: str, database: str, user: str):
self._con = None
self._host = host
self._database = database
self._user = user
self.connected = False
try:
self._co... | true | true |
f71fbb8b5e0dc57ce6f0bd235b70ff2b45cd4410 | 4,913 | py | Python | ilustrado/util.py | ml-evs/ilustrado | 3121ecaff9cb517f3946b2283bf50dce499caad9 | [
"MIT"
] | 3 | 2019-10-31T20:54:55.000Z | 2022-01-05T16:39:43.000Z | ilustrado/util.py | ml-evs/ilustrado | 3121ecaff9cb517f3946b2283bf50dce499caad9 | [
"MIT"
] | null | null | null | ilustrado/util.py | ml-evs/ilustrado | 3121ecaff9cb517f3946b2283bf50dce499caad9 | [
"MIT"
] | 2 | 2019-11-29T11:34:11.000Z | 2020-08-12T12:31:48.000Z | # coding: utf-8
""" Catch-all file for utility functions.
"""
import sys
import logging
import numpy as np
from matador.compute import ComputeTask
from matador.utils.cell_utils import cart2frac, cart2abc
LOG = logging.getLogger("ilustrado")
LOG.setLevel(logging.DEBUG)
def strip_useless(doc, to_run=False):
""... | 28.730994 | 102 | 0.574802 |
import sys
import logging
import numpy as np
from matador.compute import ComputeTask
from matador.utils.cell_utils import cart2frac, cart2abc
LOG = logging.getLogger("ilustrado")
LOG.setLevel(logging.DEBUG)
def strip_useless(doc, to_run=False):
stripped_doc = dict()
if to_run:
keys = [
... | true | true |
f71fbc58ba45ce332cf36e06106fa51f669a4b79 | 16,543 | py | Python | services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | null | null | null | services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | 29 | 2018-11-13T09:39:29.000Z | 2022-03-22T10:11:32.000Z | services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | null | null | null | """The scheduler shall be run as a background task.
Based on oSparc pipelines, it monitors when to start the next celery task(s), either one at a time or as a group of tasks.
In principle the Scheduler maintains the comp_runs table in the database.
It contains how the pipeline was run and by whom.
It also contains the... | 38.651869 | 150 | 0.609684 |
import asyncio
import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional, Set, Tuple, cast
import networkx as nx
from aiopg.sa.engine import Engine
from models_library.projects import ProjectID
from models_library.projects_nodes_io im... | true | true |
f71fbf2af7ee4f4be9f4ac329665e4e092b4627e | 1,045 | py | Python | tests/pyre/filesystem/local_rootNotDirectory.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/filesystem/local_rootNotDirectory.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/filesystem/local_rootNotDirectory.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
"""
Verify that attempts to create local filesystems with nonexistent roots fails as expected
"""
def test():
# support
import pyre.primitives
# my package
import pyre.filesyste... | 21.770833 | 89 | 0.643062 |
def test():
import pyre.primitives
import pyre.filesystem
dummy = pyre.primitives.path("./local_rootNotDirectory.py")
try:
pyre.filesystem.local(root=dummy)
assert False
# if it fails as expected
except pyre.filesystem.MountPointE... | true | true |
f71fc0279e6c6df13e14b65f4c5bea90b17f596c | 21,395 | py | Python | pytorchtools/ptnetworks/ResNetCIFAR.py | Criscraft/pytorch_classification | d5772963e55ce218ae4719fb7f85604263aab65f | [
"MIT"
] | null | null | null | pytorchtools/ptnetworks/ResNetCIFAR.py | Criscraft/pytorch_classification | d5772963e55ce218ae4719fb7f85604263aab65f | [
"MIT"
] | null | null | null | pytorchtools/ptnetworks/ResNetCIFAR.py | Criscraft/pytorch_classification | d5772963e55ce218ae4719fb7f85604263aab65f | [
"MIT"
] | null | null | null | from collections import OrderedDict
import torch
from torch import Tensor
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from ptnetworks.ActivationTracker import ActivationTracker
from typing import Type, Any, Callable, Union, List, Optional
class ResNetCIFAR(nn.Module):... | 39.329044 | 111 | 0.621874 | from collections import OrderedDict
import torch
from torch import Tensor
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from ptnetworks.ActivationTracker import ActivationTracker
from typing import Type, Any, Callable, Union, List, Optional
class ResNetCIFAR(nn.Module):... | true | true |
f71fc229e7d866aedfc0418b748cc620f97d4880 | 19,666 | py | Python | libs/pdfminer/pdfminer/psparser.py | diverted247/SigningService | a630357a2bf5bea4e5d55106f092e4a2a31cab15 | [
"MIT"
] | null | null | null | libs/pdfminer/pdfminer/psparser.py | diverted247/SigningService | a630357a2bf5bea4e5d55106f092e4a2a31cab15 | [
"MIT"
] | null | null | null | libs/pdfminer/pdfminer/psparser.py | diverted247/SigningService | a630357a2bf5bea4e5d55106f092e4a2a31cab15 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import re
from utils import choplist
STRICT = 0
## PS Exceptions
##
class PSException(Exception):
pass
class PSEOF(PSException):
pass
class PSSyntaxError(PSException):
pass
class PSTypeError(PSException):
pass
class PSValueError(PSException):
pass
## B... | 27.582048 | 99 | 0.501119 |
import sys
import re
from utils import choplist
STRICT = 0
on(Exception):
pass
class PSEOF(PSException):
pass
class PSSyntaxError(PSException):
pass
class PSTypeError(PSException):
pass
class PSValueError(PSException):
pass
ase class for all PS or PDF-related data types."""
pass
... | false | true |
f71fc26c9b8a2256095ae1cb28a68d64d9c6fef3 | 20,784 | py | Python | gym_minigrid/extendedminigrid.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | null | null | null | gym_minigrid/extendedminigrid.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | 6 | 2021-03-18T21:24:56.000Z | 2022-03-11T23:34:25.000Z | gym_minigrid/extendedminigrid.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | null | null | null | from gym_minigrid.minigrid import *
from configurations import config_grabber as cg
import math
import operator
from functools import reduce
import traceback
import numpy as np
config = cg.Configuration.grab()
AGENT_VIEW_SIZE = config.agent_view_size
EXTRA_OBSERVATIONS_SIZE = 5
OBS_ARRAY_SIZE = (AGENT_VIEW_SIZE, A... | 31.301205 | 126 | 0.520737 | from gym_minigrid.minigrid import *
from configurations import config_grabber as cg
import math
import operator
from functools import reduce
import traceback
import numpy as np
config = cg.Configuration.grab()
AGENT_VIEW_SIZE = config.agent_view_size
EXTRA_OBSERVATIONS_SIZE = 5
OBS_ARRAY_SIZE = (AGENT_VIEW_SIZE, A... | true | true |
f71fc2a75dfc0689982cf24fdf8bcd85ccd1cfdc | 3,121 | py | Python | sponsors/notifications.py | geofft/pythondotorg | 4e6747acaffad21ba22d4611b58dccbf04a4ccac | [
"Apache-2.0"
] | 2 | 2021-04-06T16:22:51.000Z | 2021-05-04T13:48:42.000Z | sponsors/notifications.py | vishalsingha/pythondotorg | af59bc03f63cdea16b0f2bd98aae2dcec713c4c1 | [
"Apache-2.0"
] | 6 | 2021-03-19T15:57:15.000Z | 2021-12-13T20:50:11.000Z | sponsors/notifications.py | vishalsingha/pythondotorg | af59bc03f63cdea16b0f2bd98aae2dcec713c4c1 | [
"Apache-2.0"
] | 1 | 2021-08-21T10:36:44.000Z | 2021-08-21T10:36:44.000Z | from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
class BaseEmailSponsorshipNotification:
subject_template = None
message_template = None
email_context_keys = None
def get_subject(self, context):
return render_to_string... | 37.60241 | 82 | 0.779878 | from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
class BaseEmailSponsorshipNotification:
subject_template = None
message_template = None
email_context_keys = None
def get_subject(self, context):
return render_to_string... | true | true |
f71fc31f870e9d876d456cf459dc6a6019bc3ab0 | 336 | py | Python | py_001/py_contextmanager.py | shawn0915/python-study | 4f6d59ed93cb63295f6e67e661860e1f6a4b18c2 | [
"MIT"
] | null | null | null | py_001/py_contextmanager.py | shawn0915/python-study | 4f6d59ed93cb63295f6e67e661860e1f6a4b18c2 | [
"MIT"
] | null | null | null | py_001/py_contextmanager.py | shawn0915/python-study | 4f6d59ed93cb63295f6e67e661860e1f6a4b18c2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import codecs
from contextlib import contextmanager
@contextmanager
def Open(filename, mode, encoding='utf-8'):
fp = codecs.open(filename, mode, encoding)
try:
yield fp
finally:
fp.close()
data = u"context汉字测试"
with Open('data.txt', 'w') as f:
... | 17.684211 | 46 | 0.636905 |
import codecs
from contextlib import contextmanager
@contextmanager
def Open(filename, mode, encoding='utf-8'):
fp = codecs.open(filename, mode, encoding)
try:
yield fp
finally:
fp.close()
data = u"context汉字测试"
with Open('data.txt', 'w') as f:
f.write(data)
| true | true |
f71fc3e734e5af8996dc6c80f55020bcea9a755a | 2,085 | py | Python | simpleAPI/api/v1/serializers.py | Gleb-Stasuyk/simpleAPI | 9b30202915a4f144921b9bd5204f7bfac8b1201f | [
"MIT"
] | null | null | null | simpleAPI/api/v1/serializers.py | Gleb-Stasuyk/simpleAPI | 9b30202915a4f144921b9bd5204f7bfac8b1201f | [
"MIT"
] | null | null | null | simpleAPI/api/v1/serializers.py | Gleb-Stasuyk/simpleAPI | 9b30202915a4f144921b9bd5204f7bfac8b1201f | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from rest_framework import serializers
from companys.models import Company, News
from users.models import Profile
User = get_user_model()
class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'
class Company... | 26.730769 | 88 | 0.655635 | from django.contrib.auth import get_user_model
from rest_framework import serializers
from companys.models import Company, News
from users.models import Profile
User = get_user_model()
class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'
class Company... | true | true |
f71fc5a556957ba4ad43afcc5e2c620d83d7aa7c | 749 | py | Python | Server/tests/queries/test_leaderboards.py | Team-SeeTo/SeeTo-Backend | 19990cd6f4895e773eaa504f7b7a07ddbb5856e5 | [
"Apache-2.0"
] | 4 | 2018-06-18T06:50:12.000Z | 2018-11-15T00:08:24.000Z | Server/tests/queries/test_leaderboards.py | Team-SeeTo/SeeTo-Backend | 19990cd6f4895e773eaa504f7b7a07ddbb5856e5 | [
"Apache-2.0"
] | null | null | null | Server/tests/queries/test_leaderboards.py | Team-SeeTo/SeeTo-Backend | 19990cd6f4895e773eaa504f7b7a07ddbb5856e5 | [
"Apache-2.0"
] | null | null | null | from tests import BasicTestCase
class TestLeaderboards(BasicTestCase):
def test_leaderboards(self):
response = self.request(type="query",
call='leaderboards(token :"{0}")'.format(self.access_token),
body='''
..... | 37.45 | 92 | 0.419226 | from tests import BasicTestCase
class TestLeaderboards(BasicTestCase):
def test_leaderboards(self):
response = self.request(type="query",
call='leaderboards(token :"{0}")'.format(self.access_token),
body='''
..... | true | true |
f71fc6aac913f65673fbaf691c47f217c5bc9c25 | 536 | py | Python | imglatex/cli.py | odarbelaeze/imglatex | 8463531ae48dd4c2b4937ef4d27dbf74d6f732e3 | [
"MIT"
] | 2 | 2018-02-17T20:26:56.000Z | 2022-02-10T13:23:55.000Z | imglatex/cli.py | odarbelaeze/imglatex | 8463531ae48dd4c2b4937ef4d27dbf74d6f732e3 | [
"MIT"
] | 325 | 2018-03-18T15:28:48.000Z | 2022-03-28T04:19:18.000Z | imglatex/cli.py | odarbelaeze/imglatex | 8463531ae48dd4c2b4937ef4d27dbf74d6f732e3 | [
"MIT"
] | null | null | null | """Console script for imglatex."""
import click
from imglatex.imglatex import find_images, Image, Document
@click.command()
@click.argument('path', type=click.Path(exists=True))
@click.option('--prefix', default='.', help='Prefix for the image paths')
def main(path: click.Path, prefix: str):
"""Console script f... | 23.304348 | 73 | 0.671642 |
import click
from imglatex.imglatex import find_images, Image, Document
@click.command()
@click.argument('path', type=click.Path(exists=True))
@click.option('--prefix', default='.', help='Prefix for the image paths')
def main(path: click.Path, prefix: str):
document = Document(
list(Image(i, prefix) for... | true | true |
f71fc728dba3bae392f6f5d4e5b6e05cb75586f8 | 4,525 | py | Python | knox/auth.py | liradb2000/django-rest-knox | 2120bdb44173db121611387b9e1a2e8e358b0123 | [
"MIT"
] | null | null | null | knox/auth.py | liradb2000/django-rest-knox | 2120bdb44173db121611387b9e1a2e8e358b0123 | [
"MIT"
] | null | null | null | knox/auth.py | liradb2000/django-rest-knox | 2120bdb44173db121611387b9e1a2e8e358b0123 | [
"MIT"
] | null | null | null | try:
from hmac import compare_digest
except ImportError:
def compare_digest(a, b):
return a == b
import binascii
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentica... | 39.008621 | 113 | 0.643757 | try:
from hmac import compare_digest
except ImportError:
def compare_digest(a, b):
return a == b
import binascii
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentica... | true | true |
f71fc7ba9f38450681a76a58e0a61f43125749ab | 10,698 | py | Python | codenames/players/codemaster_glove_lookahead.py | gohyun14/Game | 39e6e192590059daade40c95cc177acb0f3a581b | [
"MIT"
] | 1 | 2022-02-25T17:44:02.000Z | 2022-02-25T17:44:02.000Z | codenames/players/codemaster_glove_lookahead.py | gohyun14/Game | 39e6e192590059daade40c95cc177acb0f3a581b | [
"MIT"
] | null | null | null | codenames/players/codemaster_glove_lookahead.py | gohyun14/Game | 39e6e192590059daade40c95cc177acb0f3a581b | [
"MIT"
] | null | null | null | import scipy.spatial.distance
from nltk.stem import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
from math import ceil
import numpy as np
import copy
import itertools
from players.codemaster import Codemaster
THRESHOLD = np.inf
class AICodemaster(Codemaster):
def __init__(self, brown_ic=Non... | 39.476015 | 123 | 0.570667 | import scipy.spatial.distance
from nltk.stem import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
from math import ceil
import numpy as np
import copy
import itertools
from players.codemaster import Codemaster
THRESHOLD = np.inf
class AICodemaster(Codemaster):
def __init__(self, brown_ic=Non... | true | true |
f71fc8515d160a9327f631beba72fefeffeddf90 | 1,049 | py | Python | misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 256 | 2020-09-09T03:27:57.000Z | 2022-03-30T10:06:06.000Z | misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 160 | 2020-09-09T14:06:07.000Z | 2022-03-30T14:50:48.000Z | """
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 32.78125 | 73 | 0.675882 | import io
from torch.utils.data import Dataset
from tqdm import tqdm
class TextContainer(Dataset):
def __init__(self, corpus):
self.data = []
with io.open(corpus, mode='r', encoding='utf-8') as f:
for line in tqdm(f):
self.data.append(line.strip())
def __len__(self)... | true | true |
f71fc8b40616224f0c26320e75087d6d233ed41a | 3,180 | py | Python | wurst/searching.py | pjamesjoyce/wurst | 95b37e72eaa18b33bdd83cd4a51d37d9eb4ae7ba | [
"BSD-2-Clause"
] | 1 | 2022-03-29T14:59:13.000Z | 2022-03-29T14:59:13.000Z | wurst/searching.py | pjamesjoyce/wurst | 95b37e72eaa18b33bdd83cd4a51d37d9eb4ae7ba | [
"BSD-2-Clause"
] | null | null | null | wurst/searching.py | pjamesjoyce/wurst | 95b37e72eaa18b33bdd83cd4a51d37d9eb4ae7ba | [
"BSD-2-Clause"
] | null | null | null | from .errors import MultipleResults, NoResults
def equals(field, value):
"""Return function where input ``field`` value is equal to ``value``"""
return lambda x: x.get(field) == value
def contains(field, value):
return lambda x: value in x.get(field)
def startswith(field, value):
return lambda x: ... | 30.576923 | 118 | 0.654088 | from .errors import MultipleResults, NoResults
def equals(field, value):
return lambda x: x.get(field) == value
def contains(field, value):
return lambda x: value in x.get(field)
def startswith(field, value):
return lambda x: x.get(field, '').startswith(value)
def either(*funcs):
return lambda x... | true | true |
f71fca16be9fa3da257d719ec7efdae5f61d8f68 | 4,100 | py | Python | sandbox/jorvis/generate_gff3_feature_identifiers.py | senjoro/biocode | 6697c17570126d99fb1cbeabf5b8322db006643d | [
"MIT"
] | 355 | 2015-01-15T18:11:20.000Z | 2022-03-26T19:23:30.000Z | sandbox/jorvis/generate_gff3_feature_identifiers.py | senjoro/biocode | 6697c17570126d99fb1cbeabf5b8322db006643d | [
"MIT"
] | 43 | 2015-03-20T08:40:14.000Z | 2022-03-09T22:37:38.000Z | sandbox/jorvis/generate_gff3_feature_identifiers.py | senjoro/biocode | 6697c17570126d99fb1cbeabf5b8322db006643d | [
"MIT"
] | 217 | 2015-01-29T08:40:33.000Z | 2022-03-26T19:23:45.000Z | #!/usr/bin/env python3
"""
This script is used to take any GFF3 file and re-generate feature identifiers within
it to match the convention used at IGS. This is:
$prefix.$type.$id.$version
The mode here defines what the identifier. For example, if using --mode=sequential for
an organism (--prefix) of b_microti,... | 29.496403 | 164 | 0.629268 |
import argparse
import os
import sys
from binascii import hexlify
from collections import defaultdict
from uuid import uuid4
from biocode import gff
equential = defaultdict(lambda: 1)
def main():
parser = argparse.ArgumentParser( description='Generates new identifiers in GFF3 files following the IGS identifie... | true | true |
f71fca6c7b717f1271683d16d11ce61370e99869 | 2,628 | py | Python | Apps/phforescoutcounteract/forescoutcounteract_consts.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 74 | 2019-10-22T02:00:53.000Z | 2022-03-15T12:56:13.000Z | Apps/phforescoutcounteract/forescoutcounteract_consts.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 375 | 2019-10-22T20:53:50.000Z | 2021-11-09T21:28:43.000Z | Apps/phforescoutcounteract/forescoutcounteract_consts.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 175 | 2019-10-23T15:30:42.000Z | 2021-11-05T21:33:31.000Z | # File: forescoutcounteract_consts.py
# Copyright (c) 2018-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
# --
# Define your constants here
FS_DEX_HOST_ENDPOINT = '/fsapi/niCore/Hosts'
FS_DEX_LIST_ENDPOINT = '/fsapi/niCore/Lists'
FS_DEX_TEST_CONNECTIVITY = \
"""... | 36.5 | 117 | 0.619102 |
FS_DEX_HOST_ENDPOINT = '/fsapi/niCore/Hosts'
FS_DEX_LIST_ENDPOINT = '/fsapi/niCore/Lists'
FS_DEX_TEST_CONNECTIVITY = \
"""<?xml version="1.0" encoding="UTF-8"?>
<FSAPI TYPE="request" API_VERSION="1.0">
<TRANSACTION TYPE="update">
<OPTIONS CREATE_NEW_HOST="true"/>
<HOST_KEY N... | true | true |
f71fcd6b02e4155fea4b2f52039a9ce2c32ad6f6 | 7,009 | py | Python | nmeta2dpae/tc_policy_dpae.py | mattjhayes/nmeta2-dpae | f441d78f0cdbd63495d4f96cddb462b801d82925 | [
"Apache-2.0"
] | 1 | 2016-03-19T20:42:49.000Z | 2016-03-19T20:42:49.000Z | nmeta2dpae/tc_policy_dpae.py | mattjhayes/nmeta2-dpae | f441d78f0cdbd63495d4f96cddb462b801d82925 | [
"Apache-2.0"
] | 2 | 2016-04-09T01:17:39.000Z | 2016-04-09T01:30:58.000Z | nmeta2dpae/tc_policy_dpae.py | mattjhayes/nmeta2-dpae | f441d78f0cdbd63495d4f96cddb462b801d82925 | [
"Apache-2.0"
] | 4 | 2016-05-04T08:42:29.000Z | 2021-07-16T02:11:40.000Z | # 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
# distributed under the... | 40.75 | 79 | 0.612356 |
import logging
import logging.handlers
import coloredlogs
import sys
import yaml
IDENTITY_KEYS = ('arp',
'lldp',
'dns',
'dhcp')
class TCPolicy(object):
def __init__(self, _config):
_logging_level_s = _config.get_value \
... | true | true |
f71fcd8293089c972b431387d1197b53dd7b564d | 516 | py | Python | src/event_representations.py | ATTPC/VAE-event-classification | aae331d44bffffec2ca8a6cdef71208899db0052 | [
"MIT"
] | null | null | null | src/event_representations.py | ATTPC/VAE-event-classification | aae331d44bffffec2ca8a6cdef71208899db0052 | [
"MIT"
] | 2 | 2018-12-20T20:10:52.000Z | 2019-02-04T17:44:01.000Z | src/event_representations.py | ATTPC/VAE-event-classification | aae331d44bffffec2ca8a6cdef71208899db0052 | [
"MIT"
] | null | null | null | import numpy as np
def make_histograms(x, bins=40, interval=[1e-1, 1]):
intervals = np.linspace(interval[0], interval[1], bins)
flat_x = x.reshape((x.shape[0], -1))
hist_x = np.zeros((x.shape[0], bins))
for i in range(1, bins):
mask = flat_x <= intervals[i]
mask = np.logical_and(mask, f... | 28.666667 | 60 | 0.604651 | import numpy as np
def make_histograms(x, bins=40, interval=[1e-1, 1]):
intervals = np.linspace(interval[0], interval[1], bins)
flat_x = x.reshape((x.shape[0], -1))
hist_x = np.zeros((x.shape[0], bins))
for i in range(1, bins):
mask = flat_x <= intervals[i]
mask = np.logical_and(mask, f... | true | true |
f71fce257398e75ef7291d3d8d8cd6d620bff9ed | 122 | py | Python | zpy/classes/bases/utility/pretty.py | yu-ichiro/zpy | 65e5ae7616d6e7fce91a03f20f663caa4af834b5 | [
"MIT"
] | null | null | null | zpy/classes/bases/utility/pretty.py | yu-ichiro/zpy | 65e5ae7616d6e7fce91a03f20f663caa4af834b5 | [
"MIT"
] | null | null | null | zpy/classes/bases/utility/pretty.py | yu-ichiro/zpy | 65e5ae7616d6e7fce91a03f20f663caa4af834b5 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Pretty(ABC):
@abstractmethod
def __pretty__(self) -> str:
...
| 15.25 | 35 | 0.639344 | from abc import ABC, abstractmethod
class Pretty(ABC):
@abstractmethod
def __pretty__(self) -> str:
...
| true | true |
f71fcef13051a8d05b65c648d775148a97470b27 | 167,246 | py | Python | tensorflow/python/ops/nn_ops.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | 5 | 2019-01-13T16:15:25.000Z | 2019-07-07T16:17:32.000Z | tensorflow/python/ops/nn_ops.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/nn_ops.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.941493 | 96 | 0.668919 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
import numpy as np
from tensorflow.python.compat import compat
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.f... | true | true |
f71fd03a67d84d601549326e242f921bbfd460d7 | 3,974 | py | Python | alipay/aop/api/request/ZhimaCreditEpProductCodeQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/ZhimaCreditEpProductCodeQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/ZhimaCreditEpProductCodeQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditEpProductCodeQueryModel import ZhimaCreditEpProductCodeQueryModel
class ZhimaCreditEpProductCodeQueryRequest(object):
... | 27.406897 | 148 | 0.64469 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditEpProductCodeQueryModel import ZhimaCreditEpProductCodeQueryModel
class ZhimaCreditEpProductCodeQueryRequest(object):
def __init__(self, biz_model=None):
... | true | true |
f71fd0d406c540386851f557a8dd36be11fad94d | 37,269 | py | Python | pandas/core/indexes/datetimes.py | cgangwar11/pandas | 972f491cb7fdcc3c1c2cb9f05644128f13457f87 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-05T07:09:39.000Z | 2020-09-05T07:09:39.000Z | pandas/core/indexes/datetimes.py | cgangwar11/pandas | 972f491cb7fdcc3c1c2cb9f05644128f13457f87 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/datetimes.py | cgangwar11/pandas | 972f491cb7fdcc3c1c2cb9f05644128f13457f87 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from datetime import date, datetime, time, timedelta, tzinfo
import operator
from typing import Optional
import warnings
import numpy as np
from pandas._libs import NaT, Period, Timestamp, index as libindex, lib
from pandas._libs.tslibs import (
Resolution,
ints_to_pydatetime,
parsing,
timezones,
... | 33.395161 | 96 | 0.584937 | from datetime import date, datetime, time, timedelta, tzinfo
import operator
from typing import Optional
import warnings
import numpy as np
from pandas._libs import NaT, Period, Timestamp, index as libindex, lib
from pandas._libs.tslibs import (
Resolution,
ints_to_pydatetime,
parsing,
timezones,
... | true | true |
f71fd14cad832cbba2759947ed66a936ca0786bb | 5,432 | py | Python | src/python/sim_doc.py | csiu/kick | 0ebc9166074b702fc8b5835685ad102957ab349c | [
"MIT"
] | null | null | null | src/python/sim_doc.py | csiu/kick | 0ebc9166074b702fc8b5835685ad102957ab349c | [
"MIT"
] | null | null | null | src/python/sim_doc.py | csiu/kick | 0ebc9166074b702fc8b5835685ad102957ab349c | [
"MIT"
] | null | null | null | import sys
sys.path.append("/Users/csiu/repo/kick/src/python")
import argparse
import custom
import pandas as pd
import numpy as np
import re
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils.extmath import randomized_s... | 30.01105 | 97 | 0.60475 | import sys
sys.path.append("/Users/csiu/repo/kick/src/python")
import argparse
import custom
import pandas as pd
import numpy as np
import re
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils.extmath import randomized_s... | true | true |
f71fd21c199e5a31cb8e95fea4d6ad447b4eb6cf | 2,082 | py | Python | adsputils/tests/test_init.py | adsabs/ADSPipelineUtils | eb8cc988f57c19a256ebc8802cc2a812d5279d12 | [
"MIT"
] | null | null | null | adsputils/tests/test_init.py | adsabs/ADSPipelineUtils | eb8cc988f57c19a256ebc8802cc2a812d5279d12 | [
"MIT"
] | 36 | 2017-06-23T20:29:22.000Z | 2020-03-18T15:04:27.000Z | adsputils/tests/test_init.py | adsabs/ADSPipelineUtils | eb8cc988f57c19a256ebc8802cc2a812d5279d12 | [
"MIT"
] | 12 | 2017-06-21T18:10:57.000Z | 2021-11-01T19:13:32.000Z | # -*- coding: utf-8 -*-
import adsputils
import unittest
import os
import json
import time
from inspect import currentframe, getframeinfo
from adsputils.exceptions import UnicodeHandlerError
def _read_file(fpath):
with open(fpath, 'r') as fi:
return fi.read()
class TestInit(unittest.TestCase):
def t... | 28.135135 | 87 | 0.604707 |
import adsputils
import unittest
import os
import json
import time
from inspect import currentframe, getframeinfo
from adsputils.exceptions import UnicodeHandlerError
def _read_file(fpath):
with open(fpath, 'r') as fi:
return fi.read()
class TestInit(unittest.TestCase):
def test_logging(self):
... | true | true |
f71fd223ff855bd602d59319796b96fc483982ca | 20,550 | py | Python | log_complete_bcl2/model_76.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_76.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_76.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.138889 | 798 | 0.804136 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f71fd3f3075081a6f7b219e41391ee28001ad25c | 2,073 | py | Python | codes/poop/fizzbuzz.py | cassiobotaro/go_slides | 1e9bedff22acc78a39cc054c0de432ef80c2df7b | [
"MIT"
] | 2 | 2019-02-27T14:45:39.000Z | 2021-09-27T03:46:20.000Z | codes/poop/fizzbuzz.py | cassiobotaro/go_slides | 1e9bedff22acc78a39cc054c0de432ef80c2df7b | [
"MIT"
] | null | null | null | codes/poop/fizzbuzz.py | cassiobotaro/go_slides | 1e9bedff22acc78a39cc054c0de432ef80c2df7b | [
"MIT"
] | 2 | 2017-04-13T14:42:31.000Z | 2021-09-27T03:46:22.000Z | # smalltalk infected fizzbuzz version
from forbiddenfruit import curse
from collections import deque
def if_true(self, block):
# simulate blocks using functions
self and block()
# close circuit when object is truthy
return self
def if_false(self, block):
# simulate blocks using functions
not... | 25.280488 | 75 | 0.670043 |
from forbiddenfruit import curse
from collections import deque
def if_true(self, block):
self and block()
return self
def if_false(self, block):
not self and block()
return self
def println(self):
print(self)
def do(self, block):
deque(map(block, self), maxlen=0)
... | true | true |
f71fd4a1f731db04f57e93f442976ca80b5b4b5d | 8,349 | py | Python | s2e_env/tui/tui.py | michaelbrownuc/s2e-env | 4bd6a45bf1ec9456ed5acf5047b6aac3fcd19683 | [
"BSD-3-Clause"
] | null | null | null | s2e_env/tui/tui.py | michaelbrownuc/s2e-env | 4bd6a45bf1ec9456ed5acf5047b6aac3fcd19683 | [
"BSD-3-Clause"
] | null | null | null | s2e_env/tui/tui.py | michaelbrownuc/s2e-env | 4bd6a45bf1ec9456ed5acf5047b6aac3fcd19683 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Cyberhaven
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, distribute, sub... | 26.674121 | 78 | 0.573602 |
import curses
import time
_s_screen = None
class Form:
def __init__(self, parent, x, y, w=None, h=None):
self._children = []
self._parent = parent
self._x = x
self._y = y
self._h = h
self._w = w
self._vcenter, self._hcenter = False, False
... | true | true |
f71fd745dc747e5cd621bba11088fb4afbc2acb3 | 1,092 | py | Python | jmatcher/users/migrations/0004_auto_20170303_2141.py | jamesaud/se1-group4 | 5280b13dff33e72ce717318a8dd78a06cd6effb3 | [
"MIT"
] | 1 | 2021-09-09T15:43:09.000Z | 2021-09-09T15:43:09.000Z | jmatcher/users/migrations/0004_auto_20170303_2141.py | jamesaud/se1-group4 | 5280b13dff33e72ce717318a8dd78a06cd6effb3 | [
"MIT"
] | null | null | null | jmatcher/users/migrations/0004_auto_20170303_2141.py | jamesaud/se1-group4 | 5280b13dff33e72ce717318a8dd78a06cd6effb3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-03 21:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_remove_student_student_name'),
]
ope... | 30.333333 | 150 | 0.57967 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_remove_student_student_name'),
]
operations = [
migrations.CreateModel(
name='Skill',
... | true | true |
f71fd8d00f312300adb54ea7c3dae8e0ed739a61 | 9,839 | py | Python | datasets/preprocess/mpi_inf_3dhp.py | virgile-hernicot/SPIN | 21871e3d333ef37866402ae21498b331aa771b2d | [
"BSD-3-Clause"
] | 555 | 2019-09-30T01:03:23.000Z | 2022-03-30T03:56:09.000Z | datasets/preprocess/mpi_inf_3dhp.py | virgile-hernicot/SPIN | 21871e3d333ef37866402ae21498b331aa771b2d | [
"BSD-3-Clause"
] | 110 | 2019-10-01T05:51:07.000Z | 2022-03-23T13:51:05.000Z | datasets/preprocess/mpi_inf_3dhp.py | virgile-hernicot/SPIN | 21871e3d333ef37866402ae21498b331aa771b2d | [
"BSD-3-Clause"
] | 158 | 2019-09-30T07:06:48.000Z | 2022-03-22T02:32:03.000Z | import os
import sys
import cv2
import glob
import h5py
import json
import numpy as np
import scipy.io as sio
import scipy.misc
from .read_openpose import read_openpose
def read_calibration(calib_file, vid_list):
Ks, Rs, Ts = [], [], []
file = open(calib_file, 'r')
content = file.readlines()
for vid_i ... | 39.514056 | 112 | 0.468035 | import os
import sys
import cv2
import glob
import h5py
import json
import numpy as np
import scipy.io as sio
import scipy.misc
from .read_openpose import read_openpose
def read_calibration(calib_file, vid_list):
Ks, Rs, Ts = [], [], []
file = open(calib_file, 'r')
content = file.readlines()
for vid_i ... | true | true |
f71fd8ed4a60f1f0cb0713800b0c028bb7bc4489 | 16,140 | py | Python | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/cert.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/cert.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 4 | 2021-03-11T04:02:00.000Z | 2022-03-27T08:31:56.000Z | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/cert.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | __author__ = 'haho0032'
import base64
import datetime
import dateutil.parser
import pytz
import six
from OpenSSL import crypto
from os.path import join
from os import remove
from Cryptodome.Util import asn1
class WrongInput(Exception):
pass
class CertificateError(Exception):
pass
class PayloadError(Except... | 43.621622 | 98 | 0.495291 | __author__ = 'haho0032'
import base64
import datetime
import dateutil.parser
import pytz
import six
from OpenSSL import crypto
from os.path import join
from os import remove
from Cryptodome.Util import asn1
class WrongInput(Exception):
pass
class CertificateError(Exception):
pass
class PayloadError(Except... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.