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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72b389f11090c3291e690acc9bf38811dce7cae | 1,162 | py | Python | src/tests/ftest/util/oclass_utils.py | cibervicho/daos | 3868c758c696d0a7973ac2b93b56d986fabfc6e0 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/util/oclass_utils.py | cibervicho/daos | 3868c758c696d0a7973ac2b93b56d986fabfc6e0 | [
"BSD-2-Clause-Patent"
] | null | null | null | src/tests/ftest/util/oclass_utils.py | cibervicho/daos | 3868c758c696d0a7973ac2b93b56d986fabfc6e0 | [
"BSD-2-Clause-Patent"
] | null | null | null | #!/usr/bin/env python3
"""
(C) Copyright 2018-2022 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import re
def extract_redundancy_factor(oclass):
"""Extract the redundancy factor from an object class.
Args:
oclass (str): the object class.
Returns:
int: the redu... | 23.714286 | 76 | 0.593804 |
import re
def extract_redundancy_factor(oclass):
match = re.search("EC_[0-9]+P([0-9])+", oclass)
if match:
return int(match.group(1))
match = re.search("RP_([0-9]+)", oclass)
if match:
return int(match.group(1)) - 1
return 0
def calculate_min_servers(oclass):
patterns = [
... | true | true |
f72b3967e92f28affb77f904b54628581c7af2bf | 7,799 | py | Python | galaxy/api/v2/tests/test_collection_views.py | bmclaughlin/galaxy | 3f57e3684c27cb88d45881eaec16dc3095ac4e6d | [
"Apache-2.0"
] | 904 | 2016-10-11T13:35:19.000Z | 2022-03-25T09:29:09.000Z | galaxy/api/v2/tests/test_collection_views.py | bmclaughlin/galaxy | 3f57e3684c27cb88d45881eaec16dc3095ac4e6d | [
"Apache-2.0"
] | 1,866 | 2016-10-15T21:28:09.000Z | 2022-03-29T18:09:20.000Z | galaxy/api/v2/tests/test_collection_views.py | bmclaughlin/galaxy | 3f57e3684c27cb88d45881eaec16dc3095ac4e6d | [
"Apache-2.0"
] | 368 | 2016-10-11T13:44:08.000Z | 2022-03-30T02:23:12.000Z | # (c) 2012-2019, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... | 36.443925 | 79 | 0.62149 |
import hashlib
from unittest import mock
import os
import tempfile
import shutil
import tarfile
from contextlib import contextmanager
from django.contrib.auth import get_user_model
from rest_framework.test import APITestCase
from rest_framework import status as http_codes
from galaxy.main import model... | true | true |
f72b39da0ed6829e91b76ba1b8864ebef44e2299 | 1,043 | py | Python | cortex/options.py | lembert1990/pycortex | f1cd6abb5e193d0b7ec120107268dbbbf3a002fc | [
"BSD-2-Clause"
] | null | null | null | cortex/options.py | lembert1990/pycortex | f1cd6abb5e193d0b7ec120107268dbbbf3a002fc | [
"BSD-2-Clause"
] | null | null | null | cortex/options.py | lembert1990/pycortex | f1cd6abb5e193d0b7ec120107268dbbbf3a002fc | [
"BSD-2-Clause"
] | 1 | 2019-03-04T02:45:59.000Z | 2019-03-04T02:45:59.000Z | import os
try:
import configparser
except ImportError:
import ConfigParser as configparser
from . import appdirs
cwd = os.path.split(os.path.abspath(__file__))[0]
userdir = appdirs.user_data_dir("pycortex", "JamesGao")
usercfg = os.path.join(userdir, "options.cfg")
# Read defaults from pycortex repo
config = ... | 33.645161 | 89 | 0.731544 | import os
try:
import configparser
except ImportError:
import ConfigParser as configparser
from . import appdirs
cwd = os.path.split(os.path.abspath(__file__))[0]
userdir = appdirs.user_data_dir("pycortex", "JamesGao")
usercfg = os.path.join(userdir, "options.cfg")
config = configparser.ConfigParser()
config... | true | true |
f72b39f30657384a75e0bf6bea346fedfc2a5b53 | 784 | py | Python | users/migrations/0002_auto_20200807_1424.py | Hogwarts250/lesson-discussion | 42aa0d5d4e4a8cb10c99ff7558e9d7a5f2f3e470 | [
"Apache-2.0"
] | null | null | null | users/migrations/0002_auto_20200807_1424.py | Hogwarts250/lesson-discussion | 42aa0d5d4e4a8cb10c99ff7558e9d7a5f2f3e470 | [
"Apache-2.0"
] | 4 | 2021-04-08T19:49:25.000Z | 2021-06-10T20:08:37.000Z | users/migrations/0002_auto_20200807_1424.py | Hogwarts250/lesson-discussion | 42aa0d5d4e4a8cb10c99ff7558e9d7a5f2f3e470 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.9 on 2020-08-07 21:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
... | 30.153846 | 144 | 0.653061 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='transaction',
name='bu... | true | true |
f72b3a24ac71bb8d2a6c614a0679f5609ec4ff65 | 1,051 | py | Python | fedex/services/tracking.py | jzempel/fedex | 9c617767799217a80669c1ecca0c3a7667f82d71 | [
"BSD-3-Clause"
] | 19 | 2015-02-02T03:00:54.000Z | 2021-09-06T02:22:22.000Z | fedex/services/tracking.py | hongzhou-liu/fedex | 9c617767799217a80669c1ecca0c3a7667f82d71 | [
"BSD-3-Clause"
] | 2 | 2015-08-14T22:05:17.000Z | 2017-03-01T18:54:40.000Z | fedex/services/tracking.py | hongzhou-liu/fedex | 9c617767799217a80669c1ecca0c3a7667f82d71 | [
"BSD-3-Clause"
] | 53 | 2015-03-31T14:46:30.000Z | 2022-01-02T15:06:38.000Z | # -*- coding: utf-8 -*-
"""
fedex.services.tracking
~~~~~~~~~~~~~~~~~~~~~~~
FedEx tracking web services.
:copyright: 2014 by Jonathan Zempel.
:license: BSD, see LICENSE for more details.
"""
from .commons import BaseService
class TrackingService(BaseService):
"""Tracking service.
:para... | 26.275 | 73 | 0.636537 |
from .commons import BaseService
class TrackingService(BaseService):
def __init__(self, configuration, wsdl_version=10):
super(TrackingService, self).__init__(configuration, "Track",
wsdl_version, "trck")
def create_selection_details(self):
return self.create("TrackSelectio... | true | true |
f72b3a9eea2bf0c678dea23dbb4a5561470fadad | 2,227 | py | Python | extract.py | DengYiping/IAT_EAT | a0763a8167285f99d356f05c50ad5c3120354a58 | [
"MIT"
] | null | null | null | extract.py | DengYiping/IAT_EAT | a0763a8167285f99d356f05c50ad5c3120354a58 | [
"MIT"
] | null | null | null | extract.py | DengYiping/IAT_EAT | a0763a8167285f99d356f05c50ad5c3120354a58 | [
"MIT"
] | null | null | null | import os
import sys
import pefile
import esm
'''
tuning this parameter to get a better curracy
'''
COMMON = set([
'rand', 'malloc', 'realloc', 'memset', 'exit', 'free', 'calloc', 'memcpy', 'memmove',
'GetVersion', 'printf', 'strchr', 'strncmp', 'fread',
'fclose', 'fprintf', 'sprintf', '_snprintf','fope... | 28.551282 | 104 | 0.597665 | import os
import sys
import pefile
import esm
'''
tuning this parameter to get a better curracy
'''
COMMON = set([
'rand', 'malloc', 'realloc', 'memset', 'exit', 'free', 'calloc', 'memcpy', 'memmove',
'GetVersion', 'printf', 'strchr', 'strncmp', 'fread',
'fclose', 'fprintf', 'sprintf', '_snprintf','fope... | false | true |
f72b3aaaffce70e47700f8e60f660a0f8a235566 | 810 | py | Python | utils/logger.py | tengfeixue-victor/One-Shot-Animal-Video-Segmentation | 15f9011c1b10f1e0c068f90ed46e72b3bc343310 | [
"MIT"
] | 2 | 2021-09-26T07:03:54.000Z | 2022-02-21T15:46:30.000Z | utils/logger.py | tengfeixue-victor/One-Shot-Animal-Video-Segmentation | 15f9011c1b10f1e0c068f90ed46e72b3bc343310 | [
"MIT"
] | null | null | null | utils/logger.py | tengfeixue-victor/One-Shot-Animal-Video-Segmentation | 15f9011c1b10f1e0c068f90ed46e72b3bc343310 | [
"MIT"
] | 1 | 2021-04-16T06:11:41.000Z | 2021-04-16T06:11:41.000Z | import logging
import time
import os
import sys
def create_logger(final_output_path, description=None):
if description is None:
log_file = '{}.log'.format(time.strftime('%Y-%m-%d-%H-%M'))
else:
log_file = '{}_{}.log'.format(time.strftime('%Y-%m-%d-%H-%M'), description)
head = '%(asctime)-1... | 33.75 | 89 | 0.653086 | import logging
import time
import os
import sys
def create_logger(final_output_path, description=None):
if description is None:
log_file = '{}.log'.format(time.strftime('%Y-%m-%d-%H-%M'))
else:
log_file = '{}_{}.log'.format(time.strftime('%Y-%m-%d-%H-%M'), description)
head = '%(asctime)-1... | true | true |
f72b3aba051c3d6ff702a6ceb870932003b147bc | 975 | py | Python | examples/uncrc32.py | z3v2cicidi/impacket | d8da712c3dea013c61fe019a7efc7e1289ebb891 | [
"Apache-1.1"
] | 7 | 2018-06-06T05:19:36.000Z | 2022-03-16T02:04:47.000Z | impacket/examples/uncrc32.py | Aliced3645/DataCenterMarketing | 67bc485e73cf538498a89b28465afb822717affb | [
"Apache-2.0"
] | null | null | null | impacket/examples/uncrc32.py | Aliced3645/DataCenterMarketing | 67bc485e73cf538498a89b28465afb822717affb | [
"Apache-2.0"
] | 4 | 2015-02-25T20:08:18.000Z | 2021-07-06T12:31:29.000Z | # based on:
#
# Reversing CRC - Theory and Practice.
# HU Berlin Public Report
# SAR-PR-2006-05
# May 2006
# Authors:
# Martin Stigge, Henryk Plotz, Wolf Muller, Jens-Peter Redlich
FINALXOR = 0xffffffffL
INITXOR = 0xf... | 22.159091 | 75 | 0.544615 |
FINALXOR = 0xffffffffL
INITXOR = 0xffffffffL
CRCPOLY = 0xEDB88320L
CRCINV = 0x5B358FD3L
from binascii import crc32
from struct import pack
def tableAt(byte):
return crc32(chr(byte ^ 0xff)) & 0xffffffff ^ FINALXOR ^ (INITXOR >> 8)
def compensate(buf, wanted):
wanted ^= FINALXOR
newBits = 0
... | false | true |
f72b3aca2cee2eefced9efcef5337ee9bdadcbda | 719 | py | Python | arrays/height_checker.py | ChristianChiarulli/leetcode | 6920cea51b61feae9038b185c0b1172a93f6316a | [
"MIT"
] | 4 | 2020-12-09T03:53:21.000Z | 2021-03-30T12:28:21.000Z | .old/arrays/height_checker.py | ChristianChiarulli/data_structures_and_algorithms | 05c5c7c9db0cc0a15e83ba20d5bf4f6534b08fc1 | [
"MIT"
] | null | null | null | .old/arrays/height_checker.py | ChristianChiarulli/data_structures_and_algorithms | 05c5c7c9db0cc0a15e83ba20d5bf4f6534b08fc1 | [
"MIT"
] | 2 | 2020-06-12T17:00:07.000Z | 2020-07-13T20:13:56.000Z | # Students are asked to stand in non-decreasing
# order of heights for an annual photo.
# Return the minimum number of students that must
# move in order for all students to be standing in
# non-decreasing order of height.
# Notice that when a group of students is selected
# they can reorder in any possible way betwe... | 25.678571 | 57 | 0.707928 |
def heightchecker(heights):
swap_count = 0
sorted_heights = sorted(heights)
if heights == sorted_heights:
return swap_count
for i in range(len(heights)):
if heights[i] != sorted_heights[i]:
swap_count += 1
return swap_count
heights = [1, 1, 4, 2, 1, 3]
hei... | true | true |
f72b3ae733f2a861d7932c76a99b7695e4c0bcce | 842 | py | Python | lstmcpipe/scripts/script_merge_utils_move_dir.py | cta-observatory/lst-i-rf | 7a634e0b3b07dda2b20df47875d97616eab65821 | [
"MIT"
] | 2 | 2021-02-01T17:30:46.000Z | 2021-02-22T13:59:49.000Z | lstmcpipe/scripts/script_merge_utils_move_dir.py | cta-observatory/lst-i-rf | 7a634e0b3b07dda2b20df47875d97616eab65821 | [
"MIT"
] | 106 | 2021-04-16T21:15:20.000Z | 2022-03-31T23:02:50.000Z | lstmcpipe/scripts/script_merge_utils_move_dir.py | cta-observatory/lstmcpipe | 7a634e0b3b07dda2b20df47875d97616eab65821 | [
"MIT"
] | 3 | 2022-03-02T09:23:09.000Z | 2022-03-03T16:00:25.000Z | #!/usr/bin/env python
import argparse
from lstmcpipe.io.data_management import (
move_dir_content,
check_and_make_dir_without_verification,
)
parser = argparse.ArgumentParser(
description="Script to move a directory and its content after creating the destination"
" directory."
)
parser.add_argument(
... | 20.536585 | 91 | 0.704276 |
import argparse
from lstmcpipe.io.data_management import (
move_dir_content,
check_and_make_dir_without_verification,
)
parser = argparse.ArgumentParser(
description="Script to move a directory and its content after creating the destination"
" directory."
)
parser.add_argument(
"--source",
"... | true | true |
f72b3cc7e9db8fe13e7966a92394dc17106664c7 | 82,459 | py | Python | fpn/symbols/resnet_v1_101_fpn_rcnn.py | YAMLONG/Deformable-ConvNets | ea937451e103ba1fbf4fdcbd08ef3ca1ca832ef4 | [
"Apache-2.0"
] | 2 | 2018-10-24T01:47:49.000Z | 2020-05-30T15:23:02.000Z | fpn/symbols/resnet_v1_101_fpn_rcnn.py | YAMLONG/Deformable-ConvNets | ea937451e103ba1fbf4fdcbd08ef3ca1ca832ef4 | [
"Apache-2.0"
] | null | null | null | fpn/symbols/resnet_v1_101_fpn_rcnn.py | YAMLONG/Deformable-ConvNets | ea937451e103ba1fbf4fdcbd08ef3ca1ca832ef4 | [
"Apache-2.0"
] | 1 | 2018-03-29T11:47:01.000Z | 2018-03-29T11:47:01.000Z | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Written by Haozhi Qi
# --------------------------------------------------------
import cPickle
import mxnet as mx
from utils.... | 85.009278 | 180 | 0.613323 |
import cPickle
import mxnet as mx
from utils.symbol import Symbol
from operator_py.pyramid_proposal import *
from operator_py.proposal_target import *
from operator_py.fpn_roi_pooling import *
from operator_py.box_annotator_ohem import *
class resnet_v1_101_fpn_rcnn(Symbol):
def __init__(self):
sel... | true | true |
f72b3fd1a230b5adaf1f4d92129a73ad00db5a0e | 618 | py | Python | spider/main.py | ly-520/cbec-toolbox | e60dac81bec0403cf2e7cfd3ae216a8fc9cad343 | [
"Apache-2.0"
] | null | null | null | spider/main.py | ly-520/cbec-toolbox | e60dac81bec0403cf2e7cfd3ae216a8fc9cad343 | [
"Apache-2.0"
] | null | null | null | spider/main.py | ly-520/cbec-toolbox | e60dac81bec0403cf2e7cfd3ae216a8fc9cad343 | [
"Apache-2.0"
] | 1 | 2021-04-26T08:20:43.000Z | 2021-04-26T08:20:43.000Z | import logging
import flask
from controller.goods_controller import *
from controller.order_controller import *
from common.exception_advice import *
app = flask.Flask(__name__)
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message... | 25.75 | 102 | 0.708738 | import logging
import flask
from controller.goods_controller import *
from controller.order_controller import *
from common.exception_advice import *
app = flask.Flask(__name__)
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message... | true | true |
f72b4000190522de1de32f143323c9268b7fabb6 | 658 | py | Python | test/test_add_contact.py | olesya-sharafislamova/python_training | 10369f4988261005451f47d5f4242521a0de6b69 | [
"Apache-2.0"
] | 1 | 2019-06-03T15:24:53.000Z | 2019-06-03T15:24:53.000Z | test/test_add_contact.py | olesya-sharafislamova/python_training | 10369f4988261005451f47d5f4242521a0de6b69 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact.py | olesya-sharafislamova/python_training | 10369f4988261005451f47d5f4242521a0de6b69 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
import pytest
def test_add_contact(app, db, json_contacts):
contact = json_contacts
with pytest.allure.step('Given a Contact list'):
old_contacts = db.get_contact_list()
with pytest.allure.step('When I add a contact %s to the list' % conta... | 27.416667 | 105 | 0.702128 |
from model.contact import Contact
import pytest
def test_add_contact(app, db, json_contacts):
contact = json_contacts
with pytest.allure.step('Given a Contact list'):
old_contacts = db.get_contact_list()
with pytest.allure.step('When I add a contact %s to the list' % contact):
app.contac... | true | true |
f72b41cfb72a15d0999c4d3c54c0b25cae7907ac | 1,379 | py | Python | cnf/tests/conftest.py | nyck33/my_cnf | 9ca2b169efec4e84fa63c3b8d68a78e4c3a27ea7 | [
"Apache-2.0"
] | null | null | null | cnf/tests/conftest.py | nyck33/my_cnf | 9ca2b169efec4e84fa63c3b8d68a78e4c3a27ea7 | [
"Apache-2.0"
] | null | null | null | cnf/tests/conftest.py | nyck33/my_cnf | 9ca2b169efec4e84fa63c3b8d68a78e4c3a27ea7 | [
"Apache-2.0"
] | null | null | null | """
conftest.py pytest_fixtures can be accessed by multiple test files
test function has fixture func name as param, then fixture func called and result
passed to test func
added localhost.localdomain to /etc/hosts
"""
import pytest
from cnf.main import setup_app
import pymongo
config_name = 'testing'
the_app = setup... | 24.192982 | 81 | 0.648296 | import pytest
from cnf.main import setup_app
import pymongo
config_name = 'testing'
the_app = setup_app(config_name, dict(
TESTING=True,
LOGIN_DISABLED=False,
MAIL_SUPPRESS_SEND=True,
SERVER_NAME='localhost.localdomain',
... | true | true |
f72b41deca8203786bd3da834a3d9db8b40ffee7 | 14,866 | py | Python | tensorflow_data_validation/statistics/stats_options.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tensorflow_data_validation/statistics/stats_options.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tensorflow_data_validation/statistics/stats_options.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 43.852507 | 80 | 0.735907 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import json
import types as python_types
from typing import Dict, List, Optional, Text
from tensorflow_data_validation import types
from tensorflow_data_validation.statistics.generat... | true | true |
f72b42d5c27b87418372e74671846c4f0f9ab98a | 3,825 | py | Python | tests/extension/thread_/stream_reduce_arg_max/thread_stream_reduce_arg_max.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/stream_reduce_arg_max/thread_stream_reduce_arg_max.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/stream_reduce_arg_max/thread_stream_reduce_arg_max.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import ve... | 27.12766 | 87 | 0.602092 | from __future__ import absolute_import
from __future__ import print_function
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))))
from veriloggen import *
import veriloggen.thread as vthread
import veriloggen.type... | true | true |
f72b4311c1c935e36ff12b3275ecdd0411d9a83c | 2,457 | py | Python | solfasol/shop/migrations/0004_auto_20201004_2111.py | rekognize/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | null | null | null | solfasol/shop/migrations/0004_auto_20201004_2111.py | rekognize/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | 1 | 2020-06-18T13:08:47.000Z | 2020-06-18T13:08:47.000Z | solfasol/shop/migrations/0004_auto_20201004_2111.py | Solfasol/solfasol | c960c3364c753d75161242eccac4f085d800c843 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-04 18:11
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('issues', '0009_auto_20200918_0020'),
('shop', '0003_auto_20201004_2109'),
]
operations = [
migratio... | 40.95 | 142 | 0.580383 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('issues', '0009_auto_20200918_0020'),
('shop', '0003_auto_20201004_2109'),
]
operations = [
migrations.CreateModel(
name='Cart',
... | true | true |
f72b433198e89063d5e6f1584dc14c04ef6a68fb | 2,261 | py | Python | tests/test_mixture_transitions.py | probcomp/cgpm2 | 280ab5bf3dd0d7c61196deaff7cb590692fc412a | [
"Apache-2.0"
] | 3 | 2019-01-20T08:55:06.000Z | 2019-12-02T05:59:26.000Z | tests/test_mixture_transitions.py | probcomp/cgpm2 | 280ab5bf3dd0d7c61196deaff7cb590692fc412a | [
"Apache-2.0"
] | null | null | null | tests/test_mixture_transitions.py | probcomp/cgpm2 | 280ab5bf3dd0d7c61196deaff7cb590692fc412a | [
"Apache-2.0"
] | 3 | 2019-08-06T07:27:34.000Z | 2019-09-28T23:26:57.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018 MIT Probabilistic Computing Project.
# Released under Apache 2.0; refer to LICENSE.txt.
from collections import Counter
import numpy as np
from cgpm.utils.general import get_prng
from cgpm2.crp import CRP
from cgpm2.normal import Normal
from cgpm2.flexible_rowmix impor... | 37.065574 | 80 | 0.689518 |
from collections import Counter
import numpy as np
from cgpm.utils.general import get_prng
from cgpm2.crp import CRP
from cgpm2.normal import Normal
from cgpm2.flexible_rowmix import FlexibleRowMixture
from cgpm2.transition_hypers import transition_hyper_grids
from cgpm2.transition_hypers import transition_hy... | true | true |
f72b43a85de65bf336aa1e3f70ddb2708ba53801 | 15,647 | py | Python | webStorm-APICloud/python_tools/Lib/test/test_exceptions.py | zzr925028429/androidyianyan | 8967fdba92473e8e65ee222515dfc54cdae5bb0b | [
"MIT"
] | null | null | null | webStorm-APICloud/python_tools/Lib/test/test_exceptions.py | zzr925028429/androidyianyan | 8967fdba92473e8e65ee222515dfc54cdae5bb0b | [
"MIT"
] | null | null | null | webStorm-APICloud/python_tools/Lib/test/test_exceptions.py | zzr925028429/androidyianyan | 8967fdba92473e8e65ee222515dfc54cdae5bb0b | [
"MIT"
] | null | null | null | # Python test set -- part 5, built-in exceptions
import os
import sys
import unittest
import pickle, cPickle
import warnings
from test.test_support import TESTFN, unlink, run_unittest, captured_output
from test.test_pep352 import ignore_message_warning
# XXX This is not really enough, each *operation* sho... | 39.31407 | 88 | 0.495686 |
import os
import sys
import unittest
import pickle, cPickle
import warnings
from test.test_support import TESTFN, unlink, run_unittest, captured_output
from test.test_pep352 import ignore_message_warning
class ExceptionTests(unittest.TestCase):
def testReload(self):
tr... | false | true |
f72b440bbd74e2d435413383ae7761a669cd513a | 68,958 | py | Python | arelle/plugin/xbrlDB/XbrlSemanticSqlDB.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 1 | 2021-07-01T17:52:12.000Z | 2021-07-01T17:52:12.000Z | arelle/plugin/xbrlDB/XbrlSemanticSqlDB.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 3 | 2021-01-07T23:36:40.000Z | 2021-12-13T20:43:27.000Z | arelle/plugin/xbrlDB/XbrlSemanticSqlDB.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 2 | 2020-02-24T16:06:12.000Z | 2021-02-24T00:21:32.000Z | '''
XbrlSemanticSqlDB.py implements an SQL database interface for Arelle, based
on a concrete realization of the Abstract Model PWD 2.0 layer. This is a semantic
representation of XBRL information.
This module may save directly to a Postgres, MySQL, SQLite, MSSQL, or Oracle server.
This module provides the executi... | 58.5382 | 144 | 0.517068 |
import os, time, datetime, logging
from arelle.ModelDocument import Type
from arelle.ModelDtsObject import ModelConcept, ModelType, ModelResource, ModelRelationship
from arelle.ModelInstanceObject import ModelFact
from arelle.ModelXbrl import ModelXbrl
from arelle.ModelDocument import ModelDocument
from arelle.ModelOb... | true | true |
f72b45704b6b738dc155c0160abe96949099d9a7 | 13,758 | py | Python | spacegraphcats/catlas/catlas.py | mogproject/spacegraphcats | e21015daa8e2968c3076bd250c553aa20e6d912b | [
"BSD-3-Clause"
] | null | null | null | spacegraphcats/catlas/catlas.py | mogproject/spacegraphcats | e21015daa8e2968c3076bd250c553aa20e6d912b | [
"BSD-3-Clause"
] | null | null | null | spacegraphcats/catlas/catlas.py | mogproject/spacegraphcats | e21015daa8e2968c3076bd250c553aa20e6d912b | [
"BSD-3-Clause"
] | null | null | null | """Data structure for CAtlas."""
import argparse
import cProfile
import os
import sys
import tempfile
import gzip
import copy
from .rdomset import rdomset, domination_graph
from .graph_io import read_from_gxt, write_to_gxt
from .graph import Graph
from spacegraphcats.utils.logging import log_command
from io import Tex... | 36.590426 | 79 | 0.559674 |
import argparse
import cProfile
import os
import sys
import tempfile
import gzip
import copy
from .rdomset import rdomset, domination_graph
from .graph_io import read_from_gxt, write_to_gxt
from .graph import Graph
from spacegraphcats.utils.logging import log_command
from io import TextIOWrapper
from collections impor... | true | true |
f72b457385a4ebe5715f4121fb45c8d4b9cc7073 | 4,175 | py | Python | frontera/core/components.py | vy-labs/frontera | ba2c07470111270de090215dc4ebc051bbd8b7e0 | [
"BSD-3-Clause"
] | 1 | 2018-01-17T02:17:55.000Z | 2018-01-17T02:17:55.000Z | frontera/core/components.py | vy-labs/frontera | ba2c07470111270de090215dc4ebc051bbd8b7e0 | [
"BSD-3-Clause"
] | 16 | 2017-02-03T06:31:39.000Z | 2020-03-03T15:15:09.000Z | frontera/core/components.py | vy-labs/frontera | ba2c07470111270de090215dc4ebc051bbd8b7e0 | [
"BSD-3-Clause"
] | null | null | null | from abc import ABCMeta, abstractmethod
class Component(object):
"""
Interface definition for a frontier component
The :class:`Component <frontera.core.components.Component>` object is the base class for frontier
:class:`Middleware <frontera.core.components.Middleware>` and
:class:`Backend <fronte... | 31.390977 | 114 | 0.662275 | from abc import ABCMeta, abstractmethod
class Component(object):
__metaclass__ = ABCMeta
component_name = 'Base Component'
@abstractmethod
def frontier_start(self):
pass
@abstractmethod
def frontier_stop(self):
pass
@abstractmethod
def add_seeds(self, seeds):
... | true | true |
f72b4575023d53c977d16e195686c5c67ffc5f9f | 3,076 | py | Python | src/hypergraph.py | HKUST-KnowComp/HPHG | 48b704b28c217e4590edf4dd3c7825495dffb76e | [
"MIT"
] | 5 | 2019-08-31T11:00:40.000Z | 2021-04-15T10:05:35.000Z | src/hypergraph.py | HKUST-KnowComp/HPHG | 48b704b28c217e4590edf4dd3c7825495dffb76e | [
"MIT"
] | null | null | null | src/hypergraph.py | HKUST-KnowComp/HPHG | 48b704b28c217e4590edf4dd3c7825495dffb76e | [
"MIT"
] | 1 | 2020-05-27T08:00:53.000Z | 2020-05-27T08:00:53.000Z | import numpy as np
from tqdm import tqdm
class Hypergraph(object):
def __init__(self,graph_type='0',nums_type=None):
self._nodes = {} # node set
self._edges = {} # edge set (hash index)
self.graph_type = graph_type # graph type, homogeneous:0, heterogeneous:1
self.nums_type = nu... | 28.747664 | 106 | 0.545189 | import numpy as np
from tqdm import tqdm
class Hypergraph(object):
def __init__(self,graph_type='0',nums_type=None):
self._nodes = {}
self._edges = {}
self.graph_type = graph_type
self.nums_type = nums_type
self.cumsum = np.cumsum(self.nums_type) if self.graph_type=... | true | true |
f72b45b62702b41808f02cf163bf8b5b63de5b30 | 5,644 | py | Python | Tests/Cube.py | joel-intito/tm1py | 42e59dcdeb70357577c19e974995936b5dbb1131 | [
"MIT"
] | null | null | null | Tests/Cube.py | joel-intito/tm1py | 42e59dcdeb70357577c19e974995936b5dbb1131 | [
"MIT"
] | null | null | null | Tests/Cube.py | joel-intito/tm1py | 42e59dcdeb70357577c19e974995936b5dbb1131 | [
"MIT"
] | null | null | null | import configparser
from pathlib import Path
import unittest
import uuid
from TM1py import Element, Hierarchy, Dimension
from TM1py.Objects import Cube
from TM1py.Objects import Rules
from TM1py.Services import TM1Service
config = configparser.ConfigParser()
config.read(Path(__file__).parent.joinpath('config.ini'))
... | 38.394558 | 108 | 0.677711 | import configparser
from pathlib import Path
import unittest
import uuid
from TM1py import Element, Hierarchy, Dimension
from TM1py.Objects import Cube
from TM1py.Objects import Rules
from TM1py.Services import TM1Service
config = configparser.ConfigParser()
config.read(Path(__file__).parent.joinpath('config.ini'))
... | true | true |
f72b4610811bde97505c92b313e84557e3fe0425 | 809 | py | Python | time_this_using_with.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | time_this_using_with.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | time_this_using_with.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from timeit import default_timer
class TimeThis:
def __init__(self, title="TimeThis"):
self.title = title
self.start_time = None
def __enter__(self):
self.start_time = default_timer()
return self
de... | 19.731707 | 94 | 0.566131 |
__author__ = 'ipetrash'
from timeit import default_timer
class TimeThis:
def __init__(self, title="TimeThis"):
self.title = title
self.start_time = None
def __enter__(self):
self.start_time = default_timer()
return self
def __exit__(self, exc_type, exc_value, exc_tra... | true | true |
f72b46c25c47804afbeb964bc15146379d6938f8 | 49,448 | py | Python | lib/sqlalchemy/ext/associationproxy.py | mattkohl/sqlalchemy | edf8e782cf5011cd43a0ee281b9e0b1d1becef1f | [
"MIT"
] | 2 | 2020-02-19T17:50:50.000Z | 2021-02-10T02:52:41.000Z | lib/sqlalchemy/ext/associationproxy.py | KonstantinKlepikov/sqlalchemy-1 | 2c34d2503a17316cae3282192405b9b9d60df6fe | [
"MIT"
] | null | null | null | lib/sqlalchemy/ext/associationproxy.py | KonstantinKlepikov/sqlalchemy-1 | 2c34d2503a17316cae3282192405b9b9d60df6fe | [
"MIT"
] | 1 | 2019-08-27T06:57:57.000Z | 2019-08-27T06:57:57.000Z | # ext/associationproxy.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... | 31.217172 | 86 | 0.596809 |
import operator
from .. import exc
from .. import inspect
from .. import orm
from .. import util
from ..orm import collections
from ..orm import interfaces
from ..sql import or_
from ..sql.operators import ColumnOperators
def association_proxy(target_collection, attr, **kw):
return AssociationProxy(target... | true | true |
f72b47b083e75e7fc1652ef55122a7c099974a7c | 2,333 | py | Python | integreat_cms/cms/views/settings/mfa/authenticate_modify_mfa_view.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | 1 | 2022-01-16T01:15:21.000Z | 2022-01-16T01:15:21.000Z | integreat_cms/cms/views/settings/mfa/authenticate_modify_mfa_view.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | null | null | null | integreat_cms/cms/views/settings/mfa/authenticate_modify_mfa_view.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | null | null | null | """
This module contains all views related to multi-factor authentication
"""
import logging
import time
from django.contrib.auth.decorators import login_required
from django.contrib.auth.hashers import check_password
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.utils.decorato... | 44.865385 | 143 | 0.743678 | import logging
import time
from django.contrib.auth.decorators import login_required
from django.contrib.auth.hashers import check_password
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
... | true | true |
f72b482966239f05aa2cebf8fa85221da508dbeb | 44 | py | Python | CodeUp/6030.py | chae-heechan/Algorithm_Study | 183a77e2cfe352cd82fb5e988b493082529a73dd | [
"MIT"
] | null | null | null | CodeUp/6030.py | chae-heechan/Algorithm_Study | 183a77e2cfe352cd82fb5e988b493082529a73dd | [
"MIT"
] | null | null | null | CodeUp/6030.py | chae-heechan/Algorithm_Study | 183a77e2cfe352cd82fb5e988b493082529a73dd | [
"MIT"
] | null | null | null | # 영문자 1개 입력받아 10진수로 변환하기
print(ord(input())) | 22 | 24 | 0.704545 |
print(ord(input())) | true | true |
f72b491d57302f379d5a1bd917da7dd51854de51 | 11,032 | py | Python | allennlp/tests/common/params_test.py | craigbig/allennlp | 3f15a8bdcae366f3ef732eec1e9df26d91521582 | [
"Apache-2.0"
] | 1 | 2020-02-24T10:21:37.000Z | 2020-02-24T10:21:37.000Z | allennlp/tests/common/params_test.py | craigbig/allennlp | 3f15a8bdcae366f3ef732eec1e9df26d91521582 | [
"Apache-2.0"
] | null | null | null | allennlp/tests/common/params_test.py | craigbig/allennlp | 3f15a8bdcae366f3ef732eec1e9df26d91521582 | [
"Apache-2.0"
] | null | null | null | import json
import os
import re
from collections import OrderedDict
import pytest
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import infer_and_cast, Params, parse_overrides, unflatten, with_fallback
from allennlp.common.testing import AllenNlpTestCase
class TestParams(AllenNlpT... | 35.818182 | 100 | 0.562817 | import json
import os
import re
from collections import OrderedDict
import pytest
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import infer_and_cast, Params, parse_overrides, unflatten, with_fallback
from allennlp.common.testing import AllenNlpTestCase
class TestParams(AllenNlpT... | true | true |
f72b4933b2a73e756ab6c71f5af4eb81142adabf | 978 | py | Python | ecl/tests/functional/baremetal/test_stock.py | nttcom/eclsdk | 866bea3290806332f677344982f39cb8e5155480 | [
"Apache-2.0"
] | 5 | 2017-04-07T06:23:04.000Z | 2019-11-19T00:52:34.000Z | ecl/tests/functional/baremetal/test_stock.py | nttcom/eclsdk | 866bea3290806332f677344982f39cb8e5155480 | [
"Apache-2.0"
] | 16 | 2018-09-12T11:14:40.000Z | 2021-04-19T09:02:44.000Z | ecl/tests/functional/baremetal/test_stock.py | nttcom/eclsdk | 866bea3290806332f677344982f39cb8e5155480 | [
"Apache-2.0"
] | 14 | 2017-05-11T14:26:26.000Z | 2021-07-14T14:00:06.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 t... | 37.615385 | 75 | 0.742331 |
import six
from ecl.tests.functional import base
class TestStock(base.BaseFunctionalTest):
def test_01_get_stock(self):
stock = self.conn.baremetal.get_stock(
"44d4ce9e-cf3d-4853-bdc9-95680bf95668", "groupa"
)
self.assertIsInstance(stock.flavor_id, six.string_types... | true | true |
f72b4949f2249b81afca92d0ad7c2bcf75710a96 | 9,579 | py | Python | fudge/productData/distributions/distribution.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 14 | 2019-08-29T23:46:24.000Z | 2022-03-21T10:16:25.000Z | fudge/productData/distributions/distribution.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 1 | 2020-08-04T16:14:45.000Z | 2021-12-01T01:54:34.000Z | fudge/productData/distributions/distribution.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 2 | 2022-03-03T22:41:41.000Z | 2022-03-03T22:54:43.000Z | # <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
"""Distribution class."""
from PoPs import IDs as IDsPoPsModule
from fudge import abstractClasses as abstractClassesModule
... | 48.135678 | 169 | 0.614156 |
from PoPs import IDs as IDsPoPsModule
from fudge import abstractClasses as abstractClassesModule
from xData import standards as standardsModule
from . import angular as angularModule
from . import energy as energyModule
from . import energyAngular as energyAngularModule
from . import energyAngularMC as energy... | true | true |
f72b4999422344e122188abc17640c29c420b644 | 5,593 | py | Python | tfx/components/example_gen/base_example_gen_executor_test.py | pingsutw/tfx | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | [
"Apache-2.0"
] | 1 | 2020-11-24T16:59:37.000Z | 2020-11-24T16:59:37.000Z | tfx/components/example_gen/base_example_gen_executor_test.py | pingsutw/tfx | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | [
"Apache-2.0"
] | null | null | null | tfx/components/example_gen/base_example_gen_executor_test.py | pingsutw/tfx | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... | 36.555556 | 79 | 0.66619 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import apache_beam as beam
import tensorflow as tf
from google.protobuf import json_format
from tfx.components.example_gen import base_example_gen_executor
from tfx.proto ... | true | true |
f72b4a5949a2383abf083c3da9e19c3770c8c953 | 6,683 | py | Python | service/moleprop.py | uta-smile/CD-MVGNN | b48f4cd14befed298980a83edb417ab6809f0af6 | [
"MIT"
] | 3 | 2022-02-06T09:13:51.000Z | 2022-02-19T15:03:35.000Z | service/moleprop.py | uta-smile/CD-MVGNN | b48f4cd14befed298980a83edb417ab6809f0af6 | [
"MIT"
] | 1 | 2022-02-14T23:16:27.000Z | 2022-02-14T23:16:27.000Z | service/moleprop.py | uta-smile/CD-MVGNN | b48f4cd14befed298980a83edb417ab6809f0af6 | [
"MIT"
] | null | null | null | import os
import time
import math
import numpy as np
import torch
# torch.multiprocessing.set_start_method('spawn')
torch.multiprocessing.set_start_method('forkserver', force=True)
import torch.nn as nn
from torch.utils.data import DataLoader
from tqdm import tqdm
from argparse import Namespace
from typing import List... | 38.854651 | 115 | 0.60422 | import os
import time
import math
import numpy as np
import torch
torch.multiprocessing.set_start_method('forkserver', force=True)
import torch.nn as nn
from torch.utils.data import DataLoader
from tqdm import tqdm
from argparse import Namespace
from typing import List
from dglt.data.dataset.molecular import Molecule... | true | true |
f72b4b922b786b9836eb43cd19f849b1ef9f3014 | 2,011 | py | Python | cv-competition-1/pytorch_baseline/compute_overlaps_np.py | ipovalyaev/events | 64ec6324368dd21f9cedd464304eed01e1737024 | [
"MIT"
] | 5 | 2021-06-15T05:34:01.000Z | 2021-08-17T12:12:34.000Z | cv-competition-1/pytorch_baseline/compute_overlaps_np.py | ipovalyaev/events | 64ec6324368dd21f9cedd464304eed01e1737024 | [
"MIT"
] | 1 | 2021-06-15T13:24:48.000Z | 2021-06-15T13:24:48.000Z | cv-competition-1/pytorch_baseline/compute_overlaps_np.py | ipovalyaev/events | 64ec6324368dd21f9cedd464304eed01e1737024 | [
"MIT"
] | 7 | 2021-06-15T05:36:47.000Z | 2021-09-30T08:00:08.000Z | import time
import numpy as np
from compute_overlap import compute_overlap
def compute_overlap_np(a: np.array, b: np.array) -> np.array:
"""
Args
a: (N, 4) ndarray of float [xmin, ymin, xmax, ymax]
b: (K, 4) ndarray of float [xmin, ymin, xmax, ymax]
Returns
overlaps: (N, K) ndarra... | 29.144928 | 71 | 0.513178 | import time
import numpy as np
from compute_overlap import compute_overlap
def compute_overlap_np(a: np.array, b: np.array) -> np.array:
N, K = len(a), len(b)
overlaps = np.zeros(shape=(N, K))
for n in range(N):
a_area = (a[n, 2] - a[n, 0]) * (a[n, 3] - a[n, 1])
for k in range(K):
... | true | true |
f72b4bbd4fb629bc220cd90dcdf55c738b02e203 | 4,032 | py | Python | policy_value_net_numpy.py | wesleytao/Checkers-Reinforcement-Learning | 80d45f1c29fb7cd4503cdadedf344267553cad31 | [
"MIT"
] | 2 | 2019-01-21T02:54:19.000Z | 2019-01-21T02:54:58.000Z | policy_value_net_numpy.py | wesleytao/Checkers-Reinforcement-Learning | 80d45f1c29fb7cd4503cdadedf344267553cad31 | [
"MIT"
] | null | null | null | policy_value_net_numpy.py | wesleytao/Checkers-Reinforcement-Learning | 80d45f1c29fb7cd4503cdadedf344267553cad31 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Implement the policy value network using numpy, so that we can play with the
trained AI model without installing any DL framwork
@author: Junxiao Song
"""
from __future__ import print_function
import numpy as np
# some utility functions
def softmax(x):
probs = np.exp(x - np.max(x))
... | 34.758621 | 79 | 0.615575 |
from __future__ import print_function
import numpy as np
def softmax(x):
probs = np.exp(x - np.max(x))
probs /= np.sum(probs)
return probs
def relu(X):
out = np.maximum(X, 0)
return out
def conv_forward(X, W, b, stride=1, padding=1):
n_filters, d_filter, h_filter, w_filter = W.shape
... | true | true |
f72b4bf2acff866c3c0619b8bab73f2ba21e89f0 | 581 | py | Python | project euler solutions/Problem_027.py | helq/old_code | a432faf1b340cb379190a2f2b11b997b02d1cd8d | [
"CC0-1.0"
] | null | null | null | project euler solutions/Problem_027.py | helq/old_code | a432faf1b340cb379190a2f2b11b997b02d1cd8d | [
"CC0-1.0"
] | 4 | 2020-03-10T19:20:21.000Z | 2021-06-07T15:39:48.000Z | project euler solutions/Problem_027.py | helq/old_code | a432faf1b340cb379190a2f2b11b997b02d1cd8d | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from math import sqrt
def is_prime(a):
a = abs(int(a))
for i in range( 2, int(sqrt(a)) + 1 ):
if a % i == 0:
return False
return True
def num_primes(a,b):
i = 0
while True:
if not is_prime( i*(i + a) + b ):
bre... | 19.366667 | 42 | 0.500861 |
from math import sqrt
def is_prime(a):
a = abs(int(a))
for i in range( 2, int(sqrt(a)) + 1 ):
if a % i == 0:
return False
return True
def num_primes(a,b):
i = 0
while True:
if not is_prime( i*(i + a) + b ):
break
else:
i += 1
retur... | false | true |
f72b4d5a2a367abecd980532b8d4750d10b4ca89 | 1,961 | py | Python | sdk/python/tests/utils/online_store_utils.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | 810 | 2018-12-25T15:16:11.000Z | 2020-05-14T09:49:40.000Z | sdk/python/tests/utils/online_store_utils.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | 701 | 2018-12-21T05:18:43.000Z | 2020-05-16T01:30:21.000Z | sdk/python/tests/utils/online_store_utils.py | ibnummuhammad/feast | 1fd9c2def1fbaca68e865a7c67336793ddb25582 | [
"Apache-2.0"
] | 155 | 2018-12-22T11:05:04.000Z | 2020-05-14T07:33:41.000Z | from datetime import datetime
import boto3
from feast import utils
from feast.infra.online_stores.helpers import compute_entity_id
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
def _create_n_customer_test_samples(n=1... | 34.403509 | 86 | 0.63182 | from datetime import datetime
import boto3
from feast import utils
from feast.infra.online_stores.helpers import compute_entity_id
from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto
from feast.protos.feast.types.Value_pb2 import Value as ValueProto
def _create_n_customer_test_samples(n=1... | true | true |
f72b4fcb126c9560cd993ddf3c97358bf4458c21 | 2,011 | py | Python | internal/notes/builtin-SAVE/packages/bbcp/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/bbcp/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/bbcp/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 41.040816 | 78 | 0.651914 | true | true | |
f72b4ff25106f6a06c072e4b810373c1bc5e5e95 | 1,964 | py | Python | sdap/studies/admin.py | umr1085-irset/reproGenomicsViewer | 187ea320668e567d01572bfbf9497bebd691569a | [
"MIT"
] | null | null | null | sdap/studies/admin.py | umr1085-irset/reproGenomicsViewer | 187ea320668e567d01572bfbf9497bebd691569a | [
"MIT"
] | 1 | 2020-02-16T10:48:55.000Z | 2020-02-16T11:06:36.000Z | sdap/studies/admin.py | umr1085-irset/reproGenomicsViewer | 187ea320668e567d01572bfbf9497bebd691569a | [
"MIT"
] | 4 | 2019-11-04T15:00:55.000Z | 2020-03-02T13:36:17.000Z | from django.contrib import admin
from django import forms
from .models import *
from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
import sdap.tools.forms as tool_forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from django.apps impor... | 32.733333 | 155 | 0.556517 | from django.contrib import admin
from django import forms
from .models import *
from django_better_admin_arrayfield.admin.mixins import DynamicArrayMixin
import sdap.tools.forms as tool_forms
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from django.apps impor... | true | true |
f72b50a50d6a2732a98caa1aae33253e14cfd9d0 | 1,772 | py | Python | examples/simple/fe.py | HQSquantumsimulations/ActiveSpaceFinder | 2471dd1cb764169a1be51937addea04813cf42d1 | [
"Apache-2.0"
] | 10 | 2020-11-09T18:12:43.000Z | 2021-12-17T16:48:54.000Z | examples/simple/fe.py | HQSquantumsimulations/ActiveSpaceFinder | 2471dd1cb764169a1be51937addea04813cf42d1 | [
"Apache-2.0"
] | null | null | null | examples/simple/fe.py | HQSquantumsimulations/ActiveSpaceFinder | 2471dd1cb764169a1be51937addea04813cf42d1 | [
"Apache-2.0"
] | 3 | 2021-01-26T12:41:08.000Z | 2021-12-16T04:33:11.000Z | # Copyright 2020 HQS Quantum Simulations GmbH
# Reza Ghafarian Shirazi, Thilo Mast.
# reza.shirazi@quantumsimulations.de
#
# 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.apa... | 30.551724 | 74 | 0.738149 |
from pyscf import gto, scf
import asf
mol = gto.Mole()
mol.atom = """
Fe -0.0000000 0.0000000 0.0000000
O 0.0000000 2.0622910 0.0000000
H 0.7919274 2.6471973 0.0000000
H -0.7919274 2.6471973 0.0000000
O -0.0000000 0.0000000 2.0622910
H -0.0000000 0.7919274 2.6471973
H 0.0000000 -0.7919274 2.6471973
O 2... | true | true |
f72b50aeba2955ce6ef70f323284adca857cfc4f | 3,088 | py | Python | yolo_app/etc/commons/opencv_helpers.py | arvincsh/multiobjectdetection | 26b4d43ce981a7a4cd031611df70b8f7c08757df | [
"MIT"
] | null | null | null | yolo_app/etc/commons/opencv_helpers.py | arvincsh/multiobjectdetection | 26b4d43ce981a7a4cd031611df70b8f7c08757df | [
"MIT"
] | 3 | 2021-06-08T22:25:30.000Z | 2022-01-13T03:18:29.000Z | yolo_app/etc/commons/opencv_helpers.py | arvincsh/multiobjectdetection | 26b4d43ce981a7a4cd031611df70b8f7c08757df | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from math import sqrt
from scipy.spatial import distance
from yolo_app.etc.config import config
def crop_image(save_path, img, xywh):
x = xywh[0]
y = xywh[1]
w = xywh[2]
h = xywh[3]
crop_img = img[y:y + h, x:x + w]
cv2.imwrite(save_path, crop_img)
def np_xyxy2xy... | 26.393162 | 100 | 0.562176 | import cv2
import numpy as np
from math import sqrt
from scipy.spatial import distance
from yolo_app.etc.config import config
def crop_image(save_path, img, xywh):
x = xywh[0]
y = xywh[1]
w = xywh[2]
h = xywh[3]
crop_img = img[y:y + h, x:x + w]
cv2.imwrite(save_path, crop_img)
def np_xyxy2xy... | true | true |
f72b5313853fd9dfc01ec04630bfc7a8a3c1dfba | 2,762 | py | Python | simple_generate.py | yuning1990/GPT2-Chinese | 299855ad9a84ad81b2da6e2c583af124f6ed6ff9 | [
"MIT"
] | null | null | null | simple_generate.py | yuning1990/GPT2-Chinese | 299855ad9a84ad81b2da6e2c583af124f6ed6ff9 | [
"MIT"
] | null | null | null | simple_generate.py | yuning1990/GPT2-Chinese | 299855ad9a84ad81b2da6e2c583af124f6ed6ff9 | [
"MIT"
] | null | null | null | from generate import *
from datetime import datetime
def main():
''' e.g.
python ./generate.py --length=512
--nsamples=1
--prefix=[MASK]哈利站在窗边
--tokenizer_path cache/vocab_small.txt
--topk 40 --model_path model/model_epoch29
--save_samples --save_samples_path result/20210915_29_1135
... | 54.156863 | 115 | 0.68139 | from generate import *
from datetime import datetime
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--key', default='intro', type=str, required=False, help='哪个模型')
parser.add_argument('--model_v', default='-1', type=str, required=False, help='第几个模型')
parser.add_argument('--device',... | true | true |
f72b5336226a539fe7cd56683840a850c1179b1c | 8,536 | py | Python | awareutils/vision/col.py | anna-aware/awareutils | 5571de71ad6f0adad6361e39f82073ba4dd402c5 | [
"MIT"
] | null | null | null | awareutils/vision/col.py | anna-aware/awareutils | 5571de71ad6f0adad6361e39f82073ba4dd402c5 | [
"MIT"
] | null | null | null | awareutils/vision/col.py | anna-aware/awareutils | 5571de71ad6f0adad6361e39f82073ba4dd402c5 | [
"MIT"
] | null | null | null | import hashlib
from typing import Iterable, Tuple
from loguru import logger
class Col:
named: "NamedCols"
def __init__(self, r: int, g: int, b: int, clip: bool = False, fix_numeric_type: bool = True):
self._clip = clip
self._fix_numeric_type = fix_numeric_type
self.r = r # Note this... | 31.732342 | 115 | 0.573336 | import hashlib
from typing import Iterable, Tuple
from loguru import logger
class Col:
named: "NamedCols"
def __init__(self, r: int, g: int, b: int, clip: bool = False, fix_numeric_type: bool = True):
self._clip = clip
self._fix_numeric_type = fix_numeric_type
self.r = r
se... | true | true |
f72b548ac9a0d323d3b91f562646813415979b88 | 8,590 | py | Python | python/caffe/detector.py | MilesQLi/highway-networks | 87d1c8d091ed698b7959c6dbcbbe2ac2e8bf5e3e | [
"BSD-2-Clause"
] | 106 | 2015-08-11T05:45:50.000Z | 2021-04-08T02:29:07.000Z | python/caffe/detector.py | scott89/caffe-crowd | de1875c33e311c12df7dc33decda67706dbf250a | [
"BSD-2-Clause"
] | 2 | 2016-07-07T15:04:10.000Z | 2016-09-12T14:00:13.000Z | python/caffe/detector.py | scott89/caffe-crowd | de1875c33e311c12df7dc33decda67706dbf250a | [
"BSD-2-Clause"
] | 36 | 2015-08-14T07:33:42.000Z | 2021-03-11T09:48:40.000Z | #!/usr/bin/env python
"""
Do windowed detection by classifying a number of images/crops at once,
optionally using the selective search window proposal method.
This implementation follows ideas in
Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik.
Rich feature hierarchies for accurate object detection... | 39.585253 | 80 | 0.590803 |
import numpy as np
import os
import caffe
class Detector(caffe.Net):
def __init__(self, model_file, pretrained_file, mean=None,
input_scale=None, raw_scale=None, channel_swap=None,
context_pad=None):
caffe.Net.__init__(self, model_file, pretrained_file, caffe.TEST)
... | true | true |
f72b56c1b85626f170db0a70640a8d036cae722e | 858 | py | Python | pcaspy/tools.py | dchabot/python-pcaspy | 42c32e90b854414d0f929a1ecef32b7438344d42 | [
"BSD-3-Clause"
] | null | null | null | pcaspy/tools.py | dchabot/python-pcaspy | 42c32e90b854414d0f929a1ecef32b7438344d42 | [
"BSD-3-Clause"
] | null | null | null | pcaspy/tools.py | dchabot/python-pcaspy | 42c32e90b854414d0f929a1ecef32b7438344d42 | [
"BSD-3-Clause"
] | null | null | null | import threading
# Thread running server processing loop
class ServerThread(threading.Thread):
"""
A helper class to run server in a thread.
The following snippet runs the server for 4 seconds and quit::
server = SimpleServer()
server_thread = ServerThread(server)
server_thread.st... | 22.578947 | 66 | 0.578089 | import threading
class ServerThread(threading.Thread):
def __init__(self, server):
super(ServerThread, self).__init__()
self.server = server
self.running = True
def run(self):
while self.running:
self.server.process(0.1)
def stop(self):
self.running = ... | true | true |
f72b56de21ac740c008099e3f07466941329206c | 6,793 | py | Python | bindings/python/ensmallen_graph/datasets/string/lachnobacteriumbovis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/lachnobacteriumbovis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/lachnobacteriumbovis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Lachnobacterium bovis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-... | 35.565445 | 223 | 0.708229 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def LachnobacteriumBovis(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
r... | true | true |
f72b570f213204c468b4f1b373c9ca56f111cbd6 | 1,128 | py | Python | windyquery/validator/field.py | bluerelay/windyquery | 049dc624f4c4a3210d455352b1495db6bd1ff441 | [
"MIT"
] | 51 | 2019-05-13T10:51:23.000Z | 2021-09-12T08:11:56.000Z | windyquery/validator/field.py | bluerelay/windyquery | 049dc624f4c4a3210d455352b1495db6bd1ff441 | [
"MIT"
] | 2 | 2020-10-08T16:28:45.000Z | 2021-06-23T03:27:42.000Z | windyquery/validator/field.py | bluerelay/windyquery | 049dc624f4c4a3210d455352b1495db6bd1ff441 | [
"MIT"
] | 3 | 2021-05-10T13:08:21.000Z | 2021-06-20T19:58:30.000Z | from ._base import Base, _rule
from .fullname_json import FullnameJson
from .values.text_val import TextVal
from .values.null import NULL
from .values.holder import Holder
from .values.true import TRUE
from .values.false import FALSE
class Field(FullnameJson, TextVal, NULL, Holder, TRUE, FALSE):
reserved = {**Bas... | 29.684211 | 111 | 0.606383 | from ._base import Base, _rule
from .fullname_json import FullnameJson
from .values.text_val import TextVal
from .values.null import NULL
from .values.holder import Holder
from .values.true import TRUE
from .values.false import FALSE
class Field(FullnameJson, TextVal, NULL, Holder, TRUE, FALSE):
reserved = {**Bas... | true | true |
f72b575498b298ee6a17f438e78286df5deb72f6 | 4,471 | py | Python | distributex/service.py | calston/distributex | 06ef0f948f7587ccf2a45305e8de45e9922990cc | [
"MIT"
] | 2 | 2018-06-07T12:46:22.000Z | 2020-11-21T18:10:44.000Z | distributex/service.py | calston/distributex | 06ef0f948f7587ccf2a45305e8de45e9922990cc | [
"MIT"
] | null | null | null | distributex/service.py | calston/distributex | 06ef0f948f7587ccf2a45305e8de45e9922990cc | [
"MIT"
] | null | null | null | from twisted.application import internet, service
from twisted.web import server, resource, client
from twisted.internet import defer, reactor, threads, utils, task
from zope import interface
import yaml
import time
import cgi
import random
from distributex.backends import in_memory_backend, memcached_backend
class ... | 29.609272 | 78 | 0.569895 | from twisted.application import internet, service
from twisted.web import server, resource, client
from twisted.internet import defer, reactor, threads, utils, task
from zope import interface
import yaml
import time
import cgi
import random
from distributex.backends import in_memory_backend, memcached_backend
class ... | true | true |
f72b5891618054c5f8898c72c812d2bae47239f4 | 3,403 | py | Python | note/meiduo34/mall/apps/users/models.py | gaosong666/taobao | cec3be71376fb94dc38553360253b70e88855594 | [
"MIT"
] | null | null | null | note/meiduo34/mall/apps/users/models.py | gaosong666/taobao | cec3be71376fb94dc38553360253b70e88855594 | [
"MIT"
] | null | null | null | note/meiduo34/mall/apps/users/models.py | gaosong666/taobao | cec3be71376fb94dc38553360253b70e88855594 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
# from itsdangerous import Serializer
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadData
from mall import settings
from utils.models import BaseModel
class User(AbstractUser):
... | 37.395604 | 125 | 0.645901 | from django.contrib.auth.models import AbstractUser
from django.db import models
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, BadData
from mall import settings
from utils.models import BaseModel
class User(AbstractUser):
mobile = models.CharField(max_length=11, unique=True, verbose_... | true | true |
f72b58f5171215cd31d5b12f28261a896f30aa4c | 7,827 | py | Python | research/object_detection/training/TFLite_detection_video.py | geometrikal/tensorflow_models | 44a82f3f18a2e62b1cd99b94922f752be0672f46 | [
"Apache-2.0"
] | null | null | null | research/object_detection/training/TFLite_detection_video.py | geometrikal/tensorflow_models | 44a82f3f18a2e62b1cd99b94922f752be0672f46 | [
"Apache-2.0"
] | null | null | null | research/object_detection/training/TFLite_detection_video.py | geometrikal/tensorflow_models | 44a82f3f18a2e62b1cd99b94922f752be0672f46 | [
"Apache-2.0"
] | null | null | null | ######## Webcam Object Detection Using Tensorflow-trained Classifier #########
#
# Author: Evan Juras
# Date: 10/2/19
# Description:
# This program uses a TensorFlow Lite model to perform object detection on a
# video. It draws boxes and scores around the objects of interest in each frame
# from the video.
#
# This co... | 37.995146 | 180 | 0.689408 | ument('--graph', help='Name of the .tflite file, if different than detect.tflite',
default='detect.tflite')
parser.add_argument('--labels', help='Name of the labelmap file, if different than labelmap.txt',
default='labelmap.txt')
parser.add_argument('--threshold', help='Minimum c... | true | true |
f72b5994c29c19a3357fc7ba21a214ddbce1dcfd | 8,591 | py | Python | my_test/get_graph.py | RuoyuX-2018/6998DL | a9b75ee63a92c6824db9ac25cc6d931713e0cae5 | [
"BSD-3-Clause"
] | null | null | null | my_test/get_graph.py | RuoyuX-2018/6998DL | a9b75ee63a92c6824db9ac25cc6d931713e0cae5 | [
"BSD-3-Clause"
] | null | null | null | my_test/get_graph.py | RuoyuX-2018/6998DL | a9b75ee63a92c6824db9ac25cc6d931713e0cae5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 14 15:47:45 2021
@author: xuery
"""
import cv2
import time
import numpy as np
import os
import copy
import pickle
import random
import math
import matplotlib.pyplot as plt
from scipy import spatial
from skimage import morphology
from sklearn.mixtur... | 38.352679 | 106 | 0.583867 |
import cv2
import time
import numpy as np
import os
import copy
import pickle
import random
import math
import matplotlib.pyplot as plt
from scipy import spatial
from skimage import morphology
from sklearn.mixture import GaussianMixture
from shapely.geometry import LineString, Point
from mpl_toolkits.mplot3d import ... | true | true |
f72b5999064274f48ed6073bf289ff75177ea60f | 4,247 | py | Python | tests/make_entry_test.py | asottile/pypi_practices | a4da562c471198dd35806c52016fac44bb46c08d | [
"MIT"
] | 3 | 2015-02-16T16:41:43.000Z | 2016-08-25T03:35:12.000Z | tests/make_entry_test.py | asottile/pypi_practices | a4da562c471198dd35806c52016fac44bb46c08d | [
"MIT"
] | 1 | 2017-08-15T04:02:30.000Z | 2017-08-15T04:02:30.000Z | tests/make_entry_test.py | asottile/pypi_practices | a4da562c471198dd35806c52016fac44bb46c08d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
import io
import mock
import os.path
import pytest
import sys
from pypi_practices import five
from pypi_practices.errors import FileValidationError
from pypi_practices.make_entry import make_entry
from testing.util import REMatcher
@pyte... | 27.224359 | 77 | 0.669178 | from __future__ import absolute_import
from __future__ import unicode_literals
import io
import mock
import os.path
import pytest
import sys
from pypi_practices import five
from pypi_practices.errors import FileValidationError
from pypi_practices.make_entry import make_entry
from testing.util import REMatcher
@pyte... | true | true |
f72b59e95919066e8f4ddff2339f880b70006b93 | 17,174 | py | Python | tests/test_coroutine_sink.py | phillipuniverse/loguru | 3d5234541c81318e7f6f725eca7bab294fe09c23 | [
"MIT"
] | 11,391 | 2018-12-08T17:44:13.000Z | 2022-03-31T17:55:24.000Z | tests/test_coroutine_sink.py | vkirilenko/loguru | 68616485f4f0decb5fced36a16040f5e05e2842f | [
"MIT"
] | 610 | 2018-12-08T18:03:03.000Z | 2022-03-31T22:28:14.000Z | tests/test_coroutine_sink.py | vkirilenko/loguru | 68616485f4f0decb5fced36a16040f5e05e2842f | [
"MIT"
] | 601 | 2018-12-08T17:46:42.000Z | 2022-03-30T04:23:56.000Z | import asyncio
import logging
import multiprocessing
import re
import sys
import threading
import pytest
import loguru
from loguru import logger
async def async_writer(msg):
await asyncio.sleep(0.01)
print(msg, end="")
class AsyncWriter:
async def __call__(self, msg):
await asyncio.sleep(0.01)... | 24.120787 | 97 | 0.638116 | import asyncio
import logging
import multiprocessing
import re
import sys
import threading
import pytest
import loguru
from loguru import logger
async def async_writer(msg):
await asyncio.sleep(0.01)
print(msg, end="")
class AsyncWriter:
async def __call__(self, msg):
await asyncio.sleep(0.01)... | true | true |
f72b5a37ff02745e8949ae1f82a9e2a4b599b954 | 20,351 | py | Python | datagen.py | HotaekHan/FCOS | 8e3a0438cf1a53f8916d21ea81d892b260c100a9 | [
"Apache-2.0"
] | null | null | null | datagen.py | HotaekHan/FCOS | 8e3a0438cf1a53f8916d21ea81d892b260c100a9 | [
"Apache-2.0"
] | null | null | null | datagen.py | HotaekHan/FCOS | 8e3a0438cf1a53f8916d21ea81d892b260c100a9 | [
"Apache-2.0"
] | null | null | null | '''Load image/labels/boxes from an annotation file.
The list file is like:
img.jpg width height xmin ymin xmax ymax label xmin ymin xmax ymax label ...
'''
import random
import numpy as np
import json
import os
# from PIL import Image, ImageDraw, ImageFile
# ImageFile.LOAD_TRUNCATED_IMAGES = True
import cv2
impo... | 38.110487 | 156 | 0.541644 | import random
import numpy as np
import json
import os
import cv2
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from encoder import DataEncoder
class jsonDataset(data.Dataset):
def __init__(self, path, classes, transform, input_image_size, num_crops, fpn_level, is_nor... | true | true |
f72b5bc149c5ba2f2e841366355f1137ce247df7 | 10,256 | py | Python | meatpy/itch50/itch50_message_parser.py | vishalbelsare/MeatPy | d4f22c4aca750b7b51858383c21ee573d6481e44 | [
"BSD-3-Clause"
] | 5 | 2021-07-21T22:19:18.000Z | 2022-03-20T02:39:27.000Z | meatpy/itch50/itch50_message_parser.py | vishalbelsare/MeatPy | d4f22c4aca750b7b51858383c21ee573d6481e44 | [
"BSD-3-Clause"
] | 1 | 2021-09-22T20:13:56.000Z | 2021-09-25T14:47:54.000Z | meatpy/itch50/itch50_message_parser.py | vishalbelsare/MeatPy | d4f22c4aca750b7b51858383c21ee573d6481e44 | [
"BSD-3-Clause"
] | 4 | 2020-12-11T02:29:52.000Z | 2021-11-06T04:00:46.000Z | """itch50_message_parser.py: Message parser class for ITCH 5.0"""
__author__ = "Vincent Grégoire"
__email__ = "vincent.gregoire@gmail.com"
from copy import deepcopy
import meatpy.itch50.itch50_market_message
from meatpy.message_parser import MessageParser
class ITCH50MessageParser(MessageParser):
"""A market me... | 41.354839 | 96 | 0.604524 |
__author__ = "Vincent Grégoire"
__email__ = "vincent.gregoire@gmail.com"
from copy import deepcopy
import meatpy.itch50.itch50_market_message
from meatpy.message_parser import MessageParser
class ITCH50MessageParser(MessageParser):
def __init__(self):
self.keep_messages_types = b'SAFECXDUBHRYPQINLVWK'
... | true | true |
f72b5ca0b6e649f1aa5b09952cf5e59898061a4c | 34,977 | py | Python | SigProfilerMatrixGenerator/install.py | edawson/SigProfilerMatrixGenerator | bd6d3bb15e87805cdc7e771c3fdd886f4a9fc29b | [
"BSD-2-Clause"
] | null | null | null | SigProfilerMatrixGenerator/install.py | edawson/SigProfilerMatrixGenerator | bd6d3bb15e87805cdc7e771c3fdd886f4a9fc29b | [
"BSD-2-Clause"
] | null | null | null | SigProfilerMatrixGenerator/install.py | edawson/SigProfilerMatrixGenerator | bd6d3bb15e87805cdc7e771c3fdd886f4a9fc29b | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#Author: Erik Bergstrom
#Contact: ebergstr@eng.ucsd.edu
from __future__ import print_function
import os
import sys
import re
import subprocess
import argparse
import time
from scipy import spatial
import pandas as pd
import shutil
import logging
import hashlib
from SigProfilerMatrixGenerator.s... | 61.255692 | 245 | 0.714527 |
from __future__ import print_function
import os
import sys
import re
import subprocess
import argparse
import time
from scipy import spatial
import pandas as pd
import shutil
import logging
import hashlib
from SigProfilerMatrixGenerator.scripts import convert_input_to_simple_files as convertIn
from SigProfilerMat... | true | true |
f72b5d1333df08c7bba72728c8f28fe54e5dda17 | 2,824 | py | Python | storyboard/tests/plugin/test_event_worker.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | storyboard/tests/plugin/test_event_worker.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | storyboard/tests/plugin/test_event_worker.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 37.653333 | 79 | 0.651558 |
import storyboard.db.api.base as db_api_base
import storyboard.plugin.event_worker as plugin_base
import storyboard.tests.base as base
class TestWorkerTaskBase(base.FunctionalTest):
def setUp(self):
super(TestWorkerTaskBase, self).setUp()
def test_resolve_by_name(self):
worker ... | true | true |
f72b5ecb16ba78f38ce59b844429ea0150cb7a47 | 8,108 | py | Python | airflow/www/api/experimental/endpoints.py | guiligan/incubator-airflow | b3c0ae003037ae6c652b177b9f86ecac84c792a5 | [
"Apache-2.0"
] | null | null | null | airflow/www/api/experimental/endpoints.py | guiligan/incubator-airflow | b3c0ae003037ae6c652b177b9f86ecac84c792a5 | [
"Apache-2.0"
] | null | null | null | airflow/www/api/experimental/endpoints.py | guiligan/incubator-airflow | b3c0ae003037ae6c652b177b9f86ecac84c792a5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 32.302789 | 88 | 0.656265 |
from flask import (
g, Blueprint, jsonify, request, url_for
)
import airflow.api
from airflow.api.common.experimental import delete_dag as delete
from airflow.api.common.experimental import pool as pool_api
from airflow.api.common.experimental import trigger_dag as trigger
from airflow.api.common.expe... | true | true |
f72b5fa86d6b83ca6337f2fcfbd2bd36f1181b33 | 356 | py | Python | src/subplot1.py | AnaharaYasuo/mlPractice | 1a3d110fdc6cf4084ee6b1268d215151de5939cb | [
"Apache-2.0"
] | null | null | null | src/subplot1.py | AnaharaYasuo/mlPractice | 1a3d110fdc6cf4084ee6b1268d215151de5939cb | [
"Apache-2.0"
] | null | null | null | src/subplot1.py | AnaharaYasuo/mlPractice | 1a3d110fdc6cf4084ee6b1268d215151de5939cb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
x = np.linspace(-5, 5, 300)
sin_x = np.sin(x)
cos_x = np.cos(x)
flg, aexs = plt.subplots(2, 1)
aexs[0].set_ylim([-1.5,1.5])
aexs[1].set_ylim([-1.5,1.5])
aexs[0].plot(x,sin_x,color="r")
aexs[1].plot(x,... | 23.733333 | 39 | 0.564607 | import numpy as np
import matplotlib.pyplot as plt
if __name__ == "__main__":
x = np.linspace(-5, 5, 300)
sin_x = np.sin(x)
cos_x = np.cos(x)
flg, aexs = plt.subplots(2, 1)
aexs[0].set_ylim([-1.5,1.5])
aexs[1].set_ylim([-1.5,1.5])
aexs[0].plot(x,sin_x,color="r")
aexs[1].plot(x,... | true | true |
f72b609af987bf7e917700aeb972f5133849bc61 | 6,985 | py | Python | log_caspase/model_378.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_caspase/model_378.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_caspase/model_378.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('C6A', ['C8pro'])
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C3ub')
Monomer('C3A', ['Xiap', 'ParpU', 'C6pro'])
Mo... | 69.85 | 296 | 0.818039 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C3ub')
Monomer('C3A', ['Xiap', 'ParpU', 'C6pro'])
Monomer('Xiap', ['C3A'])
Monomer('C8... | true | true |
f72b6381fc06e7cffc979d54eb10670337ea3e1b | 35,546 | py | Python | sorn/utils.py | Saran-nns/sorn | 619772c508b88aa711780ab9155fe5d0aa5214eb | [
"MIT"
] | 19 | 2019-03-18T21:51:53.000Z | 2022-01-02T01:27:37.000Z | sorn/utils.py | Saran-nns/sorn | 619772c508b88aa711780ab9155fe5d0aa5214eb | [
"MIT"
] | 32 | 2019-03-10T23:55:22.000Z | 2022-01-04T19:28:45.000Z | sorn/utils.py | Saran-nns/sorn | 619772c508b88aa711780ab9155fe5d0aa5214eb | [
"MIT"
] | 4 | 2019-05-07T13:46:47.000Z | 2022-01-07T17:06:41.000Z | from __future__ import division
import numpy as np
from scipy.stats import norm
import random
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.optimize import curve_fit
from scipy import stats
import networkx as nx
import pandas as pd
from mpl_toolkits.axes_grid1.inset_locator import InsetPosition
cla... | 30.537801 | 207 | 0.596213 | from __future__ import division
import numpy as np
from scipy.stats import norm
import random
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.optimize import curve_fit
from scipy import stats
import networkx as nx
import pandas as pd
from mpl_toolkits.axes_grid1.inset_locator import InsetPosition
cla... | true | true |
f72b65415eb00899b5a39a72574ea82cbc1d04c6 | 21,954 | py | Python | Lib/site-packages/django/conf/global_settings.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 42 | 2019-03-01T09:51:13.000Z | 2021-07-22T12:22:49.000Z | Lib/site-packages/django/conf/global_settings.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 31 | 2018-08-26T14:01:16.000Z | 2018-10-19T07:35:57.000Z | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | eyern/instagram_clone | c18da15b35d28d91c3f63904af9d5da4e8e3e8ae | [
"MIT"
] | 145 | 2019-03-14T18:54:45.000Z | 2022-03-04T20:25:31.000Z | """
Default Django settings. Override these with settings in the module pointed to
by the DJANGO_SETTINGS_MODULE environment variable.
"""
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
def gettext_noop(s):
return s
####... | 34.518868 | 101 | 0.701603 |
# django.utils.translation -- that module depends on the settings.
def gettext_noop(s):
return s
####################
# CORE #
####################
DEBUG = False
# Whether the framework should propagate raw exceptions rather than catching
# them. This is useful under some testing situations and s... | true | true |
f72b65ae791790eb0c6dae59632f170bfaa9b26d | 984 | py | Python | setup.py | prafulbagai/uwsgi-sloth | b19b9a7e6a0b8edfdc94bfbe9f7a0030ab95db03 | [
"Apache-2.0"
] | 127 | 2015-01-02T11:57:22.000Z | 2022-03-03T02:23:54.000Z | setup.py | prafulbagai/uwsgi-sloth | b19b9a7e6a0b8edfdc94bfbe9f7a0030ab95db03 | [
"Apache-2.0"
] | 8 | 2015-06-15T12:10:13.000Z | 2019-07-21T23:01:18.000Z | setup.py | prafulbagai/uwsgi-sloth | b19b9a7e6a0b8edfdc94bfbe9f7a0030ab95db03 | [
"Apache-2.0"
] | 20 | 2015-01-06T03:27:25.000Z | 2020-09-04T03:53:46.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from setuptools import setup, find_packages
# **Python version check**
if sys.version_info < (3, 5):
error = """
uwsgi-sloth only supports Python 3.5 and above.
If you are using Python 2.7, please install "uwsgi-sloth<3.0.0" instead.
"""
... | 24.6 | 72 | 0.648374 |
from __future__ import print_function
import sys
from setuptools import setup, find_packages
if sys.version_info < (3, 5):
error = """
uwsgi-sloth only supports Python 3.5 and above.
If you are using Python 2.7, please install "uwsgi-sloth<3.0.0" instead.
"""
print(error, file=sys.stderr)
sys.exit(1)
... | true | true |
f72b65b992c41b19e9209c007df907202066b8d1 | 2,817 | py | Python | weatherScraper/spiders/weatherbot.py | aabedi/weatherScraper | 069d07c19fbbba93aad5499cd1bb400accbcf644 | [
"MIT"
] | null | null | null | weatherScraper/spiders/weatherbot.py | aabedi/weatherScraper | 069d07c19fbbba93aad5499cd1bb400accbcf644 | [
"MIT"
] | null | null | null | weatherScraper/spiders/weatherbot.py | aabedi/weatherScraper | 069d07c19fbbba93aad5499cd1bb400accbcf644 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from weatherScraper.items import TempData
from weatherScraper.items import InputData
import scrapy
class WeatherbotSpider(scrapy.Spider):
name = 'weatherbot'
allowed_domains = ['www.wunderground.com']
start_urls = ['http://www.wunderground.com/history/']
def __init__(self, cod... | 48.568966 | 120 | 0.619453 |
from weatherScraper.items import TempData
from weatherScraper.items import InputData
import scrapy
class WeatherbotSpider(scrapy.Spider):
name = 'weatherbot'
allowed_domains = ['www.wunderground.com']
start_urls = ['http://www.wunderground.com/history/']
def __init__(self, code='', month='', day='',... | true | true |
f72b65ccd73696678a74b7a0c74f72dda1f6b69c | 3,974 | py | Python | flink-ml-framework/python/setup.py | yangqi199808/dl-on-flink | 3b2ab15ce06e877f90997f5950df44bc30b88b29 | [
"Apache-2.0"
] | null | null | null | flink-ml-framework/python/setup.py | yangqi199808/dl-on-flink | 3b2ab15ce06e877f90997f5950df44bc30b88b29 | [
"Apache-2.0"
] | null | null | null | flink-ml-framework/python/setup.py | yangqi199808/dl-on-flink | 3b2ab15ce06e877f90997f5950df44bc30b88b29 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The flink-ai-extended 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 ... | 36.458716 | 89 | 0.605435 |
import os
import platform
import re
import subprocess
import sys
from distutils.version import LooseVersion
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
this_directory = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(t... | true | true |
f72b65fef7e833abe364975fab274dd40f6a20f9 | 359 | py | Python | predict.py | TomG4/flair | 2db057ec60c25d55f69622a6a6881aedae13be49 | [
"MIT"
] | null | null | null | predict.py | TomG4/flair | 2db057ec60c25d55f69622a6a6881aedae13be49 | [
"MIT"
] | null | null | null | predict.py | TomG4/flair | 2db057ec60c25d55f69622a6a6881aedae13be49 | [
"MIT"
] | null | null | null | #Test
from flair.data import Sentence
from flair.models import SequenceTagger
tagger: SequenceTagger = SequenceTagger.load("ner")
sentence: Sentence = Sentence("George Washington went to Washington .")
tagger.predict(sentence)
print("Analysing the sentence %s" % sentence)
print("\nThe following NER tags are found: \... | 27.615385 | 71 | 0.78273 |
from flair.data import Sentence
from flair.models import SequenceTagger
tagger: SequenceTagger = SequenceTagger.load("ner")
sentence: Sentence = Sentence("George Washington went to Washington .")
tagger.predict(sentence)
print("Analysing the sentence %s" % sentence)
print("\nThe following NER tags are found: \n")
p... | true | true |
f72b66e8e4c78293736c0c00b94f7ce5be92fa9b | 35,288 | py | Python | owscapable/csw.py | b-cube/OwsCapable | a01815418fe982434503d6542cb18e1ac8989684 | [
"BSD-3-Clause"
] | 1 | 2016-02-01T12:55:13.000Z | 2016-02-01T12:55:13.000Z | owscapable/csw.py | b-cube/OwsCapable | a01815418fe982434503d6542cb18e1ac8989684 | [
"BSD-3-Clause"
] | 1 | 2015-06-23T14:07:50.000Z | 2015-06-23T14:07:50.000Z | owscapable/csw.py | b-cube/OwsCapable | a01815418fe982434503d6542cb18e1ac8989684 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# =============================================================================
"""... | 43.351351 | 268 | 0.611766 |
from __future__ import (absolute_import, division, print_function)
import base64
import inspect
import warnings
import StringIO
import random
from urllib import urlencode
from urllib2 import Request, urlopen
from owscapable.util import OrderedDict
from owscapable.etree import etree
from owscapable import f... | true | true |
f72b67fe680c8d3c4ade97a3c8636404858cf558 | 648 | py | Python | setup.py | sufiyanghori/sensu-plugin-python | 6682163a2a2219e8132b4c9e1dd53663fa477ae5 | [
"MIT"
] | null | null | null | setup.py | sufiyanghori/sensu-plugin-python | 6682163a2a2219e8132b4c9e1dd53663fa477ae5 | [
"MIT"
] | null | null | null | setup.py | sufiyanghori/sensu-plugin-python | 6682163a2a2219e8132b4c9e1dd53663fa477ae5 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='sensu_plugin',
version='0.7.0',
author='Sensu-Plugins and Contributors',
author_email='sensu-users@googlegroups.com',
packages=['sensu_plugin', 'sensu_plugin.tests'],
scripts=[],
url='https://github.com/sensu-plugins/sensu-plugin-python',
li... | 23.142857 | 64 | 0.594136 | from distutils.core import setup
setup(
name='sensu_plugin',
version='0.7.0',
author='Sensu-Plugins and Contributors',
author_email='sensu-users@googlegroups.com',
packages=['sensu_plugin', 'sensu_plugin.tests'],
scripts=[],
url='https://github.com/sensu-plugins/sensu-plugin-python',
li... | true | true |
f72b685d506ef171b93f3f1fddeda1a0a511663e | 8,723 | py | Python | tests/test_joint_logprob.py | kc611/aeppl | d24eee80a7448c48b55a8ec41aec150d1dd9d6a7 | [
"MIT"
] | null | null | null | tests/test_joint_logprob.py | kc611/aeppl | d24eee80a7448c48b55a8ec41aec150d1dd9d6a7 | [
"MIT"
] | null | null | null | tests/test_joint_logprob.py | kc611/aeppl | d24eee80a7448c48b55a8ec41aec150d1dd9d6a7 | [
"MIT"
] | null | null | null | import aesara
import aesara.tensor as at
import numpy as np
import pytest
import scipy.stats.distributions as sp
from aesara.graph.basic import Apply, ancestors, equal_computations
from aesara.graph.op import Op
from aesara.tensor.subtensor import (
AdvancedIncSubtensor,
AdvancedIncSubtensor1,
AdvancedSubte... | 28.6 | 115 | 0.652872 | import aesara
import aesara.tensor as at
import numpy as np
import pytest
import scipy.stats.distributions as sp
from aesara.graph.basic import Apply, ancestors, equal_computations
from aesara.graph.op import Op
from aesara.tensor.subtensor import (
AdvancedIncSubtensor,
AdvancedIncSubtensor1,
AdvancedSubte... | true | true |
f72b69a62107d6763a33183b36f8ec377f171f30 | 2,003 | py | Python | sgmock/fixture/setup.py | blurstudio/sgmock | 6b5b949cbd4bc16db8060f1b07bb8113a624e9e4 | [
"BSD-3-Clause"
] | null | null | null | sgmock/fixture/setup.py | blurstudio/sgmock | 6b5b949cbd4bc16db8060f1b07bb8113a624e9e4 | [
"BSD-3-Clause"
] | null | null | null | sgmock/fixture/setup.py | blurstudio/sgmock | 6b5b949cbd4bc16db8060f1b07bb8113a624e9e4 | [
"BSD-3-Clause"
] | null | null | null | import random
from .base import Fixture
# From various online generators.
project_names = [
'Waiting for Johnson',
'Helping Delilah',
'Finding Gump',
'Double Danger',
'Master of Surrender',
'Compulsive Winter',
'Inner Space',
]
# All of the WesternX sequence codes from previous films.
se... | 28.614286 | 75 | 0.51323 | import random
from .base import Fixture
project_names = [
'Waiting for Johnson',
'Helping Delilah',
'Finding Gump',
'Double Danger',
'Master of Surrender',
'Compulsive Winter',
'Inner Space',
]
sequence_names = [
'AB', 'BA', 'BB', 'BD', 'BE', 'BL', 'BS', 'BU', 'BX', 'CD', 'CF', 'CT... | true | true |
f72b6b42f15d1adf79085531fb38312487b1ca0c | 3,816 | py | Python | FairnessTest/models/Seq2Seq_WER/opts.py | zgahhblhc/DialogueFairness | dc00eb8aad7145cdd01f69c99fd79f741b9aa8d4 | [
"MIT"
] | 3 | 2020-12-10T02:20:44.000Z | 2022-02-23T18:03:30.000Z | FairnessTest/models/Seq2Seq_WER/opts.py | zgahhblhc/DialogueFairness | dc00eb8aad7145cdd01f69c99fd79f741b9aa8d4 | [
"MIT"
] | null | null | null | FairnessTest/models/Seq2Seq_WER/opts.py | zgahhblhc/DialogueFairness | dc00eb8aad7145cdd01f69c99fd79f741b9aa8d4 | [
"MIT"
] | 4 | 2020-11-03T18:33:24.000Z | 2022-02-23T18:04:01.000Z | opt = {'task': 'twitter',
'download_path': '/mnt/home/liuhaoc1/ParlAI/downloads',
'datatype': 'train',
'image_mode': 'raw',
'numthreads': 1,
'hide_labels': False,
'batchsize': 32,
'batch_sort': True,
'context_length': -1,
'include_labels': True,
'dat... | 51.567568 | 539 | 0.60587 | opt = {'task': 'twitter',
'download_path': '/mnt/home/liuhaoc1/ParlAI/downloads',
'datatype': 'train',
'image_mode': 'raw',
'numthreads': 1,
'hide_labels': False,
'batchsize': 32,
'batch_sort': True,
'context_length': -1,
'include_labels': True,
'dat... | true | true |
f72b6b557eea5c628cc1be578fe43d5224c205f4 | 6,820 | py | Python | ivy_tests/test_ivy/test_functional/test_core/test_nest.py | mattbarrett98/ivy | a706e59b907c0f78edb819959cc2035ebf48946f | [
"Apache-2.0"
] | null | null | null | ivy_tests/test_ivy/test_functional/test_core/test_nest.py | mattbarrett98/ivy | a706e59b907c0f78edb819959cc2035ebf48946f | [
"Apache-2.0"
] | null | null | null | ivy_tests/test_ivy/test_functional/test_core/test_nest.py | mattbarrett98/ivy | a706e59b907c0f78edb819959cc2035ebf48946f | [
"Apache-2.0"
] | null | null | null | """
Collection of tests for unified general functions
"""
# global
import copy
import pytest
# local
import ivy
import ivy.functional.backends.numpy
# Helpers #
# --------#
def _snai(n, idx, v):
if len(idx) == 1:
n[idx[0]] = v
else:
_snai(n[idx[0]], idx[1:], v)
def _mnai(n, idx, fn):
... | 29.396552 | 87 | 0.532111 |
import copy
import pytest
import ivy
import ivy.functional.backends.numpy
def _snai(n, idx, v):
if len(idx) == 1:
n[idx[0]] = v
else:
_snai(n[idx[0]], idx[1:], v)
def _mnai(n, idx, fn):
if len(idx) == 1:
n[idx[0]] = fn(n[idx[0]])
else:
_mnai(n[idx[0]], idx[1:], ... | true | true |
f72b6e15d5c16951ab125cba7909154559f185ff | 1,850 | py | Python | app/i18n.py | CircuitsBots/discord-i18n | a0832a464566850eeda9bb386d7528d2d63a8fd8 | [
"MIT"
] | 1 | 2021-05-24T15:37:55.000Z | 2021-05-24T15:37:55.000Z | app/i18n.py | CircuitsBots/discord-i18n | a0832a464566850eeda9bb386d7528d2d63a8fd8 | [
"MIT"
] | 1 | 2021-05-26T12:47:11.000Z | 2021-05-26T13:31:31.000Z | app/i18n.py | CircuitsBots/discord-i18n | a0832a464566850eeda9bb386d7528d2d63a8fd8 | [
"MIT"
] | null | null | null | import contextvars
import gettext
import os.path
from glob import glob
from app.t_string import TString
BASE_DIR = ""
LOCALE_DEFAULT = "en_US"
LOCALE_DIR = "locale"
locales = frozenset(
map(
os.path.basename,
filter(os.path.isdir, glob(os.path.join(BASE_DIR, LOCALE_DIR, "*"))),
)
)
gettext_tr... | 23.125 | 77 | 0.687027 | import contextvars
import gettext
import os.path
from glob import glob
from app.t_string import TString
BASE_DIR = ""
LOCALE_DEFAULT = "en_US"
LOCALE_DIR = "locale"
locales = frozenset(
map(
os.path.basename,
filter(os.path.isdir, glob(os.path.join(BASE_DIR, LOCALE_DIR, "*"))),
)
)
gettext_tr... | true | true |
f72b6e7d0faa806aa74633ee75bd77534ef86dea | 4,079 | py | Python | Saniti/main.py | ChamRoshi/Saniti | ddff09e60df1a2046e79e4356f07573f30210f22 | [
"Apache-2.0"
] | null | null | null | Saniti/main.py | ChamRoshi/Saniti | ddff09e60df1a2046e79e4356f07573f30210f22 | [
"Apache-2.0"
] | null | null | null | Saniti/main.py | ChamRoshi/Saniti | ddff09e60df1a2046e79e4356f07573f30210f22 | [
"Apache-2.0"
] | null | null | null | # import nltk
# import gensim
# import pandas
import string
from nltk.corpus import stopwords
from nltk import word_tokenize
from nltk import WordNetLemmatizer
from nltk import pos_tag
from nltk.stem import PorterStemmer
from gensim.models.doc2vec import TaggedDocument
from gensim.corpora import Dictionary
from gensim.... | 21.356021 | 109 | 0.664379 |
import string
from nltk.corpus import stopwords
from nltk import word_tokenize
from nltk import WordNetLemmatizer
from nltk import pos_tag
from nltk.stem import PorterStemmer
from gensim.models.doc2vec import TaggedDocument
from gensim.corpora import Dictionary
from gensim.models.phrases import Phrases, Phraser
cla... | true | true |
f72b6ec0218d668349c89e6dabbf4bb56ed17158 | 3,294 | py | Python | pytest/testFragmentedBackup.py | RomanValov/ArmoryDB | 625eff9712161676ad83deb03616e6edb48283ca | [
"MIT"
] | 505 | 2016-02-04T15:54:46.000Z | 2022-03-27T18:43:01.000Z | pytest/testFragmentedBackup.py | jimmysong/BitcoinArmory | 1c7190176897a2e0f3e4e198ab2f199059bb2402 | [
"MIT"
] | 528 | 2016-02-06T19:50:12.000Z | 2022-01-15T10:21:16.000Z | pytest/testFragmentedBackup.py | jimmysong/BitcoinArmory | 1c7190176897a2e0f3e4e198ab2f199059bb2402 | [
"MIT"
] | 208 | 2015-01-02T10:31:40.000Z | 2021-12-14T07:37:36.000Z | ################################################################################
# #
# Copyright (C) 2011-2014, Armory Technologies, Inc. #
# Distributed under the GNU Affero General Public License (AGPL v3) ... | 37.862069 | 112 | 0.61779 | true | true | |
f72b6ff661d13354a6eeda99808229daf19f9eb3 | 988 | py | Python | tools/leetcode.223.Rectangle Area/leetcode.223.Rectangle Area.submission3.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | 4 | 2015-10-10T00:30:55.000Z | 2020-07-27T19:45:54.000Z | tools/leetcode.223.Rectangle Area/leetcode.223.Rectangle Area.submission3.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | tools/leetcode.223.Rectangle Area/leetcode.223.Rectangle Area.submission3.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | class Solution:
# @param {integer} A
# @param {integer} B
# @param {integer} C
# @param {integer} D
# @param {integer} E
# @param {integer} F
# @param {integer} G
# @param {integer} H
# @return {integer}
def computeArea(self, A, B, C, D, E, F, G, H):
# calculate the separ... | 988 | 988 | 0.374494 | class Solution:
| true | true |
f72b707bda389dc12a15cc8354b94ca79cf61a68 | 9,096 | py | Python | mfem/_ser/symmat.py | GabrielJie/PyMFEM | fa654447ac6819c5aa0341397b91a299f4ce5492 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T07:16:59.000Z | 2022-01-19T07:16:59.000Z | mfem/_ser/symmat.py | GabrielJie/PyMFEM | fa654447ac6819c5aa0341397b91a299f4ce5492 | [
"BSD-3-Clause"
] | null | null | null | mfem/_ser/symmat.py | GabrielJie/PyMFEM | fa654447ac6819c5aa0341397b91a299f4ce5492 | [
"BSD-3-Clause"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | 40.972973 | 118 | 0.726143 |
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeError("Python 2.7 or later required")
if __package__ or "." in __name__:
from . import _symmat
else:
import _symmat
try:
import builtins as __builtin__
except ImportError:
import... | true | true |
f72b70b8b138e4a1d4a8b2d5b7e35ce0046217f0 | 4,948 | py | Python | src/pretalx/schedule/utils.py | Hydro2shine/sprout | 7dfa5e9fa0a7ef9157517ad0752e393599053873 | [
"Apache-2.0"
] | null | null | null | src/pretalx/schedule/utils.py | Hydro2shine/sprout | 7dfa5e9fa0a7ef9157517ad0752e393599053873 | [
"Apache-2.0"
] | null | null | null | src/pretalx/schedule/utils.py | Hydro2shine/sprout | 7dfa5e9fa0a7ef9157517ad0752e393599053873 | [
"Apache-2.0"
] | null | null | null | from contextlib import suppress
from datetime import timedelta
from dateutil.parser import parse
from django.db import transaction
from django_scopes import scope
from pretalx.person.models import SpeakerProfile, User
from pretalx.schedule.models import Room, TalkSlot
from pretalx.submission.models import (
Submi... | 34.84507 | 123 | 0.637833 | from contextlib import suppress
from datetime import timedelta
from dateutil.parser import parse
from django.db import transaction
from django_scopes import scope
from pretalx.person.models import SpeakerProfile, User
from pretalx.schedule.models import Room, TalkSlot
from pretalx.submission.models import (
Submi... | true | true |
f72b726b4dcae39366215f12ae7011d2b2bf9606 | 1,072 | py | Python | Codes-B/matplotlib-py-files/matplot-image.py | sanils2002/PYTHON-CODES | 607fadc2cba4b185a5529bd101faefa08f4c3469 | [
"MIT"
] | null | null | null | Codes-B/matplotlib-py-files/matplot-image.py | sanils2002/PYTHON-CODES | 607fadc2cba4b185a5529bd101faefa08f4c3469 | [
"MIT"
] | null | null | null | Codes-B/matplotlib-py-files/matplot-image.py | sanils2002/PYTHON-CODES | 607fadc2cba4b185a5529bd101faefa08f4c3469 | [
"MIT"
] | null | null | null | # importing required libraries
import matplotlib.pyplot as plt
import matplotlib.image as img
# reading the image
testImage = img.imread('g4g.png')
# displaying the image
plt.imshow(testImage)
# displaying the image as an array
print(testImage)
###############################################
# In th... | 23.304348 | 80 | 0.689366 |
import matplotlib.pyplot as plt
import matplotlib.image as img
testImage = img.imread('g4g.png')
plt.imshow(testImage)
print(testImage)
| true | true |
f72b72d7b104572721fe60e33a1bbc59a4784e63 | 827 | py | Python | setup.py | STEMinds/Eduponics-Pi-MQTT | 9a8359aaec6b0f571897cc454341d4df336a0b20 | [
"MIT"
] | 10 | 2020-08-12T08:03:00.000Z | 2021-07-07T05:42:36.000Z | setup.py | STEMinds/Eduponics-Pi-MQTT | 9a8359aaec6b0f571897cc454341d4df336a0b20 | [
"MIT"
] | null | null | null | setup.py | STEMinds/Eduponics-Pi-MQTT | 9a8359aaec6b0f571897cc454341d4df336a0b20 | [
"MIT"
] | 2 | 2020-08-15T06:50:28.000Z | 2020-08-19T06:33:23.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="eduponics-mqtt-STEMinds", # Replace with your own username
version="0.0.1",
author="Roni Gorodetsky",
author_email="contact@steminds.com",
description="Python MQTT package for STEMinds Edu... | 29.535714 | 85 | 0.657799 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="eduponics-mqtt-STEMinds",
version="0.0.1",
author="Roni Gorodetsky",
author_email="contact@steminds.com",
description="Python MQTT package for STEMinds Eduponics react-native mobile app",... | true | true |
f72b7400fbb8c82da785145fefce3095b952b913 | 3,480 | py | Python | src/m2_extra.py | josephklaw/99-CapstoneProject-201920 | 0e8b8a652a8694e453c57ff42c412043e02b9800 | [
"MIT"
] | null | null | null | src/m2_extra.py | josephklaw/99-CapstoneProject-201920 | 0e8b8a652a8694e453c57ff42c412043e02b9800 | [
"MIT"
] | null | null | null | src/m2_extra.py | josephklaw/99-CapstoneProject-201920 | 0e8b8a652a8694e453c57ff42c412043e02b9800 | [
"MIT"
] | null | null | null | import ev3dev.ev3 as ev3
import rosebot as robot
import time
def increasing_tone(initial_tone, tone_rate_increase, speed, robot):
""":type robot: rosebot.RoseBot"""
robot.drive_system.go(speed, speed)
starting_distance = robot.sensor_system.ir_proximity_sensor.get_distance_in_inches()
while True:
... | 36.631579 | 103 | 0.66408 | import ev3dev.ev3 as ev3
import rosebot as robot
import time
def increasing_tone(initial_tone, tone_rate_increase, speed, robot):
robot.drive_system.go(speed, speed)
starting_distance = robot.sensor_system.ir_proximity_sensor.get_distance_in_inches()
while True:
new_distance = robot.sensor_system.i... | true | true |
f72b748ba56730f9620b2b9c4d086d31b3c8eea7 | 101,044 | py | Python | numpy/random/tests/test_generator_mt19937.py | czgdp1807/numpy | fb314a390851d4c21f3f6a2a87cffd329219c524 | [
"BSD-3-Clause"
] | 1 | 2021-12-27T06:52:12.000Z | 2021-12-27T06:52:12.000Z | numpy/random/tests/test_generator_mt19937.py | zooba/numpy | e4894aef5c93c845081388818a2eb4264c5e1d72 | [
"BSD-3-Clause"
] | 32 | 2019-05-20T02:43:57.000Z | 2022-01-28T21:06:29.000Z | numpy/random/tests/test_generator_mt19937.py | zooba/numpy | e4894aef5c93c845081388818a2eb4264c5e1d72 | [
"BSD-3-Clause"
] | null | null | null | import sys
import hashlib
import pytest
import numpy as np
from numpy.linalg import LinAlgError
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_allclose,
assert_warns, assert_no_warnings, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
from numpy.random import G... | 42.101667 | 90 | 0.581331 | import sys
import hashlib
import pytest
import numpy as np
from numpy.linalg import LinAlgError
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_allclose,
assert_warns, assert_no_warnings, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
from numpy.random import G... | true | true |
f72b75b24d8df7b71d3467658ad40886dad96118 | 454 | py | Python | snacks/models.py | anas-abusaif/djangox | 969dbb9ade0f242f250bd65a1a0d6893d1fea07f | [
"MIT"
] | null | null | null | snacks/models.py | anas-abusaif/djangox | 969dbb9ade0f242f250bd65a1a0d6893d1fea07f | [
"MIT"
] | null | null | null | snacks/models.py | anas-abusaif/djangox | 969dbb9ade0f242f250bd65a1a0d6893d1fea07f | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
# Create your models here.
class Snack(models.Model):
title = models.CharField(max_length=64)
purchaser = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
description = models.TextField()
... | 28.375 | 75 | 0.759912 | from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
class Snack(models.Model):
title = models.CharField(max_length=64)
purchaser = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
description = models.TextField()
def __str__(self) -> str:
... | true | true |
f72b75d390d9cde5998e85de12cd980938336177 | 5,168 | py | Python | rllib/examples/env/parametric_actions_cartpole.py | daobook/ray | af9f1ef4dc160e0671206556b387f8017f3c3930 | [
"Apache-2.0"
] | 33 | 2020-05-27T14:25:24.000Z | 2022-03-22T06:11:30.000Z | rllib/examples/env/parametric_actions_cartpole.py | daobook/ray | af9f1ef4dc160e0671206556b387f8017f3c3930 | [
"Apache-2.0"
] | 227 | 2021-10-01T08:00:01.000Z | 2021-12-28T16:47:26.000Z | rllib/examples/env/parametric_actions_cartpole.py | gramhagen/ray | c18caa4db36d466718bdbcb2229aa0b2dc03da1f | [
"Apache-2.0"
] | 5 | 2020-08-06T15:53:07.000Z | 2022-02-09T03:31:31.000Z | import gym
from gym.spaces import Box, Dict, Discrete
import numpy as np
import random
class ParametricActionsCartPole(gym.Env):
"""Parametric action version of CartPole.
In this env there are only ever two valid actions, but we pretend there are
actually up to `max_avail_actions` actions that can be tak... | 38.567164 | 79 | 0.615906 | import gym
from gym.spaces import Box, Dict, Discrete
import numpy as np
import random
class ParametricActionsCartPole(gym.Env):
def __init__(self, max_avail_actions):
self.left_action_embed = np.random.randn(2)
self.right_action_embed = np.random.randn(2)
self.action_space = Dis... | true | true |
f72b75dd9e026a6ef00652afd5b76efddbde22d2 | 192 | py | Python | captain_comeback/restart/messages.py | waldo2590/captain-comeback | e02e3774eab62d7b8ba454331a785e2ae32c89fc | [
"MIT"
] | null | null | null | captain_comeback/restart/messages.py | waldo2590/captain-comeback | e02e3774eab62d7b8ba454331a785e2ae32c89fc | [
"MIT"
] | null | null | null | captain_comeback/restart/messages.py | waldo2590/captain-comeback | e02e3774eab62d7b8ba454331a785e2ae32c89fc | [
"MIT"
] | 1 | 2020-10-27T06:40:08.000Z | 2020-10-27T06:40:08.000Z | # coding:utf-8
class RestartRequestedMessage(object):
def __init__(self, cg):
self.cg = cg
class RestartCompleteMessage(object):
def __init__(self, cg):
self.cg = cg
| 19.2 | 38 | 0.661458 |
class RestartRequestedMessage(object):
def __init__(self, cg):
self.cg = cg
class RestartCompleteMessage(object):
def __init__(self, cg):
self.cg = cg
| true | true |
f72b75e5be3cd503344771ffbf3987aff531bc9b | 416 | py | Python | plotly/validators/scatterpolar/_thetasrc.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/scatterpolar/_thetasrc.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/scatterpolar/_thetasrc.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class ThetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name='thetasrc', parent_name='scatterpolar', **kwargs
):
super(ThetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | 26 | 74 | 0.629808 | import _plotly_utils.basevalidators
class ThetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name='thetasrc', parent_name='scatterpolar', **kwargs
):
super(ThetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=par... | true | true |
f72b76631a7a3c4e17aca32054d6f0a3ca9e33a8 | 14,058 | py | Python | jax_omeroutils/importer.py | mellertd/jax-omeroutils | 0190522109f9476e25f55292693dfa56f1037606 | [
"MIT"
] | null | null | null | jax_omeroutils/importer.py | mellertd/jax-omeroutils | 0190522109f9476e25f55292693dfa56f1037606 | [
"MIT"
] | null | null | null | jax_omeroutils/importer.py | mellertd/jax-omeroutils | 0190522109f9476e25f55292693dfa56f1037606 | [
"MIT"
] | null | null | null | """
This module is for managing OMERO imports, making use of the OMERO CLI,
which can be called from a Python script. Note that this code requires
a properly structured import.json file, which is produced during data
intake (using the intake.py module).
"""
import logging
from ezomero import post_dataset, post_projec... | 34.121359 | 79 | 0.583155 |
import logging
from ezomero import post_dataset, post_project
from ezomero import get_image_ids, link_images_to_dataset
from ezomero import post_screen, link_plates_to_screen
from importlib import import_module
from omero.cli import CLI
from omero.plugins.sessions import SessionsControl
from omero.rtypes import rstri... | true | true |
f72b767f4b0695212462ecc1142bccc223f481ec | 755 | py | Python | meraki/api/content_filtering_categories.py | fsandberg/dashboard-api-python | c01ff038643a39bd12660d2719375eeb05c7ba24 | [
"MIT"
] | null | null | null | meraki/api/content_filtering_categories.py | fsandberg/dashboard-api-python | c01ff038643a39bd12660d2719375eeb05c7ba24 | [
"MIT"
] | null | null | null | meraki/api/content_filtering_categories.py | fsandberg/dashboard-api-python | c01ff038643a39bd12660d2719375eeb05c7ba24 | [
"MIT"
] | null | null | null | class ContentFilteringCategories(object):
def __init__(self, session):
super(ContentFilteringCategories, self).__init__()
self._session = session
def getNetworkContentFilteringCategories(self, networkId: str):
"""
**List all available content filtering categories for an MX n... | 34.318182 | 97 | 0.651656 | class ContentFilteringCategories(object):
def __init__(self, session):
super(ContentFilteringCategories, self).__init__()
self._session = session
def getNetworkContentFilteringCategories(self, networkId: str):
metadata = {
'tags': ['Content filtering categories'],
... | true | true |
f72b76cf495d554aada39527fcd895707831533d | 540 | py | Python | model/group_data.py | AlexeyKozlov/python_training-master | 5e677e8be521bffac027843c5ba049695ca31492 | [
"Apache-2.0"
] | null | null | null | model/group_data.py | AlexeyKozlov/python_training-master | 5e677e8be521bffac027843c5ba049695ca31492 | [
"Apache-2.0"
] | null | null | null | model/group_data.py | AlexeyKozlov/python_training-master | 5e677e8be521bffac027843c5ba049695ca31492 | [
"Apache-2.0"
] | null | null | null |
from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s" % (self.id, self.name)
def __eq__(self, other):
... | 21.6 | 103 | 0.574074 |
from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s" % (self.id, self.name)
def __eq__(self, other):
... | true | true |
f72b773ac9b1776af73d49d00186f6e6bae720af | 576 | py | Python | step4.py | rezabojnordi/learning-image-processing | b0abb4005428af40dda3958561b7a78cfc6bafa6 | [
"MIT"
] | null | null | null | step4.py | rezabojnordi/learning-image-processing | b0abb4005428af40dda3958561b7a78cfc6bafa6 | [
"MIT"
] | null | null | null | step4.py | rezabojnordi/learning-image-processing | b0abb4005428af40dda3958561b7a78cfc6bafa6 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
cap = cv2.VideoCapture(1) # number 0 for one camera
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc,24.0,(640,480)) #params 3 = fram rate speed fram for save
# GRAY SCALE FOR ALL PIC
while(True): #video is pics
... | 28.8 | 100 | 0.689236 | import cv2
import numpy as np
from matplotlib import pyplot as plt
cap = cv2.VideoCapture(1)
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out = cv2.VideoWriter('output.avi',fourcc,24.0,(640,480))
while(True):
ret,fram = cap.read()
gray = cv2.cvtColor(fram,cv2.COLOR_BGR2GRAY)
out.write(fram)
cv2.imsh... | true | true |
f72b7753eec3b5170014e7cf49eb5e0152bc3dab | 1,282 | py | Python | custom/new/new.py | freepoet/mmdetection | 74894c36da600014c372646c34ff4838d6968942 | [
"Apache-2.0"
] | 1 | 2021-01-21T14:20:48.000Z | 2021-01-21T14:20:48.000Z | custom/new/new.py | freepoet/mmdetection | 74894c36da600014c372646c34ff4838d6968942 | [
"Apache-2.0"
] | null | null | null | custom/new/new.py | freepoet/mmdetection | 74894c36da600014c372646c34ff4838d6968942 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#读取mnist数据集字符图片
import torch
import torchvision
from PIL import Image
import cv2
import numpy as np
import os
import gzip
import matplotlib
import matplotlib.pyplot as pltsfas
# 定义加载数据的函数,data_folder为保存gz数据的文件夹,该文件夹下有4个文件
# 'train-labels-idx1-ubyte.gz', 'train-images-idx3-ubyte.gz',
# 't10k-labe... | 29.136364 | 92 | 0.690328 |
import torch
import torchvision
from PIL import Image
import cv2
import numpy as np
import os
import gzip
import matplotlib
import matplotlib.pyplot as pltsfas
def load_data(data_folder):
files = [
'train-labels-idx1-ubyte.gz', 'train-images-idx3-ubyte.gz',
't10k-labels-idx1-ubyte.gz', 't10k-images-i... | true | true |
f72b78257722b6c8736302bff4164efaba35af74 | 176 | py | Python | Day01-15/code/Day02/variable1.py | bdfd/Python_Zero2Hero_DS | 9dafe90b8112fdc3d07e1aa02e41ed3f019f733c | [
"MIT"
] | 3 | 2022-01-15T19:06:19.000Z | 2022-01-18T16:47:27.000Z | Day01-15/code/Day02/variable1.py | bdfd/4.5_Data-Science-Python-Zero2Hero- | 9dafe90b8112fdc3d07e1aa02e41ed3f019f733c | [
"MIT"
] | null | null | null | Day01-15/code/Day02/variable1.py | bdfd/4.5_Data-Science-Python-Zero2Hero- | 9dafe90b8112fdc3d07e1aa02e41ed3f019f733c | [
"MIT"
] | 1 | 2022-01-09T00:18:49.000Z | 2022-01-09T00:18:49.000Z | """
使用变量保存数据并进行操作
Version: 0.1
Author: BDFD
Date: 2018-02-27
"""
a = 321
b = 123
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
print(a % b)
print(a ** b)
| 9.777778 | 16 | 0.573864 |
a = 321
b = 123
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
print(a % b)
print(a ** b)
| true | true |
f72b7a277c123afcf6d76434f86d3383e699a8fc | 3,379 | py | Python | setup.py | rajivshah3/checkov | c6a6eca21bedae50574814c92973b65d2d963581 | [
"Apache-2.0"
] | 1 | 2021-02-16T15:07:29.000Z | 2021-02-16T15:07:29.000Z | setup.py | rajivshah3/checkov | c6a6eca21bedae50574814c92973b65d2d963581 | [
"Apache-2.0"
] | null | null | null | setup.py | rajivshah3/checkov | c6a6eca21bedae50574814c92973b65d2d963581 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import logging
import os
from importlib import util
from os import path
import setuptools
from setuptools import setup
# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_... | 30.441441 | 79 | 0.527671 |
import logging
import os
from importlib import util
from os import path
import setuptools
from setuptools import setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
logger = logging.getLogger(__name__)... | true | true |
f72b7a44c047b0c5eed99383fa2b7f7c2da824b8 | 3,974 | py | Python | geeksurvey/views.py | NAU-SuperGeeks/geeksurvey | ee2fd0d2869f3b8b5c058d8a39c64c2d0b0c2a26 | [
"MIT"
] | 3 | 2022-01-01T23:00:45.000Z | 2022-02-26T23:35:46.000Z | geeksurvey/views.py | NAU-SuperGeeks/geeksurvey | ee2fd0d2869f3b8b5c058d8a39c64c2d0b0c2a26 | [
"MIT"
] | 5 | 2022-02-12T17:52:52.000Z | 2022-03-02T16:08:08.000Z | geeksurvey/views.py | NAU-SuperGeeks/geeksurvey | ee2fd0d2869f3b8b5c058d8a39c64c2d0b0c2a26 | [
"MIT"
] | 4 | 2022-01-12T18:47:20.000Z | 2022-01-12T19:11:59.000Z | from django.core.mail import send_mail
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import lo... | 29.879699 | 92 | 0.67539 | from django.core.mail import send_mail
from django.shortcuts import render, get_object_or_404, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import lo... | true | true |
f72b7a4a8f6c0949e5829db8520e9af17ce1d0a0 | 463 | py | Python | docs/newplatform.py | PlayerG9/PyMessageBox | 21b113c5e1a322e8412a412df071cc392b40d7c5 | [
"MIT"
] | 2 | 2021-06-28T12:35:08.000Z | 2022-03-11T16:48:01.000Z | docs/newplatform.py | PlayerG9/PyMessageBox | 21b113c5e1a322e8412a412df071cc392b40d7c5 | [
"MIT"
] | null | null | null | docs/newplatform.py | PlayerG9/PyMessageBox | 21b113c5e1a322e8412a412df071cc392b40d7c5 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
r"""
"""
def showinfo(title: str, message: str):
pass
def showwarning(title: str, message: str):
pass
def showerror(title: str, message: str):
pass
def askquestion(title: str, message: str):
pass
def askokcancel(title: str, message: str):
pass
def askyesno(title: ... | 12.513514 | 45 | 0.641469 |
def showinfo(title: str, message: str):
pass
def showwarning(title: str, message: str):
pass
def showerror(title: str, message: str):
pass
def askquestion(title: str, message: str):
pass
def askokcancel(title: str, message: str):
pass
def askyesno(title: str, message: str):
pass
d... | true | true |
f72b7a657af7cedbaad0f606f0d079a66c7b1ee8 | 314 | py | Python | home/models.py | nikhilchaudhary0126/neva | f86b6d2dfa047360f6e07a621b985faa2120d009 | [
"MIT"
] | null | null | null | home/models.py | nikhilchaudhary0126/neva | f86b6d2dfa047360f6e07a621b985faa2120d009 | [
"MIT"
] | null | null | null | home/models.py | nikhilchaudhary0126/neva | f86b6d2dfa047360f6e07a621b985faa2120d009 | [
"MIT"
] | null | null | null | from django.db import models
class Location(models.Model):
address = models.CharField(max_length=30)
addresstype = models.CharField(max_length=20)
city = models.CharField(max_length=30)
state = models.CharField(max_length=30)
latitude = models.FloatField()
longitude = models.FloatField() | 31.4 | 49 | 0.738854 | from django.db import models
class Location(models.Model):
address = models.CharField(max_length=30)
addresstype = models.CharField(max_length=20)
city = models.CharField(max_length=30)
state = models.CharField(max_length=30)
latitude = models.FloatField()
longitude = models.FloatField() | true | true |
f72b7ac60389bda7cc60bcc36a3a0881db868e79 | 170 | py | Python | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_MovingAverage_Seasonal_DayOfMonth_LSTM.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_MovingAverage_Seasonal_DayOfMonth_LSTM.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_MovingAverage_Seasonal_DayOfMonth_LSTM.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | 42.5 | 97 | 0.770588 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['MovingAverage'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | true | true |
f72b7c7528116153eec48525b0ed3411067b3ddc | 4,627 | py | Python | doc/pvtol-nested.py | stelselim/python-control | d73b635d2b130af5c2829eefd59c99b9bd53fb01 | [
"BSD-3-Clause"
] | 1,112 | 2015-01-14T08:01:33.000Z | 2022-03-31T11:54:00.000Z | doc/pvtol-nested.py | stelselim/python-control | d73b635d2b130af5c2829eefd59c99b9bd53fb01 | [
"BSD-3-Clause"
] | 646 | 2015-02-02T15:35:23.000Z | 2022-03-30T08:19:26.000Z | doc/pvtol-nested.py | stelselim/python-control | d73b635d2b130af5c2829eefd59c99b9bd53fb01 | [
"BSD-3-Clause"
] | 366 | 2015-01-28T17:58:06.000Z | 2022-03-29T11:04:10.000Z | # pvtol-nested.py - inner/outer design for vectored thrust aircraft
# RMM, 5 Sep 09
#
# This file works through a fairly complicated control design and
# analysis, corresponding to the planar vertical takeoff and landing
# (PVTOL) aircraft in Astrom and Murray, Chapter 11. It is intended
# to demonstrate the basic fun... | 25.849162 | 76 | 0.661336 |
from __future__ import print_function
import os
import matplotlib.pyplot as plt
from control.matlab import *
import numpy as np
m = 4
J = 0.0475
r = 0.25
g = 9.8
c = 0.05
Pi = tf([r], [J, 0, 0])
Po = tf([1], [m, c, 0])
k, a... | true | true |
f72b7e5c1c47e2d9063b237e29c8de4e5ecad2aa | 4,093 | py | Python | utils/vocab_reader.py | aaj-fullfact/slot_filling_and_intent_detection_of_SLU | 27adf381b9b087caa1e90bfafb88765e5e296192 | [
"Apache-2.0"
] | 361 | 2019-06-17T08:37:49.000Z | 2022-03-29T20:46:15.000Z | utils/vocab_reader.py | aaj-fullfact/slot_filling_and_intent_detection_of_SLU | 27adf381b9b087caa1e90bfafb88765e5e296192 | [
"Apache-2.0"
] | 9 | 2019-07-03T06:38:36.000Z | 2021-12-09T12:08:56.000Z | utils/vocab_reader.py | aaj-fullfact/slot_filling_and_intent_detection_of_SLU | 27adf381b9b087caa1e90bfafb88765e5e296192 | [
"Apache-2.0"
] | 100 | 2019-06-17T03:04:36.000Z | 2022-03-21T21:07:30.000Z | """Data utilities."""
#import torch
import operator
#import json
def read_vocab_file(vocab_path, bos_eos=False, no_pad=False, no_unk=False, separator=':'):
'''file format: "word : idx" '''
word2id, id2word = {}, {}
if not no_pad:
word2id['<pad>'] = len(word2id)
id2word[len(id2word)] = '<pad... | 31.976563 | 142 | 0.50623 |
import operator
def read_vocab_file(vocab_path, bos_eos=False, no_pad=False, no_unk=False, separator=':'):
word2id, id2word = {}, {}
if not no_pad:
word2id['<pad>'] = len(word2id)
id2word[len(id2word)] = '<pad>'
if not no_unk:
word2id['<unk>'] = len(word2id)
id2word[len(id... | true | true |
f72b7f156678de318e745bd933773f338fc00cc7 | 15,626 | py | Python | tests/jet_test.py | machineko/jax | 5a9048a0058d027000afc5707413d24209aa6f9f | [
"Apache-2.0"
] | 7 | 2020-12-04T16:54:54.000Z | 2022-02-15T07:26:56.000Z | tests/jet_test.py | josephrocca/jax | ab544cb26dfea3147c336754d3e3eb457a405e38 | [
"Apache-2.0"
] | 20 | 2021-08-17T20:31:56.000Z | 2022-03-31T11:56:24.000Z | tests/jet_test.py | kbnarayanavit/jax | 1e3c4833c97302caf6046ff99656b8ff21430b8d | [
"Apache-2.0"
] | 1 | 2021-08-11T20:57:59.000Z | 2021-08-11T20:57:59.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.653012 | 114 | 0.656534 |
from functools import reduce, partial
from absl.testing import absltest
import numpy as np
import unittest
import jax
from jax import test_util as jtu
import jax.numpy as jnp
import jax.scipy.special
from jax import random
from jax import jacfwd, jit
from jax.experimental import stax
from jax.experimen... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.