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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d5c63d8bc7d44cf69b5b0cb6fc55a3fb8d3f9b9 | 12,804 | py | Python | Lib/site-packages/kivy/uix/layout.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | Lib/site-packages/kivy/uix/layout.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 1 | 2017-05-30T20:45:15.000Z | 2017-05-30T20:45:15.000Z | Lib/site-packages/kivy/uix/layout.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | '''
Layout
======
Layouts are used to calculate and assign widget positions.
The :class:`Layout` class itself cannot be used directly.
You should use one of the following layout classes:
- Anchor layout: :class:`kivy.uix.anchorlayout.AnchorLayout`
- Box layout: :class:`kivy.uix.boxlayout.BoxLayout`
- Float layout: :... | 39.640867 | 78 | 0.593955 |
2d5c6f1083a4887e998c5e1d0763e178f6636b7b | 5,451 | py | Python | data/base_dataset.py | caixin1998/pl-template | 6918f0289ab2b32d107e5722617d25c9a683399c | [
"BSD-3-Clause"
] | null | null | null | data/base_dataset.py | caixin1998/pl-template | 6918f0289ab2b32d107e5722617d25c9a683399c | [
"BSD-3-Clause"
] | null | null | null | data/base_dataset.py | caixin1998/pl-template | 6918f0289ab2b32d107e5722617d25c9a683399c | [
"BSD-3-Clause"
] | null | null | null | """This module implements an abstract base class (ABC) 'BaseDataset' for datasets.
It also includes common transformation functions (e.g., get_transform, __scale_width), which can be later used in subclasses.
"""
import random
import numpy as np
import torch.utils.data as data
from PIL import Image
import torchvision.... | 33.648148 | 141 | 0.636947 |
2d5c85af010772e32da352c79e301d6eb583e386 | 10,435 | py | Python | jina/optimizers/__init__.py | liushuigs/jina | b3550e901b2a340924330b5ba2801603e493c933 | [
"Apache-2.0"
] | null | null | null | jina/optimizers/__init__.py | liushuigs/jina | b3550e901b2a340924330b5ba2801603e493c933 | [
"Apache-2.0"
] | 2 | 2021-02-15T01:40:38.000Z | 2021-02-15T02:00:21.000Z | jina/optimizers/__init__.py | liushuigs/jina | b3550e901b2a340924330b5ba2801603e493c933 | [
"Apache-2.0"
] | null | null | null | import os
from collections import defaultdict
from typing import Optional
import yaml
from .parameters import (
IntegerParameter,
UniformParameter,
LogUniformParameter,
CategoricalParameter,
DiscreteUniformParameter,
)
from .parameters import load_optimization_parameters
from ..helper import color... | 36.232639 | 139 | 0.652132 |
2d5cc33381850be07762eb2169a95c6958aeb19a | 8,132 | py | Python | heartFEM/lcleeHeart/forms_shavik.py | WeiXuanChan/heartFEM | 7f26c71434919c3141fac600f08685e5383e7137 | [
"MIT"
] | 3 | 2021-04-13T07:05:20.000Z | 2021-10-02T13:41:09.000Z | heartFEM/lcleeHeart/forms_shavik.py | WeiXuanChan/heartFEM | 7f26c71434919c3141fac600f08685e5383e7137 | [
"MIT"
] | null | null | null | heartFEM/lcleeHeart/forms_shavik.py | WeiXuanChan/heartFEM | 7f26c71434919c3141fac600f08685e5383e7137 | [
"MIT"
] | 2 | 2021-09-06T13:13:41.000Z | 2022-03-11T18:59:02.000Z | from dolfin import *
from ufl import cofac
import dolfin as dolfin
import numpy as np
from ufl import k
from ufl import i
from ufl import j
#from mpi4py import MPI
import sys
class Forms(object):
def __init__(self, params):
self.parameters = params
def Fmat(self,inverse=False):
u = self.parameters["... | 27.754266 | 174 | 0.60969 |
2d5cc8e54fcf4aec76e4014d52f5868ac36ddd67 | 665 | py | Python | services/traction/acapy_wrapper/models/schemas_created_result.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 12 | 2022-01-29T20:30:03.000Z | 2022-03-29T11:46:14.000Z | services/traction/acapy_wrapper/models/schemas_created_result.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 38 | 2021-11-22T17:52:50.000Z | 2022-03-31T17:52:00.000Z | services/traction/acapy_wrapper/models/schemas_created_result.py | Open-Earth-Foundation/traction | 908b555a7f408a88541b7692d3730e37a297c919 | [
"Apache-2.0"
] | 9 | 2021-11-22T18:05:48.000Z | 2022-03-29T11:25:08.000Z | # coding: utf-8
from __future__ import annotations
from datetime import date, datetime # noqa: F401
import re # noqa: F401
from typing import Any, Dict, List, Optional # noqa: F401
from pydantic import AnyUrl, BaseModel, EmailStr, validator # noqa: F401
class SchemasCreatedResult(BaseModel):
"""NOTE: This ... | 25.576923 | 96 | 0.741353 |
2d5cd184d7e60e7c333d6907aedfc310fb1d3b84 | 12,638 | py | Python | mars/core/session.py | deka108/mars | 2cd39847c188bb690dd5e2d612a5cbe9f7b21eca | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/core/session.py | deka108/mars | 2cd39847c188bb690dd5e2d612a5cbe9f7b21eca | [
"Apache-2.0"
] | null | null | null | mars/core/session.py | deka108/mars | 2cd39847c188bb690dd5e2d612a5cbe9f7b21eca | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 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... | 28.209821 | 78 | 0.59416 |
2d5ce47373f58e81c4851090affba2a1c06c2cbd | 921 | py | Python | alipay/aop/api/response/AlipayCommerceSportsFacepayskinReceiveResponse.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/response/AlipayCommerceSportsFacepayskinReceiveResponse.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/response/AlipayCommerceSportsFacepayskinReceiveResponse.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.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.UserFacePaySkinInfo import UserFacePaySkinInfo
class AlipayCommerceSportsFacepayskinReceiveResponse(AlipayResponse):
def __init__(self):
super(AlipayComm... | 30.7 | 119 | 0.716612 |
2d5cf3c02ca954af2e13ca927f31fc96a6264b7f | 258 | py | Python | contest/hourrank-8/beautiful-binary-string/beautiful-binary-string.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | 4 | 2017-01-18T17:51:58.000Z | 2019-10-20T12:14:37.000Z | contest/hourrank-8/beautiful-binary-string/beautiful-binary-string.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | null | null | null | contest/hourrank-8/beautiful-binary-string/beautiful-binary-string.py | zeyuanxy/HackerRank | 5194a4af780ece396501c215996685d1be529e73 | [
"MIT"
] | 8 | 2016-03-14T17:16:59.000Z | 2021-06-26T10:11:33.000Z | # -*- coding: utf-8 -*-
# @Author: Zeyuan Shang
# @Date: 2016-05-03 00:32:24
# @Last Modified by: Zeyuan Shang
# @Last Modified time: 2016-05-03 00:35:00
import re
if __name__ == "__main__":
raw_input()
s = raw_input()
print len(re.findall('010', s)) | 23.454545 | 42 | 0.643411 |
2d5cf5949397d3f708c31f60834ab27dad5a5189 | 21,243 | py | Python | kopf/reactor/running.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/reactor/running.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/reactor/running.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | import asyncio
import functools
import logging
import signal
import threading
import warnings
from typing import Collection, Coroutine, MutableSequence, Optional, Sequence
from kopf.clients import auth
from kopf.engines import peering, posting, probing
from kopf.reactor import activities, daemons, lifecycles, observat... | 42.656627 | 102 | 0.671704 |
2d5d57d2bde89243cf7196a90a5cebbf4be5376d | 1,387 | py | Python | extensions/iocloud/login/forms.py | iocafe/iocom | 9762b78fa1591994c74ed1fc6fe23b9ef44e0dff | [
"MIT"
] | 1 | 2020-04-28T23:25:50.000Z | 2020-04-28T23:25:50.000Z | extensions/iocloud/login/forms.py | iocafe/iocom | 9762b78fa1591994c74ed1fc6fe23b9ef44e0dff | [
"MIT"
] | 11 | 2020-01-30T16:27:24.000Z | 2020-08-09T06:25:06.000Z | extensions/iocloud/login/forms.py | iocafe/iocom | 9762b78fa1591994c74ed1fc6fe23b9ef44e0dff | [
"MIT"
] | null | null | null | """Sign-up & log-in forms."""
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired, Email, EqualTo, Length, Optional
class SignupForm(FlaskForm):
"""User Sign-up Form."""
name = StringField('Name',
valida... | 43.34375 | 95 | 0.548666 |
2d5d64ee90b635e738d2f8344165947a294a235a | 596 | py | Python | abc/224/C.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/224/C.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/224/C.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
def main():
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N = ni()
X = [0] * N
Y = [0] * N
for i in range(N):
X[i], Y[i] = na()
ans = 0
for i i... | 20.551724 | 82 | 0.432886 |
2d5d7f26a399bf66baa51869f36180dbca76dd66 | 1,752 | py | Python | master/Impractical_Python_Projects-master/Impractical_Python_Projects-master/Chapter_4/rail_fence_cipher_decrypt.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | master/Impractical_Python_Projects-master/Impractical_Python_Projects-master/Chapter_4/rail_fence_cipher_decrypt.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | master/Impractical_Python_Projects-master/Impractical_Python_Projects-master/Chapter_4/rail_fence_cipher_decrypt.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | r"""Decrypt a Civil War 'rail fence' type cipher.
This is for a "2-rail" fence cipher for short messages
Example plaintext: 'Buy more Maine potatoes'
Rail fence style: B Y O E A N P T T E
U M R M I E O A O S
Read zig-zag: \/\/\/\/\/\/\/\/\/\/
Ciphertext: BYOEA NPTTE UMRMI EOSOS
"""
i... | 26.953846 | 79 | 0.579909 |
2d5d9770458b549266fe9a974fbceb27f70f0611 | 8,388 | py | Python | objectives.py | adamsolomou/second-order-random-search | 212e8ed3b081c8a7928ebcf5de99d012218a15c6 | [
"Apache-2.0"
] | null | null | null | objectives.py | adamsolomou/second-order-random-search | 212e8ed3b081c8a7928ebcf5de99d012218a15c6 | [
"Apache-2.0"
] | null | null | null | objectives.py | adamsolomou/second-order-random-search | 212e8ed3b081c8a7928ebcf5de99d012218a15c6 | [
"Apache-2.0"
] | null | null | null | import autograd.numpy as np
import matplotlib.pyplot as plt
from autograd import grad
from autograd import hessian
class Benchmark(object):
def __init__(self, dimensions):
self._dimensions = dimensions
self.fglob = np.nan
self.global_optimum = None
def __str__(self):
return '{0} ({1} dimensions)'.format... | 24.890208 | 100 | 0.628636 |
2d5db98e22f455054884697020a1302da723ef61 | 3,486 | py | Python | modin/engines/ray/cudf_on_ray/frame/data.py | gatech-sysml/modin | 76d19217bc1e33e4c47f7740b4fd2490d3ce7777 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | modin/engines/ray/cudf_on_ray/frame/data.py | gatech-sysml/modin | 76d19217bc1e33e4c47f7740b4fd2490d3ce7777 | [
"ECL-2.0",
"Apache-2.0"
] | 57 | 2021-01-22T15:52:03.000Z | 2021-06-12T18:22:04.000Z | modin/engines/ray/cudf_on_ray/frame/data.py | gatech-sysml/modin | 76d19217bc1e33e4c47f7740b4fd2490d3ce7777 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | 37.891304 | 92 | 0.570568 |
2d5dcf0098845f4ca843203008196d67ec92404d | 2,162 | py | Python | lore/stores/disk.py | startrekor/lore | 72c8a28f19565373f1addd8ff65794211ed65edf | [
"MIT"
] | null | null | null | lore/stores/disk.py | startrekor/lore | 72c8a28f19565373f1addd8ff65794211ed65edf | [
"MIT"
] | null | null | null | lore/stores/disk.py | startrekor/lore | 72c8a28f19565373f1addd8ff65794211ed65edf | [
"MIT"
] | 1 | 2018-03-13T05:57:49.000Z | 2018-03-13T05:57:49.000Z | import os
import pickle
from lore.stores.base import Base
from lore.util import timer
class Disk(Base):
EXTENSION = '.pickle'
def __init__(self, dir):
self.dir = dir
self.limit = None
if not os.path.exists(self.dir):
os.makedirs(self.dir)
def __getitem__(self... | 27.717949 | 86 | 0.550879 |
2d5e2e29355c8c980ca207ba284b9c0ee840ca57 | 74,611 | py | Python | idb/idapython.py | 6un9-h0-Dan/python-idb | 649a12d6d2b7778f3def921a9acd045fb3286138 | [
"Apache-2.0"
] | 1 | 2020-12-23T19:22:58.000Z | 2020-12-23T19:22:58.000Z | idb/idapython.py | 6un9-h0-Dan/python-idb | 649a12d6d2b7778f3def921a9acd045fb3286138 | [
"Apache-2.0"
] | null | null | null | idb/idapython.py | 6un9-h0-Dan/python-idb | 649a12d6d2b7778f3def921a9acd045fb3286138 | [
"Apache-2.0"
] | 1 | 2020-12-23T19:24:33.000Z | 2020-12-23T19:24:33.000Z | # -*- coding: utf-8 -*-
import re
import logging
import weakref
import collections
import six
if six.PY2:
import functools32 as functools
else:
import functools
import idb.netnode
import idb.analysis
logger = logging.getLogger(__name__)
# via: https://stackoverflow.com/a/33672499/87207
def memoized_metho... | 30.379072 | 176 | 0.581509 |
2d5e3a059a224afe5fdb825b34d8d95a9ec9bd8f | 19,885 | py | Python | syft/serde/msgpack/serde.py | ivynasantino/PySyft | 2efacddc5053c61dff9f05658207be228a90e872 | [
"Apache-2.0"
] | 1 | 2020-04-11T06:46:49.000Z | 2020-04-11T06:46:49.000Z | syft/serde/msgpack/serde.py | haofanwang/PySyft | 653d31001dbc0c611d486c6c5543fce0abf9b27d | [
"Apache-2.0"
] | 1 | 2020-04-07T13:36:44.000Z | 2020-04-07T13:36:44.000Z | syft/serde/msgpack/serde.py | JMBehnken/PySyft | 35012f5bf55628bb19761d5f40d03181fbbb1766 | [
"Apache-2.0"
] | 1 | 2020-03-11T09:52:47.000Z | 2020-03-11T09:52:47.000Z | """
This file exists to provide one common place for all msgpack serialization to occur.
As msgpack only supports basic types and binary formats every type must be first be
converted to one of these types. Thus, we've split our functionality into three steps.
When converting from a PySyft object (or collection of objec... | 42.040169 | 115 | 0.742721 |
2d5e3ae9cf1d323261894a7660760ea3dd797e98 | 21 | py | Python | Python/tempCodeRunnerFile.py | shivendra90/HackerRank_Solutions | 0e6f9b907c5f8ca93b2945787cb1fe7ed172bed6 | [
"MIT"
] | null | null | null | Python/tempCodeRunnerFile.py | shivendra90/HackerRank_Solutions | 0e6f9b907c5f8ca93b2945787cb1fe7ed172bed6 | [
"MIT"
] | null | null | null | Python/tempCodeRunnerFile.py | shivendra90/HackerRank_Solutions | 0e6f9b907c5f8ca93b2945787cb1fe7ed172bed6 | [
"MIT"
] | null | null | null | n = int(input())
| 10.5 | 20 | 0.428571 |
2d5e640bb3375d39b097092051f23a521da73e03 | 2,051 | py | Python | Chapter 4/04/recipe29.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | Chapter 4/04/recipe29.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | Chapter 4/04/recipe29.py | robert0714/Python-Testing-Cookbook-Second-Edition | c7c5d59e42e9ca2874faf12a6dd201736a45ca83 | [
"MIT"
] | null | null | null | import doctest
class BddDocTestRunner(doctest.DocTestRunner):
"""
This is a customized test runner. It is meant
to run code examples like DocTestRunner,
but if a line preceeds the code example
starting with '#', then it prints that
comment.
If the line starts with '#when', it is printed... | 32.046875 | 61 | 0.536324 |
2d5e71b15f97237dd7a199f39c5e19cdf2d5ff0a | 15,732 | py | Python | deepchem/models/tensorgraph/tests/test_layers_pickle.py | 0ut0fcontrol/deepchem | a680cc126c8b057aa4727b74a7bd175ad8457ef3 | [
"MIT"
] | null | null | null | deepchem/models/tensorgraph/tests/test_layers_pickle.py | 0ut0fcontrol/deepchem | a680cc126c8b057aa4727b74a7bd175ad8457ef3 | [
"MIT"
] | null | null | null | deepchem/models/tensorgraph/tests/test_layers_pickle.py | 0ut0fcontrol/deepchem | a680cc126c8b057aa4727b74a7bd175ad8457ef3 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from deepchem.models import TensorGraph
from deepchem.models.tensorgraph.graph_layers import WeaveLayer, WeaveGather, DTNNEmbedding, DTNNGather, DTNNStep, \
DTNNExtract, DAGLayer, DAGGather, MessagePassing, SetGather
from deepchem.models.tensorgraph.layers import Feature, C... | 24.971429 | 121 | 0.701119 |
2d5eb53c5f2a45f27c0f051498c2c4a98fe8177c | 9,817 | py | Python | gluoncv/data/cityscapes_panoptic.py | Angzz/panoptic-fpn-gluon | aed71b3b6ed296a51e3a327532b59d2508283aec | [
"Apache-2.0"
] | 62 | 2019-05-22T14:57:27.000Z | 2021-06-18T21:39:16.000Z | gluoncv/data/cityscapes_panoptic.py | mornydew/panoptic-fpn-gluon | aed71b3b6ed296a51e3a327532b59d2508283aec | [
"Apache-2.0"
] | 5 | 2019-07-15T11:26:43.000Z | 2020-07-17T18:51:01.000Z | gluoncv/data/cityscapes_panoptic.py | mornydew/panoptic-fpn-gluon | aed71b3b6ed296a51e3a327532b59d2508283aec | [
"Apache-2.0"
] | 11 | 2019-06-20T01:48:30.000Z | 2021-04-14T09:46:44.000Z | """Cityscapes Dataloader"""
import os
import json
import random
import numpy as np
from PIL import Image, ImageOps, ImageFilter
import cv2
import mxnet as mx
from .segbase import SegmentationDataset
from .base import VisionDataset
from .transforms import bbox as tbbox
"""
Cityscapes Panoptic Save Type:
channel 0: all... | 42.133047 | 93 | 0.55903 |
2d5f005522d1cfa41102b732d9684110135241ad | 3,229 | py | Python | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 48.19403 | 130 | 0.704552 |
2d5f08a2b2b6d3ac5285871df03f892b8962b07e | 809 | py | Python | coyote_framework/webdriver/webdriverwrapper/exceptions/WebDriverTimeoutException.py | vaibhavrastogi1988/python_testing_framework | 583a2286479ed0ccda309c866a403dc92fa1bb3b | [
"MIT"
] | null | null | null | coyote_framework/webdriver/webdriverwrapper/exceptions/WebDriverTimeoutException.py | vaibhavrastogi1988/python_testing_framework | 583a2286479ed0ccda309c866a403dc92fa1bb3b | [
"MIT"
] | null | null | null | coyote_framework/webdriver/webdriverwrapper/exceptions/WebDriverTimeoutException.py | vaibhavrastogi1988/python_testing_framework | 583a2286479ed0ccda309c866a403dc92fa1bb3b | [
"MIT"
] | null | null | null | from coyote_framework.webdriver.webdriverwrapper.exceptions import WebDriverWrapperException
__author__ = 'justin'
class WebDriverTimeoutException(WebDriverWrapperException.WebDriverWrapperException):
def __init__(self, driver_wrapper, timeout, locator, msg, execute_on_error=None):
try:
if n... | 40.45 | 117 | 0.660074 |
2d5f0a31d1b19704cee9ece5ab151fb0dbdb0c97 | 1,330 | py | Python | maths/find_lcm.py | jojoduquartier/Python | aa92332d80662bc356bf8964f74c4d2fec9b8333 | [
"MIT"
] | null | null | null | maths/find_lcm.py | jojoduquartier/Python | aa92332d80662bc356bf8964f74c4d2fec9b8333 | [
"MIT"
] | null | null | null | maths/find_lcm.py | jojoduquartier/Python | aa92332d80662bc356bf8964f74c4d2fec9b8333 | [
"MIT"
] | null | null | null | def find_lcm(num_1, num_2):
"""
Returns the least common multiple of two integers.
:param x: any integer
:param y: any integer
:return: integer z such that remainder(z/x) == 0 and remainder(z/y) == 0
"""
max = num_1 if num_1 > num_2 else num_2
lcm = max
while (True):
if ((lcm... | 27.142857 | 93 | 0.609774 |
2d5f0c75881e3e338a06fc5538d8a1cc8f6835bf | 3,400 | py | Python | res/houdini/hda/avalonidRead.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 3 | 2020-04-01T10:51:17.000Z | 2021-08-05T18:35:23.000Z | res/houdini/hda/avalonidRead.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | null | null | null | res/houdini/hda/avalonidRead.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 1 | 2020-07-05T12:06:30.000Z | 2020-07-05T12:06:30.000Z | """Houdini Digital Asset for Unpacking `AvalonID` from alembic file
Created @chordee
Modified @davidlatwe
"""
import hou
import _alembic_hom_extensions as abc
target_attrs = ["AvalonID"]
node = hou.pwd()
geo = node.geometry()
abc_file_attr = geo.findGlobalAttrib("abcFileName")
if abc_file_attr is not None:
ab... | 31.481481 | 79 | 0.567647 |
2d5f27e475fbb21466b44b0fcdd4d55a43cfdd1c | 9,060 | py | Python | finrl/neo_finrl/env_portfolio_allocation/env_portfolio.py | hokhay/FinRL | 8582d27552ab541ee8d176d8996d419a6a3c2ef7 | [
"MIT"
] | null | null | null | finrl/neo_finrl/env_portfolio_allocation/env_portfolio.py | hokhay/FinRL | 8582d27552ab541ee8d176d8996d419a6a3c2ef7 | [
"MIT"
] | null | null | null | finrl/neo_finrl/env_portfolio_allocation/env_portfolio.py | hokhay/FinRL | 8582d27552ab541ee8d176d8996d419a6a3c2ef7 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from gym.utils import seeding
import gym
from gym import spaces
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from stable_baselines3.common.vec_env import DummyVecEnv
class StockPortfolioEnv(gym.Env):
"""A single stock trading environment for OpenA... | 34.846154 | 129 | 0.591943 |
2d5f3a2d21fb8f9a447b6115126c242b91673362 | 1,462 | py | Python | marqeta/response_models/bank_account_funding_source_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/bank_account_funding_source_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/bank_account_funding_source_model.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models.funding_source_model import FundingSourceModel
from marqeta.response_models import datetime_object
import json
import re
class BankAccountFundingSourceModel(FundingSourceModel):
def __init__(self, json_response):
self.json_response = json_re... | 25.649123 | 124 | 0.71751 |
2d5f4551bb7061e83ee9f6eeaec2413ce7d1cb5b | 349 | py | Python | osiris/base/logutils.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | 4 | 2020-04-23T18:43:27.000Z | 2022-02-22T03:57:06.000Z | osiris/base/logutils.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | 1 | 2021-06-02T00:47:12.000Z | 2021-06-02T00:47:12.000Z | osiris/base/logutils.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | null | null | null | import logging
from osiris.exceptions import IllegalArgumentException
def bootstrap():
pass
def get_logger(name: str):
if not name:
raise IllegalArgumentException("'logger name' is required")
return logging.getLogger(name)
# Fallback Configuration; Will be overridden in bootstrap
logging.basi... | 19.388889 | 67 | 0.762178 |
2d5f7d50688cb2920790126ddc5a99e1fbce97ee | 4,683 | py | Python | assemblyline/odm/models/service.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/odm/models/service.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | assemblyline/odm/models/service.py | malvidin/assemblyline-base | 6e7de0c15fbca2cf586e33f04df7d3717bd0c0b5 | [
"MIT"
] | null | null | null | from typing import List, Optional as Opt
from assemblyline import odm
from assemblyline.common import forge
from assemblyline.common.constants import DEFAULT_SERVICE_ACCEPTS, DEFAULT_SERVICE_REJECTS
Classification = forge.get_classification()
@odm.model(index=False, store=False)
class EnvironmentVariable(odm.Model)... | 43.766355 | 119 | 0.717489 |
2d5f7e1a1752d323719f16f7b5f2e583e778541c | 4,085 | py | Python | tests/tests_errors.py | BioTheWolff/subnetwork-constructor | 1834ee3ef98dfeca2906a96a2a914a962ccb6b04 | [
"MIT"
] | 6 | 2019-07-28T09:57:39.000Z | 2019-08-28T22:02:02.000Z | tests/tests_errors.py | BioTheWolff/subnetwork-constructor | 1834ee3ef98dfeca2906a96a2a914a962ccb6b04 | [
"MIT"
] | 6 | 2020-01-05T20:34:35.000Z | 2020-03-03T16:05:46.000Z | tests/tests_errors.py | BioTheWolff/NetworkUtilities | 1834ee3ef98dfeca2906a96a2a914a962ccb6b04 | [
"MIT"
] | null | null | null | import unittest
import unittest.mock as m
import nettools.utils.errors as e
class ErrorsInstanciationTests(unittest.TestCase):
b = 'builtins.print'
@m.patch(b)
def test_bytes_length_exception(self, mocked_print):
inst = e.BytesLengthException('IP', 5)
print(str(inst))
self.assert... | 37.477064 | 115 | 0.632313 |
2d5f80d57c80744a5799c22ba9de37a39cf37e6a | 904 | py | Python | sdks/python/test/test_StringProperty.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_StringProperty.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_StringProperty.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 22.6 | 87 | 0.712389 |
2d5fa1243f44a2c1446571b3784e443f8ef991a7 | 30,080 | py | Python | demisto_sdk/commands/lint/lint_manager.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/lint/lint_manager.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/lint/lint_manager.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | # STD packages
import concurrent.futures
import json
import logging
import os
import re
import sys
import textwrap
from typing import Any, Dict, List, Set
import demisto_sdk.commands.common.tools as tools
# Third party packages
import docker
import docker.errors
import git
import requests.exceptions
import urllib3.exc... | 50.983051 | 125 | 0.548138 |
2d5fad3542c96c04987c87694b4234bb45911c62 | 1,941 | py | Python | lib/tests/streamlit/echo_test.py | dwiel/streamlit | 74ae7f30cc3d95948aff311371449963f8eaf29e | [
"Apache-2.0"
] | 1 | 2020-01-07T06:10:44.000Z | 2020-01-07T06:10:44.000Z | lib/tests/streamlit/echo_test.py | yutiansut/streamlit | 929942f755ca40f859a03d905ffcbf743f45dffa | [
"Apache-2.0"
] | null | null | null | lib/tests/streamlit/echo_test.py | yutiansut/streamlit | 929942f755ca40f859a03d905ffcbf743f45dffa | [
"Apache-2.0"
] | 1 | 2020-06-26T14:41:01.000Z | 2020-06-26T14:41:01.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit 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 applicabl... | 23.670732 | 74 | 0.625966 |
2d5fda52441c48eee0e590e7c3b0af0b71d3c135 | 17,761 | py | Python | dnacentersdk/api/v1_3_0/task.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/api/v1_3_0/task.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/api/v1_3_0/task.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Task API wrapper.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without... | 36.395492 | 78 | 0.574968 |
2d5fe02763995d286909829bc2fdeb581fdcd894 | 1,128 | py | Python | run_time/src/gae_server_test/test_web_handler.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | run_time/src/gae_server_test/test_web_handler.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | run_time/src/gae_server_test/test_web_handler.py | moyogo/tachyfont | 05c8b3e7357e7a13af37ef81b719a0ff749105a5 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2014 Google 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 applicable law or ... | 31.333333 | 74 | 0.754433 |
2d5ff3fdb384b5ec6c436737aa8e900d76142521 | 5,576 | py | Python | dipy/tracking/local/localtracking.py | martcous/dipy | 6bff5655f03db19bde5aa951ffb91987983a889b | [
"MIT"
] | null | null | null | dipy/tracking/local/localtracking.py | martcous/dipy | 6bff5655f03db19bde5aa951ffb91987983a889b | [
"MIT"
] | null | null | null | dipy/tracking/local/localtracking.py | martcous/dipy | 6bff5655f03db19bde5aa951ffb91987983a889b | [
"MIT"
] | null | null | null | import numpy as np
from .localtrack import local_tracker
from dipy.align import Bunch
from dipy.tracking import utils
# enum TissueClass (tissue_classifier.pxd) is not accessible
# from here. To be changed when minimal cython version > 0.21.
# cython 0.21 - cpdef enum to export values into Python-level namespace
# ht... | 41.61194 | 82 | 0.593615 |
2d5ff902fbc6c29ff01882b7f99203560ed74035 | 2,855 | py | Python | src/si/data/feature_selection.py | pg42872/Sistemas_Inteligentes | 884af63cbd0ce2baa759d7197282dce0776e476b | [
"Apache-2.0"
] | null | null | null | src/si/data/feature_selection.py | pg42872/Sistemas_Inteligentes | 884af63cbd0ce2baa759d7197282dce0776e476b | [
"Apache-2.0"
] | null | null | null | src/si/data/feature_selection.py | pg42872/Sistemas_Inteligentes | 884af63cbd0ce2baa759d7197282dce0776e476b | [
"Apache-2.0"
] | null | null | null | import numpy as np
from copy import copy
import warnings
from ..data import Dataset
import scipy.stats as stats
class VarianceThreshold:
def __init__(self, threshold=0):
"""
the variance threshold is a simple baseline approach to feature selection
it removes all features which variance doe... | 34.39759 | 126 | 0.624168 |
2d6007fda323ec36bc7dcc2c149850fef163e6b4 | 13,934 | py | Python | src/StockMysql/scripts/rebuild_StockMysql.py | xylsxyls/xueyelingshuan | 61eb1c7c4f76c3eaf4cf26e4b2b37b6ed2abc5b9 | [
"MIT"
] | 3 | 2019-11-26T05:33:47.000Z | 2020-05-18T06:49:41.000Z | src/StockMysql/scripts/rebuild_StockMysql.py | xylsxyls/xueyelingshuan | 61eb1c7c4f76c3eaf4cf26e4b2b37b6ed2abc5b9 | [
"MIT"
] | null | null | null | src/StockMysql/scripts/rebuild_StockMysql.py | xylsxyls/xueyelingshuan | 61eb1c7c4f76c3eaf4cf26e4b2b37b6ed2abc5b9 | [
"MIT"
] | null | null | null | #!python3
# -*- coding:utf-8 -*-
import os
import sys
import time
import ctypes
import shutil
import subprocess
IsPy3 = sys.version_info[0] >= 3
if IsPy3:
import winreg
else:
import codecs
import _winreg as winreg
BuildType = 'Release'
IsRebuild = True
Build = 'Rebuild'
Update = False
C... | 39.140449 | 196 | 0.580451 |
2d6030f38a5067b329d3781789271017e7a6974b | 1,550 | py | Python | delete_resources.py | joshuapwalton/cloud-reset | 0589f04185998e4094c319a2b5a01925401ab7f2 | [
"MIT"
] | 3 | 2020-02-02T18:48:24.000Z | 2020-09-18T19:00:45.000Z | delete_resources.py | joshuapwalton/cloud-reset | 0589f04185998e4094c319a2b5a01925401ab7f2 | [
"MIT"
] | null | null | null | delete_resources.py | joshuapwalton/cloud-reset | 0589f04185998e4094c319a2b5a01925401ab7f2 | [
"MIT"
] | 1 | 2020-07-20T15:29:08.000Z | 2020-07-20T15:29:08.000Z | """
Delete resources as listed in a YAML file
Usage:
```
python delete_resources.py -f <resources.yml>
```
Example of `example.yml` file:
```
ec2:
tags:
Name: Test
```
Executing `python delete_resources.py -f example.yml` would delete all EC2 instances with tag `Name=Test`
"""
import argparse
import sys... | 25 | 105 | 0.645806 |
2d604dc42f8f71c5c82e90bbfc5edee6ab6ab974 | 1,191 | py | Python | openrl/algorithms/cql/models.py | natetsang/open-rl | 426723d0d6759672ce77e02afeb55cbeb68fcfb0 | [
"MIT"
] | 2 | 2021-09-10T18:52:35.000Z | 2022-01-03T19:48:06.000Z | openrl/algorithms/cql/models.py | natetsang/open-rl | 426723d0d6759672ce77e02afeb55cbeb68fcfb0 | [
"MIT"
] | 1 | 2021-12-28T17:42:23.000Z | 2021-12-28T17:42:23.000Z | openrl/algorithms/cql/models.py | natetsang/open-rl | 426723d0d6759672ce77e02afeb55cbeb68fcfb0 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import layers
def dqn_fc_discrete_network(state_dims: int,
num_actions: int,
num_hidden_layers: int,
hidden_size: int) -> tf.keras.Model:
"""
Creates a fully-connected deep Q-netwo... | 34.028571 | 94 | 0.670025 |
2d607e147671bd23d03625023053f7e8d8200087 | 2,206 | py | Python | examples/pylab_examples/multi_image.py | yuvallanger/matplotlib | e0020d318a9a9685594c6bff4631f74599321459 | [
"MIT",
"BSD-3-Clause"
] | 8 | 2017-04-11T08:55:30.000Z | 2022-03-25T04:31:26.000Z | examples/pylab_examples/multi_image.py | epgauss/matplotlib | c9898ea9a30c67c579ab27cd61b68e2abae0fb0e | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/pylab_examples/multi_image.py | epgauss/matplotlib | c9898ea9a30c67c579ab27cd61b68e2abae0fb0e | [
"MIT",
"BSD-3-Clause"
] | 14 | 2015-10-05T04:15:46.000Z | 2020-06-11T18:06:02.000Z | #!/usr/bin/env python
'''
Make a set of images with a single colormap, norm, and colorbar.
It also illustrates colorbar tick labelling with a multiplier.
'''
from matplotlib.pyplot import figure, show, axes, sci
from matplotlib import cm, colors
from matplotlib.font_manager import FontProperties
from numpy import ami... | 27.234568 | 74 | 0.654125 |
2d608304fc27217966af9e7e0008f21f27314ef1 | 12,297 | py | Python | mi/dataset/parser/issmcnsm_flortd.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/issmcnsm_flortd.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/issmcnsm_flortd.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
@package mi.dataset.parser.issmcnsm_flortd
@file marine-integrations/mi/dataset/parser/issmcnsm_flortd.py
@author Emily Hahn
@brief Parser for the issmcnsm_flort dataset driver
Release notes:
Initial release
"""
__author__ = 'Emily Hahn'
__license__ = 'Apache 2.0'
import copy
import re
fro... | 44.233813 | 113 | 0.62251 |
2d609768cb22b3be5cc5faa5b6c69860c50b9083 | 12,769 | py | Python | Tools/resultsdbpy/resultsdbpy/model/ci_context.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/resultsdbpy/resultsdbpy/model/ci_context.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/resultsdbpy/resultsdbpy/model/ci_context.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2019 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 43.431973 | 145 | 0.635054 |
2d60a4a07b9a40aceab38ca6f14fc3c589c005b4 | 303 | py | Python | energyquantified/exceptions/client.py | energyquantified/eq-python-client | 3ca8423ae29c4a3dbd8f6289ab76a64b21dabf1c | [
"Apache-2.0"
] | 4 | 2021-03-02T10:08:37.000Z | 2021-11-12T08:18:18.000Z | energyquantified/exceptions/client.py | mfsorensen/eq-python-client | 6dc65f5c16881b27fc22c9f461440c327997861e | [
"Apache-2.0"
] | 23 | 2020-07-22T13:41:20.000Z | 2021-10-12T09:03:27.000Z | energyquantified/exceptions/client.py | mfsorensen/eq-python-client | 6dc65f5c16881b27fc22c9f461440c327997861e | [
"Apache-2.0"
] | 2 | 2020-10-01T20:18:08.000Z | 2021-03-02T10:08:41.000Z |
class InitializationError(Exception):
"""
Initialization error for the Energy Quantified Python client.
"""
def __init__(self, reason=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.reason = reason or ""
def __str__(self):
return self.reason | 25.25 | 65 | 0.633663 |
2d60ae99173b225a8910f86110aca05cef5d2b82 | 373 | py | Python | tests/pipupgrade/test_config.py | JamesMcGuigan/pipupgrade | 6c868ba92a95fe71352d91485c04e6f860257092 | [
"MIT"
] | null | null | null | tests/pipupgrade/test_config.py | JamesMcGuigan/pipupgrade | 6c868ba92a95fe71352d91485c04e6f860257092 | [
"MIT"
] | null | null | null | tests/pipupgrade/test_config.py | JamesMcGuigan/pipupgrade | 6c868ba92a95fe71352d91485c04e6f860257092 | [
"MIT"
] | null | null | null | from pipupgrade.config import Settings, environment
from pipupgrade import __version__
def test_settings():
settings = Settings()
settings.get("version") == __version__
def test_environment():
details = environment()
assert all((k in details for k in ("version", "python_version", "os",
... | 26.642857 | 73 | 0.686327 |
2d60b9d91dd8b20aeda2c14172cd13a018da931b | 3,523 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 ... | 48.260274 | 130 | 0.701107 |
2d60d0b3e74ac6314ff6c0f814e027bfb55543e6 | 385 | py | Python | cryptoxlib/clients/bitforex/exceptions.py | PetrZufan/cryptoxlib-aio | 8fbb817ee7a7a88693804e24877863370d1d53c7 | [
"MIT"
] | 90 | 2020-04-09T18:34:49.000Z | 2022-03-09T14:29:32.000Z | cryptoxlib/clients/bitforex/exceptions.py | PetrZufan/cryptoxlib-aio | 8fbb817ee7a7a88693804e24877863370d1d53c7 | [
"MIT"
] | 44 | 2020-04-03T17:02:20.000Z | 2022-01-29T14:51:51.000Z | cryptoxlib/clients/bitforex/exceptions.py | PetrZufan/cryptoxlib-aio | 8fbb817ee7a7a88693804e24877863370d1d53c7 | [
"MIT"
] | 28 | 2020-04-25T21:34:53.000Z | 2022-03-31T07:20:07.000Z | from typing import Optional
from cryptoxlib.exceptions import CryptoXLibException
class BitforexException(CryptoXLibException):
pass
class BitforexRestException(BitforexException):
def __init__(self, status_code: int, body: Optional[dict]):
super().__init__(f"Rest API exception: status [{status_code}], respons... | 25.666667 | 84 | 0.787013 |
2d60e3007b5d900ca90071e3be5dbd399e9e6ed0 | 1,285 | py | Python | site_scons/ackward/tests/test_method.py | abingham/ackward | f1a45293de570f4b4429d9eaeb3f6c4da7d245bf | [
"MIT"
] | null | null | null | site_scons/ackward/tests/test_method.py | abingham/ackward | f1a45293de570f4b4429d9eaeb3f6c4da7d245bf | [
"MIT"
] | null | null | null | site_scons/ackward/tests/test_method.py | abingham/ackward | f1a45293de570f4b4429d9eaeb3f6c4da7d245bf | [
"MIT"
] | null | null | null | import unittest
from ..method import Method, method
from . import scratch
class MethodTest(unittest.TestCase):
def _process(self, m):
list(m.process(
scratch, 'header',
{'class_name': 'MethodTest'}))
list(m.process(
scratch, 'impl',
{'class_name': '... | 23.363636 | 51 | 0.523735 |
2d60fa822af71a276b59396384846bb904e758ef | 3,460 | py | Python | notebooks/monte_carlo_dev/get_lat_lon_indices.py | MIDOSS/analysis-rachael | c4a3082eca53b49e358e86a6e623a359ca6668be | [
"Apache-2.0"
] | null | null | null | notebooks/monte_carlo_dev/get_lat_lon_indices.py | MIDOSS/analysis-rachael | c4a3082eca53b49e358e86a6e623a359ca6668be | [
"Apache-2.0"
] | 3 | 2020-07-03T17:07:04.000Z | 2020-07-07T16:09:53.000Z | notebooks/monte_carlo_dev/get_lat_lon_indices.py | MIDOSS/analysis-rachael | c4a3082eca53b49e358e86a6e623a359ca6668be | [
"Apache-2.0"
] | null | null | null | import rasterio
from rasterio.enums import Resampling
import numpy as np
from numpy.random import choice
import pathlib
def truncate(f, n):
'''Truncates/pads a float f to n decimal places without rounding'''
s = '{}'.format(f)
if 'e' in s or 'E' in s:
return '{0:.{1}f}'.format(f, n)
i, p, d = ... | 33.921569 | 90 | 0.595087 |
2d60ff0d9e8084a59cd487ce90bf671112b8e7db | 108,952 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/scatterpolar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/scatterpolar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/scatterpolar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# marker
# ------
@property
def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
... | 37.350703 | 87 | 0.553381 |
2d61234361c2589f0a26ec34375e3636010c57fa | 3,109 | py | Python | segmentation_model.py | yuddim/DefectSoft | b81fe8afcd6ca6d2ea38fc5a90a02a334e29e1b8 | [
"MIT"
] | 2 | 2020-06-11T11:16:27.000Z | 2021-11-17T03:14:52.000Z | segmentation_model.py | yuddim/DefectSoft | b81fe8afcd6ca6d2ea38fc5a90a02a334e29e1b8 | [
"MIT"
] | null | null | null | segmentation_model.py | yuddim/DefectSoft | b81fe8afcd6ca6d2ea38fc5a90a02a334e29e1b8 | [
"MIT"
] | null | null | null | import os
import time
from config import *
from data_processing import *
class SegmentationModel:
def __init__(self):
self.image_width = IMAGE_WIDTH
self.image_height = IMAGE_HEIGHT
current_dir = os.getcwd()
self.model_path = current_dir + MODEL_PATH
# diction... | 40.376623 | 112 | 0.560309 |
2d6130eb2c30226d779dc84f39c5ea96bdc56845 | 2,434 | py | Python | theseus/segmentation/models/beit.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:52:53.000Z | 2022-03-19T11:52:53.000Z | theseus/segmentation/models/beit.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | null | null | null | theseus/segmentation/models/beit.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:53:10.000Z | 2022-03-19T11:53:10.000Z | from typing import Dict, Any
from pyrsistent import freeze
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import (
BeitConfig,
BeitForSemanticSegmentation,
)
class Beit(nn.Module):
def __init__(
self,
pretrained: str = "microsoft/beit-base-finetuned-... | 28.302326 | 83 | 0.614215 |
2d614cc4dd0aecaa4b1867f61fbd3d29cc17984a | 731 | py | Python | pkg/orchestrator/_orchestrator.py | shrohilla/kafka-func-core-tool-test | 110815f74bd035758542526c74ebaa55ce51046f | [
"Apache-2.0"
] | null | null | null | pkg/orchestrator/_orchestrator.py | shrohilla/kafka-func-core-tool-test | 110815f74bd035758542526c74ebaa55ce51046f | [
"Apache-2.0"
] | null | null | null | pkg/orchestrator/_orchestrator.py | shrohilla/kafka-func-core-tool-test | 110815f74bd035758542526c74ebaa55ce51046f | [
"Apache-2.0"
] | null | null | null | from pkg.creator._creator import Creator
from pkg.enums.Platform._platform import OSPlatform
from pkg.factory.creator import _creator
from pkg.factory.creator._creator import CreatorFactory
from pkg.enums.language._language import Language
from pkg.processor.FunctionProcessor._function import FunctionPlatformProcessor
... | 34.809524 | 84 | 0.77565 |
2d6172d4e84fbca394f5b22b810ee67ea76e27ea | 2,732 | py | Python | tests/test_read_flux.py | pzarabadip/thermof | 44c33e37aeadce31241a878135b1531757a2b1c4 | [
"MIT"
] | null | null | null | tests/test_read_flux.py | pzarabadip/thermof | 44c33e37aeadce31241a878135b1531757a2b1c4 | [
"MIT"
] | 11 | 2017-08-15T22:11:32.000Z | 2017-08-22T23:32:17.000Z | tests/test_read_flux.py | pzarabadip/thermof | 44c33e37aeadce31241a878135b1531757a2b1c4 | [
"MIT"
] | 1 | 2017-01-31T19:44:02.000Z | 2017-01-31T19:44:02.000Z | """
Tests reading thermal flux and calculating thermal conductivity
"""
import os
import pytest
import yaml
import numpy as np
from thermof.read import read_thermal_flux, calculate_k, estimate_k, average_k, get_flux_directions
from thermof.read import FluxFileNotFoundError, TimestepsMismatchError
from thermof.parameter... | 37.424658 | 99 | 0.729868 |
2d6192ce44c901d522e15062e385a900cff1cbbc | 35,659 | py | Python | modules/data_processers.py | HMEIatJHU/neurawkes | 808d3ec28c3aebd907c63616e133acd52380246f | [
"MIT"
] | 174 | 2017-10-03T13:08:03.000Z | 2021-10-11T02:06:29.000Z | modules/data_processers.py | hongyuanmei/neurawkes | 808d3ec28c3aebd907c63616e133acd52380246f | [
"MIT"
] | 5 | 2019-04-24T11:15:59.000Z | 2021-07-27T16:21:15.000Z | modules/data_processers.py | HMEIatJHU/neurawkes | 808d3ec28c3aebd907c63616e133acd52380246f | [
"MIT"
] | 59 | 2017-10-31T14:23:04.000Z | 2021-09-25T15:04:26.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 8th 10:58:37 2016
data processers
@author: hongyuan
"""
import pickle
import time
import numpy
import theano
from theano import sandbox
import theano.tensor as tensor
import os
#import scipy.io
from collections import defaultdict
from theano.tensor.shared_randomstreams ... | 36.498465 | 139 | 0.516924 |
2d61ad598513ba622553917f8ad18343f91a07ab | 3,223 | py | Python | collections/ansible_collections/ansible/tower/plugins/modules/tower_import.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/tower/plugins/modules/tower_import.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/ansible/tower/plugins/modules/tower_import.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, John Westcott IV <john.westcott.iv@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... | 29.842593 | 120 | 0.704623 |
2d61fa0091780e5a95959edb556cb67837429c30 | 6,991 | py | Python | data/level/level33.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | null | null | null | data/level/level33.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 6 | 2020-07-04T02:53:08.000Z | 2022-03-11T23:53:14.000Z | data/level/level33.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 3 | 2019-12-31T11:42:59.000Z | 2021-03-28T20:06:13.000Z | data = {
'level_index': 33,
'move_count': 25,
'board_info': {
(0, 0): {
'base': (51, 1),
'prev': (0, -1),
'next': (0, 1),
'fall_point': (0, -1)
},
(0, 1): {
'cover': (60, 1),
'prev': (0, -1),
'next': ... | 22.4791 | 33 | 0.190388 |
2d62074470c04d403feeb2e3311269784efcdb6e | 6,082 | py | Python | doctr/models/classification/magc_resnet/tensorflow.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 628 | 2021-02-13T21:49:37.000Z | 2022-03-31T19:48:57.000Z | doctr/models/classification/magc_resnet/tensorflow.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 694 | 2021-02-08T15:23:38.000Z | 2022-03-31T07:24:59.000Z | doctr/models/classification/magc_resnet/tensorflow.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 90 | 2021-04-28T05:39:02.000Z | 2022-03-31T06:48:36.000Z | # Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import math
from functools import partial
from typing import Any, Dict, List, Optional, Tuple
import tensorflow as tf
from t... | 31.189744 | 104 | 0.583361 |
2d622205f8d2f73fbbabe90f04763b27f13dfd26 | 1,437 | py | Python | src/dcos_e2e_cli/dcos_docker/commands/clean.py | cprovencher/dcos-e2e | c54b3d41f246efe3f90dcf225b0bffdc1f615daa | [
"Apache-2.0"
] | null | null | null | src/dcos_e2e_cli/dcos_docker/commands/clean.py | cprovencher/dcos-e2e | c54b3d41f246efe3f90dcf225b0bffdc1f615daa | [
"Apache-2.0"
] | null | null | null | src/dcos_e2e_cli/dcos_docker/commands/clean.py | cprovencher/dcos-e2e | c54b3d41f246efe3f90dcf225b0bffdc1f615daa | [
"Apache-2.0"
] | null | null | null | """
Clean all Docker containers, volumes etc. from using the Docker backend.
"""
import click
from dcos_e2e.backends import Docker
from dcos_e2e.docker_utils import DockerLoopbackVolume
from dcos_e2e_cli.common.options import verbosity_option
from dcos_e2e_cli.common.utils import set_logging
from ._common import (
... | 27.113208 | 76 | 0.707724 |
2d6237bf86a15be263cfecac1c7bc10e26a548a2 | 1,574 | py | Python | dp/min_cost_stations.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null | dp/min_cost_stations.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null | dp/min_cost_stations.py | santoshmano/pybricks | bcb3ab80417e8e896280062494ce6c046329b7e8 | [
"MIT"
] | null | null | null |
def min_cost(cost, start, dest):
if start >= len(cost) or dest >= len(cost):
return -1
if start == dest or start == dest-1:
return cost[start][dest]
mincost = cost[start][dest]
for mid in range(start+1, dest):
tempcost = min_cost(cost, start, mid) + min_cost(cost, mid, dest... | 23.492537 | 75 | 0.562262 |
2d623c88e864a9b52e8add7591d36f649403cf99 | 3,029 | py | Python | drivers/run_RSG5_gaia_analysis.py | lgbouma/rudolf | 0f130f45fdbcce109a6750aa179dd26a12179619 | [
"MIT"
] | null | null | null | drivers/run_RSG5_gaia_analysis.py | lgbouma/rudolf | 0f130f45fdbcce109a6750aa179dd26a12179619 | [
"MIT"
] | null | null | null | drivers/run_RSG5_gaia_analysis.py | lgbouma/rudolf | 0f130f45fdbcce109a6750aa179dd26a12179619 | [
"MIT"
] | null | null | null | """
# pull a big box around rsg5
# looking at kerr's plot, we're going to want d=200-400pc
# spanning galactic latitudes of 0 to 20 deg (maybe 2 to 20 deg)
# glon of 70 to 90 to get RSG-5 and 2:???
# glon down to 50 to get the stephenson-1/delta lyr complex
"""
from astropy.io import fits
from astropy.table import Ta... | 34.033708 | 83 | 0.662925 |
2d6254d36776e4f18dd6d9d66486fdc988f3ce65 | 6,543 | py | Python | acme/tf/losses/distributional_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 2,650 | 2020-06-01T16:31:25.000Z | 2022-03-31T07:32:41.000Z | acme/tf/losses/distributional_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 199 | 2020-06-02T01:09:09.000Z | 2022-03-31T17:11:20.000Z | acme/tf/losses/distributional_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 344 | 2020-06-01T16:45:21.000Z | 2022-03-30T11:15:09.000Z | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 36.966102 | 80 | 0.630598 |
2d6268f6e47506cd5c692f33d72ff8997de8d51a | 3,921 | py | Python | futaba/navi/abc.py | Hoffs/futaba | 4d07c421c4229c81ddd42da1a49594b8cf11832d | [
"MIT"
] | 23 | 2018-09-17T09:06:27.000Z | 2021-05-27T15:21:37.000Z | futaba/navi/abc.py | Hoffs/futaba | 4d07c421c4229c81ddd42da1a49594b8cf11832d | [
"MIT"
] | 257 | 2018-08-18T21:27:54.000Z | 2020-12-29T23:27:10.000Z | futaba/navi/abc.py | Hoffs/futaba | 4d07c421c4229c81ddd42da1a49594b8cf11832d | [
"MIT"
] | 22 | 2018-09-09T09:03:13.000Z | 2021-11-09T03:34:34.000Z | #
# cogs/navi/task/abc.py
#
# futaba - A Discord Mod bot for the Programming server
# Copyright (c) 2017-2020 Jake Richardson, Ammon Smith, jackylam5
#
# futaba is available free of charge under the terms of the MIT
# License. You are free to redistribute and/or modify it under those
# terms. It is distributed in the h... | 27.808511 | 93 | 0.62331 |
2d6299c66e62eb74cdc382015275632c98543a90 | 7,878 | py | Python | disco_aws_automation/disco_metrics.py | Angakkuq/asiaq-aws | f7ddec9fc60aef685f372cbaefee2b08ae18b6a0 | [
"BSD-2-Clause"
] | null | null | null | disco_aws_automation/disco_metrics.py | Angakkuq/asiaq-aws | f7ddec9fc60aef685f372cbaefee2b08ae18b6a0 | [
"BSD-2-Clause"
] | 4 | 2016-03-22T17:04:04.000Z | 2016-03-23T18:03:45.000Z | disco_aws_automation/disco_metrics.py | Angakkuit/asiaq-aws | f7ddec9fc60aef685f372cbaefee2b08ae18b6a0 | [
"BSD-2-Clause"
] | null | null | null | """
Uploads Machine metrics to AWS CloudWatch.
"""
import datetime
import logging
import re
from subprocess import check_output, CalledProcessError
import boto.utils
from boto.ec2 import cloudwatch
from disco_aws_automation.resource_helper import keep_trying
class DiscoMetrics(object):
"""Class for sending cus... | 37.69378 | 108 | 0.558137 |
2d62be4a65afacaaf83b79c653b6869fa8f46262 | 4,688 | py | Python | opts.py | tgc1997/video-caption.pytorch | 66430862696678f7233a1fc67af22f0525b22e52 | [
"MIT"
] | 39 | 2018-05-14T02:30:32.000Z | 2021-07-17T11:39:28.000Z | opts.py | AmmieQi/video-caption.pytorch-1 | 66430862696678f7233a1fc67af22f0525b22e52 | [
"MIT"
] | 8 | 2018-09-20T09:08:46.000Z | 2019-12-12T08:24:54.000Z | opts.py | AmmieQi/video-caption.pytorch-1 | 66430862696678f7233a1fc67af22f0525b22e52 | [
"MIT"
] | 19 | 2018-05-14T13:12:01.000Z | 2021-06-25T07:48:07.000Z | import argparse
def parse_opt():
parser = argparse.ArgumentParser()
# Data input settings
parser.add_argument(
'--input_json',
type=str,
default='data/videodatainfo_2017.json',
help='path to the json file containing video info')
parser.add_argument(
'--info_json... | 30.640523 | 80 | 0.599616 |
2d62cbd7d597c8c819804a1aa03db4aabfe492b4 | 562 | py | Python | dailycodingproblem/problems/20180723.py | marianosimone/interviewed | adb58d8ca9cd300d621cce04ce5d9338885c4c63 | [
"Unlicense"
] | 4 | 2019-04-26T14:58:33.000Z | 2022-02-15T20:12:02.000Z | dailycodingproblem/problems/20180723.py | marianosimone/interviewed | adb58d8ca9cd300d621cce04ce5d9338885c4c63 | [
"Unlicense"
] | null | null | null | dailycodingproblem/problems/20180723.py | marianosimone/interviewed | adb58d8ca9cd300d621cce04ce5d9338885c4c63 | [
"Unlicense"
] | 2 | 2016-06-15T23:52:39.000Z | 2021-07-30T11:35:46.000Z | # cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair.
# For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4.
# Given this implementation of cons:
def cons(a, b):
def pair(f):
return f(a, b)
return pair
# Implement car and cdr.
... | 23.416667 | 108 | 0.626335 |
2d62e04e1d90cd0021aec971d6ca26783f08c796 | 6,686 | py | Python | qiskit/aqua/algorithms/__init__.py | Unathi-Skosana/qiskit-aqua | e13f66eda6d8b819a6f132319a2bac819941f6b1 | [
"Apache-2.0"
] | 2 | 2020-06-29T16:08:12.000Z | 2020-08-07T22:42:13.000Z | qiskit/aqua/algorithms/__init__.py | Unathi-Skosana/qiskit-aqua | e13f66eda6d8b819a6f132319a2bac819941f6b1 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/algorithms/__init__.py | Unathi-Skosana/qiskit-aqua | e13f66eda6d8b819a6f132319a2bac819941f6b1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 27.628099 | 105 | 0.71732 |
2d62ff5c11de719d941a612ffd8313fbec38932d | 6,479 | py | Python | src/timeshap/utils/timeshap_legacy.py | feedzai/timeshap | 0d56b3b86222d52fdc5a1e96f125513e0ed18e6c | [
"Apache-2.0"
] | 49 | 2022-03-25T14:35:52.000Z | 2022-03-31T18:05:51.000Z | src/timeshap/utils/timeshap_legacy.py | feedzai/timeshap | 0d56b3b86222d52fdc5a1e96f125513e0ed18e6c | [
"Apache-2.0"
] | 1 | 2022-03-31T12:15:55.000Z | 2022-03-31T14:59:06.000Z | src/timeshap/utils/timeshap_legacy.py | feedzai/timeshap | 0d56b3b86222d52fdc5a1e96f125513e0ed18e6c | [
"Apache-2.0"
] | 2 | 2022-03-28T04:32:35.000Z | 2022-03-28T06:39:24.000Z | # Copyright 2022 Feedzai
#
# 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 writi... | 40.748428 | 132 | 0.627103 |
2d631155818f1c83de830444b1360f25b748dbcf | 2,389 | py | Python | appengine/findit/gae_libs/test/pubsub_util_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/gae_libs/test/pubsub_util_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/gae_libs/test/pubsub_util_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 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.
import functools
import mock
from gae_libs import pubsub_util
from gae_libs.testcase import TestCase
def Execute(func):
@functools.wraps(func)
def Wr... | 27.147727 | 75 | 0.700293 |
2d63208d1c6754ae06b026b06b6173b8079ffe56 | 3,469 | py | Python | plot_scripts/plot_modelsearch_boxplot.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | plot_scripts/plot_modelsearch_boxplot.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | plot_scripts/plot_modelsearch_boxplot.py | lzamparo/SdA_reduce | 1dc11f23b395f316df5f41448542d2d5c2e619ff | [
"BSD-3-Clause"
] | null | null | null | """ Process all the model training output files in the given directory
and produce a boxplot on per-layer results.
Files names look like this: stacked_denoising_autoencoder_800-900-300-50.2013-05-31.08:57:06.721435
The average training error for each layer of each model is reported:
e.g Pre-training layer 0, epoch 4... | 30.429825 | 99 | 0.680023 |
2d63550e3aef45758cd90b3cc1e2781efb7ba632 | 3,104 | py | Python | setup.py | tohanss/repobee | cf5eb1e83e62c20bbca00c8ad9f798a612e1664f | [
"MIT"
] | null | null | null | setup.py | tohanss/repobee | cf5eb1e83e62c20bbca00c8ad9f798a612e1664f | [
"MIT"
] | null | null | null | setup.py | tohanss/repobee | cf5eb1e83e62c20bbca00c8ad9f798a612e1664f | [
"MIT"
] | null | null | null | import re
import pathlib
import os
from setuptools import setup, find_packages
with open("README.md", mode="r", encoding="utf-8") as f:
readme = f.read()
# parse the version instead of importing it to avoid dependency-related crashes
with open("src/_repobee/__version.py", mode="r", encoding="utf-8") as f:
lin... | 27.963964 | 79 | 0.633054 |
2d63748c54432d400361ef29ad0c44650b786a42 | 7,171 | py | Python | byte_by_byte/priority_queue.py | ricdezen/random-algo-stuff | ef32fc786dca911b0f3f79e787967e462e863fcb | [
"MIT"
] | null | null | null | byte_by_byte/priority_queue.py | ricdezen/random-algo-stuff | ef32fc786dca911b0f3f79e787967e462e863fcb | [
"MIT"
] | null | null | null | byte_by_byte/priority_queue.py | ricdezen/random-algo-stuff | ef32fc786dca911b0f3f79e787967e462e863fcb | [
"MIT"
] | null | null | null | '''
**Question**: Implement a Priority Queue.
**Explanation**:
- A Queue is a data structure comprised of mainly two methods: `push` and `pop`. The former inserts
an element into the Queue, while the latter removes it and returns it.
- A Priority Queue guarantees the following:
1. A pushed element can (must) be ... | 29.755187 | 101 | 0.565054 |
2d63800a815d387dd15537af4a0ddb208d3636b1 | 941 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ws2801_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ws2801_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 11 | 2018-02-07T01:11:35.000Z | 2021-10-31T17:42:17.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ws2801_simpletest.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
### Based on example from
### https://github.com/adafruit/Adafruit_CircuitPython_DotStar/tree/master/examples
import time
import random
import board
import adafruit_ws2801
### Example for a Feather M4 driving 25 12mm leds
o... | 24.128205 | 83 | 0.633369 |
2d63d7c46cf7669d18f53c8a56d24abe2732ad21 | 224 | py | Python | tests/tendermint/conftest.py | Bilel2038/bigchaindb | b1c34523edc96ea1f0acdf4c1d3a7a5ef36e0116 | [
"Apache-2.0"
] | null | null | null | tests/tendermint/conftest.py | Bilel2038/bigchaindb | b1c34523edc96ea1f0acdf4c1d3a7a5ef36e0116 | [
"Apache-2.0"
] | null | null | null | tests/tendermint/conftest.py | Bilel2038/bigchaindb | b1c34523edc96ea1f0acdf4c1d3a7a5ef36e0116 | [
"Apache-2.0"
] | null | null | null | import pytest
@pytest.fixture
def b():
from bigchaindb import BigchainDB
return BigchainDB()
@pytest.fixture
def validator_pub_key():
return 'B0E42D2589A455EAD339A035D6CE1C8C3E25863F268120AA0162AD7D003A4014'
| 17.230769 | 77 | 0.794643 |
2d63fbd0082aba9e07d26de4deb69f44a51edb45 | 724 | py | Python | alipay/aop/api/response/AlipayOpenSearchBaseorderModifyResponse.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/response/AlipayOpenSearchBaseorderModifyResponse.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/response/AlipayOpenSearchBaseorderModifyResponse.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.response.AlipayResponse import AlipayResponse
class AlipayOpenSearchBaseorderModifyResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenSearchBaseorderModifyResponse, self).__init__()
self._apply_id = None
... | 27.846154 | 112 | 0.718232 |
2d646dc16ae46a0b9d7a4b86185a062a634792e9 | 2,054 | py | Python | nnvm/tests/python/unittest/test_top_level1.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | nnvm/tests/python/unittest/test_top_level1.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | nnvm/tests/python/unittest/test_top_level1.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30.656716 | 71 | 0.67332 |
2d6475bdcc1274a8cd1d3317c9da26f5bf9458fc | 1,079 | py | Python | photoshop/api/colors/rgb.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 17 | 2019-03-01T12:09:37.000Z | 2020-04-09T14:14:59.000Z | photoshop/api/colors/rgb.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 7 | 2019-04-28T15:20:27.000Z | 2020-04-07T19:14:47.000Z | photoshop/api/colors/rgb.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 3 | 2020-02-28T14:27:11.000Z | 2020-04-01T16:12:40.000Z | # Import local modules
from photoshop.api._core import Photoshop
class RGBColor(Photoshop):
"""The definition of an RGB color mode."""
object_name = "RGBColor"
def __init__(self, parent):
super().__init__(parent=parent)
self.blue = self.app.blue
self.green = self.app.green
... | 21.58 | 75 | 0.601483 |
2d648f5f7c52299728684c75adbc4c5a0905dc19 | 315 | py | Python | chess/main.py | pelletier2017/ChessGame | 1a88e919d446708ead2c1ee0dce37093f8a9212f | [
"MIT"
] | 1 | 2020-08-23T17:14:06.000Z | 2020-08-23T17:14:06.000Z | chess/main.py | pelletier2017/ChessGame | 1a88e919d446708ead2c1ee0dce37093f8a9212f | [
"MIT"
] | 4 | 2017-08-10T02:41:31.000Z | 2021-06-01T21:20:15.000Z | chess/main.py | pelletier2017/ChessGame | 1a88e919d446708ead2c1ee0dce37093f8a9212f | [
"MIT"
] | null | null | null | import player
# required to make imports work properly
import sys
sys.path.append("../")
from game import ChessGame
def main():
play_game()
def play_game():
p1 = player.RandomComputer()
p2 = player.BasicMinimax()
game = ChessGame(p1, p2)
game.play()
if __name__ == "__main__":
main() | 14.318182 | 40 | 0.657143 |
2d6499cb1d84ba2c12265608f717676fb7d7fc4a | 163 | py | Python | scripts/builder/Bookworm.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 18 | 2019-07-19T22:12:15.000Z | 2020-08-26T17:45:19.000Z | scripts/builder/Bookworm.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 44 | 2019-07-15T10:17:00.000Z | 2020-07-26T11:22:53.000Z | scripts/builder/Bookworm.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 9 | 2019-09-03T13:13:31.000Z | 2020-08-25T13:55:27.000Z | # coding: utf-8
if __name__ == "__main__":
import multiprocessing
multiprocessing.freeze_support()
from bookworm import bookworm
bookworm.main()
| 18.111111 | 36 | 0.711656 |
2d64d02abae7f3e0c9f39fed589470e7eed346da | 513 | py | Python | user/collection/manager/utils/switch_language.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 4 | 2018-04-23T00:04:01.000Z | 2018-10-28T22:56:51.000Z | user/collection/manager/utils/switch_language.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 23 | 2017-12-22T08:27:35.000Z | 2021-12-13T19:57:35.000Z | user/collection/manager/utils/switch_language.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 1 | 2020-06-03T02:07:26.000Z | 2020-06-03T02:07:26.000Z | import gettext
class SwitchLanguage():
def __call__(self, req, resp, resource, params):
valid_langs = {
'en_US': 'en_US',
'es_CO': 'es_CO',
'pt_BR': 'pt_BR'
}
value_lang_cookie = valid_langs.get(
req.cookies.get('user_lang')) or 'es_CO'
... | 25.65 | 72 | 0.54191 |
2d64d44c841b9011b233eb180eb8fc3dc202bf6e | 25,180 | py | Python | ocs_ci/ocs/resources/storage_cluster.py | deepshikhaaa/ocs-ci | 5477ee85c395e808589ba45e3db34d4efe54fc97 | [
"MIT"
] | null | null | null | ocs_ci/ocs/resources/storage_cluster.py | deepshikhaaa/ocs-ci | 5477ee85c395e808589ba45e3db34d4efe54fc97 | [
"MIT"
] | null | null | null | ocs_ci/ocs/resources/storage_cluster.py | deepshikhaaa/ocs-ci | 5477ee85c395e808589ba45e3db34d4efe54fc97 | [
"MIT"
] | null | null | null | """
StorageCluster related functionalities
"""
import re
import logging
import tempfile
from jsonschema import validate
from ocs_ci.framework import config
from ocs_ci.ocs import constants, defaults, ocp
from ocs_ci.ocs.exceptions import ResourceNotFoundError, UnsupportedFeatureError
from ocs_ci.ocs.ocp import get_im... | 38.151515 | 102 | 0.647855 |
2d64def61be07653b0cb46959baad4ec58062b14 | 13,495 | py | Python | nlisim/oldmodules/macrophage.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 4 | 2021-05-21T15:46:15.000Z | 2022-03-01T02:58:32.000Z | nlisim/oldmodules/macrophage.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 10 | 2020-11-10T23:20:37.000Z | 2022-03-12T01:34:47.000Z | nlisim/oldmodules/macrophage.py | jbeezley/simulation-hello-world | b4e1258de9c7601af1701041fa39f8f6c5e5a61e | [
"Apache-2.0"
] | 2 | 2020-12-16T14:24:26.000Z | 2021-01-08T15:56:20.000Z | import itertools
from random import choice, shuffle
from typing import Any, Dict, Tuple
import attr
import numpy as np
from nlisim.cell import CellData, CellList
from nlisim.coordinates import Point, Voxel
from nlisim.grid import RectangularGrid
from nlisim.module import ModuleModel, ModuleState
from nlisim.oldmodule... | 38.778736 | 100 | 0.582957 |
2d6553f0cd214d126207a01e0fd3f360acb8255b | 5,935 | py | Python | src/simulator/cache/state.py | pskopnik/htc-cache-simulator | ee502db3f1c2b99ffe05ee609a18069b583798da | [
"MIT"
] | 1 | 2020-12-15T16:09:31.000Z | 2020-12-15T16:09:31.000Z | src/simulator/cache/state.py | pskopnik/htc-cache-system-simulator | ee502db3f1c2b99ffe05ee609a18069b583798da | [
"MIT"
] | null | null | null | src/simulator/cache/state.py | pskopnik/htc-cache-system-simulator | ee502db3f1c2b99ffe05ee609a18069b583798da | [
"MIT"
] | null | null | null | import abc
from typing import Iterable, Iterator, List, Optional
from .accesses import SimpleAccessReader
from .processor import AccessInfo, OfflineProcessor, OnlineProcessor
from .storage import Storage
from ..workload import Access, FileID
__all__ = [
'Access',
'AccessInfo',
'FileID',
'SimpleAccessReader',
'St... | 28.397129 | 97 | 0.733446 |
2d6563cf12c059920978c1d7a49bd771bf146da3 | 3,270 | py | Python | tests/ixia/test_ixia_traffic.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | tests/ixia/test_ixia_traffic.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | tests/ixia/test_ixia_traffic.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# This test case demonstrates:
# * All the fixtures required for running ixia script (please see the
# arguments of the test function)
# * How Ixia chassis card/ports are addressed
# * How you can configure/control ixia devices,... | 36.333333 | 82 | 0.661774 |
2d65821ec793c608040253a4f6de0e1c84572906 | 1,645 | py | Python | lib/depth_pcl.py | Wei2624/pcl_post_processing | 64d6069d70a49853305b2ab647cadb8480bffdd1 | [
"MIT"
] | null | null | null | lib/depth_pcl.py | Wei2624/pcl_post_processing | 64d6069d70a49853305b2ab647cadb8480bffdd1 | [
"MIT"
] | null | null | null | lib/depth_pcl.py | Wei2624/pcl_post_processing | 64d6069d70a49853305b2ab647cadb8480bffdd1 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import sys
import scipy.io
import curvox
import pcl
import image_geometry
import random
import scipy.io
def point_cloud(depth,cx,cy,fx,fy):
"""Transform a depth image into a point cloud with one point for each
pixel in the image, using the camera transform for a camera... | 26.111111 | 73 | 0.657143 |
2d658562babe3c147dbcc3d8be9db5bc853e9420 | 5,092 | py | Python | libmultilabel/linear/metrics.py | sian-chen/LibMultiLabel | 8aa6a3ffff6ac437359de4fb53a99de544fdb720 | [
"MIT"
] | 120 | 2021-04-16T10:25:39.000Z | 2022-03-23T14:32:58.000Z | libmultilabel/linear/metrics.py | sian-chen/LibMultiLabel | 8aa6a3ffff6ac437359de4fb53a99de544fdb720 | [
"MIT"
] | 25 | 2021-04-16T10:17:14.000Z | 2022-03-17T13:19:07.000Z | libmultilabel/linear/metrics.py | Eleven1Liu/LibMultiLabel | 56feb362ee0342242656c3303c5f25816f2c12ab | [
"MIT"
] | 17 | 2021-04-16T08:43:32.000Z | 2022-03-31T03:16:12.000Z | import re
import numpy as np
import scipy.sparse as sparse
__all__ = ['RPRecision',
'Precision',
'F1',
'MetricCollection',
'get_metrics',
'tabulate_metrics']
class RPrecision:
def __init__(self, top_k: int) -> None:
self.top_k = top_k
self.s... | 35.361111 | 88 | 0.586803 |
2d659a4a6a7e46c8d196f1c2e6140ba9554d12a0 | 2,266 | py | Python | nevergrad/common/test_testing.py | kwonhur/nevergrad | 7821ff2ddf46ed7ece61529449f770d32179433c | [
"MIT"
] | 2 | 2021-04-13T12:14:46.000Z | 2021-07-07T14:37:50.000Z | nevergrad/common/test_testing.py | kwonhur/nevergrad | 7821ff2ddf46ed7ece61529449f770d32179433c | [
"MIT"
] | 1 | 2020-09-25T10:45:06.000Z | 2020-09-25T11:51:13.000Z | nevergrad/common/test_testing.py | kwonhur/nevergrad | 7821ff2ddf46ed7ece61529449f770d32179433c | [
"MIT"
] | 1 | 2021-04-07T10:34:20.000Z | 2021-04-07T10:34:20.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import platform
import typing as tp
from pathlib import Path
import pytest
import numpy as np
from . impo... | 39.068966 | 121 | 0.695057 |
2d65ad3445196fd283201e6b932fed3ee6072415 | 376 | py | Python | will/plugins/admin/version.py | rgorsuch/will | ebfc0d2953b4dcf5a4acc1118811cab5aec3bd17 | [
"MIT"
] | 1 | 2018-11-19T15:34:07.000Z | 2018-11-19T15:34:07.000Z | will/plugins/admin/version.py | rgorsuch/will | ebfc0d2953b4dcf5a4acc1118811cab5aec3bd17 | [
"MIT"
] | null | null | null | will/plugins/admin/version.py | rgorsuch/will | ebfc0d2953b4dcf5a4acc1118811cab5aec3bd17 | [
"MIT"
] | 1 | 2019-02-26T02:17:32.000Z | 2019-02-26T02:17:32.000Z | import pkg_resources
from will.plugin import WillPlugin
from will.decorators import respond_to
import socket
class VersionPlugin(WillPlugin):
@respond_to("^version$")
def say_version(self, message):
version = pkg_resources.get_distribution("will").version
self.say("I'm running version %s from ... | 31.333333 | 101 | 0.742021 |
2d665944d9549aba09bd2d9abef327efa1ff6063 | 7,318 | py | Python | src/engine/corpusprocessing/CorpusHandler.py | aysenurbilgin/tilt_api | 24e3a31ed331d0ae5f98e4dcb3b0b4d0ab3220ae | [
"Apache-2.0"
] | 1 | 2021-01-20T11:10:55.000Z | 2021-01-20T11:10:55.000Z | src/engine/corpusprocessing/CorpusHandler.py | aysenurbilgin/tilt_api | 24e3a31ed331d0ae5f98e4dcb3b0b4d0ab3220ae | [
"Apache-2.0"
] | null | null | null | src/engine/corpusprocessing/CorpusHandler.py | aysenurbilgin/tilt_api | 24e3a31ed331d0ae5f98e4dcb3b0b4d0ab3220ae | [
"Apache-2.0"
] | null | null | null | from os.path import join
import os
from glob import glob
from src.engine import EngineConstants
__author__ = 'abilgin'
class CorpusHandler(object):
def __init__(self, experiment, keyword, similar_keywords_dictionary):
self.genres = experiment.genre
self.corpus_list = experiment.corpus_list
... | 45.7375 | 150 | 0.563952 |
2d669d646ab564e19d74e3c1df228cf865f33d61 | 2,952 | py | Python | vision_transform_codes/tests/test_runner.py | spencerkent/vision-transform-codes | 63258ce698e436ee3ce29def75c89337759fb98b | [
"BSD-3-Clause"
] | null | null | null | vision_transform_codes/tests/test_runner.py | spencerkent/vision-transform-codes | 63258ce698e436ee3ce29def75c89337759fb98b | [
"BSD-3-Clause"
] | null | null | null | vision_transform_codes/tests/test_runner.py | spencerkent/vision-transform-codes | 63258ce698e436ee3ce29def75c89337759fb98b | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import traceback
all_tests = [
'dataset generation test',
'sparse coding test 1',
'sparse coding test 2',
'sparse coding test 3',
'sparse coding test 4',
'ista_fista test 1',
'ista_fista test 2',
'ista_fista test 3',
'sparse coding test 5',
]
# terminal col... | 24 | 79 | 0.66023 |
2d66b18655b2ce9016cb7755b30fd5c537094164 | 3,740 | py | Python | ufora/FORA/python/PurePython/TrustRegionTests.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | ufora/FORA/python/PurePython/TrustRegionTests.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | ufora/FORA/python/PurePython/TrustRegionTests.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2016 Ufora 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 i... | 30.655738 | 76 | 0.561497 |
2d6706088745e6b3e7fa86966a4c7335359b1985 | 3,176 | py | Python | volatility/framework/plugins/linux/lsmod.py | orchechik/volatility3 | 99a536e57e908850a656f8aed6262d56f60e4bdc | [
"Linux-OpenIB"
] | null | null | null | volatility/framework/plugins/linux/lsmod.py | orchechik/volatility3 | 99a536e57e908850a656f8aed6262d56f60e4bdc | [
"Linux-OpenIB"
] | null | null | null | volatility/framework/plugins/linux/lsmod.py | orchechik/volatility3 | 99a536e57e908850a656f8aed6262d56f60e4bdc | [
"Linux-OpenIB"
] | 1 | 2021-04-08T03:02:20.000Z | 2021-04-08T03:02:20.000Z | # This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#
"""A module containing a collection of plugins that produce data typically
found in Linux's /proc file system."""
import logging
fro... | 41.789474 | 154 | 0.679471 |
2d671b72009c3e2ffe22f5ae8c83313fed135283 | 246,077 | py | Python | ryu/ofproto/ofproto_v1_5_parser.py | samueldeng/ryu | 9dd1c746f3ceb8f3255d068acee89bc755b15214 | [
"Apache-2.0"
] | 36 | 2015-10-18T21:13:16.000Z | 2022-03-06T23:09:11.000Z | ryu/ofproto/ofproto_v1_5_parser.py | samueldeng/ryu | 9dd1c746f3ceb8f3255d068acee89bc755b15214 | [
"Apache-2.0"
] | 4 | 2017-03-07T11:51:24.000Z | 2020-07-07T20:13:55.000Z | ryu/ofproto/ofproto_v1_5_parser.py | samueldeng/ryu | 9dd1c746f3ceb8f3255d068acee89bc755b15214 | [
"Apache-2.0"
] | 32 | 2015-01-03T13:06:57.000Z | 2020-11-14T05:38:25.000Z | # Copyright (C) 2012, 2013, 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012, 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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... | 36.607706 | 87 | 0.568249 |
2d676200dcfb4a2eace144058bb712405413124c | 71,071 | py | Python | discord/message.py | DeadPool3333/enhanced-discord.py | be34c7e521c9edbe6d8ff949962c0ab777821712 | [
"MIT"
] | 4 | 2021-09-28T12:45:00.000Z | 2022-02-04T20:11:58.000Z | discord/message.py | DeadPool3333/enhanced-discord.py | be34c7e521c9edbe6d8ff949962c0ab777821712 | [
"MIT"
] | 2 | 2021-11-07T12:31:33.000Z | 2022-01-06T17:06:51.000Z | discord/message.py | DeadPool3333/enhanced-discord.py | be34c7e521c9edbe6d8ff949962c0ab777821712 | [
"MIT"
] | 8 | 2022-01-10T22:26:03.000Z | 2022-02-25T14:26:04.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 36.521583 | 179 | 0.612191 |
2d6772f50cc218519adeb17a0dcb7f12bd06e193 | 20,706 | py | Python | code/projecthandler/tosca_model.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 8 | 2017-03-13T16:34:28.000Z | 2021-11-16T11:35:56.000Z | code/projecthandler/tosca_model.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | null | null | null | code/projecthandler/tosca_model.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 3 | 2017-03-28T09:26:40.000Z | 2020-12-08T14:16:12.000Z | #
# Copyright 2017 CNIT - Consorzio Nazionale Interuniversitario per le Telecomunicazioni
#
# 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... | 44.721382 | 191 | 0.576838 |
2d67885a455a1cd0fa6704802f9855bf95ebe50b | 20,455 | py | Python | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 41.406883 | 265 | 0.682229 |
2d67a5ec11342a4ef13e35b5135dd533e7e6d271 | 10,383 | py | Python | leetcode_python/Greedy/sell-diminishing-valued-colored-balls.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Greedy/sell-diminishing-valued-colored-balls.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Greedy/sell-diminishing-valued-colored-balls.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
1648. Sell Diminishing-Valued Colored Balls
Medium
You have an inventory of different colored balls, and there is a customer that wants orders balls of any color.
The customer weirdly values the colored balls. Each colored ball's value is the number of balls of that color you currently have in your inventory. Fo... | 33.820847 | 417 | 0.5222 |
2d67acfc3844429f0e9a2de95fa63e0a62e17636 | 11,017 | py | Python | tests/dataloader/test_language_generation.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 117 | 2019-03-14T15:06:42.000Z | 2022-02-28T07:06:34.000Z | tests/dataloader/test_language_generation.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 149 | 2019-03-12T09:43:21.000Z | 2020-08-24T02:56:34.000Z | tests/dataloader/test_language_generation.py | ishine/cotk | 2242c16523830254b0ac509f7739b4cbcb03dea4 | [
"Apache-2.0"
] | 51 | 2019-03-14T15:12:48.000Z | 2021-08-09T03:37:48.000Z | import copy
import random
import operator
import os
import shutil
import pytest
from pytest_mock import mocker
from version_test_base import base_test_version
from cache_dir import CACHE_DIR
from cotk.dataloader import PretrainedTokenizer, Field, Vocab, Tokenizer, LanguageGeneration, MSCOCO, Dataloader
from cotk.metr... | 37.729452 | 142 | 0.724698 |
2d67b80dc95c67c7747b51136e076222c375915a | 1,298 | py | Python | shapes/sphere.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | shapes/sphere.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | shapes/sphere.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | from math import sqrt
from core import Intersection, dot, point, subtract, transform_from_yaml
from .material import Material
from .shape import Shape
class Sphere(Shape):
def __init__(self):
super().__init__()
self.transformations = []
@classmethod
def from_yaml(cls, data):
sph... | 26.489796 | 72 | 0.610169 |
2d67c7dae1c7aa9eee5292058abbbe0b5d646c2b | 407 | py | Python | universityforum/wsgi.py | chandru-shane/django-forum-project | 061325ce0234c7e183df7bdb180907fc23acc11e | [
"MIT"
] | null | null | null | universityforum/wsgi.py | chandru-shane/django-forum-project | 061325ce0234c7e183df7bdb180907fc23acc11e | [
"MIT"
] | null | null | null | universityforum/wsgi.py | chandru-shane/django-forum-project | 061325ce0234c7e183df7bdb180907fc23acc11e | [
"MIT"
] | null | null | null | """
WSGI config for universityforum project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJAN... | 23.941176 | 78 | 0.793612 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.