hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
910e8be7e5b1b9b4f3b8652ef7711ef957c57b03 | 6,910 | py | Python | strikethrough_classification/src/train.py | RaphaelaHeil/strikethrough-removal-cyclegans | 91555b22cac6b6a379597aa94c23bdf02c9970a7 | [
"MIT"
] | 3 | 2021-08-30T12:37:14.000Z | 2022-02-09T16:07:14.000Z | strikethrough_classification/src/train.py | ektavats/strikethrough-removal-cyclegans | 35456619ff87fa010d2c161cff774af02142bae9 | [
"MIT"
] | null | null | null | strikethrough_classification/src/train.py | ektavats/strikethrough-removal-cyclegans | 35456619ff87fa010d2c161cff774af02142bae9 | [
"MIT"
] | 1 | 2022-01-25T10:30:54.000Z | 2022-01-25T10:30:54.000Z | """
Code to train a neural network to identify which type of stroke a word was struck-through with.
"""
import logging
import time
from pathlib import Path
from typing import List, Tuple
import numpy as np
import torch
from sklearn.metrics import f1_score, accuracy_score
from torch.utils.data import DataLoader
from .... | 37.150538 | 120 | 0.639942 |
910ec127333e6b8f516ac03407cbac1c136609b1 | 3,520 | py | Python | test/knxip_tests/connect_response_test.py | M-o-a-T/xknx | 0cf07a01a44c76478d916884437f3f4769a4ddd5 | [
"MIT"
] | null | null | null | test/knxip_tests/connect_response_test.py | M-o-a-T/xknx | 0cf07a01a44c76478d916884437f3f4769a4ddd5 | [
"MIT"
] | null | null | null | test/knxip_tests/connect_response_test.py | M-o-a-T/xknx | 0cf07a01a44c76478d916884437f3f4769a4ddd5 | [
"MIT"
] | null | null | null | """Unit test for KNX/IP ConnectResponses."""
import asyncio
import unittest
from xknx import XKNX
from xknx.exceptions import CouldNotParseKNXIP
from xknx.knxip import (
HPAI, ConnectRequestType, ConnectResponse, ErrorCode, KNXIPFrame,
KNXIPServiceType)
class Test_KNXIP_ConnectResponse(unittest.TestCase):
... | 40.930233 | 86 | 0.664205 |
910ec2a450b488ecb2af150554e6af18dac33dbe | 153 | py | Python | Turtles/index10.py | Sudani-Coder/python | 9c35f04a0521789ba91b7058695139ed074f7796 | [
"MIT"
] | null | null | null | Turtles/index10.py | Sudani-Coder/python | 9c35f04a0521789ba91b7058695139ed074f7796 | [
"MIT"
] | null | null | null | Turtles/index10.py | Sudani-Coder/python | 9c35f04a0521789ba91b7058695139ed074f7796 | [
"MIT"
] | null | null | null | import turtle
tom = turtle.Turtle()
tom.color("cyan")
tom.width(3)
for side in range(22):
tom.forward(side * 10)
tom.right(360 / 3)
input()
| 10.928571 | 26 | 0.633987 |
910ecb9c58bbdf00683f8fd1c4d6590e92c7d11f | 4,222 | py | Python | firetower/admin.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | 3 | 2015-11-08T11:30:56.000Z | 2019-11-20T07:31:47.000Z | firetower/admin.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | null | null | null | firetower/admin.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | null | null | null | import datetime
import time
import json
import sys
from math import sqrt
from logbook import Logger
from logbook import TimedRotatingFileHandler
from optparse import OptionParser
import category
import classifier
import config
import redis_util
TASKS = (
'calc_stats',
'archive_events',
)
class Ad... | 31.744361 | 99 | 0.601137 |
910eefa9acd92df15d38acfb7c579cd518b1a538 | 182 | py | Python | SIMULADOR/config/BROKER_CONECTION.py | wisrovi/MANITOR-WISROVI | e4b08a9bae4ec9d1a1f0acde08a84e2b8c5e7b51 | [
"MIT"
] | null | null | null | SIMULADOR/config/BROKER_CONECTION.py | wisrovi/MANITOR-WISROVI | e4b08a9bae4ec9d1a1f0acde08a84e2b8c5e7b51 | [
"MIT"
] | null | null | null | SIMULADOR/config/BROKER_CONECTION.py | wisrovi/MANITOR-WISROVI | e4b08a9bae4ec9d1a1f0acde08a84e2b8c5e7b51 | [
"MIT"
] | null | null | null | # si se usa mosquito se debe ejecutar:
# mosquitto -p 1884
BROKER_MQTT = "100.24.61.248" # "192.168.0.109" # ip del broker
PORT_MQTT = 1883 # puerto del broker
USER = ""
PWD = ""
| 22.75 | 64 | 0.659341 |
910ef698981e05b36f0d36710e6f745c6eeb2055 | 3,017 | py | Python | dags/oss_know/oss_know_dags/dags_github/dag_github_init_issues_timeline.py | ynang/airflow-jobs-1 | 857e9dfbc2444dc1d23dd2b0463fe89108f01b89 | [
"Apache-2.0"
] | 4 | 2022-01-24T11:27:39.000Z | 2022-02-25T11:44:10.000Z | dags/oss_know/oss_know_dags/dags_github/dag_github_init_issues_timeline.py | linruoma/airflow-jobs-1 | 25d3996c6d11ee2d8f93ff2b73abcf83da986804 | [
"Apache-2.0"
] | 13 | 2021-12-17T12:14:11.000Z | 2022-02-24T07:01:08.000Z | dags/oss_know/oss_know_dags/dags_github/dag_github_init_issues_timeline.py | linruoma/airflow-jobs-1 | 25d3996c6d11ee2d8f93ff2b73abcf83da986804 | [
"Apache-2.0"
] | 13 | 2022-01-19T09:30:03.000Z | 2022-03-02T10:45:07.000Z | from datetime import datetime
from airflow import DAG
from airflow.operators.python import PythonOperator
# v0.0.1
from oss_know.libs.base_dict.variable_key import NEED_INIT_GITHUB_ISSUES_TIMELINE_REPOS, GITHUB_TOKENS, \
OPENSEARCH_CONN_DATA, PROXY_CONFS
from oss_know.libs.util.proxy import KuaiProxyService, Prox... | 40.226667 | 111 | 0.705668 |
910f160bebb8e192e40ec2a9bf1b442f19cab88d | 2,388 | py | Python | Settings/Macros_DAnTE.py | xzhang-wr/DAnTE_V2 | 8b433973aa5ab47ef237d8dfaca6232a6d9f526b | [
"Apache-2.0"
] | null | null | null | Settings/Macros_DAnTE.py | xzhang-wr/DAnTE_V2 | 8b433973aa5ab47ef237d8dfaca6232a6d9f526b | [
"Apache-2.0"
] | null | null | null | Settings/Macros_DAnTE.py | xzhang-wr/DAnTE_V2 | 8b433973aa5ab47ef237d8dfaca6232a6d9f526b | [
"Apache-2.0"
] | null | null | null | #!usr/bin/env python
__author__ = "Min Sung Ahn"
__email__ = "aminsung@gmail.com"
__copyright__ = "Copyright 2019 RoMeLa"
__date__ = "January 1, 1999"
__version__ = "0.1.0"
__status__ = "Beta"
"""
Script that holds macros for robot tuning.
"""
# ==================================================
# ==============... | 28.771084 | 119 | 0.580402 |
910f3057f4affd765772cd8fc8c47272c17e9c07 | 7,238 | py | Python | NavPython/IronPython/Lib/compileall.py | jstammers/EDMSuite | 2841c0edef32a496855ca41deaa0f710b017ae2f | [
"MIT"
] | 76 | 2015-12-20T16:56:37.000Z | 2021-12-13T09:40:48.000Z | NavPython/IronPython/Lib/compileall.py | jstammers/EDMSuite | 2841c0edef32a496855ca41deaa0f710b017ae2f | [
"MIT"
] | 20 | 2015-04-20T12:09:12.000Z | 2022-03-12T01:25:04.000Z | NavPython/IronPython/Lib/compileall.py | jstammers/EDMSuite | 2841c0edef32a496855ca41deaa0f710b017ae2f | [
"MIT"
] | 24 | 2015-07-22T08:08:54.000Z | 2021-12-28T06:56:09.000Z | """Module/script to "compile" all .py files to .pyc (or .pyo) file.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.
Without arguments, if compiles all modules on sys.path, without
recursing into subdirecto... | 33.665116 | 80 | 0.534954 |
910f40afa0bbca0500b1304b4dd241a25306f20a | 5,856 | py | Python | shard/src/utils.py | architus/architus | bb9a30acf6c9ac7538f99f04cf1ebfb538ec5cd0 | [
"MIT"
] | 27 | 2019-07-06T07:04:26.000Z | 2022-02-12T12:10:54.000Z | shard/src/utils.py | architus/architus | bb9a30acf6c9ac7538f99f04cf1ebfb538ec5cd0 | [
"MIT"
] | 65 | 2019-07-06T07:12:45.000Z | 2021-10-31T22:45:07.000Z | shard/src/utils.py | architus/architus | bb9a30acf6c9ac7538f99f04cf1ebfb538ec5cd0 | [
"MIT"
] | 17 | 2019-07-06T06:59:04.000Z | 2021-06-26T13:42:06.000Z | from datetime import datetime
from pytz import timezone
from aiohttp import ClientSession
import io
import functools
from string import digits
import discord
from lib.config import logger
from lib.ipc import manager_pb2 as message
async def download_emoji(emoji: discord.Emoji) -> io.BytesIO:
async with ClientSe... | 33.462857 | 106 | 0.624488 |
910f657f7fc6ec1dcf7a92348f9873c464062e82 | 24,850 | py | Python | models/water_supply/run.py | roseDickinson/nismod2 | 5c571b055a6f5dc26bdc2bc8950b9cf1c9202fca | [
"MIT"
] | 5 | 2019-12-18T15:27:28.000Z | 2020-10-03T09:10:23.000Z | models/water_supply/run.py | roseDickinson/nismod2 | 5c571b055a6f5dc26bdc2bc8950b9cf1c9202fca | [
"MIT"
] | 11 | 2019-12-18T14:53:03.000Z | 2021-12-30T07:26:46.000Z | models/water_supply/run.py | roseDickinson/nismod2 | 5c571b055a6f5dc26bdc2bc8950b9cf1c9202fca | [
"MIT"
] | 3 | 2019-12-18T15:27:39.000Z | 2022-02-25T07:04:06.000Z | """Water supply model
"""
import os
import re
import shutil
import subprocess
import sys
import numpy as np
import pandas as pd
from smif.model.sector_model import SectorModel
from smif.data_layer import DataArray
class WaterWrapper(SectorModel):
"""Water Model Wrapper
"""
def before_model_run(self, da... | 38.586957 | 120 | 0.613803 |
910f779ac1306fa4201f07e500bfaa7a12b4a927 | 4,103 | py | Python | tests/core/utilities/test_construct_event_topics.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | tests/core/utilities/test_construct_event_topics.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | tests/core/utilities/test_construct_event_topics.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | import pytest
from platon_abi.exceptions import (
EncodingTypeError,
ValueOutOfBounds,
)
from platon._utils.events import (
construct_event_topic_set,
)
EVENT_1_ABI = {
"anonymous": False,
"inputs": [
{"indexed": False, "name": "arg0", "type": "uint256"},
{"indexed": True, "name":... | 24.866667 | 84 | 0.451133 |
910f84ddb87f2df4ba726f111d576532065ea4d2 | 246,123 | py | Python | tests/test_browser.py | luisfonsivevo/emscripten | 8699628b59c8bffe3f03557215438a6a65da9b4e | [
"MIT"
] | null | null | null | tests/test_browser.py | luisfonsivevo/emscripten | 8699628b59c8bffe3f03557215438a6a65da9b4e | [
"MIT"
] | null | null | null | tests/test_browser.py | luisfonsivevo/emscripten | 8699628b59c8bffe3f03557215438a6a65da9b4e | [
"MIT"
] | 1 | 2020-06-17T20:33:48.000Z | 2020-06-17T20:33:48.000Z | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
... | 50.025 | 324 | 0.647363 |
910f8c0b817abbf13b58fc285967a04982c07496 | 2,075 | py | Python | demisto_sdk/commands/format/update_incidenttype.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/format/update_incidenttype.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/format/update_incidenttype.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | from typing import Tuple
from demisto_sdk.commands.common.hook_validations.incident_type import \
IncidentTypeValidator
from demisto_sdk.commands.common.tools import print_error
from demisto_sdk.commands.format.format_constants import (ERROR_RETURN_CODE,
SK... | 41.5 | 125 | 0.639518 |
910f96ce8dcf7f7adc55b498c61114d65743e306 | 43,931 | py | Python | autolrn/classification/train_calibrate.py | SimonCarozza/autolrn | d0875844a3e9b4fc22510ef320aa498e339b6192 | [
"MIT"
] | null | null | null | autolrn/classification/train_calibrate.py | SimonCarozza/autolrn | d0875844a3e9b4fc22510ef320aa498e339b6192 | [
"MIT"
] | null | null | null | autolrn/classification/train_calibrate.py | SimonCarozza/autolrn | d0875844a3e9b4fc22510ef320aa498e339b6192 | [
"MIT"
] | null | null | null | """
This module allows you to tune and calibrate the best estimator.
This module allows you to tune and calibrate the best estimator
returned by nested cv evaluation, and to just calibrate
the best estimator returned by the non-nested cv evaluation.
"""
from sklearn.calibration import CalibratedClassifierCV
import... | 34.591339 | 92 | 0.60438 |
910fadbd9c0269a5de627e03fb95faed52340c95 | 1,599 | py | Python | arrays/array_product.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null | arrays/array_product.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null | arrays/array_product.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null |
# Array Product
# Given an array store in the array[i] the product of all the numbers of the array other than i.
#
# example
# input : [1, 2, 3, 4, 5]
# output: [(2*3*4*5), (1*3*4*5), (1*2*4*5), (1*2*3*5), (1*2*3*4)]
# = [120, 60, 40, 30, 24]
#
# Do this in O(1) solution without using division
# naive O(n**2... | 22.842857 | 96 | 0.555347 |
910fbaca24952bf60b95178aa4858b6160891d52 | 8,476 | py | Python | mmmg_tools/io.py | mmm-group/mmmg_tools | ef80afb9ced66103578bf07aeeb001cf8c6ca848 | [
"MIT"
] | null | null | null | mmmg_tools/io.py | mmm-group/mmmg_tools | ef80afb9ced66103578bf07aeeb001cf8c6ca848 | [
"MIT"
] | null | null | null | mmmg_tools/io.py | mmm-group/mmmg_tools | ef80afb9ced66103578bf07aeeb001cf8c6ca848 | [
"MIT"
] | null | null | null | import numpy as np
from pymatgen.core import Lattice
from pymatgen.electronic_structure.bandstructure import BandStructure, Kpoint
from pymatgen.electronic_structure.core import Spin
def read_wavecar(filename):
"""
Information is extracted from the given WAVECAR
Args:
filename (str): path to inpu... | 43.690722 | 88 | 0.439358 |
910fbf18892e96871f5d63605fdb31e8b04c911f | 429 | py | Python | stests/generators/wg_211/p2s1_await_eras.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 4 | 2020-03-10T15:28:17.000Z | 2021-10-02T11:41:17.000Z | stests/generators/wg_211/p2s1_await_eras.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 1 | 2020-03-25T11:31:44.000Z | 2020-03-25T11:31:44.000Z | stests/generators/wg_211/p2s1_await_eras.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 9 | 2020-02-25T18:43:42.000Z | 2021-08-10T17:08:42.000Z | from stests.core.types.orchestration import ExecutionContext
# Step label.
LABEL = "await-eras"
def execute(ctx: ExecutionContext):
"""Step entry point.
:param ctx: Execution context information.
"""
# TODO: await N eras in readiness for undelegation
pass
def verify(ctx: ExecutionCon... | 16.5 | 60 | 0.668998 |
910ff9a4698513152ce242f91acf6cabdb8d8084 | 422 | py | Python | COVIDSafepassage/passsystem/migrations/0003_auto_20200424_1623.py | VICS-CORE/safepassage_server | 58bc04dbfa55430c0218567211e5259de77518ae | [
"MIT"
] | null | null | null | COVIDSafepassage/passsystem/migrations/0003_auto_20200424_1623.py | VICS-CORE/safepassage_server | 58bc04dbfa55430c0218567211e5259de77518ae | [
"MIT"
] | 8 | 2020-04-25T09:42:25.000Z | 2022-03-12T00:23:32.000Z | COVIDSafepassage/passsystem/migrations/0003_auto_20200424_1623.py | VICS-CORE/safepassage_server | 58bc04dbfa55430c0218567211e5259de77518ae | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-24 10:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('passsystem', '0002_auto_20200424_1145'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='use... | 20.095238 | 51 | 0.542654 |
910fff720f6312041a25922cf5c63dfa8f83ec76 | 6,929 | py | Python | tensorflow/python/keras/layers/embeddings.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/keras/layers/embeddings.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/keras/layers/embeddings.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 26 | 2017-04-12T16:25:44.000Z | 2018-10-30T10:10:15.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.863388 | 80 | 0.674412 |
911002144ee117969801dd6f04a92435d2ca7947 | 1,593 | py | Python | seq2seq/utils/args.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | seq2seq/utils/args.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | seq2seq/utils/args.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from dataclasses import dataclass, field
@dataclass
class ModelArguments:
"""
Arguments pertaining to which model/config/tokenizer we are going to fine-tune from.
"""
model_name_or_path: str = field(
metadata={"help": "Path to pretrained model or model identifier fr... | 36.204545 | 119 | 0.645951 |
91100c6e8ce61bf393f985f62e5bf044fc92eb71 | 4,923 | py | Python | lewis_emulators/lakeshore340/interfaces/stream_interface.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/lakeshore340/interfaces/stream_interface.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/lakeshore340/interfaces/stream_interface.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from lewis.adapters.stream import StreamInterface
from lewis.core.logging import has_log
from lewis.utils.command_builder import CmdBuilder
_CONTROL_CHANNEL, _CONTROL_CHANNEL_INDEX = "B", 1
_SENSOR_UNITS = 1
_POWERUPENABLE = 1
@has_log
class Lakeshore340StreamInterface(StreamInterface):
# Commands that we expe... | 36.466667 | 139 | 0.652245 |
9110644e34a91156a14239ac1b816c7ffe345127 | 31 | py | Python | graph_ensemble/wrappers/__init__.py | YotamFY/GraphEnsemble | a636feb1084a8b45aa1754034744281277474dd1 | [
"BSD-3-Clause"
] | 2 | 2017-11-15T14:08:34.000Z | 2017-11-18T10:43:07.000Z | graph_ensemble/wrappers/__init__.py | YotamFY/GraphEnsemble | a636feb1084a8b45aa1754034744281277474dd1 | [
"BSD-3-Clause"
] | 2 | 2017-11-04T14:33:30.000Z | 2017-11-18T10:42:52.000Z | graph_ensemble/wrappers/__init__.py | YotamFY/GraphEnsemble | a636feb1084a8b45aa1754034744281277474dd1 | [
"BSD-3-Clause"
] | null | null | null | from sklearn_wrapper import *
| 10.333333 | 29 | 0.806452 |
9110b7adc5c9a7dafded625e2c308fa8ef317d19 | 682 | py | Python | nvx/utility.py | andreasxp/pynvx | 56f7f36078c1a08c361aecc1cc423f31230c127f | [
"MIT"
] | null | null | null | nvx/utility.py | andreasxp/pynvx | 56f7f36078c1a08c361aecc1cc423f31230c127f | [
"MIT"
] | null | null | null | nvx/utility.py | andreasxp/pynvx | 56f7f36078c1a08c361aecc1cc423f31230c127f | [
"MIT"
] | null | null | null | """Utility functions."""
import sys
def handle_error(error_code):
"""Convert error code as defined in the driver to user-friendly python exceptions."""
if error_code == -1:
raise RuntimeError("invalid handle (such handle not present now)")
if error_code == -2:
raise RuntimeError("invalid f... | 26.230769 | 89 | 0.634897 |
9110d5243db2e6f8efd84275a1315dcdbd41ff00 | 3,751 | py | Python | duconv/src/model_utils/moxing_adapter.py | kingcong/MindSpore_Code | afe6ef9cada6c98f601754197db84ee1c21dbc9d | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | duconv/src/model_utils/moxing_adapter.py | kingcong/MindSpore_Code | afe6ef9cada6c98f601754197db84ee1c21dbc9d | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | duconv/src/model_utils/moxing_adapter.py | kingcong/MindSpore_Code | afe6ef9cada6c98f601754197db84ee1c21dbc9d | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
# Copyright 2021 Huawei Technologies Co., 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
#
# ... | 32.059829 | 116 | 0.625167 |
91110bd03aefa2a6a6fbccc08ae059dc7c1026a0 | 1,558 | py | Python | rls/utils/hdf5_utils.py | StepNeverStop/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 371 | 2019-04-26T00:37:33.000Z | 2022-03-31T07:33:12.000Z | rls/utils/hdf5_utils.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 47 | 2019-07-21T11:51:57.000Z | 2021-08-31T08:45:22.000Z | rls/utils/hdf5_utils.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 102 | 2019-06-29T13:11:15.000Z | 2022-03-28T13:51:04.000Z | from typing import NamedTuple
import h5py
import numpy as np
# TODO:
def namedtuple2hdf5(path: str, data: NamedTuple):
def save(hf, data):
for k, v in data._asdict().items():
if isinstance(v, tuple):
hfk = hf.create_group(k)
save(hfk, v)
else:
... | 22.257143 | 70 | 0.521181 |
91112c71eadf8ed80d077a0b17bd5b19882431fe | 3,615 | py | Python | pysimt/utils/topology.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 34 | 2020-09-21T10:49:57.000Z | 2022-01-08T04:50:42.000Z | pysimt/utils/topology.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 2 | 2021-01-08T03:52:51.000Z | 2021-09-10T07:45:05.000Z | pysimt/utils/topology.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 5 | 2021-04-23T09:30:51.000Z | 2022-01-09T08:40:45.000Z | from collections import UserString, OrderedDict
from .. import datasets
class DataSource(UserString):
def __init__(self, name, _type, src=False, trg=False):
super().__init__(name)
self._type = _type
self.src = src
self.trg = trg
self.side = 'src' if self.src else 'trg'
... | 34.428571 | 90 | 0.546611 |
91117b13d0d4018166f002ed9d82690930f177df | 5,454 | py | Python | pyplan/pyplan/users/serializers.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | null | null | null | pyplan/pyplan/users/serializers.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | null | null | null | pyplan/pyplan/users/serializers.py | jorgedouglas71/pyplan-ide | 5ad0e4a2592b5f2716ff680018f717c65de140f5 | [
"MIT"
] | null | null | null | from django.contrib.auth.hashers import make_password
from rest_framework import serializers
from .models import User
from pyplan.pyplan.companies.serializers import CompanySerializer
class UserSerializer(serializers.ModelSerializer):
active = serializers.BooleanField()
langCode = serializers.CharField()
... | 41.633588 | 112 | 0.708838 |
9111b8731aebac7165b405fed8fd2ab02eede6e8 | 2,536 | py | Python | kode/script_rapport05_fylkesveg_u_10tonn.py | LtGlahn/kostrarapportering2021 | a5096c0e6de3c33089b2a5de37118da562fa3b4d | [
"MIT"
] | null | null | null | kode/script_rapport05_fylkesveg_u_10tonn.py | LtGlahn/kostrarapportering2021 | a5096c0e6de3c33089b2a5de37118da562fa3b4d | [
"MIT"
] | null | null | null | kode/script_rapport05_fylkesveg_u_10tonn.py | LtGlahn/kostrarapportering2021 | a5096c0e6de3c33089b2a5de37118da562fa3b4d | [
"MIT"
] | null | null | null | from datetime import datetime
import geopandas as gpd
import pandas as pd
import numpy as np
from copy import deepcopy
import STARTHER
import lastnedvegnett
import skrivdataframe
import nvdbapiv3
import nvdbgeotricks
t0 = datetime.now()
# (904,
# 10901, # Bruksklasse 10901
# 18186, # BkT8 - 50 tonn 18186 ... | 34.739726 | 160 | 0.704259 |
91121790004ba7275df9078c086fb4d7fb5c2f2b | 1,100 | py | Python | leetcode/560. Subarray Sum Equals K/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 3 | 2017-02-15T20:55:04.000Z | 2018-09-26T18:48:24.000Z | leetcode/560. Subarray Sum Equals K/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 4 | 2017-10-07T18:59:20.000Z | 2019-10-08T05:43:25.000Z | leetcode/560. Subarray Sum Equals K/soln.py | saisankargochhayat/algo_quest | a24f9a22c019ab31d56bd5a7ca5ba790d54ce5dc | [
"Apache-2.0"
] | 1 | 2017-10-08T06:52:21.000Z | 2017-10-08T06:52:21.000Z | # sum(i,j)=sum(0,j)-sum(0,i), where sum(i,j) represents the sum of all the elements from index i to j-1. Can we use this property to optimize it.
# Further, for every sum encountered, we also determine the number of times the sum sum-ksum−k has occured already, since it will determine the number of times a subarray wi... | 55 | 267 | 0.634545 |
91123718dfebc2b21c4047a0947baeda5fb86d55 | 1,336 | py | Python | src/utils/DataSetStat.py | Jarvis73/SubKmeans-Python | 71c30c5722df9f043e4d90845bbaa30c6017403e | [
"MIT"
] | null | null | null | src/utils/DataSetStat.py | Jarvis73/SubKmeans-Python | 71c30c5722df9f043e4d90845bbaa30c6017403e | [
"MIT"
] | null | null | null | src/utils/DataSetStat.py | Jarvis73/SubKmeans-Python | 71c30c5722df9f043e4d90845bbaa30c6017403e | [
"MIT"
] | null | null | null | import numpy as np
def determineScatter(centered: "[N, ndims]"):
# [N, ndims, 1]
centered = centered[:, :, None]
return np.sum(np.matmul(centered, centered.transpose(0, 2, 1)), axis=0)
def determineCov(centered: "[N, ndims]", adjustCov: bool):
scatter = determineScatter(centered)
if adjustCov:
... | 26.196078 | 75 | 0.680389 |
9112386bd6c77719b087addaecdf7d791dc1a650 | 9,050 | py | Python | examples.py | larsbratholm/ddr | 1d9690c73553aeb4287694084af781e0944c0190 | [
"MIT"
] | 1 | 2020-03-17T03:27:18.000Z | 2020-03-17T03:27:18.000Z | examples.py | larsbratholm/ddr | 1d9690c73553aeb4287694084af781e0944c0190 | [
"MIT"
] | null | null | null | examples.py | larsbratholm/ddr | 1d9690c73553aeb4287694084af781e0944c0190 | [
"MIT"
] | 1 | 2020-03-17T02:58:32.000Z | 2020-03-17T02:58:32.000Z | import ddr
import numpy as np
import glob
from qml.qmlearn.data import Data
import sklearn
from sklearn.pipeline import make_pipeline
from sklearn.decomposition import IncrementalPCA, SparsePCA, PCA, TruncatedSVD, NMF, \
LatentDirichletAllocation, IncrementalPCA, FastICA, FactorAnalysis
from sklearn.manifold im... | 46.891192 | 120 | 0.775249 |
91129b8efeeee7753e73d40691485f449a986c15 | 1,905 | py | Python | python-code/opencv-learning/misc/hog_svm.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 13 | 2018-09-07T02:29:07.000Z | 2021-06-18T08:40:09.000Z | python-code/opencv-learning/misc/hog_svm.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | null | null | null | python-code/opencv-learning/misc/hog_svm.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 4 | 2019-06-20T00:09:39.000Z | 2021-07-15T10:14:36.000Z | # -*- coding: utf-8 -*-
import cv2
import sys
import os
def getFilePath(path, filter=''):
file_list = []
for (root, dirs, files) in os.walk(path):
if path == root:
for file in files:
if file.find(filter) > -1:
file_list.append(os.path.join(root,file).repl... | 35.943396 | 125 | 0.609974 |
9112cdd47bb5e4d2de95b0f6653cd8d6fbd48c72 | 53 | py | Python | test/an_util_test.py | schwehr/ais-areanotice-py | 4d09beba37533c7ddc3d2bb9260be74989d44ed2 | [
"Apache-2.0"
] | 7 | 2016-08-02T04:49:08.000Z | 2021-03-10T05:16:49.000Z | test/an_util_test.py | schwehr/ais-areanotice-py | 4d09beba37533c7ddc3d2bb9260be74989d44ed2 | [
"Apache-2.0"
] | 4 | 2015-03-31T20:47:03.000Z | 2015-04-23T20:48:49.000Z | test/an_util_test.py | schwehr/ais-areanotice-py | 4d09beba37533c7ddc3d2bb9260be74989d44ed2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# TODO(schwehr): Write tests.
| 13.25 | 29 | 0.679245 |
91130befda4740f9b49f12ba785af5e19210a10c | 2,045 | py | Python | recap_am/model/color.py | ReCAP-UTR/Argument-Graph-Mining | b12cd6fa32560c559418340015f36855f7d2a061 | [
"Apache-2.0"
] | 8 | 2020-07-15T10:45:40.000Z | 2022-03-09T07:28:02.000Z | recap_am/model/color.py | ReCAP-UTR/Argument-Graph-Mining | b12cd6fa32560c559418340015f36855f7d2a061 | [
"Apache-2.0"
] | null | null | null | recap_am/model/color.py | ReCAP-UTR/Argument-Graph-Mining | b12cd6fa32560c559418340015f36855f7d2a061 | [
"Apache-2.0"
] | 3 | 2020-08-05T05:11:00.000Z | 2021-09-29T02:03:18.000Z | import colorsys
import itertools
import math
from fractions import Fraction
from typing import Generator
# https://stackoverflow.com/a/13781114
def _zenos_dichotomy():
"""
http://en.wikipedia.org/wiki/1/2_%2B_1/4_%2B_1/8_%2B_1/16_%2B_%C2%B7_%C2%B7_%C2%B7
"""
for k in itertools.count():
yield ... | 24.345238 | 171 | 0.604401 |
9113385453743a3bd924c8fc33596c9aac254fcf | 2,576 | py | Python | Multitask-CNN/data/test_video_dataset.py | wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels | e6df7ffc9b0318fdce405e40993c79785b47c785 | [
"MIT"
] | 74 | 2020-03-08T15:29:00.000Z | 2022-03-05T14:57:33.000Z | Multitask-CNN/data/test_video_dataset.py | HKUST-NISL/Multitask-Emotion-Recognition-with-Incomplete-Labels | ac5152b7a4b9c6c54d13c06c9302270350e8ce3f | [
"MIT"
] | 19 | 2020-03-06T08:56:51.000Z | 2022-03-27T05:07:35.000Z | Multitask-CNN/data/test_video_dataset.py | wtomin/Multitask-Emotion-Recognition-with-Incomplete-Labels | e6df7ffc9b0318fdce405e40993c79785b47c785 | [
"MIT"
] | 23 | 2020-03-20T08:19:55.000Z | 2022-03-16T17:40:09.000Z | import os.path
import torchvision.transforms as transforms
from .dataset import DatasetBase
from PIL import Image
import random
import numpy as np
import pickle
import pandas as pd
from PATH import PATH
PRESET_VARS = PATH()
import pickle
class Test_dataset(object):
def __init__(self, opt, video_data, train_mode = ... | 35.777778 | 99 | 0.528727 |
91135d470b1099b5cd3e2b6d14cec22e80381942 | 1,443 | bzl | Python | dependency_support/org_gnu_readline/org_gnu_readline.bzl | kammoh/bazel_rules_hdl | 17dfb5cea5ab58460f5ca55244f3afd0724a8a3a | [
"Apache-2.0"
] | null | null | null | dependency_support/org_gnu_readline/org_gnu_readline.bzl | kammoh/bazel_rules_hdl | 17dfb5cea5ab58460f5ca55244f3afd0724a8a3a | [
"Apache-2.0"
] | null | null | null | dependency_support/org_gnu_readline/org_gnu_readline.bzl | kammoh/bazel_rules_hdl | 17dfb5cea5ab58460f5ca55244f3afd0724a8a3a | [
"Apache-2.0"
] | 1 | 2022-01-06T22:01:46.000Z | 2022-01-06T22:01:46.000Z | # Copyright 2020-2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 40.083333 | 88 | 0.694387 |
91135fe0d0c8c1b2263d299cabb234efc189f2a5 | 751 | py | Python | utils/saveParaDataToDB.py | igemsoftware/HFUT-China_2015 | 5db86858963d29188ec1a8fdedaf7a98f4528cf4 | [
"Apache-2.0"
] | null | null | null | utils/saveParaDataToDB.py | igemsoftware/HFUT-China_2015 | 5db86858963d29188ec1a8fdedaf7a98f4528cf4 | [
"Apache-2.0"
] | 3 | 2015-09-21T21:50:45.000Z | 2015-09-22T15:42:28.000Z | utils/saveParaDataToDB.py | igemsoftware/HFUT-China_2015 | 5db86858963d29188ec1a8fdedaf7a98f4528cf4 | [
"Apache-2.0"
] | 2 | 2020-03-28T01:33:51.000Z | 2021-07-18T13:56:27.000Z | import os
import django
import sys
import csv
pro_dir = os.getcwd()
sys.path.append(pro_dir)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BioDesigner.settings")
from design.models import parts, part_parameters
def readDataToDB(csv_reader):
count = 0
for row in csv_reader:
try:
partObj... | 25.033333 | 72 | 0.637816 |
911369dbadb9a811ffd209a8508073600d0e68b9 | 8,610 | py | Python | dragons/plugins/climate.py | TeamDragons/Dragons-Userbot | e40584f4dc898b785523adea4519ffb412dc92c4 | [
"MIT"
] | 3 | 2021-08-11T08:33:39.000Z | 2022-01-17T00:09:11.000Z | dragons/plugins/climate.py | sophiashirashaki/Dragons-Userbot | 2255c18428e488a267eaec1ec8c081fabcde167a | [
"MIT"
] | null | null | null | dragons/plugins/climate.py | sophiashirashaki/Dragons-Userbot | 2255c18428e488a267eaec1ec8c081fabcde167a | [
"MIT"
] | 6 | 2021-08-14T08:20:41.000Z | 2022-03-20T02:31:45.000Z | import io
import json
from datetime import datetime
import aiohttp
import requests
from pytz import country_names as c_n
from pytz import country_timezones as c_tz
from pytz import timezone as tz
from ..Config import Config
from ..helpers.utils import _format
from ..sql_helper.globals import addgvar, gvarstatus
from ... | 37.112069 | 148 | 0.5964 |
91136af4b2d1f5b26c7b88e4d53efd29770ca9fd | 1,323 | py | Python | test/v2/test_kwargs_v2.py | wavestate/wavestate-iirrational | 01d6dba8b2131fa2a099a74f17e6540f30cee606 | [
"Apache-2.0"
] | null | null | null | test/v2/test_kwargs_v2.py | wavestate/wavestate-iirrational | 01d6dba8b2131fa2a099a74f17e6540f30cee606 | [
"Apache-2.0"
] | null | null | null | test/v2/test_kwargs_v2.py | wavestate/wavestate-iirrational | 01d6dba8b2131fa2a099a74f17e6540f30cee606 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
from __future__ import division, print_function, unicode_literals
import pytest
import os.path as path
from wavestate.iirrational.testing import IIRrational_data
from wavestate.iirrational import v2
from wavestate.iirrational.v2.__main__ import main as v2_main
from wavestate.iirrationa... | 21.33871 | 67 | 0.641723 |
9113801823de8ed1d9e1e803deff23ef49aa4647 | 553 | py | Python | solve.py | vonas/adventofcode | 0c9e4920243c37c4b143e01fe5bd4f78834b4e51 | [
"MIT"
] | null | null | null | solve.py | vonas/adventofcode | 0c9e4920243c37c4b143e01fe5bd4f78834b4e51 | [
"MIT"
] | null | null | null | solve.py | vonas/adventofcode | 0c9e4920243c37c4b143e01fe5bd4f78834b4e51 | [
"MIT"
] | 1 | 2020-12-12T01:11:08.000Z | 2020-12-12T01:11:08.000Z | from importlib import import_module
from sys import argv, exit
if __name__ == '__main__':
if len(argv) not in (2, 3): exit(1)
day = argv[1].zfill(2)
part = int(argv[2]) if len(argv) == 3 else None
try: module = import_module('src.day_{}'.format(day))
except Exception as e:
raise e
if part:
if p... | 23.041667 | 59 | 0.647378 |
9113ec725f9f4148cdd9d775ac74566843bcbee4 | 15,665 | py | Python | cosmotech_api/model/workspace.py | Cosmo-Tech/cosmotech-api-python-client | 49ef58784605da8dd6b290cab15b363671991d8e | [
"MIT"
] | null | null | null | cosmotech_api/model/workspace.py | Cosmo-Tech/cosmotech-api-python-client | 49ef58784605da8dd6b290cab15b363671991d8e | [
"MIT"
] | null | null | null | cosmotech_api/model/workspace.py | Cosmo-Tech/cosmotech-api-python-client | 49ef58784605da8dd6b290cab15b363671991d8e | [
"MIT"
] | null | null | null | """
Cosmo Tech Plaform API
Cosmo Tech Platform API # noqa: E501
The version of the OpenAPI document: 0.0.11-SNAPSHOT
Contact: platform@cosmotech.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from cosmotech_api.model_utils import ( # noqa... | 48.498452 | 424 | 0.590744 |
911405f0f403e8bde97475df70fc74f311886ed5 | 588 | py | Python | array/907_sum_of_subarray_minimums.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | array/907_sum_of_subarray_minimums.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | array/907_sum_of_subarray_minimums.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | class Solution(object):
def sumSubarrayMins(self, A):
"""
:type A: List[int]
:rtype: int
"""
# handle overflow
MOD = 10**9 + 7
stack = []
ans = dot = 0
for j, y in enumerate(A):
# Add all answers for subarrays [i, j], i <= j
... | 25.565217 | 58 | 0.396259 |
91140e76e2c386c1758c4012c27d0dc51be7dfad | 3,326 | py | Python | setup.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | setup.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | setup.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import (
find_packages,
setup,
)
extras_require = {
'tester': [
"platon-tester[py-evm]==v0.5.0-beta.4",
# "py-node>=3.2.0,<4",
],
'linter': [
"flake8==3.8.3",
"isort>=4.2.15,<4.3.5",
"mypy==0.812",... | 29.696429 | 89 | 0.536981 |
911415aac574116b1117964c0012685878628d14 | 941 | py | Python | alipay/aop/api/domain/AlipayBossFncInvoiceLinkamtBatchqueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayBossFncInvoiceLinkamtBatchqueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayBossFncInvoiceLinkamtBatchqueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayBossFncInvoiceLinkamtBatchqueryModel(object):
def __init__(self):
self._invoice_id = None
@property
def invoice_id(self):
return self._invoice_id
@invoice_id.s... | 22.95122 | 71 | 0.615303 |
91144bf10a2eb68072cbdedc4b7c3deef739b811 | 8,134 | py | Python | pollination_sdk/models/task_path_return.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | pollination_sdk/models/task_path_return.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | pollination_sdk/models/task_path_return.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pollination_sdk.configu... | 30.464419 | 164 | 0.597984 |
91146f8e0773766b01565b78afa8d092b3579f86 | 792 | py | Python | ote_sdk/ote_sdk/usecases/tasks/image_deep_learning_task.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | ote_sdk/ote_sdk/usecases/tasks/image_deep_learning_task.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 229 | 2019-02-28T21:37:08.000Z | 2020-09-07T15:11:49.000Z | ote_sdk/ote_sdk/usecases/tasks/image_deep_learning_task.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | """This module contains the base class for deep learning image-based tasks. """
# Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import abc
from ote_sdk.usecases.tasks.interfaces.evaluate_interface import IEvaluationTask
from ote_sdk.usecases.tasks.interfaces.inference_interface i... | 29.333333 | 83 | 0.77399 |
911471a79d3cc01e2c862464b5d538f75a580fbe | 847 | py | Python | tests/plotting/bokeh/testareaplot.py | jsignell/holoviews | 4f9fd27367f23c3d067d176f638ec82e4b9ec8f0 | [
"BSD-3-Clause"
] | null | null | null | tests/plotting/bokeh/testareaplot.py | jsignell/holoviews | 4f9fd27367f23c3d067d176f638ec82e4b9ec8f0 | [
"BSD-3-Clause"
] | null | null | null | tests/plotting/bokeh/testareaplot.py | jsignell/holoviews | 4f9fd27367f23c3d067d176f638ec82e4b9ec8f0 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from holoviews.element import Area
from .testplot import TestBokehPlot, bokeh_renderer
class TestAreaPlot(TestBokehPlot):
def test_area_with_nans(self):
area = Area([1, 2, 3, np.nan, 5, 6, 7])
plot = bokeh_renderer.get_plot(area)
cds = plot.handles['cds']
self... | 33.88 | 81 | 0.506494 |
91148a6fc52dd5b8224e1fb67678cdf0416f5cdf | 10,000 | py | Python | Lib/test/test_multibytecodec.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 164 | 2015-01-04T07:04:07.000Z | 2022-01-06T03:18:56.000Z | Lib/test/test_multibytecodec.py | idobatter/cpython | c7b03e7b57cedccb77e37f65f9bbcb82050c2bb5 | [
"PSF-2.0"
] | 3 | 2015-08-27T07:35:26.000Z | 2016-04-07T16:35:39.000Z | Lib/test/test_multibytecodec.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 35 | 2015-06-11T05:35:55.000Z | 2022-01-11T19:32:00.000Z | #!/usr/bin/env python3
#
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
from test import support
from test.support import TESTFN
import unittest, io, codecs, sys, os
import _multibytecodec
ALL_CJKENCODINGS = [
# _codecs_cn
'gb2312', 'gbk', 'gb18030', 'hz',
# _codecs_hk
'big5hkscs',
# _code... | 37.735849 | 79 | 0.6138 |
91148e1bbce1e1dbbb97ec4321f3405460da4e54 | 7,878 | py | Python | test/integ/test_execute_multi_statements.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | null | null | null | test/integ/test_execute_multi_statements.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | 14 | 2021-01-26T06:53:10.000Z | 2022-03-14T11:16:54.000Z | test/integ/test_execute_multi_statements.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import codecs
import os
from io import BytesIO, StringIO
import pytest
from mock import patch
from snowflake.connector import DictCursor, ProgrammingError
THIS_DIR = os.path.dirname(os.path.realp... | 35.013333 | 104 | 0.580858 |
91149f3b66fe326ce0eeeea5dc122ba20f5cc4b6 | 110 | py | Python | Scripts/urllib1.py | annelida/stuff | 699d0230d5329a5eaebc8c93f9fba3c53920925f | [
"MIT"
] | null | null | null | Scripts/urllib1.py | annelida/stuff | 699d0230d5329a5eaebc8c93f9fba3c53920925f | [
"MIT"
] | 2 | 2021-06-01T21:52:33.000Z | 2021-12-13T19:44:00.000Z | Scripts/urllib1.py | annelida/stuff | 699d0230d5329a5eaebc8c93f9fba3c53920925f | [
"MIT"
] | 1 | 2015-10-14T12:16:07.000Z | 2015-10-14T12:16:07.000Z | import urllib
fhand = urllib.urlopen('http://www.pythonlearn.com')
for line in fhand:
print line.strip()
| 15.714286 | 52 | 0.718182 |
9114aec84533326f47aba0a76d35d090ac4d91f6 | 1,285 | py | Python | tf2onnx/tflite/RankOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 1,473 | 2018-03-16T02:47:33.000Z | 2022-03-31T03:43:52.000Z | tf2onnx/tflite/RankOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 1,208 | 2018-03-14T09:58:49.000Z | 2022-03-31T17:56:20.000Z | tf2onnx/tflite/RankOptions.py | LoicDagnas/tensorflow-onnx | 6691850e79047d05d85017573170fd8240393b57 | [
"Apache-2.0"
] | 350 | 2018-04-03T03:48:40.000Z | 2022-03-30T11:23:55.000Z | # SPDX-License-Identifier: Apache-2.0
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class RankOptions(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0... | 32.125 | 114 | 0.705837 |
9114b151ada8ea93106b2933a9a5b373006a083b | 9,598 | py | Python | scripts/microbes/util.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | scripts/microbes/util.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | scripts/microbes/util.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | #!/usr/bin/env python
# Dan Blankenberg
import sys
assert sys.version_info[:2] >= (2, 4)
# genbank_to_bed
class Region:
def __init__(self):
self.qualifiers = {}
self.start = None
self.end = None
self.strand = '+'
def set_coordinates_by_location(self, location):
locat... | 40.669492 | 200 | 0.527089 |
9114b937b0a9732c802824ff065267e640af2ec3 | 7,883 | py | Python | alipay/aop/api/domain/TimeTableLineInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/TimeTableLineInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/TimeTableLineInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.TimeInterval import TimeInterval
class TimeTableLineInfo(object):
def __init__(self):
self._customized_time_interval_list = None
self._direction = None
... | 36.16055 | 109 | 0.628568 |
9114e3dc365127bb5795dcd0ec44c35e4c0774ca | 2,128 | py | Python | atnlp/model/io.py | wedavey/atnlp | 002497f27abfcdac9701aa324301d482dbf4df0e | [
"MIT"
] | null | null | null | atnlp/model/io.py | wedavey/atnlp | 002497f27abfcdac9701aa324301d482dbf4df0e | [
"MIT"
] | null | null | null | atnlp/model/io.py | wedavey/atnlp | 002497f27abfcdac9701aa324301d482dbf4df0e | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
io.py
~~~~~
Functionality for reading and writing models
"""
__author__ = "Will Davey"
__email__ = "wedavey@gmail.com"
__created__ = "2018-06-07"
__copyright__ = "Copyright 2018 Will Davey"
__license__ = "MIT https://opensource.org/licenses/MIT"
# standard imports
import os
import pkg_resources... | 24.45977 | 91 | 0.586936 |
9115692cee473ca4fed21f155e20b5cc534e9f34 | 169 | py | Python | stests/workers/daemon_0.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 4 | 2020-03-10T15:28:17.000Z | 2021-10-02T11:41:17.000Z | stests/workers/daemon_0.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 1 | 2020-03-25T11:31:44.000Z | 2020-03-25T11:31:44.000Z | stests/workers/daemon_0.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 9 | 2020-02-25T18:43:42.000Z | 2021-08-10T17:08:42.000Z | from stests.workers.utils import setup_daemon
from stests.workers.utils import start_monitoring
# Setup.
setup_daemon()
# Start chain monitoring.
start_monitoring()
| 15.363636 | 49 | 0.810651 |
91156ce78837245761f99ede93027d39ef60432a | 4,661 | py | Python | examples/framework_examples/a2c_sil_gridworld.py | lorenzosteccanella/machin | 9d3ce87dbed820b5019211b0690b54613084d9e4 | [
"MIT"
] | null | null | null | examples/framework_examples/a2c_sil_gridworld.py | lorenzosteccanella/machin | 9d3ce87dbed820b5019211b0690b54613084d9e4 | [
"MIT"
] | null | null | null | examples/framework_examples/a2c_sil_gridworld.py | lorenzosteccanella/machin | 9d3ce87dbed820b5019211b0690b54613084d9e4 | [
"MIT"
] | null | null | null | from machin.frame.algorithms import A2C_SIL
from machin.utils.logging import default_logger as logger
from machin.frame.buffers.prioritized_buffer import PrioritizedBuffer
from torch.distributions import Categorical
import torch as t
import torch.nn as nn
import gym
import numpy as np
import random
from gym_minigrid.wr... | 34.021898 | 121 | 0.578417 |
91157230460859dd64e9ad1af1f91ca9dc5e3d90 | 4,040 | py | Python | Phase2/Code/Test_supervised.py | mjoshi07/AutoPano | 1d60ac1c717ccdaae40c129959fed5a27533d225 | [
"MIT"
] | null | null | null | Phase2/Code/Test_supervised.py | mjoshi07/AutoPano | 1d60ac1c717ccdaae40c129959fed5a27533d225 | [
"MIT"
] | null | null | null | Phase2/Code/Test_supervised.py | mjoshi07/AutoPano | 1d60ac1c717ccdaae40c129959fed5a27533d225 | [
"MIT"
] | null | null | null | """
CMSC733 Spring 2022: Classical and Deep Learning Approaches for Geometric Computer Vision
Project1: MyAutoPano: Phase 2
Author(s):
Mayank Joshi
Masters student in Robotics,
University of Maryland, College Park
Adithya Gaurav Singh
Masters student in Robotics,
University of Maryland, College Park
"""
import cv2
i... | 38.47619 | 115 | 0.626733 |
911573f14b209645a3c0d108c4ea6cd60c7b65d8 | 994 | py | Python | federatedml/resource/test/cpu_engine_test.py | renzhenghang/FATE | c2adc4d40f6d54508bc49c94380aca63eea9db97 | [
"Apache-2.0"
] | 1 | 2020-03-26T07:21:49.000Z | 2020-03-26T07:21:49.000Z | federatedml/resource/test/cpu_engine_test.py | renzhenghang/FATE | c2adc4d40f6d54508bc49c94380aca63eea9db97 | [
"Apache-2.0"
] | null | null | null | federatedml/resource/test/cpu_engine_test.py | renzhenghang/FATE | c2adc4d40f6d54508bc49c94380aca63eea9db97 | [
"Apache-2.0"
] | null | null | null | import unittest
from federatedml.secureprotol.fate_paillier import PaillierKeypair
from ..task_mgr import EncryptTask, DecryptTask
from ..compute_engine import cpu_engine as CE, gpu_engine as GE
import random
random.seed(0)
class TestRawEncrypt(unittest.TestCase):
def setUp(self):
self.public_key, se... | 33.133333 | 78 | 0.686117 |
91158aaf085293b831153b6d9cbe784208412571 | 3,724 | py | Python | gaphor/SysML/requirements/requirement.py | Xander982/gaphor | b5c55fa18b79b80d9c14ee0cb0ce8a9963e90f86 | [
"Apache-2.0"
] | null | null | null | gaphor/SysML/requirements/requirement.py | Xander982/gaphor | b5c55fa18b79b80d9c14ee0cb0ce8a9963e90f86 | [
"Apache-2.0"
] | null | null | null | gaphor/SysML/requirements/requirement.py | Xander982/gaphor | b5c55fa18b79b80d9c14ee0cb0ce8a9963e90f86 | [
"Apache-2.0"
] | null | null | null | from gaphor.diagram.presentation import from_package_str
from gaphor.diagram.shapes import (
Box,
EditableText,
FontStyle,
FontWeight,
Text,
TextAlign,
VerticalAlign,
draw_border,
draw_top_separator,
)
from gaphor.diagram.support import represents
from gaphor.SysML.sysml import Requi... | 32.955752 | 85 | 0.474758 |
9115dad739ce882eda441b8a0724b39272e56efc | 1,373 | py | Python | tests/test_osculating_elements.py | seignovert/python-webgeocalc | 1c992f61b913043c26e80a90785ee69f9c8d41c0 | [
"MIT"
] | 6 | 2019-01-30T00:21:11.000Z | 2021-11-26T15:18:00.000Z | tests/test_osculating_elements.py | seignovert/python-webgeocalc | 1c992f61b913043c26e80a90785ee69f9c8d41c0 | [
"MIT"
] | 8 | 2019-09-19T14:09:22.000Z | 2022-02-16T13:10:48.000Z | tests/test_osculating_elements.py | seignovert/python-webgeocalc | 1c992f61b913043c26e80a90785ee69f9c8d41c0 | [
"MIT"
] | 5 | 2019-10-18T07:47:11.000Z | 2022-02-04T21:36:00.000Z | """Test WGC angular size calculation."""
from pytest import fixture
from webgeocalc import OsculatingElements
@fixture
def kernels():
"""Kernels sets Solar and Cassini."""
return [1, 5]
@fixture
def time():
"""Input time."""
return '2012-10-19T08:24:00.000'
@fixture
def orbiting():
"""Orbiti... | 19.898551 | 58 | 0.572469 |
91160c01aa8d80c78001a4fcea32ea15e0288687 | 711 | py | Python | src/tinydag/node.py | omyllymaki/PySimpleGraph | ac7b8cf982ba9a869d618c0e95539153457498a6 | [
"MIT"
] | null | null | null | src/tinydag/node.py | omyllymaki/PySimpleGraph | ac7b8cf982ba9a869d618c0e95539153457498a6 | [
"MIT"
] | null | null | null | src/tinydag/node.py | omyllymaki/PySimpleGraph | ac7b8cf982ba9a869d618c0e95539153457498a6 | [
"MIT"
] | null | null | null | import functools
from typing import List, Callable
class Node:
def __init__(self,
inputs: List[str],
function: Callable,
name: str = None,
output: str = None):
self.function = function
self.inputs = inputs
self.name = nam... | 26.333333 | 78 | 0.580872 |
91162bce8f0e477cc4ee496711114efc025fd5bb | 22,963 | py | Python | Robustness V2/self_play.py | hayashimasa/Robust_MuZero | b4fa4713c0f103514f7e462d187c5516a03039b6 | [
"MIT"
] | 3 | 2021-03-09T09:37:09.000Z | 2021-09-08T12:02:34.000Z | Robustness V2/self_play.py | hayashimasa/Robust_MuZero | b4fa4713c0f103514f7e462d187c5516a03039b6 | [
"MIT"
] | null | null | null | Robustness V2/self_play.py | hayashimasa/Robust_MuZero | b4fa4713c0f103514f7e462d187c5516a03039b6 | [
"MIT"
] | null | null | null | """Self Play Module
Author: Masahiro Hayashi - Bakr Ouairem
This script defines the SelfPlay class for the MuZero algorithm. It also
contains an implementation of Monte Carlo Tree Search.
https://arxiv.org/pdf/1911.08265.pdf
This implementation is modified from the following MuZero implementation:
https://... | 37.156958 | 180 | 0.548535 |
91162df7ee85378bb7a257f78011d01943969b89 | 7,690 | py | Python | BitsBack/tvae_beta_binomial.py | deepaks4077/bits-back | 0d4355302eb4c5a18a229fa15a0a1caf8fe529d4 | [
"MIT"
] | null | null | null | BitsBack/tvae_beta_binomial.py | deepaks4077/bits-back | 0d4355302eb4c5a18a229fa15a0a1caf8fe529d4 | [
"MIT"
] | null | null | null | BitsBack/tvae_beta_binomial.py | deepaks4077/bits-back | 0d4355302eb4c5a18a229fa15a0a1caf8fe529d4 | [
"MIT"
] | null | null | null | import argparse
import torch
import torch.utils.data
from torch import nn, optim, lgamma
from torch.nn import functional as F
from torchvision import datasets, transforms
from torch.distributions import Normal, Categorical, Beta, Binomial
from torchvision.utils import save_image
import numpy as np
parser = argparse.Ar... | 40.473684 | 136 | 0.618336 |
91163a0d8f3dc94b5829e1b29b06c04e2b4cd286 | 1,522 | py | Python | tests_d2/conftest.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 39 | 2021-12-14T11:05:25.000Z | 2022-03-31T18:50:58.000Z | tests_d2/conftest.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 17 | 2022-01-04T14:32:26.000Z | 2022-03-29T14:01:36.000Z | tests_d2/conftest.py | deepdoctection/deepdoctection | 7e0d7396e5ef8bf8109904e09c5d4ee56cb5a036 | [
"Apache-2.0"
] | 4 | 2022-01-11T16:40:17.000Z | 2022-03-30T02:09:55.000Z | # -*- coding: utf-8 -*-
# File: conftest.py
# Copyright 2021 Dr. Janis Meyer. 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/LICE... | 27.178571 | 105 | 0.720762 |
9116473055c5bd072ad59a444dc826781f8a2c35 | 2,387 | py | Python | tests/test_integration_partition.py | themoodymann/piChain | 4de9e8da3994901371713b68bc05295fe6676571 | [
"MIT"
] | 8 | 2018-02-22T08:52:26.000Z | 2022-02-01T01:28:29.000Z | tests/test_integration_partition.py | themoodymann/piChain | 4de9e8da3994901371713b68bc05295fe6676571 | [
"MIT"
] | 3 | 2018-03-07T18:13:53.000Z | 2019-12-03T23:42:42.000Z | tests/test_integration_partition.py | florianmorath/piChain | df498021cb7c2df26a7980fb85b795f4a0105faf | [
"MIT"
] | 7 | 2018-02-26T12:28:34.000Z | 2021-01-01T11:33:59.000Z | """Integration test: Test partition of piChain nodes.
Note: run tests with default setting values in config.py.
"""
import time
from tests.util import MultiNodeTest
class MultiNodeTestPartition(MultiNodeTest):
def test_scenario30_partition(self):
self.start_processes_with_test_scenario(30, 5)
t... | 38.5 | 70 | 0.735233 |
91164faa4b793fe7665d33dc95b06ce870c01cba | 1,772 | py | Python | main/datasets/celeba.py | kpandey008/DiffuseVAE | b505894668ac1e4ef9a66ec220f5b40f5c83629e | [
"MIT"
] | 90 | 2022-01-04T05:53:13.000Z | 2022-03-31T02:04:46.000Z | main/datasets/celeba.py | kpandey008/DiffuseVAE | b505894668ac1e4ef9a66ec220f5b40f5c83629e | [
"MIT"
] | 2 | 2022-01-28T04:15:40.000Z | 2022-02-17T13:47:54.000Z | main/datasets/celeba.py | kpandey008/DiffuseVAE | b505894668ac1e4ef9a66ec220f5b40f5c83629e | [
"MIT"
] | 5 | 2022-01-13T08:25:11.000Z | 2022-02-09T18:40:37.000Z | import os
import numpy as np
import torch
import torchvision.transforms as T
from PIL import Image
from torch.utils.data import Dataset
from tqdm import tqdm
# A very simplistic implementation of the CelebA dataset supporting only images and no annotations
# TODO: Add functionality to download CelebA and setup the d... | 28.580645 | 98 | 0.623589 |
9116643661694b6485af70b9340bbc081f564076 | 6,210 | py | Python | src/test_only_plugins/bitbucket/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/test_only_plugins/bitbucket/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/test_only_plugins/bitbucket/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.plugins.bases.issue2 import IssuePlugin2, IssueGroupActionEndpoint
from sentry.utils.http import absolute_uri
from test_only_plugins.exceptions import ApiError
from .mixins import BitbucketMixin
from .repository_provider... | 32.684211 | 100 | 0.538003 |
911685f8cb374ddce12614043be183dbb5fb15dd | 762 | py | Python | 203_Remove-Linked-List-Elements.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | 3 | 2018-07-05T05:51:10.000Z | 2019-05-04T08:35:44.000Z | 203_Remove-Linked-List-Elements.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | 203_Remove-Linked-List-Elements.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def removeElements(self, head: ListNode, val: int) -> ListNode:
if not head:
return None
while head:
if head... | 23.090909 | 67 | 0.447507 |
9116bfb6cefbb9a138246e333d55d647c9512423 | 4,973 | py | Python | shrec16/train.py | mackenzie-warren/SO-Net | 141e26c48dfdc0845b287c02402acbd3ab2d09f7 | [
"MIT"
] | 325 | 2018-02-28T06:14:05.000Z | 2022-03-09T08:39:31.000Z | shrec16/train.py | LONG-9621/SO-Net | 9efbc45ba0e3908872c43ebe933c6a8e264cf94c | [
"MIT"
] | 37 | 2018-05-11T06:04:41.000Z | 2022-03-01T11:36:26.000Z | shrec16/train.py | LONG-9621/SO-Net | 9efbc45ba0e3908872c43ebe933c6a8e264cf94c | [
"MIT"
] | 87 | 2018-03-13T13:06:34.000Z | 2022-02-24T02:35:45.000Z | import time
import copy
import numpy as np
import math
from shrec16.options import Options
opt = Options().parse() # set CUDA_VISIBLE_DEVICES before import torch
import torch
import torchvision
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
impor... | 38.851563 | 125 | 0.621355 |
9116d7a5218deba89ad26b3f672de98241d3f51a | 1,442 | py | Python | flexget/plugins/generic/cron_env.py | BrainDamage/Flexget | 50f75bdad64ce023daaff334df8478319ddb9f64 | [
"MIT"
] | null | null | null | flexget/plugins/generic/cron_env.py | BrainDamage/Flexget | 50f75bdad64ce023daaff334df8478319ddb9f64 | [
"MIT"
] | 1 | 2018-06-09T18:03:35.000Z | 2018-06-09T18:03:35.000Z | flexget/plugins/generic/cron_env.py | sasese/Flexget | 8cca4a6a3cacc919c7a5b36f428176e170739de5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from flexget.utils.log import log_once
__author__ = 'paranoidi'
import logging
import sys
from flexget.event import event
from flexget.utils.simple_persistence import SimplePersistence
log = logging.getLogger('cron_env')
@event('manager.execute.st... | 40.055556 | 107 | 0.660888 |
9116d89ef19e4cfb6db9c1eff63e3bf9589c0773 | 1,462 | py | Python | portals/strings.py | jalanb/portals | 7a5360b48547719d3fbe50790f08eaf5571148dd | [
"ADSL"
] | null | null | null | portals/strings.py | jalanb/portals | 7a5360b48547719d3fbe50790f08eaf5571148dd | [
"ADSL"
] | null | null | null | portals/strings.py | jalanb/portals | 7a5360b48547719d3fbe50790f08eaf5571148dd | [
"ADSL"
] | null | null | null | """Handle strings for portals
Most methods in this module are needed for python2 -> 3
"""
import hashlib
from typing import Optional
def to_ascii(string: str) -> str:
"""Remove any non-ascii chars from a string
Encoding converts to bytes, so need to "convert back" to a string
>>> assert to_ascii("tó h... | 31.106383 | 78 | 0.653899 |
9116e34f6719d4603a176aec5579dd435fcc3da6 | 8,044 | py | Python | examples/fast_neural_style/neural_style.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | 1 | 2020-08-29T16:49:36.000Z | 2020-08-29T16:49:36.000Z | examples/fast_neural_style/neural_style.py | hefv57/ignite | a22a0f5e909ac70d2a1f76a60b6e84b2134f196c | [
"BSD-3-Clause"
] | 5 | 2020-08-29T16:49:48.000Z | 2020-08-29T17:05:54.000Z | examples/fast_neural_style/neural_style.py | hefv57/ignite | a22a0f5e909ac70d2a1f76a60b6e84b2134f196c | [
"BSD-3-Clause"
] | 1 | 2020-06-13T15:30:46.000Z | 2020-06-13T15:30:46.000Z | # coding: utf-8
import argparse
import os
import sys
import numpy as np
import random
import torch
from torch.optim import Adam
from torch.utils.data import DataLoader
from torchvision import datasets
from torchvision import transforms
from ignite.engine import Engine, Events
from ignite.handlers import ModelCheckpoi... | 36.071749 | 119 | 0.691074 |
9116fc760beb5851ae6ad24a8fd3cdb5b0e2fcd7 | 1,331 | py | Python | django_productline/features/multilanguage_switcher/views.py | henzk/django-productline | 24ff156924c1a8c07b99cbb8a1de0a42b8d81f60 | [
"MIT"
] | 5 | 2015-06-16T17:36:33.000Z | 2017-10-17T19:22:59.000Z | django_productline/features/multilanguage_switcher/views.py | henzk/django-productline | 24ff156924c1a8c07b99cbb8a1de0a42b8d81f60 | [
"MIT"
] | 8 | 2016-03-14T09:02:13.000Z | 2017-11-16T16:00:31.000Z | django_productline/features/multilanguage_switcher/views.py | henzk/django-productline | 24ff156924c1a8c07b99cbb8a1de0a42b8d81f60 | [
"MIT"
] | 17 | 2015-08-04T18:45:18.000Z | 2017-11-16T14:52:46.000Z | from __future__ import unicode_literals
from django.core.urlresolvers import translate_url
from django.http import HttpResponseRedirect
from django.utils import translation
from django.utils.translation import check_for_language
from django.utils.translation import LANGUAGE_SESSION_KEY
from django.views.generic import... | 40.333333 | 87 | 0.678437 |
911734e5ce0181f52b9a74eff044576b6e316efd | 29,617 | py | Python | src/epivizFileParser/BigWig.py | epiviz/parser | 255dc6409db3f55b6f967df079ada469862cd02c | [
"MIT"
] | 4 | 2018-09-14T19:00:16.000Z | 2020-04-08T07:58:34.000Z | src/epivizFileParser/BigWig.py | epiviz/parser | 255dc6409db3f55b6f967df079ada469862cd02c | [
"MIT"
] | 6 | 2019-04-27T21:08:49.000Z | 2021-12-21T01:03:11.000Z | src/epivizFileParser/BigWig.py | epiviz/epivizFileParser | bba301db40458b6666653c77a446db8778ee07f8 | [
"MIT"
] | 2 | 2021-01-11T17:09:24.000Z | 2021-01-28T16:17:11.000Z | from .BaseFile import BaseFile
import struct
import zlib
import os
import math
from .utils import toDataFrame
import pandas as pd
__author__ = "Jayaram Kancherla"
__copyright__ = "jkanche"
__license__ = "mit"
class BigWig(BaseFile):
"""
BigWig file parser
Args:
file (str): bigwig file location
... | 40.131436 | 208 | 0.51511 |
91175627765d4286849bf24dd76c7324410319bb | 1,549 | py | Python | haste/desktop_agent/simulator/__main__.py | HASTE-project/desktop-agent | 71a3d0d69b5a6660d63158897a53d1a65aba49ba | [
"BSD-3-Clause"
] | 2 | 2020-08-06T22:27:39.000Z | 2021-12-04T12:59:45.000Z | haste/desktop_agent/simulator/__main__.py | HASTE-project/desktop-agent | 71a3d0d69b5a6660d63158897a53d1a65aba49ba | [
"BSD-3-Clause"
] | null | null | null | haste/desktop_agent/simulator/__main__.py | HASTE-project/desktop-agent | 71a3d0d69b5a6660d63158897a53d1a65aba49ba | [
"BSD-3-Clause"
] | 1 | 2021-04-30T23:57:44.000Z | 2021-04-30T23:57:44.000Z | import sys
import time
import os
import shutil
import logging
from haste.desktop_agent import config
from haste.desktop_agent.config import EXTENSION, TARGET_DIR, FREQUENCY
if __name__ == '__main__':
SOURCE_DIR = sys.argv[1]
LOGGING_FORMAT_DATE = '%Y-%m-%d %H:%M:%S.%d3'
LOGGING_FORMAT = '%(asctime)s - SI... | 29.226415 | 93 | 0.663008 |
91175ff7aaa09dfb223cfb404356bb6dd21ae03a | 9,433 | py | Python | machine_learning/dbscan/dbscan.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | machine_learning/dbscan/dbscan.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | machine_learning/dbscan/dbscan.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | 1 | 2020-06-26T09:46:17.000Z | 2020-06-26T09:46:17.000Z | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... | 32.304795 | 98 | 0.569384 |
9117633cdd4a01416426b4d2b354d4c2b5c83c44 | 4,633 | py | Python | src/build/util/lib/results/result_sink.py | lazymartin/naiveproxy | 696e8714278e85e67e56a2eaea11f26c53116f0c | [
"BSD-3-Clause"
] | null | null | null | src/build/util/lib/results/result_sink.py | lazymartin/naiveproxy | 696e8714278e85e67e56a2eaea11f26c53116f0c | [
"BSD-3-Clause"
] | null | null | null | src/build/util/lib/results/result_sink.py | lazymartin/naiveproxy | 696e8714278e85e67e56a2eaea11f26c53116f0c | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import base64
import json
import os
import six
import requests # pylint: disable=import-error
from . import result_t... | 31.732877 | 78 | 0.643643 |
91176b70c34b4514e2cdf897043bf2082c257422 | 920 | py | Python | other/RxNorm.py | rohanpandey/central_line | 3692df97b96fef08a5cae64a547d2175b27f8010 | [
"MIT"
] | null | null | null | other/RxNorm.py | rohanpandey/central_line | 3692df97b96fef08a5cae64a547d2175b27f8010 | [
"MIT"
] | null | null | null | other/RxNorm.py | rohanpandey/central_line | 3692df97b96fef08a5cae64a547d2175b27f8010 | [
"MIT"
] | null | null | null | import pandas as pd
import requests
from bs4 import BeautifulSoup
import json
df=pd.read_excel('drug_freq.xlsx')
arr=[]
for index,row in df.iterrows():
base_url="https://rxnav.nlm.nih.gov/REST/rxclass/class/byDrugName.json?drugName="
value=requests.get(base_url+row['Drug Name'])
soup = BeautifulSoup(value.t... | 34.074074 | 85 | 0.622826 |
911771825d8df52a9e0780ce53111cfb78e5738b | 1,388 | py | Python | phr/establecimiento/admin.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/establecimiento/admin.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/establecimiento/admin.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | from django.contrib import admin
from phr.establecimiento import forms
from phr.establecimiento.models import (
Diresa, Establecimiento, EstablecimientoCategoria, EstablecimientoSector, Microred, Red,
)
@admin.register(Diresa)
class DiresaAdmin(admin.ModelAdmin):
ordering = ('nombre',)
search_fields = ('... | 28.916667 | 112 | 0.721182 |
91178f102fc18f5165c1d2b1a5857926755e4791 | 1,272 | py | Python | Python/ssl_tls/client/client.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Python/ssl_tls/client/client.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Python/ssl_tls/client/client.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | import socket, ssl, pprint
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Require a certificate from the server. We used a self-signed certificate
# so here ca_certs must be the server certificate itself.
ssl_sock = ssl.wrap_socket(s,
certfile="client.crt", # client's cert presen... | 37.411765 | 110 | 0.675314 |
9117a31d1f3969f5bbca5d0c8e65cf0275ca8963 | 4,110 | py | Python | cfnbootstrap/winhup.py | roberthutto/aws-cfn-bootstrap | 801a16802a931fa4dae0eba4898fe1ccdb304924 | [
"Apache-2.0"
] | null | null | null | cfnbootstrap/winhup.py | roberthutto/aws-cfn-bootstrap | 801a16802a931fa4dae0eba4898fe1ccdb304924 | [
"Apache-2.0"
] | null | null | null | cfnbootstrap/winhup.py | roberthutto/aws-cfn-bootstrap | 801a16802a931fa4dae0eba4898fe1ccdb304924 | [
"Apache-2.0"
] | 3 | 2017-02-10T13:14:38.000Z | 2018-09-20T01:04:20.000Z | #==============================================================================
# Copyright 2011 Amazon.com, Inc. or its affiliates. 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 ... | 41.515152 | 119 | 0.573236 |
9117cb1ea2d6469f4f2d58e109f31bb76b68a044 | 4,378 | py | Python | rpi_d3m_primitives/pyBN/utils/markov_blanket.py | naiyuyin/rpi_d3m_primitives | f95553bee90916d241885d28fb71c8167116d9fa | [
"MIT"
] | 1 | 2019-05-02T21:05:27.000Z | 2019-05-02T21:05:27.000Z | rpi_d3m_primitives/pyBN/utils/markov_blanket.py | naiyuyin/rpi_d3m_primitives | f95553bee90916d241885d28fb71c8167116d9fa | [
"MIT"
] | 1 | 2021-03-18T15:52:27.000Z | 2021-03-26T17:54:04.000Z | rpi_d3m_primitives/pyBN/utils/markov_blanket.py | naiyuyin/rpi_d3m_primitives | f95553bee90916d241885d28fb71c8167116d9fa | [
"MIT"
] | null | null | null | """
**************
Markov Blanket
**************
References
----------
[1] Koller and Sahami, "Toward Optimal Feature Selection."
[2] Yaramakala and Margaritis, "Speculative Markov Blanket Discovery
for Optimal Feature Selection"
[3] Pellet and Elisseff, "Using Markov Blankets for Causal Structure Learning"
"""
from... | 25.905325 | 85 | 0.672682 |
9117db55d9df2da7d3873bc40f756e77d5d6799e | 9,241 | py | Python | romp/lib/dataset/mpi_inf_3dhp.py | HuiliCui/ROMP | 8606d695e104f550a83bd74da3f3927c8e01faaf | [
"MIT"
] | 2 | 2022-03-28T07:22:01.000Z | 2022-03-28T07:22:05.000Z | romp/lib/dataset/mpi_inf_3dhp.py | HuiliCui/ROMP | 8606d695e104f550a83bd74da3f3927c8e01faaf | [
"MIT"
] | null | null | null | romp/lib/dataset/mpi_inf_3dhp.py | HuiliCui/ROMP | 8606d695e104f550a83bd74da3f3927c8e01faaf | [
"MIT"
] | null | null | null | import sys, os
from config import args
from dataset.image_base import *
class MPI_INF_3DHP(Image_base):
def __init__(self, train_flag=True, validation=False, **kwargs):
super(MPI_INF_3DHP,self).__init__(train_flag, regress_smpl=True)
self.data_folder = os.path.join(self.data_folder,'mpi_inf_3dhp/... | 46.205 | 161 | 0.600801 |
9117e3648d8b5cd647b3a3abda7834759bdeaff2 | 2,464 | py | Python | oscar/lib/python2.7/site-packages/flake8/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/flake8/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/flake8/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Top-level module for Flake8.
This module
- initializes logging for the command-line tool
- tracks the version of the package
- provides a way to configure logging for the command-line tool
.. autofunction:: flake8.configure_logging
"""
import logging
try:
from logging import NullHandler
except ... | 29.686747 | 80 | 0.658279 |
9117f2431d4bbff6d8c6288c19a79d2422d39d3c | 2,464 | py | Python | testing/test_utils.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | 2 | 2020-12-24T16:18:36.000Z | 2021-11-10T15:00:24.000Z | testing/test_utils.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | 12 | 2020-06-23T23:33:52.000Z | 2021-12-20T12:31:57.000Z | testing/test_utils.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | 5 | 2020-07-11T16:09:13.000Z | 2022-02-21T02:29:08.000Z | import unittest
from toscatranslator.providers.common.python_sources import transform_units
KIBS = '230 KiB'
GIBS = '230 GiB'
class TestUtills(unittest.TestCase):
def test_transform_units(self):
# from bytes to bytes
self.assertEqual(transform_units('230 KB', 'MB'), '0.23 MB')
self.asser... | 54.755556 | 98 | 0.670049 |
9118013d0079590f5efc862cccd09682a7421f4a | 335 | py | Python | backend/contact/admin.py | uncle-yura/simple_booking | 91a9609ae4521e4b2d52953112607c69db54d0ee | [
"MIT"
] | null | null | null | backend/contact/admin.py | uncle-yura/simple_booking | 91a9609ae4521e4b2d52953112607c69db54d0ee | [
"MIT"
] | null | null | null | backend/contact/admin.py | uncle-yura/simple_booking | 91a9609ae4521e4b2d52953112607c69db54d0ee | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import SocialContact, Contact, ContactsList
@admin.register(SocialContact)
class SocialContactAdmin(admin.ModelAdmin):
pass
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
pass
@admin.register(ContactsList)
class ContactsListAdmin(admin.ModelAd... | 17.631579 | 56 | 0.79403 |
91182d6ef5c24b43022c27e1ee3702996fdb5e49 | 4,429 | py | Python | src/lambda/producer-python/main.py | timothy-baker/lambda-refarch-streamprocessing | d5f3f6ccf49a25f91c3e21785352e99f1eed2f3f | [
"Apache-2.0"
] | null | null | null | src/lambda/producer-python/main.py | timothy-baker/lambda-refarch-streamprocessing | d5f3f6ccf49a25f91c3e21785352e99f1eed2f3f | [
"Apache-2.0"
] | null | null | null | src/lambda/producer-python/main.py | timothy-baker/lambda-refarch-streamprocessing | d5f3f6ccf49a25f91c3e21785352e99f1eed2f3f | [
"Apache-2.0"
] | 1 | 2019-09-06T14:16:05.000Z | 2019-09-06T14:16:05.000Z | """
Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of the License is
located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this f... | 34.601563 | 105 | 0.667419 |
9118363aca8cfbaa68c8fd7fc93627e544678d3a | 173 | py | Python | cachetools/__init__.py | miku/cachetools | 79180c8c1f9152be6d9e9d571e08956abd70974a | [
"BSD-3-Clause"
] | 3 | 2015-04-03T09:56:00.000Z | 2020-01-14T09:45:18.000Z | cachetools/__init__.py | miku/cachetools | 79180c8c1f9152be6d9e9d571e08956abd70974a | [
"BSD-3-Clause"
] | null | null | null | cachetools/__init__.py | miku/cachetools | 79180c8c1f9152be6d9e9d571e08956abd70974a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
cache_directory = os.path.join(os.path.expanduser("~"), ".cachetools")
from decorators import pickled, memoized
from url import URLCache
| 21.625 | 70 | 0.722543 |
91184334d947e97e07a0d4b2d7f6a7784295f1e5 | 1,880 | py | Python | crowdastro/active_learning/uncertainty_sampler.py | chengsoonong/crowdastro | ce14432c36de0574b73d813304365b74446a61f8 | [
"MIT"
] | 13 | 2015-11-07T15:24:44.000Z | 2020-04-20T05:29:58.000Z | crowdastro/active_learning/uncertainty_sampler.py | chengsoonong/crowdastro | ce14432c36de0574b73d813304365b74446a61f8 | [
"MIT"
] | 234 | 2016-02-21T23:53:16.000Z | 2019-06-27T00:26:08.000Z | crowdastro/active_learning/uncertainty_sampler.py | chengsoonong/crowdastro | ce14432c36de0574b73d813304365b74446a61f8 | [
"MIT"
] | 3 | 2015-11-07T00:20:09.000Z | 2018-10-03T13:37:15.000Z | """Active learning with uncertainty sampling.
Pool-based. Binary class labels.
Matthew Alger
The Australian National University
2016
"""
import numpy
from .sampler import Sampler
class ConfidenceUncertaintySampler(Sampler):
"""Pool-based active learning with uncertainty sampling, with uncertainty
based on... | 35.471698 | 78 | 0.662234 |
911867f52c26f635aa2d3cd93bf3b40470169fda | 70,846 | py | Python | code/toscaparser/tests/test_toscatplvalidation.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 8 | 2017-03-13T16:34:28.000Z | 2021-11-16T11:35:56.000Z | code/toscaparser/tests/test_toscatplvalidation.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | null | null | null | code/toscaparser/tests/test_toscatplvalidation.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 3 | 2017-03-28T09:26:40.000Z | 2020-12-08T14:16:12.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 39.689636 | 79 | 0.565311 |
91186cff1b44e2a7b01589a67169825f8c867445 | 10,976 | py | Python | conans/client/conf/config_installer.py | chhitz/conan | f361690beae3608d93a8d79dec7abb24f75ddd85 | [
"MIT"
] | null | null | null | conans/client/conf/config_installer.py | chhitz/conan | f361690beae3608d93a8d79dec7abb24f75ddd85 | [
"MIT"
] | null | null | null | conans/client/conf/config_installer.py | chhitz/conan | f361690beae3608d93a8d79dec7abb24f75ddd85 | [
"MIT"
] | null | null | null | import json
import os
import shutil
from datetime import datetime
from dateutil.tz import gettz
from contextlib import contextmanager
from six.moves.urllib.parse import urlparse
from conans import load
from conans.client import tools
from conans.client.cache.remote_registry import load_registry_txt,\
migrate_regi... | 39.482014 | 100 | 0.622267 |
91188c54f09131badb85aa93c8cbefc49cc1f442 | 316 | py | Python | eventsourcing/tests/test_actors_with_django.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | 1 | 2020-02-10T08:12:31.000Z | 2020-02-10T08:12:31.000Z | eventsourcing/tests/test_actors_with_django.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/tests/test_actors_with_django.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | from eventsourcing.tests.sequenced_item_tests.test_django_record_manager import DjangoTestCase
from eventsourcing.application.django import DjangoApplication
from eventsourcing.tests.test_actors import TestActors
class TestActorsWithDjango(DjangoTestCase, TestActors):
infrastructure_class = DjangoApplication
| 39.5 | 94 | 0.886076 |
911892a93fd959cc6d35cc60252c4792374117b2 | 1,284 | py | Python | indra/tests/test_sif_assembler.py | budakn/INDRA | 393958b2ca7bc1ca5d054885c0634f434ff7496e | [
"BSD-2-Clause"
] | 2 | 2020-01-14T08:59:10.000Z | 2020-12-18T16:21:38.000Z | indra/tests/test_sif_assembler.py | budakn/INDRA | 393958b2ca7bc1ca5d054885c0634f434ff7496e | [
"BSD-2-Clause"
] | null | null | null | indra/tests/test_sif_assembler.py | budakn/INDRA | 393958b2ca7bc1ca5d054885c0634f434ff7496e | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.assemblers import SifAssembler
from indra.statements import *
def test_simple_assembly():
st1 = Activation(Agent('a'), Agent('b'))
st2 = Inhibition(Agent('a'), Agent('c'))
sa = SifAssembler([... | 31.317073 | 72 | 0.633178 |
9118bb585780ea261adf23b19b3f8976e0e88f28 | 1,148 | py | Python | calc/handler.py | LucasRoesler/pytest-openfaas-sample | 18b0e6ca6e197a26a27373e8213cd61485b0bf51 | [
"MIT"
] | null | null | null | calc/handler.py | LucasRoesler/pytest-openfaas-sample | 18b0e6ca6e197a26a27373e8213cd61485b0bf51 | [
"MIT"
] | null | null | null | calc/handler.py | LucasRoesler/pytest-openfaas-sample | 18b0e6ca6e197a26a27373e8213cd61485b0bf51 | [
"MIT"
] | null | null | null | from pydantic import BaseModel, ValidationError
from enum import Enum, unique
@unique
class OperationType(Enum):
ADD = "+"
SUBTRACT = "-"
MULTIPLY = "*"
DIVIDE = "/"
POWER = "^"
class Calculation(BaseModel):
op: OperationType
var1: float
var2: float
def execute(self) -> float:
... | 22.076923 | 47 | 0.59669 |
9118cdaaf86e24a142547c9b74e2a0d55090a0e3 | 1,508 | py | Python | helpers/algorithms.py | GoBoopADog/maelstrom | fce79fa964578dfee5d7beb4ec440deec5f8f25d | [
"MIT"
] | null | null | null | helpers/algorithms.py | GoBoopADog/maelstrom | fce79fa964578dfee5d7beb4ec440deec5f8f25d | [
"MIT"
] | null | null | null | helpers/algorithms.py | GoBoopADog/maelstrom | fce79fa964578dfee5d7beb4ec440deec5f8f25d | [
"MIT"
] | null | null | null | from typing import Tuple
from math import sqrt
class Algorithm:
"""A base levelling algorithm."""
@classmethod
def calc(cls, before: int, after: int, inc: int) -> Tuple[int, int, bool]:
"""Returns the level, xp required to level up, whether the current xp gain is a levelup."""
bl, _ = cls... | 24.721311 | 99 | 0.559019 |
9118df48eaee963fe7dc06f810d90afdf9b99dca | 1,918 | py | Python | checkov/common/util/type_forcers.py | melscoop-test/checkov-1133567 | cd3cc95dd496059a7bebff13b242823ca3e5f6d0 | [
"Apache-2.0"
] | 5 | 2021-07-29T18:08:40.000Z | 2022-03-21T04:39:32.000Z | checkov/common/util/type_forcers.py | melscoop-test/checkov-1133567 | cd3cc95dd496059a7bebff13b242823ca3e5f6d0 | [
"Apache-2.0"
] | null | null | null | checkov/common/util/type_forcers.py | melscoop-test/checkov-1133567 | cd3cc95dd496059a7bebff13b242823ca3e5f6d0 | [
"Apache-2.0"
] | 2 | 2021-08-23T13:25:36.000Z | 2021-11-05T21:44:52.000Z | import json
import logging
from typing import TypeVar, List, overload, Union, Optional, Any, Dict
import yaml
T = TypeVar("T")
@overload
def force_list(var: List[T]) -> List[T]:
...
@overload
def force_list(var: T) -> List[T]:
...
def force_list(var: Union[T, List[T]]) -> List[T]:
if not isinstance(... | 23.108434 | 117 | 0.607404 |
91190d1b9f71cacd33745e3568d600aac1a7ec88 | 13,702 | py | Python | fire/inspectutils.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | null | null | null | fire/inspectutils.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | null | null | null | fire/inspectutils.py | loynoir/python-fire | 1f99e282f079bea992105f609ad1a70ed60d6635 | [
"Apache-2.0"
] | 1 | 2021-04-10T14:17:27.000Z | 2021-04-10T14:17:27.000Z | # Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.255 | 102 | 0.651584 |
9119173369315266ba53553e374f013c271809ea | 3,748 | py | Python | rhucrl_experiments/utilities.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2021-11-19T11:46:48.000Z | 2021-11-19T11:46:48.000Z | rhucrl_experiments/utilities.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2021-11-22T07:48:03.000Z | 2021-11-22T07:48:03.000Z | rhucrl_experiments/utilities.py | sebascuri/rhucrl | 27663e1302f3bbc636dff28495c6f2667bb7c1da | [
"MIT"
] | 1 | 2022-03-26T10:18:01.000Z | 2022-03-26T10:18:01.000Z | """Python Script Template."""
import argparse
from gym.envs import registry
from rllib.agent import AGENTS as BASE_AGENTS
from rllib.agent import MODEL_FREE
from rhucrl.agent import AGENTS as ROBUST_AGENTS
def get_command_line_parser():
"""Get command line parser."""
parser = argparse.ArgumentParser("Run ex... | 30.721311 | 87 | 0.616862 |
911927cb4248a3bf5146e5873bb1adcc3128eb38 | 1,754 | py | Python | practise/phonechanllege.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | practise/phonechanllege.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | practise/phonechanllege.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(S):
def get_time_and_number(row):
'''
get the number and time in ses
'''
timegap, number = row.split(',')
number = int(''.join(number.split('-')))
timegap = ti... | 29.728814 | 87 | 0.579818 |
91192ee51ba898a10f598e11d19f7136e993243d | 2,235 | py | Python | scrap/readlineOld.py | nomelm50s/lightcst | 93c137472782d8f726283294a017a7f578c66a93 | [
"MIT"
] | null | null | null | scrap/readlineOld.py | nomelm50s/lightcst | 93c137472782d8f726283294a017a7f578c66a93 | [
"MIT"
] | null | null | null | scrap/readlineOld.py | nomelm50s/lightcst | 93c137472782d8f726283294a017a7f578c66a93 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
import sys
import glob
""" Readline old was the first attempt but ultimatly not used. """
def getfname():
""" Prompts for a file name.
Arguments:
nothing
Returns:
the selected file name and path.
Created 11/7/2020 by Mike Lemon
"""
fpaths = g... | 21.699029 | 106 | 0.622371 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.