hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f714a7605ee022f93df4415ea3b71026282a989e | 30 | py | Python | dolphindb_numpy/polynomial/__init__.py | jiajiaxu123/Orca | e86189e70c1d0387816bb98b8047a6232fbda9df | [
"Apache-2.0"
] | 20 | 2019-12-02T11:49:12.000Z | 2021-12-24T19:34:32.000Z | dolphindb_numpy/polynomial/__init__.py | jiajiaxu123/Orca | e86189e70c1d0387816bb98b8047a6232fbda9df | [
"Apache-2.0"
] | null | null | null | dolphindb_numpy/polynomial/__init__.py | jiajiaxu123/Orca | e86189e70c1d0387816bb98b8047a6232fbda9df | [
"Apache-2.0"
] | 5 | 2019-12-02T12:16:22.000Z | 2021-10-22T02:27:47.000Z | from numpy.polynomial import * | 30 | 30 | 0.833333 | from numpy.polynomial import * | true | true |
f714a765ed3fdb8802a47ef9a05184c1987b46ec | 2,243 | py | Python | transfer/rcvfromelf.py | arhefner/max_mon | 75c02804089c957c53bf5f68c52f89ba5ceeb5bc | [
"MIT"
] | null | null | null | transfer/rcvfromelf.py | arhefner/max_mon | 75c02804089c957c53bf5f68c52f89ba5ceeb5bc | [
"MIT"
] | null | null | null | transfer/rcvfromelf.py | arhefner/max_mon | 75c02804089c957c53bf5f68c52f89ba5ceeb5bc | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import click
import serial
from enum import Enum, auto
from intelhex import IntelHex,IntelHexError
import constants
@click.command()
@click.argument(
'file',
required=True,
type=click.Path(dir_okay=False, writable=True)
)
@click.option(
'--append', '-a',
help='append data to... | 27.353659 | 68 | 0.532769 | import click
import serial
from enum import Enum, auto
from intelhex import IntelHex,IntelHexError
import constants
@click.command()
@click.argument(
'file',
required=True,
type=click.Path(dir_okay=False, writable=True)
)
@click.option(
'--append', '-a',
help='append data to hex file',
is_flag=... | true | true |
f714a790e3dbb16554cbe41c2190b6201936b882 | 1,522 | py | Python | app.py | tylerhand/cals-floor | e8f88641e73425ad911f91984b0915cc0cec5446 | [
"MIT"
] | null | null | null | app.py | tylerhand/cals-floor | e8f88641e73425ad911f91984b0915cc0cec5446 | [
"MIT"
] | 2 | 2019-08-12T05:21:10.000Z | 2019-08-24T20:18:03.000Z | app.py | tylerhand/cals-floor | e8f88641e73425ad911f91984b0915cc0cec5446 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, redirect, abort, send_file
from flaskext.markdown import Markdown
import os.path
from config import config
app = Flask(__name__)
Markdown(app)
site_title=config['site_title']
site_all_notification=config['site_all_notification']
footer='<small class="m-0 text-center text-whi... | 31.061224 | 196 | 0.756899 | from flask import Flask, render_template, redirect, abort, send_file
from flaskext.markdown import Markdown
import os.path
from config import config
app = Flask(__name__)
Markdown(app)
site_title=config['site_title']
site_all_notification=config['site_all_notification']
footer='<small class="m-0 text-center text-whi... | true | true |
f714a7f94b14209c01ac9354696aa33df0b5f72f | 7,695 | py | Python | docs/conf.py | hayata-yamamoto/tgs | 9ace499b572afb72bdd43a579bb2520d5aa24e85 | [
"MIT"
] | 1 | 2018-07-21T07:35:05.000Z | 2018-07-21T07:35:05.000Z | docs/conf.py | hayata-yamamoto/tgs | 9ace499b572afb72bdd43a579bb2520d5aa24e85 | [
"MIT"
] | 3 | 2018-07-21T07:39:59.000Z | 2018-07-21T08:54:33.000Z | docs/conf.py | hayata-yamamoto/tgs | 9ace499b572afb72bdd43a579bb2520d5aa24e85 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# tgs documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a def... | 31.408163 | 80 | 0.704483 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'tgs'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/... | true | true |
f714a8349c35175175f8b080184942a963cc06c4 | 7,278 | py | Python | onir/datasets/irds.py | Georgetown-IR-Lab/OpenNIR | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | [
"MIT"
] | 140 | 2020-02-05T23:48:53.000Z | 2022-03-29T03:47:31.000Z | onir/datasets/irds.py | Georgetown-IR-Lab/OpenNIR | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | [
"MIT"
] | 33 | 2020-03-19T22:07:58.000Z | 2022-02-23T15:18:29.000Z | onir/datasets/irds.py | Georgetown-IR-Lab/OpenNIR | 7d93e8643fe311e3e9c7a0678efe9775fd80485e | [
"MIT"
] | 16 | 2020-03-19T19:01:04.000Z | 2021-12-12T04:18:57.000Z | import os
import io
import itertools
import gzip
import tarfile
import zipfile
import contextlib
import functools
from tqdm import tqdm
from pytools import memoize_method
import pandas as pd
import ir_datasets
import onir
from onir import util, datasets, indices
from onir.interfaces import trec, plaintext
def sanitiz... | 44.109091 | 132 | 0.632454 | import os
import io
import itertools
import gzip
import tarfile
import zipfile
import contextlib
import functools
from tqdm import tqdm
from pytools import memoize_method
import pandas as pd
import ir_datasets
import onir
from onir import util, datasets, indices
from onir.interfaces import trec, plaintext
def sanitiz... | true | true |
f714a85c25186d4ad6710276141011796da70208 | 89 | py | Python | unidade/apps.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | 1 | 2017-04-27T19:26:49.000Z | 2017-04-27T19:26:49.000Z | unidade/apps.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | null | null | null | unidade/apps.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UnidadeConfig(AppConfig):
name = 'unidade'
| 14.833333 | 33 | 0.752809 | from django.apps import AppConfig
class UnidadeConfig(AppConfig):
name = 'unidade'
| true | true |
f714a8ad00f77d833fe83f5364b33aa3d0322404 | 988 | py | Python | python/paddle/fluid/tests/unittests/test_dist_mnist_lars.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/test_dist_mnist_lars.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_dist_mnist_lars.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2018 PaddlePaddle 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 appli... | 30.875 | 74 | 0.751012 |
from __future__ import print_function
import unittest
from test_dist_base import TestDistBase
class TestDistMnist2x2Lars(TestDistBase):
def _setup_config(self):
self._sync_mode = True
self._use_reduce = False
def test_se_resnext(self):
self.check_with_place("dist_mnist_lars.py", del... | true | true |
f714a910233f8c72b6035a03576874ffbf9fc901 | 152,100 | py | Python | salt/modules/cmdmod.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | salt/modules/cmdmod.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | salt/modules/cmdmod.py | guoxiaod/salt | 2cd6c03b40932be137e6e8a672967b59025a2d34 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A module for shelling out.
Keep in mind that this module is insecure, in that it can give whomever has
access to the master root execution access to all salt minions.
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import functools
import g... | 37.389381 | 121 | 0.598685 | from __future__ import absolute_import, print_function, unicode_literals
import functools
import glob
import logging
import os
import shutil
import subprocess
import sys
import time
import traceback
import fnmatch
import base64
import re
import tempfile
import salt.utils.args
import salt.utils.data
import salt.utils.... | true | true |
f714a941e1710abfe811a893f00e369a5965accf | 37,199 | py | Python | src/windows10_system_logger.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | 1 | 2019-11-19T00:14:03.000Z | 2019-11-19T00:14:03.000Z | src/windows10_system_logger.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | null | null | null | src/windows10_system_logger.py | mikefeneley/stig_windows10 | 1f2a27e89d27a25768f2edc5d9f25ec6d11d4cb0 | [
"MIT"
] | 1 | 2017-10-03T03:21:27.000Z | 2017-10-03T03:21:27.000Z |
DEFAULT_CONFIG = "Windows10SystemLog.txt"
class Windows10SystemLogger:
"""
Windows10SystemLogger writes error messages to the Windows10 System log
file for every rule in the Windows10 STIG that is violated.
"""
def __init__(self, filename=DEFAULT_CONFIG):
self.filename = f... | 45.642945 | 186 | 0.625581 |
DEFAULT_CONFIG = "Windows10SystemLog.txt"
class Windows10SystemLogger:
def __init__(self, filename=DEFAULT_CONFIG):
self.filename = filename
self.log = open(filename, 'w')
self.log.write("#########################\n\n")
self.log.write("Windows10 System Audit Finding... | true | true |
f714a9a3b54319c86838c7546260c190131c7098 | 1,978 | py | Python | test/TestExpressionParser.py | imrushabh/cronjob-expression-parser | 8e577245e7956fa85222bbc5f37beb13aba7819b | [
"MIT"
] | null | null | null | test/TestExpressionParser.py | imrushabh/cronjob-expression-parser | 8e577245e7956fa85222bbc5f37beb13aba7819b | [
"MIT"
] | null | null | null | test/TestExpressionParser.py | imrushabh/cronjob-expression-parser | 8e577245e7956fa85222bbc5f37beb13aba7819b | [
"MIT"
] | null | null | null | import TestConstants
from generator.ExpressionParser import ExpressionParser
import unittest
class TestExpressionParser(unittest.TestCase):
# Test to verify the minute functionality & */multiple expression check.
def test_valid_minute_parsing(self):
expressionParser = ExpressionParser(TestConstants.V... | 52.052632 | 109 | 0.776036 | import TestConstants
from generator.ExpressionParser import ExpressionParser
import unittest
class TestExpressionParser(unittest.TestCase):
def test_valid_minute_parsing(self):
expressionParser = ExpressionParser(TestConstants.Valid_cron_expression)
self.assertListEqual(expressionParser._pars... | true | true |
f714aa4914f7a4f30b2904dd1876178860dd2364 | 44,061 | py | Python | zerver/tests/test_slack_importer.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-03-17T14:58:50.000Z | 2020-03-17T14:58:50.000Z | zerver/tests/test_slack_importer.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_slack_importer.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-07-16T06:00:10.000Z | 2020-07-16T06:00:10.000Z | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils.timezone import now as timezone_now
from zerver.data_import.slack import (
get_slack_api_data,
get_admin,
get_guest,
get_user_timezone,
fetch_shared_channel_users,
users_to_zerver_userprofile,
get_subscription,
c... | 52.204976 | 142 | 0.615737 | from django.conf import settings
from django.utils.timezone import now as timezone_now
from zerver.data_import.slack import (
get_slack_api_data,
get_admin,
get_guest,
get_user_timezone,
fetch_shared_channel_users,
users_to_zerver_userprofile,
get_subscription,
channels_to_zerver_stream... | true | true |
f714ab74caa7e9e880df60f9b2934a8d8fa7d891 | 682 | py | Python | mfr_rst/tests/test_rst.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | mfr_rst/tests/test_rst.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | mfr_rst/tests/test_rst.py | erinspace/modular-file-renderer | acbc1ea188173832dd9d0e037b55653557a04704 | [
"Apache-2.0"
] | null | null | null | import pytest
import mfr
import mfr_rst
def test_detect(fakefile):
# set filename to have .rst extension
fakefile.name = 'mydoc.rst'
handler = mfr_rst.Handler()
assert handler.detect(fakefile) is True
@pytest.mark.parametrize('filename', [
'other.rs',
'otherrst',
'other',
'other.',
]... | 22.733333 | 62 | 0.705279 | import pytest
import mfr
import mfr_rst
def test_detect(fakefile):
fakefile.name = 'mydoc.rst'
handler = mfr_rst.Handler()
assert handler.detect(fakefile) is True
@pytest.mark.parametrize('filename', [
'other.rs',
'otherrst',
'other',
'other.',
])
def test_does_not_detect_other_exten... | true | true |
f714aba34194863f081881943a6ccb4ee1151632 | 1,252 | py | Python | pyfronius/tests/web_raw/v0/web_state.py | mgrela/pyfronius | 0ed5b0d4032870292576336b66922360a1fcd4a2 | [
"MIT"
] | null | null | null | pyfronius/tests/web_raw/v0/web_state.py | mgrela/pyfronius | 0ed5b0d4032870292576336b66922360a1fcd4a2 | [
"MIT"
] | null | null | null | pyfronius/tests/web_raw/v0/web_state.py | mgrela/pyfronius | 0ed5b0d4032870292576336b66922360a1fcd4a2 | [
"MIT"
] | null | null | null | GET_INVERTER_REALTIME_DATA_SCOPE_DEVICE = {
"timestamp": {"value": "2020-09-18T14:14:24-07:00"},
"status": {"Code": 0, "Reason": "", "UserMessage": ""},
"energy_day": {"value": 6000, "unit": "Wh"},
"energy_total": {"value": 35611000, "unit": "Wh"},
"energy_year": {"value": 3310000, "unit": "Wh"},
... | 40.387097 | 62 | 0.51278 | GET_INVERTER_REALTIME_DATA_SCOPE_DEVICE = {
"timestamp": {"value": "2020-09-18T14:14:24-07:00"},
"status": {"Code": 0, "Reason": "", "UserMessage": ""},
"energy_day": {"value": 6000, "unit": "Wh"},
"energy_total": {"value": 35611000, "unit": "Wh"},
"energy_year": {"value": 3310000, "unit": "Wh"},
... | true | true |
f714ad0d90636742e89950dcb0be23eb7b1ca571 | 9,508 | py | Python | axi/planner.py | ejkaplan/axi | cb17cc3ec8093b1f029674dce88711a9c8a293db | [
"MIT"
] | null | null | null | axi/planner.py | ejkaplan/axi | cb17cc3ec8093b1f029674dce88711a9c8a293db | [
"MIT"
] | null | null | null | axi/planner.py | ejkaplan/axi | cb17cc3ec8093b1f029674dce88711a9c8a293db | [
"MIT"
] | null | null | null | from __future__ import division
from bisect import bisect
from collections import namedtuple
from math import sqrt, hypot
# a planner computes a motion profile for a list of (x, y) points
class Planner(object):
def __init__(self, acceleration, max_velocity, corner_factor):
self.acceleration = acceleratio... | 29.436533 | 86 | 0.538915 | from __future__ import division
from bisect import bisect
from collections import namedtuple
from math import sqrt, hypot
class Planner(object):
def __init__(self, acceleration, max_velocity, corner_factor):
self.acceleration = acceleration
self.max_velocity = max_velocity
self.corner_fac... | true | true |
f714ad9713e72b5a8334c0e62b82795f8e43fffe | 20,736 | py | Python | mpf/devices/logic_blocks.py | Wolfmarsh/mpf | ad71f381ce8a0e65f28958e51cf8a8b38a6154fb | [
"MIT"
] | null | null | null | mpf/devices/logic_blocks.py | Wolfmarsh/mpf | ad71f381ce8a0e65f28958e51cf8a8b38a6154fb | [
"MIT"
] | null | null | null | mpf/devices/logic_blocks.py | Wolfmarsh/mpf | ad71f381ce8a0e65f28958e51cf8a8b38a6154fb | [
"MIT"
] | null | null | null | """Logic Blocks devices."""
from typing import Any, List
from mpf.core.delays import DelayManager
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.machine import MachineController
from mpf.core.mode import Mode
from mpf.core.mode_device import ModeDevice
from mp... | 34.733668 | 119 | 0.624904 | from typing import Any, List
from mpf.core.delays import DelayManager
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.events import event_handler
from mpf.core.machine import MachineController
from mpf.core.mode import Mode
from mpf.core.mode_device import ModeDevice
from mpf.core.player import Player
... | true | true |
f714ad9a06849425b9f24c8d797c655c90f7b75e | 4,463 | py | Python | newapi/ooniapi/prio.py | cyBerta/api | af8e15a800ffc272799a269f4801cbdd174d0c43 | [
"BSD-3-Clause"
] | null | null | null | newapi/ooniapi/prio.py | cyBerta/api | af8e15a800ffc272799a269f4801cbdd174d0c43 | [
"BSD-3-Clause"
] | null | null | null | newapi/ooniapi/prio.py | cyBerta/api | af8e15a800ffc272799a269f4801cbdd174d0c43 | [
"BSD-3-Clause"
] | null | null | null | """
OONI Probe Services API - URL prioritization
"""
from typing import List
import random
import time
from flask import Blueprint, current_app, request
from flask.json import jsonify
prio_bp = Blueprint("prio", "probe_services_prio")
# TODO add unit tests
test_items = {}
last_update_time = 0
def update_url_pri... | 28.980519 | 81 | 0.599149 |
from typing import List
import random
import time
from flask import Blueprint, current_app, request
from flask.json import jsonify
prio_bp = Blueprint("prio", "probe_services_prio")
test_items = {}
last_update_time = 0
def update_url_prioritization():
log = current_app.logger
log.info("Started update_url... | true | true |
f714af1996211444cf3b111bbef2e05f72c01ea6 | 7,708 | py | Python | ibmsecurity/isam/base/extensions.py | zone-zero/ibmsecurity | 7d3e38104b67e1b267e18a44845cb756a5302c3d | [
"Apache-2.0"
] | 46 | 2017-03-21T21:08:59.000Z | 2022-02-20T22:03:46.000Z | ibmsecurity/isam/base/extensions.py | zone-zero/ibmsecurity | 7d3e38104b67e1b267e18a44845cb756a5302c3d | [
"Apache-2.0"
] | 201 | 2017-03-21T21:25:52.000Z | 2022-03-30T21:38:20.000Z | ibmsecurity/isam/base/extensions.py | zone-zero/ibmsecurity | 7d3e38104b67e1b267e18a44845cb756a5302c3d | [
"Apache-2.0"
] | 91 | 2017-03-22T16:25:36.000Z | 2022-02-04T04:36:29.000Z | import json
import logging
import ibmsecurity.utilities.tools
from ibmsecurity.utilities import tools
from io import open
logger = logging.getLogger(__name__)
uri = "/extensions"
requires_modules = None
requires_version = "9.0.5.0"
try:
basestring
except NameError:
basestring = (str, bytes)
def get_all(isa... | 34.565022 | 137 | 0.601583 | import json
import logging
import ibmsecurity.utilities.tools
from ibmsecurity.utilities import tools
from io import open
logger = logging.getLogger(__name__)
uri = "/extensions"
requires_modules = None
requires_version = "9.0.5.0"
try:
basestring
except NameError:
basestring = (str, bytes)
def get_all(isa... | true | true |
f714b043ee7c349b87647ed2e5e6463196b1863f | 946 | py | Python | ccobra/benchmark/__init__.py | CognitiveComputationLab/orca | 432753acff6072c158047000111a66f822aa51f3 | [
"MIT"
] | 9 | 2019-03-19T08:51:55.000Z | 2021-08-19T13:29:54.000Z | ccobra/benchmark/__init__.py | CognitiveComputationLab/orca | 432753acff6072c158047000111a66f822aa51f3 | [
"MIT"
] | 16 | 2018-11-27T13:30:34.000Z | 2020-06-02T14:15:12.000Z | ccobra/benchmark/__init__.py | CognitiveComputationLab/orca | 432753acff6072c158047000111a66f822aa51f3 | [
"MIT"
] | 6 | 2018-10-15T13:27:44.000Z | 2021-08-19T13:29:56.000Z | """ CCOBRA benchmark functionality.
.. rubric:: Submodules
.. autosummary::
:toctree: _autosummary
ccobra.benchmark.comparators
.. rubric:: Functions
.. autofunction:: dir_context
.. autofunction:: entry_point
.. autofunction:: fix_model_path
.. autofunction:: fix_rel_path
.. autofunction:: main
.. autofunct... | 22 | 73 | 0.758985 |
from . import comparators
from .benchmark import Benchmark, ModelInfo, fix_rel_path, fix_model_path
from .contextmanager import dir_context
from .evaluator import Evaluator
from .modelimporter import ModelImporter
from .runner import entry_point, parse_arguments, main, silence_stdout
from .evaluation_handler import E... | true | true |
f714b118c400442b20844c9947d561af1f2c1a2b | 1,990 | py | Python | kochira/services/web/google.py | gnowxilef/kochira | 817b82ad0f0893a58e8d44f8db79ddd6fc0eae77 | [
"MS-PL"
] | null | null | null | kochira/services/web/google.py | gnowxilef/kochira | 817b82ad0f0893a58e8d44f8db79ddd6fc0eae77 | [
"MS-PL"
] | null | null | null | kochira/services/web/google.py | gnowxilef/kochira | 817b82ad0f0893a58e8d44f8db79ddd6fc0eae77 | [
"MS-PL"
] | null | null | null | """
Google web search.
Run queries on Google and return results.
"""
import requests
from kochira import config
from kochira.service import Service, background, Config, coroutine
from kochira.userdata import UserData
service = Service(__name__, __doc__)
@service.config
class Config(Config):
api_key = config.F... | 22.359551 | 91 | 0.566834 |
import requests
from kochira import config
from kochira.service import Service, background, Config, coroutine
from kochira.userdata import UserData
service = Service(__name__, __doc__)
@service.config
class Config(Config):
api_key = config.Field(doc="Google API key.")
cx = config.Field(doc="Custom search e... | true | true |
f714b283ab9ae54ec531e9b15a6b3c7e23e726ab | 1,561 | py | Python | Datacamp Assignments/Data Engineer Track/8. Introduction to AWS Boto in Python/19_sns_create_multiple_topics.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | null | null | null | Datacamp Assignments/Data Engineer Track/8. Introduction to AWS Boto in Python/19_sns_create_multiple_topics.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | null | null | null | Datacamp Assignments/Data Engineer Track/8. Introduction to AWS Boto in Python/19_sns_create_multiple_topics.py | Ali-Parandeh/Data_Science_Playground | c529e9b3692381572de259e7c93938d6611d83da | [
"MIT"
] | 1 | 2021-03-10T09:40:05.000Z | 2021-03-10T09:40:05.000Z | # Creating multiple topics
# Sam suddenly became a black sheep because she is responsible for
# an onslaught of text messages and notifications to department directors.
# No one will go to lunch with her anymore!
# To fix this, she decided to create a general topic per
# department for routine notifications, and a... | 42.189189 | 409 | 0.748238 |
departments = ['trash', 'streets', 'water']
for dept in departments:
sns.create_topic(Name="{}_general".format(dept))
sns.create_topic(Name="{}_critical".format(dept))
response = sns.list_topics()
print(response['Topics'])
| true | true |
f714b3e8a0b13082e466e7c61be4a203a48afe3f | 889 | py | Python | server/utils/view_utils.py | Jordonkopp/Flask-Vue | db842f1a31f2ca4cf51ce1b2a927d6d2ad860c00 | [
"MIT"
] | 2 | 2019-02-27T16:55:01.000Z | 2019-02-27T20:23:29.000Z | server/utils/view_utils.py | Jordonkopp/Flask-Vue | db842f1a31f2ca4cf51ce1b2a927d6d2ad860c00 | [
"MIT"
] | 5 | 2020-04-30T00:01:01.000Z | 2021-10-05T19:42:15.000Z | server/utils/view_utils.py | Jordonkopp/Flask-Vue | db842f1a31f2ca4cf51ce1b2a927d6d2ad860c00 | [
"MIT"
] | null | null | null | from typing import Tuple, List
from flask import jsonify
from flask.wrappers import Response
def wrapped_response(data: dict = None, status: int = 200, message: str = "") -> Tuple[Response, int]:
"""
Create a wrapped response to have uniform json response objects
"""
if type(data) is not dict and da... | 26.939394 | 102 | 0.649044 | from typing import Tuple, List
from flask import jsonify
from flask.wrappers import Response
def wrapped_response(data: dict = None, status: int = 200, message: str = "") -> Tuple[Response, int]:
if type(data) is not dict and data is not None:
raise TypeError("Expected data to be type Dictionary")
... | true | true |
f714b4d3fcbc5ab3998518dc08e155b098493405 | 10,591 | py | Python | aws/AWSError.py | alexbredo/honeypot-s3 | f90c21e34b2c3079656a027cab9dc0cf7b2945c9 | [
"BSD-2-Clause"
] | null | null | null | aws/AWSError.py | alexbredo/honeypot-s3 | f90c21e34b2c3079656a027cab9dc0cf7b2945c9 | [
"BSD-2-Clause"
] | null | null | null | aws/AWSError.py | alexbredo/honeypot-s3 | f90c21e34b2c3079656a027cab9dc0cf7b2945c9 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014 Alexander Bredo
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions ... | 82.742188 | 271 | 0.775942 |
defAWSerrors = dict()
defAWSerrors["AccessDenied"] = ("Access Denied",403)
defAWSerrors["AccountProblem"] = ("There is a problem with your AWS account that prevents the operation from completing successfully. Please use Contact Us.",403)
defAWSerrors["AmbiguousGrantByEmailAddress"] = ("The e-mail address you provided... | true | true |
f714b5c9364ae37e0f28ed2af63d9c13870280d8 | 4,361 | py | Python | third_party/mosquitto/test/broker/06-bridge-per-listener-settings.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | null | null | null | third_party/mosquitto/test/broker/06-bridge-per-listener-settings.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | null | null | null | third_party/mosquitto/test/broker/06-bridge-per-listener-settings.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | 1 | 2021-05-04T16:09:27.000Z | 2021-05-04T16:09:27.000Z | #!/usr/bin/env python3
# Test remapping of topic name for incoming message
from mosq_test_helper import *
def write_config(filename, port1, port2, port3):
with open(filename, 'w') as f:
f.write("per_listener_settings true\n")
f.write("port %d\n" % (port2))
f.write("listener %d 127.0.0.1\n... | 33.037879 | 108 | 0.64343 |
from mosq_test_helper import *
def write_config(filename, port1, port2, port3):
with open(filename, 'w') as f:
f.write("per_listener_settings true\n")
f.write("port %d\n" % (port2))
f.write("listener %d 127.0.0.1\n" % (port3))
f.write("\n")
f.write("connection bridge_sampl... | true | true |
f714b611b630264ab6b3b01d609da0098746a3ab | 5,508 | py | Python | data/p3BR/R1/benchmark/startQiskit_QC456.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_QC456.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_QC456.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=84
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.142857 | 140 | 0.629448 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo, ... | true | true |
f714b62fb7954e13787a00829289da3e8338b36b | 466 | py | Python | Condicional/autonomia_aviao.py | Viniciusmgm/aula_processamento_info | 6b334122896e34af51d3a8469f151bca52191585 | [
"MIT"
] | null | null | null | Condicional/autonomia_aviao.py | Viniciusmgm/aula_processamento_info | 6b334122896e34af51d3a8469f151bca52191585 | [
"MIT"
] | null | null | null | Condicional/autonomia_aviao.py | Viniciusmgm/aula_processamento_info | 6b334122896e34af51d3a8469f151bca52191585 | [
"MIT"
] | null | null | null | def autonomia(carga):
if(carga <= 50000):
return 18000, 19800
elif(carga <= 200000):
return 9000, 9900
else:
return 3000, 3300
carga = int(input())
auto = autonomia(carga)
ax = float(input())
ay = float(input())
bx = float(input())
by = float(input())
dist = (((bx - ax) ** 2) + ((by... | 20.26087 | 51 | 0.551502 | def autonomia(carga):
if(carga <= 50000):
return 18000, 19800
elif(carga <= 200000):
return 9000, 9900
else:
return 3000, 3300
carga = int(input())
auto = autonomia(carga)
ax = float(input())
ay = float(input())
bx = float(input())
by = float(input())
dist = (((bx - ax) ** 2) + ((by... | true | true |
f714b6d7c1ff765f98b7b868c578681f6cd0ca1a | 3,763 | py | Python | hail/python/hail/experimental/export_entries_by_col.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 789 | 2016-09-05T04:14:25.000Z | 2022-03-30T09:51:54.000Z | hail/python/hail/experimental/export_entries_by_col.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 5,724 | 2016-08-29T18:58:40.000Z | 2022-03-31T23:49:42.000Z | hail/python/hail/experimental/export_entries_by_col.py | MaxGreil/hail | 4e0605b6bfd24a885a8194e8c0984b20994d3407 | [
"MIT"
] | 233 | 2016-08-31T20:42:38.000Z | 2022-02-17T16:42:39.000Z | import hail as hl
from hail.typecheck import typecheck
@typecheck(mt=hl.MatrixTable, path=str, batch_size=int, bgzip=bool, header_json_in_file=bool, use_string_key_as_file_name=bool)
def export_entries_by_col(mt: hl.MatrixTable,
path: str,
batch_size: int = 256,
... | 43.252874 | 145 | 0.577731 | import hail as hl
from hail.typecheck import typecheck
@typecheck(mt=hl.MatrixTable, path=str, batch_size=int, bgzip=bool, header_json_in_file=bool, use_string_key_as_file_name=bool)
def export_entries_by_col(mt: hl.MatrixTable,
path: str,
batch_size: int = 256,
... | true | true |
f714b6dd34948ac4f7a89b22be5b154664dff0b8 | 59 | py | Python | yfm/YahooFetcher/__init__.py | DanielGzgzz/yfMongo | 1ac76c74e7309519d00f0c5205a3581cc6bbfffc | [
"Apache-2.0"
] | 20 | 2017-08-29T22:54:58.000Z | 2022-01-19T03:50:50.000Z | yfm/YahooFetcher/__init__.py | DanielGzgzz/yfMongo | 1ac76c74e7309519d00f0c5205a3581cc6bbfffc | [
"Apache-2.0"
] | 2 | 2020-05-19T14:12:59.000Z | 2022-03-16T05:32:21.000Z | yfm/YahooFetcher/__init__.py | DanielGzgzz/yfMongo | 1ac76c74e7309519d00f0c5205a3581cc6bbfffc | [
"Apache-2.0"
] | 16 | 2017-10-31T09:10:28.000Z | 2022-03-10T19:02:09.000Z | __all__ = ["YahooFetcher", "QueryBuilder"]
from . import *
| 19.666667 | 42 | 0.694915 | __all__ = ["YahooFetcher", "QueryBuilder"]
from . import *
| true | true |
f714b70efde4cdb122c6eb564b9db6f1e30ed059 | 1,062 | py | Python | examples/GB-Halide/ila_spec_a/all.py | pramodsu/ILA-Tools | e76bd90cf356ada8dd6f848fb377f57c83322c71 | [
"MIT"
] | 1 | 2021-11-29T03:51:27.000Z | 2021-11-29T03:51:27.000Z | examples/GB-Halide/ila_spec_a/all.py | pramodsu/ILA-Tools | e76bd90cf356ada8dd6f848fb377f57c83322c71 | [
"MIT"
] | 1 | 2018-06-25T08:49:22.000Z | 2018-06-25T08:49:22.000Z | examples/GB-Halide/ila_spec_a/all.py | pramodsu/ILA-Tools | e76bd90cf356ada8dd6f848fb377f57c83322c71 | [
"MIT"
] | 3 | 2018-06-26T11:31:40.000Z | 2021-12-01T20:16:21.000Z | import ila
from gb_arch import GBArch
from gb_nxt_wri import WRI
from gb_nxt_wr0 import WRU0
from gb_nxt_wr0b import WRU0b
from gb_nxt_wr1 import WRU1
from gb_rdi import defNext as rdDefNext
def defUSts (gb):
m = gb.abst
gb.pre_pix = m.reg ('pre_pix', gb.DATA_SIZE)
gb.pre_pix_nxt = gb.pre_pix
... | 22.595745 | 72 | 0.667608 | import ila
from gb_arch import GBArch
from gb_nxt_wri import WRI
from gb_nxt_wr0 import WRU0
from gb_nxt_wr0b import WRU0b
from gb_nxt_wr1 import WRU1
from gb_rdi import defNext as rdDefNext
def defUSts (gb):
m = gb.abst
gb.pre_pix = m.reg ('pre_pix', gb.DATA_SIZE)
gb.pre_pix_nxt = gb.pre_pix
... | true | true |
f714b773eeecc306dbf5f5429fa3eeef17fbdaba | 58,507 | py | Python | Lib/test/test_xmlrpc.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 953 | 2021-10-08T17:12:34.000Z | 2022-03-31T18:31:50.000Z | Lib/test/test_xmlrpc.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 27 | 2021-10-13T20:54:09.000Z | 2022-03-27T14:41:13.000Z | Lib/test/test_xmlrpc.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 42 | 2021-10-08T16:05:57.000Z | 2022-03-18T13:06:12.000Z | import base64
import datetime
import decimal
import sys
import time
import unittest
from unittest import mock
import xmlrpc.client as xmlrpclib
import xmlrpc.server
import http.client
import http, http.server
import socket
import threading
import re
import io
import contextlib
from test import support
from test.support... | 38.695106 | 87 | 0.617584 | import base64
import datetime
import decimal
import sys
import time
import unittest
from unittest import mock
import xmlrpc.client as xmlrpclib
import xmlrpc.server
import http.client
import http, http.server
import socket
import threading
import re
import io
import contextlib
from test import support
from test.support... | true | true |
f714b821e990e808759fd37d6756dcffd01eafb5 | 1,162 | py | Python | dependencies/FontTools/Lib/fontTools/ttLib/tables/T_S_I__5.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 21 | 2015-01-16T05:10:02.000Z | 2021-06-11T20:48:15.000Z | dependencies/FontTools/Lib/fontTools/ttLib/tables/T_S_I__5.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 1 | 2019-09-09T12:10:27.000Z | 2020-05-22T10:12:14.000Z | dependencies/FontTools/Lib/fontTools/ttLib/tables/T_S_I__5.py | charlesmchen/typefacet | 8c6db26d0c599ece16f3704696811275120a4044 | [
"Apache-2.0"
] | 2 | 2015-05-03T04:51:08.000Z | 2018-08-24T08:28:53.000Z | import sys
import DefaultTable
import array
from fontTools import ttLib
from fontTools.misc.textTools import safeEval
class table_T_S_I__5(DefaultTable.DefaultTable):
def decompile(self, data, ttFont):
numGlyphs = ttFont['maxp'].numGlyphs
assert len(data) == 2 * numGlyphs
a = array.array("H")
a.fromstring(... | 26.409091 | 86 | 0.704819 | import sys
import DefaultTable
import array
from fontTools import ttLib
from fontTools.misc.textTools import safeEval
class table_T_S_I__5(DefaultTable.DefaultTable):
def decompile(self, data, ttFont):
numGlyphs = ttFont['maxp'].numGlyphs
assert len(data) == 2 * numGlyphs
a = array.array("H")
a.fromstring(... | false | true |
f714b9348ad752e793cdd77f438e5175c7c11a35 | 1,235 | py | Python | conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | 113 | 2021-02-15T19:22:36.000Z | 2021-05-07T15:17:42.000Z | conf/script/src/build_system/cmd/setup/_priv/setup_steps/step_setup_targets.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | __all__ = ['setup_targets']
from pathlib import Path
from typing import Final
from build_system.build_target import *
from build_system.compiler import *
from ..meson import *
def setup_targets(root_dir: Path,
targets: list[CompilerInstanceTargets],
cli_mode: bool) -> None:
f... | 37.424242 | 131 | 0.672065 | __all__ = ['setup_targets']
from pathlib import Path
from typing import Final
from build_system.build_target import *
from build_system.compiler import *
from ..meson import *
def setup_targets(root_dir: Path,
targets: list[CompilerInstanceTargets],
cli_mode: bool) -> None:
f... | true | true |
f714b949926c5c2ca7e179aeb0fa07f4a42d5c12 | 1,552 | py | Python | src/pacsanini/cli/commands.py | Therapixel/pacsanini | 8d8e61601a9df39eaa7aa4b8e9a7e1ccd1ee253d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 10 | 2021-07-05T16:59:03.000Z | 2022-02-09T11:13:03.000Z | src/pacsanini/cli/commands.py | Therapixel/pacsanini | 8d8e61601a9df39eaa7aa4b8e9a7e1ccd1ee253d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 51 | 2021-07-05T08:29:35.000Z | 2021-11-30T08:30:10.000Z | src/pacsanini/cli/commands.py | Therapixel/pacsanini | 8d8e61601a9df39eaa7aa4b8e9a7e1ccd1ee253d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 2 | 2021-07-06T06:35:37.000Z | 2021-07-09T10:26:38.000Z | # Copyright (C) 2019-2020, Therapixel SA.
# All rights reserved.
# This file is subject to the terms and conditions described in the
# LICENSE file distributed in this package.
"""The commands module exposes the different command lines methods
that can be used with pacsanini.
"""
from click import echo, group, option
... | 32.333333 | 88 | 0.794459 | from click import echo, group, option
from pacsanini.__version__ import __version__
from pacsanini.cli.config import config_cli
from pacsanini.cli.dashboard import dashboard_cli
from pacsanini.cli.db import db_cli_group
from pacsanini.cli.net import echo_cli, find_cli, move_cli, send_cli, server_cli
from pacsanini.cli... | true | true |
f714b953e0c9a6d6462cb48d28e32167397104dc | 9,005 | py | Python | CUB-experiments/nearest_embed.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 5 | 2021-05-23T13:05:45.000Z | 2022-02-13T21:40:59.000Z | CUB-experiments/nearest_embed.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | null | null | null | CUB-experiments/nearest_embed.py | ashleylqx/AIB | 77e418cac52f0ca5f2a7c54927468a7bd75a8fc9 | [
"MIT"
] | 3 | 2021-08-11T03:23:31.000Z | 2021-11-17T01:48:52.000Z | # adapted from https://github.com/nadavbh12/VQ-VAE
import numpy as np
import torch
from torch import nn
from torch.autograd import Function, Variable
import torch.nn.functional as F
from config import *
import pdb
class NearestEmbedFunc(Function):
"""
Input:
------
x - (batch_size, emb_dim, *)
... | 43.713592 | 162 | 0.595447 |
import numpy as np
import torch
from torch import nn
from torch.autograd import Function, Variable
import torch.nn.functional as F
from config import *
import pdb
class NearestEmbedFunc(Function):
@staticmethod
def forward(ctx, input, emb):
emb_ex = emb.expand(input... | true | true |
f714ba426a5248f82458ccc103e4f061235d9e45 | 436 | py | Python | venv/Scripts/easy_install-3.6-script.py | ololostapenko/bankera | 5c9093785fa02ef4aa002249ac2ae04a364de44d | [
"Apache-2.0"
] | null | null | null | venv/Scripts/easy_install-3.6-script.py | ololostapenko/bankera | 5c9093785fa02ef4aa002249ac2ae04a364de44d | [
"Apache-2.0"
] | null | null | null | venv/Scripts/easy_install-3.6-script.py | ololostapenko/bankera | 5c9093785fa02ef4aa002249ac2ae04a364de44d | [
"Apache-2.0"
] | null | null | null | #!C:\Devel\Bankera\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==28.8.0','console_scripts','easy_install-3.6'
__requires__ = 'setuptools==28.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.a... | 33.538462 | 87 | 0.683486 | __requires__ = 'setuptools==28.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==28.8.0', 'console_scripts', 'easy_install-3.6')()
)
| true | true |
f714bd81cb12dc993d3ec9237a0c0ed41807641a | 222 | py | Python | docs/source/working/include/snippets/processes/functions/calcfunction_multiple_outputs.py | pranavmodx/aiida-core | 0edbbf82dfb97ab130914d1674a6f2217eba5971 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | docs/source/working/include/snippets/processes/functions/calcfunction_multiple_outputs.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | docs/source/working/include/snippets/processes/functions/calcfunction_multiple_outputs.py | odarbelaeze/aiida_core | 934b4ccdc73a993f2a6656caf516500470e3da08 | [
"BSD-2-Clause"
] | null | null | null | from aiida.engine import calcfunction
from aiida.orm import Int
@calcfunction
def sum_and_difference(alpha, beta):
return {'sum': alpha + beta, 'difference': alpha - beta}
result = sum_and_difference(Int(1), Int(2))
| 24.666667 | 60 | 0.743243 | from aiida.engine import calcfunction
from aiida.orm import Int
@calcfunction
def sum_and_difference(alpha, beta):
return {'sum': alpha + beta, 'difference': alpha - beta}
result = sum_and_difference(Int(1), Int(2))
| true | true |
f714bdafd960a7b2117b4f5520697b701e88a097 | 10,522 | py | Python | tensorflow_federated/python/research/optimization/stackoverflow/dataset.py | hartmanwilliam/federated | 55e5fcbfde13ac4788f084e4c3c4714130cd19ec | [
"Apache-2.0"
] | 1 | 2020-10-30T10:38:46.000Z | 2020-10-30T10:38:46.000Z | tensorflow_federated/python/research/optimization/stackoverflow/dataset.py | hartmanwilliam/federated | 55e5fcbfde13ac4788f084e4c3c4714130cd19ec | [
"Apache-2.0"
] | 8 | 2019-08-06T06:12:07.000Z | 2019-12-19T02:06:17.000Z | tensorflow_federated/python/research/optimization/stackoverflow/dataset.py | Junyangz/federated | ecf51cdf8b86cbd000f6edc5715dc904bce07540 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 40.625483 | 80 | 0.720776 | from typing import List
import numpy as np
import tensorflow as tf
import tensorflow_federated as tff
EVAL_BATCH_SIZE = 100
def create_vocab(vocab_size):
vocab_dict = tff.simulation.datasets.stackoverflow.load_word_counts()
return list(vocab_dict.keys())[:vocab_size]
def split_input_target(chunk):
input_tex... | true | true |
f714bdbc502cd21e6811596121f81b0a678e8f1c | 478 | py | Python | setup.py | danielsiwiec/jetbot | 3b0e57dd1eb3a5d274e7e5bbf0623924e42258b6 | [
"MIT"
] | 5 | 2019-12-09T20:49:59.000Z | 2022-03-10T18:13:23.000Z | setup.py | SnowMasaya/jetbot | 534b7d9b88988b96a228676e2a9f8e92119d86dd | [
"MIT"
] | 4 | 2019-09-23T17:50:31.000Z | 2019-09-23T17:52:35.000Z | setup.py | SnowMasaya/jetbot | 534b7d9b88988b96a228676e2a9f8e92119d86dd | [
"MIT"
] | 8 | 2019-06-09T12:44:10.000Z | 2020-08-31T10:32:14.000Z | import glob
import subprocess
from setuptools import setup, find_packages, Extension
def build_libs():
subprocess.call(['cmake', '.'])
subprocess.call(['make'])
build_libs()
setup(
name='jetbot',
version='0.3.0',
description='An open-source robot based on NVIDIA Jetson Nano',
packages=... | 19.12 | 67 | 0.648536 | import glob
import subprocess
from setuptools import setup, find_packages, Extension
def build_libs():
subprocess.call(['cmake', '.'])
subprocess.call(['make'])
build_libs()
setup(
name='jetbot',
version='0.3.0',
description='An open-source robot based on NVIDIA Jetson Nano',
packages=... | true | true |
f714be8826c14195468efb9f011bb9edd0b15aca | 1,877 | py | Python | viz/scenes/base.py | entzian/spats | cb0d9f1f3c0fbcb3c333096d657ef96f7179de46 | [
"BSL-1.0"
] | 4 | 2016-11-27T04:44:41.000Z | 2019-10-08T18:32:51.000Z | viz/scenes/base.py | entzian/spats | cb0d9f1f3c0fbcb3c333096d657ef96f7179de46 | [
"BSL-1.0"
] | 1 | 2017-12-18T22:02:28.000Z | 2017-12-18T22:02:28.000Z | viz/scenes/base.py | entzian/spats | cb0d9f1f3c0fbcb3c333096d657ef96f7179de46 | [
"BSL-1.0"
] | 3 | 2016-06-10T11:36:00.000Z | 2021-08-30T18:25:18.000Z |
import cjb.uif
from cjb.uif.views import Label
from viz.layout import buttonSize
class BaseScene(cjb.uif.Scene):
def __init__(self, ui, key = None):
self.ui = ui
self.scroller = None
cjb.uif.Scene.__init__(self, ui.manager, key or self.__class__.__name__)
self.container.properti... | 30.274194 | 86 | 0.571124 |
import cjb.uif
from cjb.uif.views import Label
from viz.layout import buttonSize
class BaseScene(cjb.uif.Scene):
def __init__(self, ui, key = None):
self.ui = ui
self.scroller = None
cjb.uif.Scene.__init__(self, ui.manager, key or self.__class__.__name__)
self.container.properti... | true | true |
f714bf511a5db4837fb464801747ab0f635499bc | 3,832 | py | Python | networkx/drawing/tests/test_pydot.py | rakschahsa/networkx | 6cac55b1064c3c346665f9281680fa3b66442ad0 | [
"BSD-3-Clause"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | Library/lib/python3.7/site-packages/networkx/drawing/tests/test_pydot.py | gengyong/Carnets | 8930a14f69360d4db115a85ff9e0f6efa80fa2e7 | [
"BSD-3-Clause"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | site-packages/networkx/drawing/tests/test_pydot.py | Wristlebane/Pyto | 901ac307b68486d8289105c159ca702318bea5b0 | [
"MIT"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | """Unit tests for pydot drawing functions."""
try:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
except ImportError:
from io import StringIO
import sys
import tempfile
from nose.tools import assert_equal, assert_is_instance, assert_true
import networkx... | 35.155963 | 80 | 0.632307 | try:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
except ImportError:
from io import StringIO
import sys
import tempfile
from nose.tools import assert_equal, assert_is_instance, assert_true
import networkx as nx
from networkx.testing import assert_gra... | true | true |
f714c005b5071d69c3379f2889b0a8b61ed7d483 | 999 | py | Python | Data_Structures/stack.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | Data_Structures/stack.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | Data_Structures/stack.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | class Stack:
#initialize stack and top
def __init__(self,max_size=None):
self.__stack = []
self.__max_size = max_size
self.__top = 0
#current length of stack
def __len__(self):
return len(self.__stack)
#check if stack is empty
def is_empty(self):
return True if self.__top==0 else False
#check i... | 18.5 | 75 | 0.683684 | class Stack:
def __init__(self,max_size=None):
self.__stack = []
self.__max_size = max_size
self.__top = 0
def __len__(self):
return len(self.__stack)
def is_empty(self):
return True if self.__top==0 else False
def is_full(self):
return True if self.__max_size and self.__max_size==self.__top... | false | true |
f714c0121365938eec8fc72d484d1b10524db95f | 358 | py | Python | Gallery/migrations/0002_auto_20210115_1331.py | CiganOliviu/InfiniteShoot | 14f7fb21e360e3c58876d82ebbe206054c72958e | [
"MIT"
] | 1 | 2021-04-02T16:45:37.000Z | 2021-04-02T16:45:37.000Z | Gallery/migrations/0002_auto_20210115_1331.py | CiganOliviu/InfiniteShoot-1 | 6322ae34f88caaffc1de29dfa4f6d86d175810a7 | [
"Apache-2.0"
] | null | null | null | Gallery/migrations/0002_auto_20210115_1331.py | CiganOliviu/InfiniteShoot-1 | 6322ae34f88caaffc1de29dfa4f6d86d175810a7 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.8 on 2021-01-15 13:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Gallery', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='imageclient',
old_name='product',
... | 18.842105 | 47 | 0.578212 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Gallery', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='imageclient',
old_name='product',
new_name='client',
),
]
| true | true |
f714c0f34fff9800c3a67b955f8cc23e9eeb99c8 | 9,027 | py | Python | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | null | null | null | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | 1 | 2021-06-15T11:59:58.000Z | 2021-06-16T12:08:38.000Z | emu/containers/docker_container.py | CONQ-Agency/android-emulator-container-scripts | 0d5f55ca938818486a2ad638b91464e952e87cf4 | [
"Apache-2.0"
] | 1 | 2021-05-12T14:08:12.000Z | 2021-05-12T14:08:12.000Z | # Copyright 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.586207 | 107 | 0.583029 | import logging
import os
import re
import sys
import shutil
import abc
import docker
from tqdm import tqdm
from emu.utils import mkdir_p
class ProgressTracker(object):
def __init__(self):
self.progress = {}
self.idx = -1
def __del__(self):
for k in self.progress:
... | true | true |
f714c0fe8b4759fb11a941007a0f6f1a8f1d8178 | 5,927 | py | Python | statsmodels/multivariate/cancorr.py | aliavni/statsmodels | ef5d57a8d45de76a895e9401705280d558d688ad | [
"BSD-3-Clause"
] | 1 | 2022-01-24T15:17:37.000Z | 2022-01-24T15:17:37.000Z | statsmodels/multivariate/cancorr.py | aliavni/statsmodels | ef5d57a8d45de76a895e9401705280d558d688ad | [
"BSD-3-Clause"
] | null | null | null | statsmodels/multivariate/cancorr.py | aliavni/statsmodels | ef5d57a8d45de76a895e9401705280d558d688ad | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Canonical correlation analysis
author: Yichuan Liu
"""
import numpy as np
from numpy.linalg import svd
import scipy
import pandas as pd
from statsmodels.base.model import Model
from statsmodels.iolib import summary2
from .multivariate_ols import multivariate_stats
class CanCorr(Model):
... | 33.111732 | 93 | 0.549182 |
import numpy as np
from numpy.linalg import svd
import scipy
import pandas as pd
from statsmodels.base.model import Model
from statsmodels.iolib import summary2
from .multivariate_ols import multivariate_stats
class CanCorr(Model):
def __init__(self, endog, exog, tolerance=1e-8, missing='none', hasconst=None, *... | true | true |
f714c1e8dffd5c7377f91e0b8a143f15545e6c6f | 4,479 | py | Python | subcmds/branches.py | opensourcechipspark/repo | 5db69f3f6616ea199a7840f0602b988f8d5504b9 | [
"Apache-2.0"
] | null | null | null | subcmds/branches.py | opensourcechipspark/repo | 5db69f3f6616ea199a7840f0602b988f8d5504b9 | [
"Apache-2.0"
] | null | null | null | subcmds/branches.py | opensourcechipspark/repo | 5db69f3f6616ea199a7840f0602b988f8d5504b9 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 la... | 26.820359 | 74 | 0.625363 |
from __future__ import print_function
import sys
from color import Coloring
from command import Command
class BranchColoring(Coloring):
def __init__(self, config):
Coloring.__init__(self, config, 'branch')
self.current = self.printer('current', fg='green')
self.local = self.printer('local')
self.n... | true | true |
f714c30f238ba9efcd7dd75cb3798c567f7905d2 | 35,412 | py | Python | demosaic_pack/amaze_demosaic.py | rongtianjie/dcraw_py | fd45d819a67d2f52d7ca61abbe145ab1b172bee9 | [
"Unlicense"
] | 1 | 2022-03-22T02:45:10.000Z | 2022-03-22T02:45:10.000Z | demosaic_pack/amaze_demosaic.py | rongtianjie/dcraw_py | fd45d819a67d2f52d7ca61abbe145ab1b172bee9 | [
"Unlicense"
] | null | null | null | demosaic_pack/amaze_demosaic.py | rongtianjie/dcraw_py | fd45d819a67d2f52d7ca61abbe145ab1b172bee9 | [
"Unlicense"
] | null | null | null | import numpy as np
def amaze_demosaic(src, raw):
cfarray = raw.raw_colors
cfarray[cfarray == 3] = 1
rgb = amaze_demosaic_libraw(src, cfarray, raw.daylight_whitebalance)
return rgb
def amaze_demosaic_libraw(src, cfarray, daylight_wb):
TS = 512
winx = winy = 0
width = src.shape[1]
... | 53.492447 | 978 | 0.471789 | import numpy as np
def amaze_demosaic(src, raw):
cfarray = raw.raw_colors
cfarray[cfarray == 3] = 1
rgb = amaze_demosaic_libraw(src, cfarray, raw.daylight_whitebalance)
return rgb
def amaze_demosaic_libraw(src, cfarray, daylight_wb):
TS = 512
winx = winy = 0
width = src.shape[1]
... | true | true |
f714c47ee80904ec569254931c1f1328492e4608 | 6,440 | py | Python | utils.py | EdLeafe/elastic_irc | 38959e25c0b9b309b89a46c3f7ab0a3576429621 | [
"MIT"
] | null | null | null | utils.py | EdLeafe/elastic_irc | 38959e25c0b9b309b89a46c3f7ab0a3576429621 | [
"MIT"
] | 1 | 2020-07-03T14:36:10.000Z | 2020-07-03T14:36:10.000Z | utils.py | EdLeafe/elastic_irc | 38959e25c0b9b309b89a46c3f7ab0a3576429621 | [
"MIT"
] | null | null | null | import copy
from datetime import datetime
from functools import wraps, update_wrapper
from hashlib import blake2b
import logging
from math import log
import os
from subprocess import Popen, PIPE
import uuid
from dateutil import parser
import elasticsearch
import pymysql
from rich import box
from rich.console import Co... | 26.072874 | 90 | 0.612422 | import copy
from datetime import datetime
from functools import wraps, update_wrapper
from hashlib import blake2b
import logging
from math import log
import os
from subprocess import Popen, PIPE
import uuid
from dateutil import parser
import elasticsearch
import pymysql
from rich import box
from rich.console import Co... | true | true |
f714c4b095d821e174e7a6aa0d767d8a4b0c41f5 | 11,122 | py | Python | glance_docker/glance/registry/client/v1/client.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/registry/client/v1/client.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/registry/client/v1/client.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 41.969811 | 79 | 0.591261 |
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
from glance.common.client import BaseClient
from glance.common import crypt
from glance import i18n
from glance.registry.api.v1 import images
LOG = logging.getLogger(__name__)
_LE = i18n._LE
class Registry... | true | true |
f714c4cb6fce4108162f924f6f32dbbefd36b682 | 4,339 | py | Python | backend/tests/test_mollufy.py | somnisomni/mollufier | 7bc42ac51615f164bd3a479ed5e05cdea5b186d5 | [
"MIT"
] | 14 | 2021-11-13T14:59:34.000Z | 2022-02-14T06:21:49.000Z | backend/tests/test_mollufy.py | somnisomni/mollufier | 7bc42ac51615f164bd3a479ed5e05cdea5b186d5 | [
"MIT"
] | 2 | 2021-11-23T13:54:47.000Z | 2021-11-26T15:35:40.000Z | backend/tests/test_mollufy.py | somnisomni/mollufier | 7bc42ac51615f164bd3a479ed5e05cdea5b186d5 | [
"MIT"
] | 3 | 2021-11-20T16:55:41.000Z | 2021-11-26T15:27:10.000Z | import unittest
from mollufy import mollufy
class MollufyTestSimple(unittest.TestCase):
def test_mollufy_word_2chars(self):
# TEST 1: Mollufy simple 2-characters noun word
self.assertEqual(mollufy.mollufy("블루"), "블?루")
self.assertEqual(mollufy.mollufy("하루"), "하?루")
self.assertEqual(mollufy.mollufy("감... | 52.914634 | 176 | 0.704771 | import unittest
from mollufy import mollufy
class MollufyTestSimple(unittest.TestCase):
def test_mollufy_word_2chars(self):
self.assertEqual(mollufy.mollufy("블루"), "블?루")
self.assertEqual(mollufy.mollufy("하루"), "하?루")
self.assertEqual(mollufy.mollufy("감정"), "감?정")
def test_mollufy_word_manychars_w... | true | true |
f714c57c24f77188279a44953fa4e55425f6c2d6 | 7,804 | py | Python | stai/util/ssl_check.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 10 | 2021-10-02T18:33:56.000Z | 2021-11-14T17:10:48.000Z | stai/util/ssl_check.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 14 | 2021-10-07T22:10:15.000Z | 2021-12-21T09:13:49.000Z | stai/util/ssl_check.py | STATION-I/staicoin-blockchain | b8686c75dd5fe7883115d9613858c9c8cadfc4a7 | [
"Apache-2.0"
] | 6 | 2021-10-29T19:36:59.000Z | 2021-12-19T19:52:57.000Z | import os
import stat
import sys
from stai.util.config import load_config, traverse_dict
from stai.util.permissions import octal_mode_string, verify_file_permissions
from logging import Logger
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
DEFAULT_PERMISSIONS_CERT_FILE: int = 0o644
DEFAUL... | 38.44335 | 116 | 0.657868 | import os
import stat
import sys
from stai.util.config import load_config, traverse_dict
from stai.util.permissions import octal_mode_string, verify_file_permissions
from logging import Logger
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
DEFAULT_PERMISSIONS_CERT_FILE: int = 0o644
DEFAUL... | true | true |
f714c6177d1854e7a182e8a0ce20becbd5ea9017 | 1,320 | py | Python | webdev/urls.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | webdev/urls.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | 103 | 2021-04-25T21:28:11.000Z | 2022-03-15T01:36:31.000Z | webdev/urls.py | h-zanetti/jewelry-manager | 74166b89f492303b8ebf5ff8af058f394eb2a28b | [
"MIT"
] | null | null | null | """webdev URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 41.25 | 78 | 0.720455 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('webdev.produtos.urls')),
path('users/', include('webdev.users.urls')),
path('fornecedores... | true | true |
f714c61bd4e0f62ce5ce0a72df8b8cb21cc1d5f1 | 6,726 | py | Python | tests/test_other.py | dtzWill/httplib2 | 7ee25dbcc24fbe42d2f7b2839327d58ecf3c8e71 | [
"MIT"
] | null | null | null | tests/test_other.py | dtzWill/httplib2 | 7ee25dbcc24fbe42d2f7b2839327d58ecf3c8e71 | [
"MIT"
] | null | null | null | tests/test_other.py | dtzWill/httplib2 | 7ee25dbcc24fbe42d2f7b2839327d58ecf3c8e71 | [
"MIT"
] | null | null | null | import httplib2
import mock
import os
import pickle
import pytest
import socket
import sys
import tests
import time
from six.moves import urllib
@pytest.mark.skipif(
sys.version_info <= (3,),
reason=(
"TODO: httplib2._convert_byte_str was defined only in python3 code " "version"
),
)
def test_conv... | 32.181818 | 118 | 0.678115 | import httplib2
import mock
import os
import pickle
import pytest
import socket
import sys
import tests
import time
from six.moves import urllib
@pytest.mark.skipif(
sys.version_info <= (3,),
reason=(
"TODO: httplib2._convert_byte_str was defined only in python3 code " "version"
),
)
def test_conv... | true | true |
f714c6db7d33f46788a289e98db5502368671a9e | 1,863 | py | Python | data/transforms/transforms.py | nodiz/reid-strong-baseline | d3c1bc948843d0ad6e52dafa79a74ab94d5d484d | [
"MIT"
] | 1 | 2020-05-30T13:44:16.000Z | 2020-05-30T13:44:16.000Z | data/transforms/transforms.py | nodiz/reid-strong-baseline | d3c1bc948843d0ad6e52dafa79a74ab94d5d484d | [
"MIT"
] | null | null | null | data/transforms/transforms.py | nodiz/reid-strong-baseline | d3c1bc948843d0ad6e52dafa79a74ab94d5d484d | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
@author: liaoxingyu
@contact: liaoxingyu2@jd.com
"""
import math
import random
class RandomErasing(object):
""" Randomly selects a rectangle region in an image and erases its pixels.
'Random Erasing Data Augmentation' by Zhong et al.
See https://arxiv.org/pdf/1708.04896.pdf... | 33.872727 | 96 | 0.547504 |
import math
import random
class RandomErasing(object):
def __init__(self, probability=0.5, sl=0.02, sh=0.4, r1=0.3, mean=(0.4914, 0.4822, 0.4465)):
self.probability = probability
self.mean = mean
self.sl = sl
self.sh = sh
self.r1 = r1
def __call__(self, img):
... | true | true |
f714c8da841a220b302fd12f3f8bb3b9dedd0598 | 5,003 | py | Python | test/test_ssl.py | nobodyinperson/urllib3 | 79e81f918efe5ae85a276bd3ad8a1939dfa206dd | [
"MIT"
] | null | null | null | test/test_ssl.py | nobodyinperson/urllib3 | 79e81f918efe5ae85a276bd3ad8a1939dfa206dd | [
"MIT"
] | null | null | null | test/test_ssl.py | nobodyinperson/urllib3 | 79e81f918efe5ae85a276bd3ad8a1939dfa206dd | [
"MIT"
] | null | null | null | import platform
import sys
import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize(
"addr",
[
# IPv6
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
# IPv4
"127.0.0.1",
"8.8.8.8",
... | 28.919075 | 88 | 0.677593 | import platform
import sys
import mock
import pytest
from urllib3.util import ssl_
from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize(
"addr",
[
"::1",
"::",
"FE80::8939:7684:D84b:a5A4%251",
"127.0.0.1",
"8.8.8.8",
b"127.0... | true | true |
f714c9384e398c4912bca404e456801ec236b034 | 3,792 | py | Python | setup.py | vincent101/setup.py | 147b387e82b5702dea35868b708142f150f00a1f | [
"MIT"
] | null | null | null | setup.py | vincent101/setup.py | 147b387e82b5702dea35868b708142f150f00a1f | [
"MIT"
] | null | null | null | setup.py | vincent101/setup.py | 147b387e82b5702dea35868b708142f150f00a1f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'mypackage'
DESCRIPTION = 'My sho... | 28.727273 | 86 | 0.640032 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'mypackage'
DESCRIPTION = 'My short description for my project.'
URL = 'https://github.com/vincent101/myproject'
EMAIL = 'vincent.wangworks@gmail.com'
AUTHOR = 'Vicnet Wang'
REQUIRES_PYTHON = '>=3.6.... | true | true |
f714c9ace3c7e9c796c9b28a1e4cced97ecb105d | 872 | py | Python | setup.py | yuwenhou/ProxyPool-master1 | 21b6c0b7788bb24e728ec75c0b44b6e4b6583595 | [
"Apache-2.0"
] | 803 | 2017-02-23T15:43:28.000Z | 2022-03-25T15:28:19.000Z | setup.py | yuwenhou/ProxyPool-master1 | 21b6c0b7788bb24e728ec75c0b44b6e4b6583595 | [
"Apache-2.0"
] | 31 | 2017-07-30T08:47:10.000Z | 2021-04-24T20:30:54.000Z | ThirdParty/ProxyPool/setup.py | XiMuYouZi/PythonDemo | 476d4d814338f37148bbf1504c0dd94a68f55a05 | [
"MIT"
] | 483 | 2017-04-01T04:08:50.000Z | 2022-03-30T11:40:24.000Z | from setuptools import setup
setup(
name='proxy-pool',
version='1.0.0',
description='High performance proxy pool',
long_description='A proxy pool project modified from WiseDoge/ProxyPool',
author=['Germey', 'WiseDoge'],
author_email='cqc@cuiqingcai.com',
url='https://github.com/Germey/Proxy... | 24.914286 | 77 | 0.597477 | from setuptools import setup
setup(
name='proxy-pool',
version='1.0.0',
description='High performance proxy pool',
long_description='A proxy pool project modified from WiseDoge/ProxyPool',
author=['Germey', 'WiseDoge'],
author_email='cqc@cuiqingcai.com',
url='https://github.com/Germey/Proxy... | true | true |
f714ca99c5ac8b2d50a2135185af88bb05dfb468 | 1,304 | py | Python | src/nasa_sbm/configuration.py | ReeceHumphreys/NASA-breakup-model-python | 3cca5d603c846b62b31b5ac7652e040b2a31193c | [
"MIT"
] | 3 | 2022-03-07T14:42:14.000Z | 2022-03-08T19:41:04.000Z | src/nasa_sbm/configuration.py | ReeceHumphreys/NASA-breakup-model-python | 3cca5d603c846b62b31b5ac7652e040b2a31193c | [
"MIT"
] | 1 | 2022-03-30T00:44:10.000Z | 2022-03-30T00:44:10.000Z | src/nasa_sbm/configuration.py | ReeceHumphreys/python-sbm | 3cca5d603c846b62b31b5ac7652e040b2a31193c | [
"MIT"
] | null | null | null | import yaml
from enum import Enum
class SimulationType(Enum):
explosion = "EXPLOSION"
collision = "COLLISION"
class SatType(Enum):
rb = "RB"
sat = "SC"
soc = "SOC"
deb = "DEB"
class SimulationConfiguration:
# Takes a .yaml file with simulation configurations
def __init__(self, file... | 27.744681 | 92 | 0.631135 | import yaml
from enum import Enum
class SimulationType(Enum):
explosion = "EXPLOSION"
collision = "COLLISION"
class SatType(Enum):
rb = "RB"
sat = "SC"
soc = "SOC"
deb = "DEB"
class SimulationConfiguration:
def __init__(self, filePath: str):
try:
with open(fileP... | true | true |
f714caabd13b3013f599b17b11b7fce0affc6412 | 1,675 | py | Python | hellodjango/urls.py | Alonski/HelloDjango | d6de2ec2532799e54c893fbc615433681d49bbd9 | [
"MIT"
] | null | null | null | hellodjango/urls.py | Alonski/HelloDjango | d6de2ec2532799e54c893fbc615433681d49bbd9 | [
"MIT"
] | null | null | null | hellodjango/urls.py | Alonski/HelloDjango | d6de2ec2532799e54c893fbc615433681d49bbd9 | [
"MIT"
] | null | null | null | """hellodjango URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | 31.018519 | 89 | 0.64597 | from django.conf.urls import url
from django.contrib import admin
from django.http import HttpResponse, JsonResponse
def home_page(request):
return HttpResponse("Hello <b>World!</b>")
def age(request, name, value): return HttpResponse("{}, you are {} years old".format(name.title(), v... | true | true |
f714cb4507e46b6adfd3ffaaf754a90b0df72870 | 10,504 | py | Python | tests/test_plot.py | daxpryce/graspologic | b076f58ca03a41eb2e1462d20a61ff09abfd6045 | [
"MIT"
] | 148 | 2020-09-15T21:45:51.000Z | 2022-03-24T17:33:01.000Z | tests/test_plot.py | daxpryce/graspologic | b076f58ca03a41eb2e1462d20a61ff09abfd6045 | [
"MIT"
] | 533 | 2020-09-15T18:49:00.000Z | 2022-03-25T12:16:58.000Z | tests/test_plot.py | daxpryce/graspologic | b076f58ca03a41eb2e1462d20a61ff09abfd6045 | [
"MIT"
] | 74 | 2020-09-16T02:24:23.000Z | 2022-03-20T20:09:38.000Z | # Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import unittest
import numpy as np
from sklearn.mixture import GaussianMixture
from graspologic.plot.plot import (
_sort_inds,
gridplot,
heatmap,
pairplot,
pairplot_with_gmm,
)
from graspologic.simulations.s... | 33.883871 | 85 | 0.590251 |
import unittest
import numpy as np
from sklearn.mixture import GaussianMixture
from graspologic.plot.plot import (
_sort_inds,
gridplot,
heatmap,
pairplot,
pairplot_with_gmm,
)
from graspologic.simulations.simulations import er_np, sbm
def _test_pairplot_with_gmm_inputs(caller: unittest.TestCas... | true | true |
f714cb67aece3a563782c8da368a0232d2341c5a | 760 | py | Python | samples/py/obj_traversal.py | alexbudmsft/dbgscript | 76dc77109bbeb8f09a893e9dd56012ff8a4b601f | [
"PSF-2.0"
] | 27 | 2015-11-05T22:19:34.000Z | 2021-08-21T02:03:52.000Z | samples/py/obj_traversal.py | alexbudmsft/dbgscript | 76dc77109bbeb8f09a893e9dd56012ff8a4b601f | [
"PSF-2.0"
] | null | null | null | samples/py/obj_traversal.py | alexbudmsft/dbgscript | 76dc77109bbeb8f09a893e9dd56012ff8a4b601f | [
"PSF-2.0"
] | 2 | 2015-11-06T04:32:31.000Z | 2016-08-22T18:24:20.000Z | from dbgscript import *
thd = Process.current_thread
print(thd)
frame = thd.current_frame
locals = frame.get_locals()
print(locals)
for l in locals: print(l.name)
for l in locals: print(l.name, l.type)
car1 = locals[0]
print(car1.name)
car1_f = car1['f']
print(car1_f)
print(car1_f.name, car1_f.type)
print(... | 29.230769 | 75 | 0.717105 | from dbgscript import *
thd = Process.current_thread
print(thd)
frame = thd.current_frame
locals = frame.get_locals()
print(locals)
for l in locals: print(l.name)
for l in locals: print(l.name, l.type)
car1 = locals[0]
print(car1.name)
car1_f = car1['f']
print(car1_f)
print(car1_f.name, car1_f.type)
print(... | true | true |
f714cc193af3bb00e3db9b505c65fc30ea731e09 | 4,804 | py | Python | tests/ouimeaux_device/api/unit/test_service.py | KnicKnic/pywemo | 5e094b47057549a9d7c539a7e2592dcbecd50deb | [
"MIT"
] | null | null | null | tests/ouimeaux_device/api/unit/test_service.py | KnicKnic/pywemo | 5e094b47057549a9d7c539a7e2592dcbecd50deb | [
"MIT"
] | 60 | 2021-01-19T07:13:42.000Z | 2022-03-25T12:06:46.000Z | tests/ouimeaux_device/api/unit/test_service.py | KnicKnic/pywemo | 5e094b47057549a9d7c539a7e2592dcbecd50deb | [
"MIT"
] | null | null | null | """Tests for pywemo.ouimeaux_device.api.service."""
import unittest.mock as mock
from xml.etree import ElementTree
from xml.etree import cElementTree as cet
import pytest
import requests
import pywemo.ouimeaux_device.api.service as svc
HEADERS_KWARG_KEY = "headers"
CONTENT_TYPE_KEY = "Content-Type"
SOAPACTION_KEY =... | 30.598726 | 97 | 0.669858 |
import unittest.mock as mock
from xml.etree import ElementTree
from xml.etree import cElementTree as cet
import pytest
import requests
import pywemo.ouimeaux_device.api.service as svc
HEADERS_KWARG_KEY = "headers"
CONTENT_TYPE_KEY = "Content-Type"
SOAPACTION_KEY = "SOAPACTION"
MOCK_ARGS_ORDERED = 0
MOCK_ARGS_KWARG... | true | true |
f714cc8f8cc3d2beac32698e45c11ada4b6f4fde | 590 | py | Python | core/config.py | imhsz/fastapi-vue-admin | 6af8876b3d62df1de776fcf23ffcfb2bbf6082d6 | [
"MIT"
] | 1 | 2022-03-20T02:03:07.000Z | 2022-03-20T02:03:07.000Z | core/config.py | imhsz/fastapi-vue-admin | 6af8876b3d62df1de776fcf23ffcfb2bbf6082d6 | [
"MIT"
] | null | null | null | core/config.py | imhsz/fastapi-vue-admin | 6af8876b3d62df1de776fcf23ffcfb2bbf6082d6 | [
"MIT"
] | null | null | null | from pydantic import AnyHttpUrl
from typing import List
import os
ENV = os.environ.get("fast_env", "DEV") # 本次启动环境
class Settings:
APP_NAME = "fastapi-vue-admin"
# api前缀
API_PREFIX = "/api"
# jwt密钥,建议随机生成一个
SECRET_KEY = "ShsUP9qIP2Xui2GpXRY6y74v2JSVS0Q2YOXJ22VjwkI"
# token过期时间
ACCESS_TOK... | 21.851852 | 70 | 0.672881 | from pydantic import AnyHttpUrl
from typing import List
import os
ENV = os.environ.get("fast_env", "DEV")
class Settings:
APP_NAME = "fastapi-vue-admin"
API_PREFIX = "/api"
SECRET_KEY = "ShsUP9qIP2Xui2GpXRY6y74v2JSVS0Q2YOXJ22VjwkI"
ACCESS_TOKEN_EXPIRE_MINUTES = 24 * 60
BACKEND_CO... | true | true |
f714cf1852de7db2ee015f8b20b6a0e72c652f7f | 9,850 | py | Python | nova/tests/unit/db/api/test_migrations.py | crowdy/nova | 7b063e4d0518af3e57872bc0288a94edcd33c19d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/db/api/test_migrations.py | crowdy/nova | 7b063e4d0518af3e57872bc0288a94edcd33c19d | [
"Apache-2.0"
] | 3 | 2019-05-17T15:49:12.000Z | 2019-11-21T10:49:54.000Z | nova/tests/unit/db/api/test_migrations.py | crowdy/nova | 7b063e4d0518af3e57872bc0288a94edcd33c19d | [
"Apache-2.0"
] | null | null | null | # 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
# d... | 34.805654 | 79 | 0.67198 |
from alembic import command as alembic_api
from alembic import script as alembic_script
from migrate.versioning import api as migrate_api
import mock
from oslo_db.sqlalchemy import enginefacade
from oslo_db.sqlalchemy import test_fixtures
from oslo_db.sqlalchemy import test_migrations
from oslo_log import log as logg... | true | true |
f714cf7e6e60b68cd1d521d3864fc8dbec020e17 | 583 | py | Python | pipecheck/checks/icmp.py | mriedmann/pipecheck | 9919c13c96d1c9ec28e90ca9c4da5f5b33eb41e9 | [
"MIT"
] | null | null | null | pipecheck/checks/icmp.py | mriedmann/pipecheck | 9919c13c96d1c9ec28e90ca9c4da5f5b33eb41e9 | [
"MIT"
] | 5 | 2021-06-05T22:09:17.000Z | 2021-11-24T22:17:08.000Z | pipecheck/checks/icmp.py | mriedmann/pipecheck | 9919c13c96d1c9ec28e90ca9c4da5f5b33eb41e9 | [
"MIT"
] | null | null | null | import icmplib
from pipecheck.api import CheckResult, Err, Ok, Probe, Warn
class PingProbe(Probe):
"""ICMP ping check"""
host: str = ""
ping_count: int = 1
def __call__(self) -> CheckResult:
h = icmplib.ping(self.host, privileged=False, count=self.ping_count)
if h.is_alive:
... | 30.684211 | 109 | 0.61578 | import icmplib
from pipecheck.api import CheckResult, Err, Ok, Probe, Warn
class PingProbe(Probe):
host: str = ""
ping_count: int = 1
def __call__(self) -> CheckResult:
h = icmplib.ping(self.host, privileged=False, count=self.ping_count)
if h.is_alive:
if h.packet_loss > 0.0... | true | true |
f714d02380cfe366151bdfc4c476215576e9b055 | 2,195 | py | Python | sorts/recursive_mergesort_array.py | salvinanto7/Python | 78ce34637f4b22f7f530580cc2f0b687add1b94b | [
"MIT"
] | 13 | 2021-03-11T00:25:22.000Z | 2022-03-19T00:19:23.000Z | sorts/recursive_mergesort_array.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 279 | 2020-02-12T20:51:09.000Z | 2021-07-20T11:25:19.000Z | sorts/recursive_mergesort_array.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 12 | 2021-04-26T19:43:01.000Z | 2022-01-31T08:36:29.000Z | """A merge sort which accepts an array as input and recursively
splits an array in half and sorts and combines them.
"""
"""https://en.wikipedia.org/wiki/Merge_sort """
def merge(arr: list[int]) -> list[int]:
"""Return a sorted array.
>>> merge([10,9,8,7,6,5,4,3,2,1])
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
... | 33.769231 | 74 | 0.555353 |
def merge(arr: list[int]) -> list[int]:
if len(arr) > 1:
middle_length = len(arr) // 2 left_array = arr[
:middle_length
] right_array = arr[
middle_length:
] left_size = len(left_array)
right_size = len(right_array)
merge(... | true | true |
f714d1d0ae914916a9010122b6cddb2897fbe2ce | 722 | py | Python | common/helpers/utils.py | AlcindoSchleder/flaskWeb | 1f9ba3a3ac8546c24126124d4c34335825b94df9 | [
"MIT"
] | null | null | null | common/helpers/utils.py | AlcindoSchleder/flaskWeb | 1f9ba3a3ac8546c24126124d4c34335825b94df9 | [
"MIT"
] | 1 | 2019-07-31T20:50:41.000Z | 2019-08-01T03:02:10.000Z | common/helpers/utils.py | AlcindoSchleder/flask_API | 00f91ec29ba93c9ec3f45e6cfd78625f0abadc96 | [
"MIT"
] | 1 | 2019-08-02T22:38:23.000Z | 2019-08-02T22:38:23.000Z | # -*- coding: utf-8 -*-
import hmac
import hashlib
import base64
"""
unit : utils
descritption: Collection of functions used in all projetcts
author : Alcindo Schleder
version : 1.0.0
package : i-City Identification Plataform
"""
def isnumber(value):
try:
float(valu... | 24.066667 | 81 | 0.627424 | import hmac
import hashlib
import base64
def isnumber(value):
try:
float(value)
except ValueError:
return False
return True
def calcFileSignature(data: str, password: str = None):
if (password):
digest = hmac.new(password, msg=data, digestmod=hashlib.sha256).digest()
r... | true | true |
f714d29455aa555e390ca247a0f73233eed544e4 | 1,956 | py | Python | app/app.py | Farmer-chong/todo-list | fd44fae6375cf7b1485582faf71efedaebbb57fc | [
"MIT"
] | null | null | null | app/app.py | Farmer-chong/todo-list | fd44fae6375cf7b1485582faf71efedaebbb57fc | [
"MIT"
] | null | null | null | app/app.py | Farmer-chong/todo-list | fd44fae6375cf7b1485582faf71efedaebbb57fc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:file: app.py
:author: -Farmer
:url: https://blog.farmer233.top
:date: 2021/09/21 12:44:37
'''
import os
import click
from apiflask import APIFlask, abort
from app.config import config
from app.models import TodoList
from app.extensions import db, cors
from app.api.todo impor... | 22.744186 | 84 | 0.619632 | import os
import click
from apiflask import APIFlask, abort
from app.config import config
from app.models import TodoList
from app.extensions import db, cors
from app.api.todo import todo_bp
def create_app(config_name: str = None) -> APIFlask:
if config_name is None:
config_name = os.getenv('FLASK_CONFIG'... | true | true |
f714d330ffa499a156b0b00841a0f51b4e605071 | 22,516 | py | Python | research/slim/nets/mobilenet_v1.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 549 | 2020-01-02T05:14:57.000Z | 2022-03-29T18:34:12.000Z | research/slim/nets/mobilenet_v1.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 98 | 2020-01-21T09:41:30.000Z | 2022-03-12T00:53:06.000Z | research/slim/nets/mobilenet_v1.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 233 | 2020-01-18T03:46:27.000Z | 2022-03-19T03:17:47.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 46.908333 | 80 | 0.641322 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import namedtuple
import functools
import tensorflow.compat.v1 as tf
import tf_slim as slim
Conv = namedtuple('Conv', ['kernel', 'stride', 'depth'])
DepthSepConv = namedtuple('DepthSepConv',... | true | true |
f714d444f86b7ebdebc4cfbcca8048b03e1c4ab5 | 494 | py | Python | src/model/shared/data/ooo_data.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/model/shared/data/ooo_data.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | src/model/shared/data/ooo_data.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from typing import List, Dict
from .items.data_items import DataItems
from .shared_data import BaseData
from .full_imports import FullImports
from .from_import import FromImport
class Data(BaseData):
from_imports: List[FromImport]
from_imports_typing: List[FromImport]
extends_map: Dict[str... | 24.7 | 41 | 0.744939 | from typing import List, Dict
from .items.data_items import DataItems
from .shared_data import BaseData
from .full_imports import FullImports
from .from_import import FromImport
class Data(BaseData):
from_imports: List[FromImport]
from_imports_typing: List[FromImport]
extends_map: Dict[str, str]
quote... | true | true |
f714d5865cfb4cce0b782ba39d92e5596aa4c59d | 4,297 | py | Python | python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-fivetran/dagster_fivetran/asset_defs.py | asamoal/dagster | 08fad28e4b608608ce090ce2e8a52c2cf9dd1b64 | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional
from dagster_fivetran.resources import DEFAULT_POLL_INTERVAL
from dagster_fivetran.utils import generate_materializations
from dagster import AssetKey, AssetsDefinition, Out, Output
from dagster import _check as check
from dagster import multi_asset
from dagster.utils.backcompat impo... | 39.063636 | 100 | 0.667442 | from typing import List, Optional
from dagster_fivetran.resources import DEFAULT_POLL_INTERVAL
from dagster_fivetran.utils import generate_materializations
from dagster import AssetKey, AssetsDefinition, Out, Output
from dagster import _check as check
from dagster import multi_asset
from dagster.utils.backcompat impo... | true | true |
f714d5a168b4a464f6eba8acff23787cdd077327 | 4,848 | py | Python | datasets/W300.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | null | null | null | datasets/W300.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | null | null | null | datasets/W300.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import os
import numpy as np
import random
import math
from skimage import io
import torch
import torch.utils.data as data
import torchfile
# from utils.utils import *
from utils.imutils import *
from utils.transforms import *
class W300(data.Dataset):
def __init__(self, ... | 35.130435 | 111 | 0.514233 | from __future__ import print_function
import os
import numpy as np
import random
import math
from skimage import io
import torch
import torch.utils.data as data
import torchfile
from utils.imutils import *
from utils.transforms import *
class W300(data.Dataset):
def __init__(self, args, split):
self.n... | true | true |
f714d6667d827ed794b7897b3c342b7996ae0f37 | 12,279 | py | Python | tests/test_datetime_parse.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 6 | 2021-08-11T11:37:59.000Z | 2021-11-12T01:33:11.000Z | tests/test_datetime_parse.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 189 | 2020-07-12T08:13:29.000Z | 2022-03-28T01:16:29.000Z | tests/test_datetime_parse.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 2 | 2021-11-23T16:28:21.000Z | 2021-11-23T16:28:33.000Z | """
Stolen from https://github.com/django/django/blob/master/tests/utils_tests/test_dateparse.py at
9718fa2e8abe430c3526a9278dd976443d4ae3c6
Changed to:
* use standard pytest layout
* parametrize tests
"""
from datetime import date, datetime, time, timedelta, timezone
import pytest
from pydantic import BaseModel, Va... | 42.05137 | 116 | 0.58425 | from datetime import date, datetime, time, timedelta, timezone
import pytest
from pydantic import BaseModel, ValidationError, errors
from pydantic.datetime_parse import parse_date, parse_datetime, parse_duration, parse_time
def create_tz(minutes):
return timezone(timedelta(minutes=minutes))
@pytest.mark.param... | true | true |
f714d75855fb1f1011c915bfe8ff92d1d28c700e | 1,471 | py | Python | examples/hello-world.py | Shoe-Pi/gfx-hat | ac7cd4ac8873fdff692823b4bf4a804eaa2d98f8 | [
"MIT"
] | 24 | 2018-09-04T20:56:23.000Z | 2021-11-07T06:22:23.000Z | examples/hello-world.py | Shoe-Pi/gfx-hat | ac7cd4ac8873fdff692823b4bf4a804eaa2d98f8 | [
"MIT"
] | 10 | 2018-09-01T16:32:44.000Z | 2022-03-29T13:28:19.000Z | examples/hello-world.py | Shoe-Pi/gfx-hat | ac7cd4ac8873fdff692823b4bf4a804eaa2d98f8 | [
"MIT"
] | 12 | 2018-08-27T21:32:36.000Z | 2022-01-06T10:09:31.000Z | #!/usr/bin/env python
import time
import signal
from gfxhat import touch, lcd, backlight, fonts
from PIL import Image, ImageFont, ImageDraw
print("""hello-world.py
This basic example prints the text "Hello World" in the middle of the LCD
Press any button to see its corresponding LED toggle on/off.
Press Ctrl+C to... | 19.103896 | 73 | 0.626785 |
import time
import signal
from gfxhat import touch, lcd, backlight, fonts
from PIL import Image, ImageFont, ImageDraw
print("""hello-world.py
This basic example prints the text "Hello World" in the middle of the LCD
Press any button to see its corresponding LED toggle on/off.
Press Ctrl+C to exit.
""")
led_stat... | true | true |
f714d8d2b3754c5bbdedf8c1d58e3f9d656a5795 | 2,619 | py | Python | vmware_nsx/shell/admin/plugins/nsxp/resources/certificates.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/shell/admin/plugins/nsxp/resources/certificates.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/shell/admin/plugins/nsxp/resources/certificates.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 VMware, Inc. 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 a... | 35.391892 | 78 | 0.722413 |
from vmware_nsx.shell.admin.plugins.common import constants
from vmware_nsx.shell.admin.plugins.common import utils as admin_utils
from vmware_nsx.shell.admin.plugins.common import v3_common_cert
from vmware_nsx.shell import resources as shell
from neutron_lib.callbacks import registry
from oslo_config import cfg
@... | true | true |
f714d8d4dbefa94c8fbca307ba8490cc93a1e285 | 457 | py | Python | Module1/Getting_Started_with_Data_Analysis_Code/4/annotate.py | vijaysharmapc/Python-End-to-end-Data-Analysis | a00f2d5d1547993e000b2551ec6a1360240885ba | [
"MIT"
] | 38 | 2017-04-10T19:18:43.000Z | 2021-12-25T08:23:27.000Z | Module1/Getting_Started_with_Data_Analysis_Code/4/annotate.py | vijaysharmapc/Python-End-to-end-Data-Analysis | a00f2d5d1547993e000b2551ec6a1360240885ba | [
"MIT"
] | 1 | 2018-07-10T09:41:43.000Z | 2018-07-10T09:41:43.000Z | Module1/Getting_Started_with_Data_Analysis_Code/4/annotate.py | vijaysharmapc/Python-End-to-end-Data-Analysis | a00f2d5d1547993e000b2551ec6a1360240885ba | [
"MIT"
] | 37 | 2017-04-25T01:49:35.000Z | 2021-05-04T01:46:43.000Z | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-2.4, 0.4, 20)
y = x * x + 2 * x + 1
plt.plot(x, y, 'c', linewidth=2.0)
plt.text(-1.5, 1.8, 'y=x^2 + 2*x + 1',
fontsize=14, style='italic')
plt.annotate('minima point', xy=(-1, 0),
xytext=(-1, 0.3), horizontalalignment='ce... | 28.5625 | 51 | 0.619256 | import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-2.4, 0.4, 20)
y = x * x + 2 * x + 1
plt.plot(x, y, 'c', linewidth=2.0)
plt.text(-1.5, 1.8, 'y=x^2 + 2*x + 1',
fontsize=14, style='italic')
plt.annotate('minima point', xy=(-1, 0),
xytext=(-1, 0.3), horizontalalignment='center',
verticalali... | true | true |
f714d97e1633490532b220709b522cf4d4c1414c | 1,361 | py | Python | maior_menor_lista.py | eduardobaltazarmarfim/PythonC | 8e44b4f191582c73cca6df98120ab142145c4ba1 | [
"MIT"
] | null | null | null | maior_menor_lista.py | eduardobaltazarmarfim/PythonC | 8e44b4f191582c73cca6df98120ab142145c4ba1 | [
"MIT"
] | null | null | null | maior_menor_lista.py | eduardobaltazarmarfim/PythonC | 8e44b4f191582c73cca6df98120ab142145c4ba1 | [
"MIT"
] | null | null | null | def retorno():
resp=input('Deseja executar o programa novamente?[s/n] ')
if(resp=='S' or resp=='s'):
verificar()
else:
print('Processo finalizado com sucesso!')
pass
def cabecalho(titulo):
print('-'*30)
print(f'{titulo:^30}')
print('-'*30)
pass
def mensagem_er... | 15.465909 | 82 | 0.488611 | def retorno():
resp=input('Deseja executar o programa novamente?[s/n] ')
if(resp=='S' or resp=='s'):
verificar()
else:
print('Processo finalizado com sucesso!')
pass
def cabecalho(titulo):
print('-'*30)
print(f'{titulo:^30}')
print('-'*30)
pass
def mensagem_er... | true | true |
f714d9bc36813cd34431c4442b42ce62a95887ea | 3,783 | py | Python | Section 4/04.02_omniscient_agent_webapp.py | AYCHAIN/PracticalAI | 1657e31dfc60645f4f999475803f57c0ab9f1a2d | [
"MIT"
] | 7 | 2019-03-06T17:29:52.000Z | 2021-11-08T13:10:24.000Z | Section 4/04.02_omniscient_agent_webapp.py | AYCHAIN/PracticalAI | 1657e31dfc60645f4f999475803f57c0ab9f1a2d | [
"MIT"
] | null | null | null | Section 4/04.02_omniscient_agent_webapp.py | AYCHAIN/PracticalAI | 1657e31dfc60645f4f999475803f57c0ab9f1a2d | [
"MIT"
] | 5 | 2019-03-01T22:21:48.000Z | 2020-05-17T02:05:58.000Z | from flask import Flask, redirect, render_template, url_for
import numpy as np
app = Flask( __name__ )
@app.route( '/home' )
def index():
# retrieve the agent
agent = app.config['AGENT']
print( 'Episode: {}/{}'.format( agent.get_episode(), agent.get_episodes() ) )
print( 'Trial: {}/{}'.format( agent.... | 29.554688 | 94 | 0.648427 | from flask import Flask, redirect, render_template, url_for
import numpy as np
app = Flask( __name__ )
@app.route( '/home' )
def index():
agent = app.config['AGENT']
print( 'Episode: {}/{}'.format( agent.get_episode(), agent.get_episodes() ) )
print( 'Trial: {}/{}'.format( agent.get_trial(), agent.ge... | true | true |
f714d9ff51f72caaaa2af83ccd179ae251b0bb23 | 1,929 | py | Python | examples/conjunctive_graphs.py | tonyfast/rdflib | e4fe0fdbd4de7e1183418f302315b51a14602e03 | [
"BSD-3-Clause"
] | 2 | 2021-02-06T17:36:05.000Z | 2021-04-21T07:33:39.000Z | examples/conjunctive_graphs.py | pragya16067/rdflib | 6b5bd37ccc67bdec62d2e36d174eb7933b5020b2 | [
"BSD-3-Clause"
] | 2 | 2020-05-09T15:03:57.000Z | 2020-05-30T10:51:40.000Z | examples/conjunctive_graphs.py | pragya16067/rdflib | 6b5bd37ccc67bdec62d2e36d174eb7933b5020b2 | [
"BSD-3-Clause"
] | 4 | 2020-05-08T08:36:19.000Z | 2020-05-28T07:23:23.000Z | """
An RDFLib ConjunctiveGraph is an (unnamed) aggregation of all the named graphs
within a Store. The :meth:`~rdflib.graph.ConjunctiveGraph.get_context`
method can be used to get a particular named graph for use such as to add
triples to, or the default graph can be used
This example shows how to create named graphs ... | 32.15 | 82 | 0.65578 |
from rdflib import Namespace, Literal, URIRef
from rdflib.graph import Graph, ConjunctiveGraph
from rdflib.plugins.memory import IOMemory
if __name__ == "__main__":
ns = Namespace("http://love.com#")
mary = URIRef("http://love.com/lovers/mary")
john = URIRef("http://love.com/lovers/john")
cmary = U... | true | true |
f714da0d0e3039473d2c96ef73abc9cc0aa2fb6a | 13,287 | py | Python | pandas/core/indexes/extension.py | andrei-assa/pandas | ded76dbbfdff3211cfff0ec7039611b50d531efb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/extension.py | andrei-assa/pandas | ded76dbbfdff3211cfff0ec7039611b50d531efb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/extension.py | andrei-assa/pandas | ded76dbbfdff3211cfff0ec7039611b50d531efb | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """
Shared methods for Index subclasses backed by ExtensionArray.
"""
from typing import (
Hashable,
List,
Type,
TypeVar,
Union,
)
import numpy as np
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import (
cache_readonl... | 29.79148 | 87 | 0.611274 | from typing import (
Hashable,
List,
Type,
TypeVar,
Union,
)
import numpy as np
from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import (
cache_readonly,
doc,
)
from pandas.core.dtypes.cast import (
find_common_t... | true | true |
f714da179a33d1d5ea2c52e3e23e127d722d3088 | 110 | py | Python | Data Structures/Array/FindSingleNumber.py | prabhupant/daily-coding-problem | b3775dd0ad823823e60100624ccf14235c446098 | [
"MIT"
] | null | null | null | Data Structures/Array/FindSingleNumber.py | prabhupant/daily-coding-problem | b3775dd0ad823823e60100624ccf14235c446098 | [
"MIT"
] | null | null | null | Data Structures/Array/FindSingleNumber.py | prabhupant/daily-coding-problem | b3775dd0ad823823e60100624ccf14235c446098 | [
"MIT"
] | null | null | null | def find_single(arr, n):
res = arr[0]
for i in range(1,n):
res = res ^ arr[i]
return res
| 15.714286 | 26 | 0.518182 | def find_single(arr, n):
res = arr[0]
for i in range(1,n):
res = res ^ arr[i]
return res
| true | true |
f714dae6a19b474807991a76b68862fa4ed2b7a5 | 42,485 | py | Python | controllers/results.py | admed/molgears | 385c5bf1a00d54961042e75f345626f890f43bde | [
"BSD-3-Clause"
] | 5 | 2017-01-18T07:29:02.000Z | 2018-09-26T08:44:10.000Z | controllers/results.py | admed/molgears | 385c5bf1a00d54961042e75f345626f890f43bde | [
"BSD-3-Clause"
] | null | null | null | controllers/results.py | admed/molgears | 385c5bf1a00d54961042e75f345626f890f43bde | [
"BSD-3-Clause"
] | 4 | 2016-02-07T02:14:48.000Z | 2021-04-03T17:49:15.000Z | # -*- coding: utf-8 -*-
"""Sample controller with all its actions protected."""
from tg import expose, flash, redirect, request
from tg.i18n import lazy_ugettext as l_
from molgears.model import DBSession, Tags, LCompound, LPurity, Names
from molgears.model import Compound, User, Projects
from molgears.model.auth impor... | 53.507557 | 240 | 0.427775 | from tg import expose, flash, redirect, request
from tg.i18n import lazy_ugettext as l_
from molgears.model import DBSession, Tags, LCompound, LPurity, Names
from molgears.model import Compound, User, Projects
from molgears.model.auth import UserLists
from molgears.lib.base import BaseController
import os
from sqlalche... | true | true |
f714dbac06e6467ae8dac56a6f4797e46e75a4c1 | 30,324 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/operations/_ddos_protection_plans_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.711475 | 207 | 0.667491 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f714dbc004258f17a45bcd057be6ef72a01f16ec | 414 | py | Python | setup.py | SabevAtGitHub/qspreadsheet | 29127dd6f38573c7ede7680cf8f4852368fb2c38 | [
"MIT"
] | null | null | null | setup.py | SabevAtGitHub/qspreadsheet | 29127dd6f38573c7ede7680cf8f4852368fb2c38 | [
"MIT"
] | null | null | null | setup.py | SabevAtGitHub/qspreadsheet | 29127dd6f38573c7ede7680cf8f4852368fb2c38 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='qspreadsheet',
version='0.1.0',
author='TT-at-GitHub',
author_email='tt3d@start.bg',
license='MIT',
packages=setuptools.find_packages(),
install_requires=[
'numpy>=1.19.0',
'pandas>=1.0.5',
'PySide2>=5.13.0'
],
descri... | 24.352941 | 72 | 0.615942 | import setuptools
setuptools.setup(
name='qspreadsheet',
version='0.1.0',
author='TT-at-GitHub',
author_email='tt3d@start.bg',
license='MIT',
packages=setuptools.find_packages(),
install_requires=[
'numpy>=1.19.0',
'pandas>=1.0.5',
'PySide2>=5.13.0'
],
descri... | true | true |
f714dbe7af81229b495cab12b96c587e22021104 | 913 | py | Python | var/spack/repos/builtin/packages/libgcrypt/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-08-20T06:55:11.000Z | 2018-08-20T06:55:11.000Z | var/spack/repos/builtin/packages/libgcrypt/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-04-29T22:36:27.000Z | 2019-04-30T12:51:38.000Z | var/spack/repos/builtin/packages/libgcrypt/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-12T19:27:17.000Z | 2020-03-12T19:27:17.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libgcrypt(AutotoolsPackage):
"""Libgcrypt is a general purpose cryptographic library based... | 39.695652 | 74 | 0.736035 |
from spack import *
class Libgcrypt(AutotoolsPackage):
homepage = "http://www.gnu.org/software/libgcrypt/"
url = "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.1.tar.bz2"
version('1.8.1', 'b21817f9d850064d2177285f1073ec55')
version('1.7.6', '54e180679a7ae4d090f8689ca32b654c')
version('1.6... | true | true |
f714dc8856bcaebac5a0892eb1e21befd216579a | 10,791 | py | Python | examples/Ball_Drop/GenDataBallDrop1.py | lanl/SEPIA | 0a1e606e1d1072f49e4f3f358962bd8918a5d3a3 | [
"BSD-3-Clause"
] | 19 | 2020-06-22T16:37:07.000Z | 2022-02-18T22:50:59.000Z | examples/Ball_Drop/GenDataBallDrop1.py | lanl/SEPIA | 0a1e606e1d1072f49e4f3f358962bd8918a5d3a3 | [
"BSD-3-Clause"
] | 41 | 2020-07-07T22:52:33.000Z | 2021-11-04T14:05:03.000Z | examples/Ball_Drop/GenDataBallDrop1.py | lanl/SEPIA | 0a1e606e1d1072f49e4f3f358962bd8918a5d3a3 | [
"BSD-3-Clause"
] | 6 | 2020-08-14T18:58:45.000Z | 2022-03-01T21:00:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 24 07:52:25 2020
Generate, Plot, and write all data needed for ball drop example 1
@author: granthutchings
"""
#%% Imports
import numpy as np
#import pyDOE # Latin Hypercube
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
fro... | 38.130742 | 124 | 0.587712 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from invertH import invertHsim, invertHtrue
# 1. generate the h-t pairs and write them into files. (this file and invertH.py)
# 2. a "runmcmc"-type file that first ... | true | true |
f714dd2831864994b43276d37c673f59de37c3f8 | 13,979 | py | Python | monai/transforms/io/dictionary.py | tatuanb/monai_V1 | 41e492b61c78bb3c303f38b03fe9fdc74a3c2e96 | [
"Apache-2.0"
] | 2,971 | 2019-10-16T23:53:16.000Z | 2022-03-31T20:58:24.000Z | monai/transforms/io/dictionary.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 2,851 | 2020-01-10T16:23:44.000Z | 2022-03-31T22:14:53.000Z | monai/transforms/io/dictionary.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 614 | 2020-01-14T19:18:01.000Z | 2022-03-31T14:06:14.000Z | # Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 52.552632 | 115 | 0.654625 |
from pathlib import Path
from typing import Optional, Union
import numpy as np
from monai.config import DtypeLike, KeysCollection
from monai.data.image_reader import ImageReader
from monai.transforms.io.array import LoadImage, SaveImage
from monai.transforms.transform import MapTransform
from monai.utils import Grid... | true | true |
f714dd425e33726e34a19c85ff11b50408c2213b | 3,088 | py | Python | overhave/cli/s3.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 33 | 2021-02-01T15:49:37.000Z | 2021-12-20T00:44:43.000Z | overhave/cli/s3.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 46 | 2021-02-03T12:56:52.000Z | 2021-12-19T18:50:27.000Z | overhave/cli/s3.py | TinkoffCreditSystems/overhave | b0ab705ef5c5c5a65fa0b14b173b64fd7310e187 | [
"Apache-2.0"
] | 1 | 2021-12-07T09:02:44.000Z | 2021-12-07T09:02:44.000Z | from datetime import timedelta
from pathlib import Path
import click
from overhave.base_settings import LoggingSettings
from overhave.cli.group import overhave
from overhave.transport import OverhaveS3Bucket, OverhaveS3ManagerSettings, S3Manager
from overhave.utils import get_current_time
@overhave.group(short_help... | 32.166667 | 112 | 0.70693 | from datetime import timedelta
from pathlib import Path
import click
from overhave.base_settings import LoggingSettings
from overhave.cli.group import overhave
from overhave.transport import OverhaveS3Bucket, OverhaveS3ManagerSettings, S3Manager
from overhave.utils import get_current_time
@overhave.group(short_help... | true | true |
f714ddbe1fa4334438b63d1817170ad4c1db0595 | 2,250 | py | Python | coffea/lookup_tools/dense_lookup.py | kmohrman/coffea | 1963fc9371552b348a15084f5bde9390be1e6e1c | [
"BSD-3-Clause"
] | 1 | 2020-11-19T21:50:34.000Z | 2020-11-19T21:50:34.000Z | coffea/lookup_tools/dense_lookup.py | kondratyevd/coffea | 2baae94028c38b59f0eb52127d8fb92840dbf23d | [
"BSD-3-Clause"
] | null | null | null | coffea/lookup_tools/dense_lookup.py | kondratyevd/coffea | 2baae94028c38b59f0eb52127d8fb92840dbf23d | [
"BSD-3-Clause"
] | null | null | null | from coffea.lookup_tools.lookup_base import lookup_base
import numpy
from copy import deepcopy
class dense_lookup(lookup_base):
def __init__(self, values, dims, feval_dim=None):
super(dense_lookup, self).__init__()
self._dimension = 0
whattype = type(dims)
if whattype == numpy.nda... | 34.615385 | 84 | 0.517333 | from coffea.lookup_tools.lookup_base import lookup_base
import numpy
from copy import deepcopy
class dense_lookup(lookup_base):
def __init__(self, values, dims, feval_dim=None):
super(dense_lookup, self).__init__()
self._dimension = 0
whattype = type(dims)
if whattype == numpy.nda... | true | true |
f714ddd185814029f4f28b3c294fecf5acc1b57a | 834 | py | Python | components/py_engine/adapter/esp32/m5stackcore2/boot.py | yong171966/AliOS-Things | df29e6886cec68885db9975d5b9f51f057c2ba04 | [
"Apache-2.0"
] | null | null | null | components/py_engine/adapter/esp32/m5stackcore2/boot.py | yong171966/AliOS-Things | df29e6886cec68885db9975d5b9f51f057c2ba04 | [
"Apache-2.0"
] | null | null | null | components/py_engine/adapter/esp32/m5stackcore2/boot.py | yong171966/AliOS-Things | df29e6886cec68885db9975d5b9f51f057c2ba04 | [
"Apache-2.0"
] | null | null | null | import axp192
import kv
try:
# for m5stack-core2 only
axp = axp192.Axp192()
axp.powerAll()
axp.setLCDBrightness(80) # 设置背光亮度 0~100
except OSError:
print("make sure axp192.py is in libs folder")
def _on_get_url(url):
kv.set('_amp_pyapp_url', url)
execfile('/lib/appOta.py')
def _connect_... | 22.540541 | 57 | 0.672662 | import axp192
import kv
try:
axp = axp192.Axp192()
axp.powerAll()
axp.setLCDBrightness(80) except OSError:
print("make sure axp192.py is in libs folder")
def _on_get_url(url):
kv.set('_amp_pyapp_url', url)
execfile('/lib/appOta.py')
def _connect_wifi(ssid, passwd):
import network
... | true | true |
f714dedfb2fc55a060893bd7f928aefbca6e4e47 | 3,001 | py | Python | sphinx/ext/duration.py | samdoran/sphinx | 4c91c038b220d07bbdfe0c1680af42fe897f342c | [
"BSD-2-Clause"
] | 4,973 | 2015-01-03T15:44:00.000Z | 2022-03-31T03:11:51.000Z | sphinx/ext/duration.py | samdoran/sphinx | 4c91c038b220d07bbdfe0c1680af42fe897f342c | [
"BSD-2-Clause"
] | 7,850 | 2015-01-02T08:09:25.000Z | 2022-03-31T18:57:40.000Z | sphinx/ext/duration.py | samdoran/sphinx | 4c91c038b220d07bbdfe0c1680af42fe897f342c | [
"BSD-2-Clause"
] | 2,179 | 2015-01-03T15:26:53.000Z | 2022-03-31T12:22:44.000Z | """
sphinx.ext.duration
~~~~~~~~~~~~~~~~~~~
Measure durations of Sphinx processing.
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from datetime import datetime, timedelta
from itertools import islice
from operator import itemgetter
fr... | 31.260417 | 95 | 0.680107 |
from datetime import datetime, timedelta
from itertools import islice
from operator import itemgetter
from typing import Any, Dict, List, cast
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.domains import Domain
from sphinx.locale import __
from sphinx.util import logging
logger = logg... | true | true |
f714df06f4b8553ddceb7ea6424b300d9bce8373 | 1,678 | py | Python | saleor/store/migrations/0002_auto_20210513_1002.py | autobotasia/saleor | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | [
"CC-BY-4.0"
] | 1 | 2022-02-19T13:27:40.000Z | 2022-02-19T13:27:40.000Z | saleor/store/migrations/0002_auto_20210513_1002.py | autobotasia/saleor | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | [
"CC-BY-4.0"
] | null | null | null | saleor/store/migrations/0002_auto_20210513_1002.py | autobotasia/saleor | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | [
"CC-BY-4.0"
] | 2 | 2021-12-03T16:59:37.000Z | 2022-02-19T13:05:42.000Z | # Generated by Django 3.1.7 on 2021-05-13 03:02
from django.db import migrations, models
import django.utils.timezone
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('store', '0001_initial'),
]
operations = [
migrations.AddField(
model... | 29.438596 | 83 | 0.565554 |
from django.db import migrations, models
import django.utils.timezone
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('store', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='store',
name='city',
... | true | true |
f714df9ac1fd6d0bf4721aeb747d23287a74cfba | 15,684 | py | Python | tests/python/unit/dku_timeseries/resampling/test_resampler_helpers.py | dataiku/dss-plugin-timeseries-preparation | bdb662c909a0ad6d7845325a70e3dac2bdcc6b28 | [
"Apache-2.0"
] | 2 | 2021-03-12T10:48:20.000Z | 2021-04-23T09:37:18.000Z | tests/python/unit/dku_timeseries/resampling/test_resampler_helpers.py | dataiku/dss-plugin-timeseries-preparation | bdb662c909a0ad6d7845325a70e3dac2bdcc6b28 | [
"Apache-2.0"
] | 27 | 2020-07-22T15:49:25.000Z | 2021-06-18T09:40:48.000Z | tests/python/unit/dku_timeseries/resampling/test_resampler_helpers.py | dataiku/dss-plugin-timeseries-preparation | bdb662c909a0ad6d7845325a70e3dac2bdcc6b28 | [
"Apache-2.0"
] | 1 | 2021-06-01T12:49:53.000Z | 2021-06-01T12:49:53.000Z | import numpy as np
import pandas as pd
import pytest
from dku_timeseries.timeseries_helpers import generate_date_range, get_date_offset
from recipe_config_loading import get_resampling_params
@pytest.fixture
def config():
config = {u'clip_end': 0, u'constant_value': 0, u'extrapolation_method': u'none', u'shift':... | 49.166144 | 153 | 0.615851 | import numpy as np
import pandas as pd
import pytest
from dku_timeseries.timeseries_helpers import generate_date_range, get_date_offset
from recipe_config_loading import get_resampling_params
@pytest.fixture
def config():
config = {u'clip_end': 0, u'constant_value': 0, u'extrapolation_method': u'none', u'shift':... | true | true |
f714e02bb7e930b170e446ab67321d019d589be2 | 1,958 | py | Python | fltk/nets/fashion_mnist_ls_gan.py | nata1y/fltk-testbed-group-3 | e23b59fa2a5e638d3804a39fe5012983e2988ca6 | [
"BSD-2-Clause"
] | null | null | null | fltk/nets/fashion_mnist_ls_gan.py | nata1y/fltk-testbed-group-3 | e23b59fa2a5e638d3804a39fe5012983e2988ca6 | [
"BSD-2-Clause"
] | null | null | null | fltk/nets/fashion_mnist_ls_gan.py | nata1y/fltk-testbed-group-3 | e23b59fa2a5e638d3804a39fe5012983e2988ca6 | [
"BSD-2-Clause"
] | 2 | 2021-05-03T17:40:18.000Z | 2021-05-11T09:34:30.000Z | import torch.nn as nn
class Generator(nn.Module):
def __init__(self, img_size=32):
super(Generator, self).__init__()
# TODO: update to proper image size
self.init_size = img_size // 4
self.l1 = nn.Sequential(nn.Linear(10, 128 * self.init_size ** 2))
self.conv_blocks = nn.... | 32.633333 | 118 | 0.569969 | import torch.nn as nn
class Generator(nn.Module):
def __init__(self, img_size=32):
super(Generator, self).__init__()
self.init_size = img_size // 4
self.l1 = nn.Sequential(nn.Linear(10, 128 * self.init_size ** 2))
self.conv_blocks = nn.Sequential(
nn.Upsample(... | true | true |
f714e05a9950ae7e34d7aeff00d5514217f9ba13 | 1,811 | py | Python | vimsetting/bundle/VOom/autoload/voom/voom_mode_org.py | thuleqaid/boost_study | 59469af4e7b569c87c0a1de53644a39e7f9ae766 | [
"MIT"
] | 1 | 2016-03-02T16:44:59.000Z | 2016-03-02T16:44:59.000Z | vimsetting/bundle/VOom/autoload/voom/voom_mode_org.py | thuleqaid/boost_study | 59469af4e7b569c87c0a1de53644a39e7f9ae766 | [
"MIT"
] | null | null | null | vimsetting/bundle/VOom/autoload/voom/voom_mode_org.py | thuleqaid/boost_study | 59469af4e7b569c87c0a1de53644a39e7f9ae766 | [
"MIT"
] | null | null | null | # voom_mode_org.py
# Last Modified: 2013-10-31
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/
"""
VOoM markup ... | 31.224138 | 84 | 0.629486 |
import re
headline_match = re.compile(r'^(\*+)\s').match
def hook_makeOutline(VO, blines):
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
if not blines[i].startswith('*'):
co... | true | true |
f714e1119b8f7e34f516de3746a674c249a5f780 | 969 | py | Python | experiments/2014-01-28-extrap-SE.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 151 | 2015-01-09T19:25:05.000Z | 2022-01-05T02:05:52.000Z | experiments/2014-01-28-extrap-SE.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 1 | 2016-08-04T13:12:51.000Z | 2016-08-04T13:12:51.000Z | experiments/2014-01-28-extrap-SE.py | jaesikchoi/gpss-research | 2a64958a018f1668f7b8eedf33c4076a63af7868 | [
"MIT"
] | 59 | 2015-02-04T19:13:58.000Z | 2021-07-28T23:36:09.000Z | Experiment(description='SE extrapolation experiment',
data_dir='../data/tsdlr_9010/',
max_depth=1,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
max_jobs=1000... | 33.413793 | 83 | 0.495356 | Experiment(description='SE extrapolation experiment',
data_dir='../data/tsdlr_9010/',
max_depth=1,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
max_jobs=1000... | true | true |
f714e120e53da70f11f7c6bb03b17c5cd3ea28fe | 1,756 | py | Python | python/draw_height_time.py | ntu-as-cooklab/Weather-Balloon-Radiosonde-Tracker | 85e85a869439798475ad6711c280dae630c03c46 | [
"MIT"
] | 5 | 2018-04-24T19:43:20.000Z | 2022-01-24T19:31:48.000Z | python/draw_height_time.py | ntu-as-cooklab/Weather-Balloon-Radiosonde-Tracker | 85e85a869439798475ad6711c280dae630c03c46 | [
"MIT"
] | 3 | 2017-12-28T15:30:49.000Z | 2018-03-07T15:01:25.000Z | python/draw_height_time.py | ntu-as-cooklab/Weather-Balloon-Radiosonde-Tracker | 85e85a869439798475ad6711c280dae630c03c46 | [
"MIT"
] | 1 | 2018-03-07T12:59:27.000Z | 2018-03-07T12:59:27.000Z | from os import listdir, getcwd
from os.path import isfile, join
from math import sin, cos
from setting_utils import timeLimit, heightLimit, input_stream
files = [f for f in listdir(join(getcwd(), 'uploads')) if isfile(join(getcwd(), 'uploads', f))]
files = [f for f in files if f.endswith(".txt")]
czml =(
'var heigh... | 22.512821 | 95 | 0.514237 | from os import listdir, getcwd
from os.path import isfile, join
from math import sin, cos
from setting_utils import timeLimit, heightLimit, input_stream
files = [f for f in listdir(join(getcwd(), 'uploads')) if isfile(join(getcwd(), 'uploads', f))]
files = [f for f in files if f.endswith(".txt")]
czml =(
'var heigh... | true | true |
f714e1362842774b2075236c5764ecaf5ce5ef8c | 24,230 | py | Python | bagit_profile.py | tdilauro/bagit-profiles-validator | e73b66223fc05bc2498cb7f6dd5814940e8852e7 | [
"Unlicense"
] | 3 | 2018-05-18T16:07:57.000Z | 2020-05-01T16:08:26.000Z | bagit_profile.py | tdilauro/bagit-profiles-validator | e73b66223fc05bc2498cb7f6dd5814940e8852e7 | [
"Unlicense"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/bagit_profile.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 3 | 2018-11-06T17:04:45.000Z | 2021-07-21T08:08:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple Python module for validating BagIt profiles. See
https://github.com/bagit-profiles/bagit-profiles
for more information.
This module is intended for use with https://github.com/edsu/bagit but does not extend it.
Usage:
import bagit
import bagit_profile
# I... | 39.786535 | 139 | 0.586587 |
import json
import logging
import mimetypes
import sys
from fnmatch import fnmatch
from os import listdir, walk
from os.path import basename, exists, isdir, isfile, join, relpath, split
if sys.version_info > (3,):
basestring = str
from urllib.request import urlopen else:
basestring = basestring
fro... | true | true |
f714e2196b368d98e5bacb6be6c5d3f861d519e1 | 1,340 | py | Python | tests/unit/Sentry.py | jayvdb/platform-engine | 31fb8f329dc12d75e35d85c138718f68568b893a | [
"Apache-2.0"
] | null | null | null | tests/unit/Sentry.py | jayvdb/platform-engine | 31fb8f329dc12d75e35d85c138718f68568b893a | [
"Apache-2.0"
] | null | null | null | tests/unit/Sentry.py | jayvdb/platform-engine | 31fb8f329dc12d75e35d85c138718f68568b893a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from asyncy.Exceptions import StoryscriptError
from asyncy.Sentry import Sentry
from raven import Client
def test_init(patch):
# noinspection PyTypeChecker
Sentry.init(None, None) # No-op.
patch.init(Client)
Sentry.init('sentry_dsn', 'release_ver')
Client.__init__.assert_... | 27.916667 | 69 | 0.653731 | from asyncy.Exceptions import StoryscriptError
from asyncy.Sentry import Sentry
from raven import Client
def test_init(patch):
Sentry.init(None, None) patch.init(Client)
Sentry.init('sentry_dsn', 'release_ver')
Client.__init__.assert_called_with(
dsn='sentry_dsn',
enable_breadcru... | true | true |
f714e2c0711678f8f014bdff84f94e2145a726a0 | 1,389 | py | Python | bot.py | phy1um/tmtc-discord-bot | 7d01cd4c1a78dc0b8aa2bb703c8970ff7bb27f92 | [
"MIT"
] | null | null | null | bot.py | phy1um/tmtc-discord-bot | 7d01cd4c1a78dc0b8aa2bb703c8970ff7bb27f92 | [
"MIT"
] | null | null | null | bot.py | phy1um/tmtc-discord-bot | 7d01cd4c1a78dc0b8aa2bb703c8970ff7bb27f92 | [
"MIT"
] | null | null | null | from constants import *
from gateway_protocol import Gateway
from api import DiscordAPI
import bot_config as config
import logging as log
log.basicConfig(encoding='utf-8', level=log.DEBUG)
class Bot(object):
def __init__(self, token):
self.g = Gateway(token)
self.api = DiscordAPI(token)
de... | 23.948276 | 97 | 0.614111 | from constants import *
from gateway_protocol import Gateway
from api import DiscordAPI
import bot_config as config
import logging as log
log.basicConfig(encoding='utf-8', level=log.DEBUG)
class Bot(object):
def __init__(self, token):
self.g = Gateway(token)
self.api = DiscordAPI(token)
de... | true | true |
f714e36b0fce1ae5deb107d8990396cd61bd0910 | 3,150 | py | Python | database/zenodo.py | MRCIEU/ewascatalog | a37dfeb207537831b4c5e313e0edecbad8a7c1a2 | [
"MIT"
] | 1 | 2021-08-05T09:39:48.000Z | 2021-08-05T09:39:48.000Z | database/zenodo.py | MRCIEU/ewascatalog | a37dfeb207537831b4c5e313e0edecbad8a7c1a2 | [
"MIT"
] | null | null | null | database/zenodo.py | MRCIEU/ewascatalog | a37dfeb207537831b4c5e313e0edecbad8a7c1a2 | [
"MIT"
] | null | null | null | # script to upload a file to zenodo sandbox via api
# seperate sandbox- and real-zenodo accounts and ACCESS_TOKENs each need to be created
# to adapt this script to real-zenodo (from sandbox implementation):
# update urls to zenodo.org from sandbox.zenodo.org
# update SANDBOX_TOKEN to a ACCESS_TOKEN from real-... | 40.384615 | 273 | 0.729524 |
import sys, json, requests
import pandas as pd
studyid = sys.argv[1]
file_dir = sys.argv[2]
access_token = sys.argv[3]
data_dir = file_dir+'/ewas-sum-stats/to-add/'+studyid
zfile=data_dir+'/zenodo.csv'
try:
zdata = pd.read_csv(zfile)
except FileNotFoundError:
print("Can't find the file "+zfile)
... | true | true |
f714e3a075ce1c505d60b891128c7925fcf59c0c | 4,476 | py | Python | mars/worker/tests/test_dispatcher.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | mars/worker/tests/test_dispatcher.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | mars/worker/tests/test_dispatcher.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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 a... | 43.038462 | 108 | 0.638517 |
import time
from functools import partial
import gevent
from mars.tests.core import patch_method
from mars.utils import get_next_port
from mars.actors import create_actor_pool
from mars.promise import PromiseActor
from mars.worker import *
from mars.worker.tests.base import WorkerCase
class TaskActor(PromiseActor)... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.