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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c88ddb68e3d1c87dedb219a39f915d3754007d67 | 23,540 | py | Python | violas_client/json_rpc/views.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/json_rpc/views.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/json_rpc/views.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from typing import List
from violas_client.canoser import Struct, Uint64, BoolT, StrT, RustEnum, Uint8, Uint16
from violas_client.lbrtypes.account_state import AccountState
from violas_client.lbrtypes.bytecode import get_code_type, CodeType
from violas_client.canoser import RustOptional
class AmountView(Struct):
... | 27.026406 | 95 | 0.609388 |
c88de998395e48c5a222bd03a6dfc2dd04313034 | 2,283 | py | Python | tests/test_loads/test_simple_types.py | AlbertFX91/jsonty | 592ef168419be51de4f690a5a33a55c9838683d1 | [
"BSD-2-Clause"
] | null | null | null | tests/test_loads/test_simple_types.py | AlbertFX91/jsonty | 592ef168419be51de4f690a5a33a55c9838683d1 | [
"BSD-2-Clause"
] | 4 | 2019-11-11T19:25:57.000Z | 2019-12-09T19:39:14.000Z | tests/test_loads/test_simple_types.py | AlbertFX91/jsonty | 592ef168419be51de4f690a5a33a55c9838683d1 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Python core imports
import unittest
import json
# Jsonty import
from ..context import jsonty
# Test models
import tests.util.models as models
class SimpleTypesLoads(unittest.TestCase):
"""Loads test operation with simple attributes via annotations"""
def test_adult_dump(self):
... | 28.5375 | 102 | 0.571178 |
c88def2d8bdaa42b4d85388b4b6dd1c2d5c4ae6a | 22,180 | py | Python | cate/ops/plot.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | cate/ops/plot.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | null | null | null | cate/ops/plot.py | TomBlock/cate | 3924300a9d85f09fd40bc67b9f8a220230788d1c | [
"MIT"
] | 1 | 2019-02-14T13:49:37.000Z | 2019-02-14T13:49:37.000Z | # The MIT License (MIT)
# Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors
#
# 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 wi... | 37.403035 | 126 | 0.656537 |
c88e61d80e7e2ca07f967c0fe5d4bbc510365021 | 590 | py | Python | tests/commands/test_convert_from_ocds.py | open-contracting/oc4idskit | a864c4716c09dfa2141483d602106c147b211063 | [
"BSD-3-Clause"
] | null | null | null | tests/commands/test_convert_from_ocds.py | open-contracting/oc4idskit | a864c4716c09dfa2141483d602106c147b211063 | [
"BSD-3-Clause"
] | 16 | 2021-05-19T23:39:30.000Z | 2022-01-13T20:00:16.000Z | tests/commands/test_convert_from_ocds.py | open-contracting/oc4idskit | a864c4716c09dfa2141483d602106c147b211063 | [
"BSD-3-Clause"
] | null | null | null | from oc4idskit.cli.__main__ import main
from tests import assert_streaming
def test_command(capsys, monkeypatch):
assert_streaming(
capsys,
monkeypatch,
main,
["convert-from-ocds", "--project-id", "1"],
["release_1.1.json"],
["oc4ids-project_minimal.json"],
)
... | 23.6 | 64 | 0.598305 |
c88e6b1c9780550e34154f70436d449f7722be05 | 686 | py | Python | problem_1_easy.py | pythonmite/Daily-Coding-Problem | 8f758cb8cf0c6a7524c8874116ca9ed08545c773 | [
"MIT"
] | null | null | null | problem_1_easy.py | pythonmite/Daily-Coding-Problem | 8f758cb8cf0c6a7524c8874116ca9ed08545c773 | [
"MIT"
] | 1 | 2020-04-25T03:24:49.000Z | 2020-05-27T12:38:08.000Z | problem_1_easy.py | pythonmite/Daily-Coding-Problem | 8f758cb8cf0c6a7524c8874116ca9ed08545c773 | [
"MIT"
] | 2 | 2020-04-24T16:49:32.000Z | 2020-04-25T03:20:21.000Z | """
Company Name : Google
Problem Statement :
Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17
"""
def solution(number_list:list, target:int):
answer = False... | 25.407407 | 105 | 0.591837 |
c88eae31e4a678a899b23f3fed1cb52fe92dc422 | 9,232 | py | Python | prometheus_fastapi_instrumentator/instrumentation.py | trallnag/prometheus-fastapi-exporter | 673b922e97a4e943a0e4d23db7767015e4c751dd | [
"MIT"
] | 3 | 2020-07-13T15:29:38.000Z | 2020-07-15T20:55:41.000Z | prometheus_fastapi_instrumentator/instrumentation.py | trallnag/prometheus-fastapi-exporter | 673b922e97a4e943a0e4d23db7767015e4c751dd | [
"MIT"
] | null | null | null | prometheus_fastapi_instrumentator/instrumentation.py | trallnag/prometheus-fastapi-exporter | 673b922e97a4e943a0e4d23db7767015e4c751dd | [
"MIT"
] | null | null | null | import gzip
import os
import re
from enum import Enum
from typing import Callable, List, Optional, Pattern, Union
from fastapi import FastAPI
from starlette.requests import Request
from starlette.responses import Response
from prometheus_fastapi_instrumentator import metrics
from prometheus_fastapi_instrumentator.mid... | 39.452991 | 93 | 0.639623 |
c88eb9c05038306fb1ec5fd9d405c92eab429d71 | 983 | py | Python | study/propagate.py | NunoEdgarGFlowHub/wavetorch | e6171b69e66e16a2ba4c76869d4e0b15a3e9861f | [
"MIT"
] | 1 | 2019-09-17T06:15:16.000Z | 2019-09-17T06:15:16.000Z | study/propagate.py | NunoEdgarGFlowHub/wavetorch | e6171b69e66e16a2ba4c76869d4e0b15a3e9861f | [
"MIT"
] | null | null | null | study/propagate.py | NunoEdgarGFlowHub/wavetorch | e6171b69e66e16a2ba4c76869d4e0b15a3e9861f | [
"MIT"
] | null | null | null | """Propagate some waves
"""
import torch
import wavetorch
import numpy as np
import skimage
import matplotlib.pyplot as plt
dt = 1.0
t = np.arange(0, 300*dt, dt)
freq0 = 1/dt/15
Nx = 201
Ny = 201
c0 = 1.0 # Background wave speed
c1 = 0.9
src_x, src_y = skimage.draw.line(50, 80, 50, 120)
px = [150]
py = [105]
x... | 21.844444 | 129 | 0.679552 |
c88ed5fef39f27eb45310c48b80c15b0fd705a2a | 1,015 | py | Python | selfhost_client/types/thing_types.py | self-host/selfhost-python-client | 95797ef819099174d916b10e82878c370b1cd972 | [
"MIT"
] | null | null | null | selfhost_client/types/thing_types.py | self-host/selfhost-python-client | 95797ef819099174d916b10e82878c370b1cd972 | [
"MIT"
] | null | null | null | selfhost_client/types/thing_types.py | self-host/selfhost-python-client | 95797ef819099174d916b10e82878c370b1cd972 | [
"MIT"
] | null | null | null | from typing import List
try:
from typing import TypedDict
except ImportError:
from typing_extensions import TypedDict
class ThingType(TypedDict):
"""
Attributes:
uuid: The unique identifier for this thing.
name: The name of the thing.
state: The state of the thing.
... | 20.714286 | 65 | 0.523153 |
c88edc5d661d0a898dfa5ff97cfeff6dd0ed11cb | 1,228 | py | Python | autox/autox_server/feature_engineer/fe_count_ratio.py | fanghy06/AutoX | 0bad349ef1b047152e2608760fd5d197128be723 | [
"Apache-2.0"
] | 499 | 2021-07-27T02:57:58.000Z | 2022-03-28T12:08:27.000Z | autox/autox_server/feature_engineer/fe_count_ratio.py | fanghy06/AutoX | 0bad349ef1b047152e2608760fd5d197128be723 | [
"Apache-2.0"
] | 9 | 2021-08-03T15:14:56.000Z | 2022-03-11T07:06:06.000Z | autox/autox_server/feature_engineer/fe_count_ratio.py | fanghy06/AutoX | 0bad349ef1b047152e2608760fd5d197128be723 | [
"Apache-2.0"
] | 87 | 2021-07-27T01:13:02.000Z | 2022-03-29T02:14:09.000Z | import warnings
import pandas as pd
import time
from autox.autox_server.util import log
from tqdm import tqdm
warnings.filterwarnings('ignore')
def fe_count_ratio(G_df_dict, G_data_info, G_hist, is_train, remain_time):
# 对G_df_dict['BIG']表做扩展特征
start = time.time()
log('[+] feature engineer, count ratio')
... | 36.117647 | 115 | 0.637622 |
c88f0bb80d85f4e1b3d0404b58032747a2dacc76 | 1,632 | py | Python | applications/shop/views/bill.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/shop/views/bill.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/shop/views/bill.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.http import JsonResponse
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.template import Context, Template
from mighty.views import PDFView, DetailView, ListView
from mighty.models import Bill
@method_decorator(login_required, name... | 32.64 | 67 | 0.68076 |
c88f13ec6cc9c0563e694ab90052e88ff3bdb732 | 53,972 | py | Python | python/reportlab/graphics/shapes.py | Aragos/tichu-tournament | 4cdf727a30af8820ad56fe3097ec9a8e84892068 | [
"MIT"
] | 7 | 2016-12-12T02:29:42.000Z | 2020-05-12T21:21:21.000Z | python/reportlab/graphics/shapes.py | Aragos/tichu-tournament | 4cdf727a30af8820ad56fe3097ec9a8e84892068 | [
"MIT"
] | 31 | 2017-01-05T06:07:28.000Z | 2018-05-27T13:13:06.000Z | python/reportlab/graphics/shapes.py | Aragos/tichu-tournament | 4cdf727a30af8820ad56fe3097ec9a8e84892068 | [
"MIT"
] | 3 | 2017-12-21T23:30:12.000Z | 2019-01-03T20:51:52.000Z | #Copyright ReportLab Europe Ltd. 2000-2016
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/shapes.py
__version__='3.3.0'
__doc__='''Core of the graphics library - defines Drawing and Shapes'''
import os, sys
from math import pi, co... | 36.916553 | 172 | 0.584359 |
c88f160f100014e20ee7bb08a5f79279abf9e75b | 32 | py | Python | maps/park_path/__init__.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | maps/park_path/__init__.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | maps/park_path/__init__.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | from .park_path import ParkPath
| 16 | 31 | 0.84375 |
c88f325792a233d2fe4eb39cc070b7a3be1259c6 | 2,525 | py | Python | eth2/beacon/types/slashable_vote_data.py | nrryuya/trinity | 7436d9c3fdef5fbeef5d7a1123c8ed2ecd16e033 | [
"MIT"
] | null | null | null | eth2/beacon/types/slashable_vote_data.py | nrryuya/trinity | 7436d9c3fdef5fbeef5d7a1123c8ed2ecd16e033 | [
"MIT"
] | null | null | null | eth2/beacon/types/slashable_vote_data.py | nrryuya/trinity | 7436d9c3fdef5fbeef5d7a1123c8ed2ecd16e033 | [
"MIT"
] | null | null | null | import rlp
from rlp.sedes import (
binary,
CountableList,
)
from typing import (
Sequence,
Tuple,
)
from eth_typing import (
Hash32,
)
from eth2.beacon._utils.hash import hash_eth2
from eth2.beacon.sedes import (
uint24,
)
from eth2.beacon.typing import (
BLSSignature,
ValidatorIndex,
)
... | 28.693182 | 99 | 0.646337 |
c88f3f86f5dae6f81203edacadafddb69b076041 | 598 | py | Python | Salami/Constants.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 15 | 2020-04-17T12:02:14.000Z | 2022-03-16T03:01:34.000Z | Salami/Constants.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 9 | 2020-04-25T01:57:16.000Z | 2020-04-29T11:42:34.000Z | Salami/Constants.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 55 | 2020-04-17T12:01:11.000Z | 2021-12-28T10:14:02.000Z |
WIDTH = 400
HEIGHT = 300
TITLE = "Trifecta"
TILE_SIZE = 16
TILE_SIZE_D2 = TILE_SIZE / 2
SQUARE_HIT_BOX = [
[-TILE_SIZE_D2, -TILE_SIZE_D2],
[-TILE_SIZE_D2, TILE_SIZE_D2],
[TILE_SIZE_D2, TILE_SIZE_D2],
[TILE_SIZE_D2, -TILE_SIZE_D2]
]
# RAMP_HIT_BOX_LEFT = [
# [-TILE_SIZE_D2, -TILE_SIZE_D2],
# ... | 17.085714 | 37 | 0.66388 |
c88f4bf5632bb161ac8b59605927425fb09732df | 7,438 | py | Python | obsolete/pipeline_rnaseq/trackers/Genemodels.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 11 | 2018-09-07T11:33:23.000Z | 2022-01-07T12:16:11.000Z | obsolete/pipeline_rnaseq/trackers/Genemodels.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 102 | 2018-03-22T15:35:26.000Z | 2022-03-23T17:46:16.000Z | obsolete/pipeline_rnaseq/trackers/Genemodels.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 7 | 2018-06-11T15:01:41.000Z | 2020-03-31T09:29:33.000Z | import os
import sys
import re
import types
import itertools
from cgatReport.Tracker import *
from cgatReport.odict import OrderedDict as odict
from RnaseqReport import *
class TrackerGenemodels(RnaseqTracker):
mPattern = "_gene_expression"
def getTracks(self, subset=None):
print("getTracks")
... | 34.119266 | 145 | 0.588061 |
c88f4eb0ede993de73351c5a4a2710a0bdd9b522 | 5,222 | py | Python | climetlab/utils/availability.py | vidurmithal/climetlab | af0c33ff2875f9747b4fa81fc17be1a73cd3ead6 | [
"Apache-2.0"
] | null | null | null | climetlab/utils/availability.py | vidurmithal/climetlab | af0c33ff2875f9747b4fa81fc17be1a73cd3ead6 | [
"Apache-2.0"
] | null | null | null | climetlab/utils/availability.py | vidurmithal/climetlab | af0c33ff2875f9747b4fa81fc17be1a73cd3ead6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# (C) Copyright 2021- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its stat... | 26.642857 | 99 | 0.523171 |
c88f58150a4d3747c534b0c807fb554621f03ea4 | 1,393 | py | Python | api_app/api/dependencies/shared_services.py | oliver7598/AzureTRE | 38290b91fb694f6dc50a2af9f9376962de8026bd | [
"MIT"
] | null | null | null | api_app/api/dependencies/shared_services.py | oliver7598/AzureTRE | 38290b91fb694f6dc50a2af9f9376962de8026bd | [
"MIT"
] | null | null | null | api_app/api/dependencies/shared_services.py | oliver7598/AzureTRE | 38290b91fb694f6dc50a2af9f9376962de8026bd | [
"MIT"
] | null | null | null | from fastapi import Depends, HTTPException, Path, status
from pydantic import UUID4
from api.dependencies.database import get_repository
from db.errors import EntityDoesNotExist
from resources import strings
from models.domain.shared_service import SharedService
from models.domain.operation import Operation
from db.re... | 48.034483 | 170 | 0.83776 |
c88f5881049283eed192afe2e96489250e0848f4 | 613 | py | Python | mypath.py | rucnyz/pytorch-deeplab | 684e770dc82406f9572b09b2cd60d8f7b597a702 | [
"MIT"
] | null | null | null | mypath.py | rucnyz/pytorch-deeplab | 684e770dc82406f9572b09b2cd60d8f7b597a702 | [
"MIT"
] | null | null | null | mypath.py | rucnyz/pytorch-deeplab | 684e770dc82406f9572b09b2cd60d8f7b597a702 | [
"MIT"
] | null | null | null | class Path(object):
@staticmethod
def db_root_dir(dataset):
if dataset == 'pascal':
return '/path/to/datasets/VOCdevkit/VOC2012/' # folder that contains VOCdevkit/.
elif dataset == 'sbd':
return '/path/to/datasets/benchmark_RELEASE/' # folder that contains dataset/.
elif dataset == 'cityscapes':
retu... | 36.058824 | 84 | 0.7031 |
c88f789d89daa19d41836d0ed9d71ae54cc2197a | 8,827 | py | Python | mcscf/dmet_cas.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | mcscf/dmet_cas.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | mcscf/dmet_cas.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
from functools import reduce
import numpy
import scipy.linalg
from pyscf.lib import logger
from pyscf.tools import dump_mat
from pyscf import scf
def kernel(mf, dm, aolabels_or_baslst, nelec_tol=.05, occ_cutoff=1e-6, base=0,
orth_method=... | 36.475207 | 85 | 0.570636 |
c88fabe8b07ea99440addee2da3c7f93933c6f15 | 7,454 | py | Python | savu/plugins/unregistered/ptychography/ptypy_compact_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/unregistered/ptychography/ptypy_compact_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/unregistered/ptychography/ptypy_compact_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class PtypyCompactTools(PluginTools):
"""This plugin performs ptychography using the ptypy package.
"""
def define_parameters(self):
"""
data_center:
visibility: intermediate
dtype: [list[float], str, None]
... | 34.831776 | 75 | 0.542528 |
c88fb69974b529e854e3856bd9a67bceb32ce7bf | 22,770 | py | Python | pytorch_widedeep/preprocessing/_preprocessors.py | FlyingWing/pytorch-widedeep | 91a255d08bc9bdd5a05669465b7cf0313849ec9c | [
"MIT"
] | null | null | null | pytorch_widedeep/preprocessing/_preprocessors.py | FlyingWing/pytorch-widedeep | 91a255d08bc9bdd5a05669465b7cf0313849ec9c | [
"MIT"
] | null | null | null | pytorch_widedeep/preprocessing/_preprocessors.py | FlyingWing/pytorch-widedeep | 91a255d08bc9bdd5a05669465b7cf0313849ec9c | [
"MIT"
] | null | null | null | import warnings
from abc import ABC, abstractmethod
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm
from sklearn.exceptions import NotFittedError
from sklearn.preprocessing import StandardScaler
from ..wdtypes import *
from ..utils.text_utils import (
get_texts,
pad_sequences,
buil... | 38.79046 | 109 | 0.611419 |
c88fb79cc7c8e9c5b15d1f904a0ee8de5bd23ea0 | 520 | py | Python | utils/encoder_utils.py | wannabeOG/ExpertNet-Pytorch | e5c104981b3a60fca93eddd569045663157ad346 | [
"BSD-2-Clause"
] | 24 | 2019-09-28T10:58:36.000Z | 2021-11-22T13:50:16.000Z | utils/encoder_utils.py | luckilypop/ExpertNet-Pytorch | e5c104981b3a60fca93eddd569045663157ad346 | [
"BSD-2-Clause"
] | 1 | 2019-10-02T07:42:18.000Z | 2019-10-02T07:42:18.000Z | utils/encoder_utils.py | luckilypop/ExpertNet-Pytorch | e5c104981b3a60fca93eddd569045663157ad346 | [
"BSD-2-Clause"
] | 9 | 2019-10-02T07:40:54.000Z | 2022-03-26T19:41:12.000Z | import torch.nn as nn
import torch
def encoder_criterion(outputs, inputs):
loss = nn.MSELoss()
return loss(outputs, inputs)
def exp_lr_scheduler(optimizer, epoch, init_lr=0.0008, lr_decay_epoch=10):
"""
Decay learning rate by a factor of 0.1 every lr_decay_epoch epochs.
"""
lr = init_lr * (0.1**(epoch // lr_d... | 23.636364 | 74 | 0.707692 |
c88fc0e085f4a634632528c9cf40f8a214fed78c | 1,701 | py | Python | code.py | jspinella/pimoroni-trackball-circuitpy | 3f41ccb91dfa2e5670f1791c66ca9ae32e8ecf3b | [
"MIT"
] | 5 | 2021-10-30T02:23:29.000Z | 2022-01-23T19:56:04.000Z | code.py | jspinella/pimoroni-trackball-circuitpy | 3f41ccb91dfa2e5670f1791c66ca9ae32e8ecf3b | [
"MIT"
] | null | null | null | code.py | jspinella/pimoroni-trackball-circuitpy | 3f41ccb91dfa2e5670f1791c66ca9ae32e8ecf3b | [
"MIT"
] | 2 | 2021-11-05T12:52:46.000Z | 2022-01-23T12:11:34.000Z | import usb_hid
import board
import busio
from adafruit_bus_device.i2c_device import I2CDevice
from adafruit_hid.mouse import Mouse
I2C_ADDRESS = 0x0A
REG_LED_RED = 0x00
REG_LED_GRN = 0x01
REG_LED_BLU = 0x02
REG_LED_WHT = 0x03
REG_LEFT = 0x04
REG_RIGHT = 0x05
REG_UP = 0x06
REG_DOWN = 0x07
# i2c @ address 0xA
m = Mou... | 23.957746 | 68 | 0.654321 |
c88fc656f337904f75a51445ebb9f1aeb24464df | 1,177 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/open_shift_managed_cluster_auth_profile.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/open_shift_managed_cluster_auth_profile.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/open_shift_managed_cluster_auth_profile.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"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 ... | 39.233333 | 112 | 0.657604 |
c88ff6d921d105faaada08c741eb26fc9b30df6d | 2,322 | py | Python | docs/conf.py | lacker/turbo_seti | 4135c65a912f3c6c628c4434ba6b19735ee6fd80 | [
"MIT"
] | null | null | null | docs/conf.py | lacker/turbo_seti | 4135c65a912f3c6c628c4434ba6b19735ee6fd80 | [
"MIT"
] | null | null | null | docs/conf.py | lacker/turbo_seti | 4135c65a912f3c6c628c4434ba6b19735ee6fd80 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.171429 | 79 | 0.664083 |
c8901924992b3d49fd3e522ce8e3b4d1e1e92420 | 1,752 | py | Python | gym3/testing_test.py | christopher-hesse/gym3 | 2ed9d344ede8bbd96b6280e9fbbbf55861ea33a9 | [
"MIT"
] | null | null | null | gym3/testing_test.py | christopher-hesse/gym3 | 2ed9d344ede8bbd96b6280e9fbbbf55861ea33a9 | [
"MIT"
] | null | null | null | gym3/testing_test.py | christopher-hesse/gym3 | 2ed9d344ede8bbd96b6280e9fbbbf55861ea33a9 | [
"MIT"
] | null | null | null | import time
from gym3 import types, types_np
from gym3.testing import IdentityEnv, TimingEnv
def test_fast_env():
num_env = 2
num_steps = 10000
episode_len = 100
start = time.time()
env = TimingEnv(num=num_env, episode_len=episode_len)
episode_count = 0
expected_episode_count = num_env * ... | 27.809524 | 80 | 0.607877 |
c89034d8d4d98adbbd024da0577e0bf09e5a99d1 | 1,117 | py | Python | config.py | roholazandie/espnet | 574f83faaf24d9529161d5f002054eb855ad15f7 | [
"Apache-2.0"
] | 1 | 2020-06-19T14:14:15.000Z | 2020-06-19T14:14:15.000Z | config.py | roholazandie/espnet | 574f83faaf24d9529161d5f002054eb855ad15f7 | [
"Apache-2.0"
] | null | null | null | config.py | roholazandie/espnet | 574f83faaf24d9529161d5f002054eb855ad15f7 | [
"Apache-2.0"
] | null | null | null | import json
class ESPNetConfig:
def __init__(self,
trans_type="",
dict_path="",
model_path="",
vocoder_path="",
vocoder_conf="",
phonemes_dir="",
voice_dir="",
port="",
... | 26.595238 | 53 | 0.536258 |
c8906cb534bac5f6a460eae883be21897f737a68 | 2,007 | py | Python | controllers/cobrar.py | alfonsodg/sisventi | 3dfa975e771b361c3639d8830b9667494a3a63b0 | [
"FSFUL"
] | null | null | null | controllers/cobrar.py | alfonsodg/sisventi | 3dfa975e771b361c3639d8830b9667494a3a63b0 | [
"FSFUL"
] | null | null | null | controllers/cobrar.py | alfonsodg/sisventi | 3dfa975e771b361c3639d8830b9667494a3a63b0 | [
"FSFUL"
] | null | null | null | # -*- coding: utf-8 -*-
restricciones = auth.has_membership('root') or \
auth.has_membership('administrador')
@auth.requires(restricciones)
def index():
"""
Muestra los registros de cuentas por cobrar
"""
return dict()
@auth.requires(restricciones)
def clientes()... | 25.405063 | 77 | 0.650722 |
c890748eac374aee518341f9dde5fb47cdfcffc8 | 4,923 | py | Python | pymeterreader/core/meter_reader_node.py | Schwaneberg/pymeterreader | b91a24b2da3899d2f485f17154db1cc816d64359 | [
"BSD-2-Clause"
] | 5 | 2020-10-20T20:36:31.000Z | 2022-03-18T07:23:05.000Z | pymeterreader/core/meter_reader_node.py | Schwaneberg/pymeterreader | b91a24b2da3899d2f485f17154db1cc816d64359 | [
"BSD-2-Clause"
] | 1 | 2022-02-28T20:15:49.000Z | 2022-02-28T21:25:13.000Z | pymeterreader/core/meter_reader_node.py | Schwaneberg/pymeterreader | b91a24b2da3899d2f485f17154db1cc816d64359 | [
"BSD-2-Clause"
] | 3 | 2021-01-01T17:28:42.000Z | 2021-01-18T16:47:12.000Z | import logging
import typing as tp
from datetime import datetime, timezone
from pymeterreader.core.channel_upload_info import ChannelUploadInfo
from pymeterreader.device_lib import BaseReader, Sample, strip
from pymeterreader.gateway import BaseGateway
class MeterReaderNode:
"""
MeterReaderNode represents a ... | 45.583333 | 120 | 0.557587 |
c890a140c1c461c1f8a76b0ab201cc99e43205c0 | 20,943 | py | Python | mysql_to_sqlite3/transporter.py | leonardogloria/mysqltosqlite3 | aaf0a99f827b3a24053068c6dac7b0e7ce715495 | [
"MIT"
] | null | null | null | mysql_to_sqlite3/transporter.py | leonardogloria/mysqltosqlite3 | aaf0a99f827b3a24053068c6dac7b0e7ce715495 | [
"MIT"
] | null | null | null | mysql_to_sqlite3/transporter.py | leonardogloria/mysqltosqlite3 | aaf0a99f827b3a24053068c6dac7b0e7ce715495 | [
"MIT"
] | null | null | null | """Use to transfer a MySQL database to SQLite."""
from __future__ import division
import logging
import re
import sqlite3
from datetime import timedelta
from decimal import Decimal
from math import ceil
from os.path import realpath
from sys import stdout
import mysql.connector
import six
from mysql.connector import ... | 36.806678 | 151 | 0.51325 |
c890aea1e4158a350ec62209ee3ddb045608f4a1 | 4,034 | py | Python | alipay/aop/api/request/AlipayCommerceOperationPoiVendingUploadRequest.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/request/AlipayCommerceOperationPoiVendingUploadRequest.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/request/AlipayCommerceOperationPoiVendingUploadRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceOperationPoiVendingUploadModel import AlipayCommerceOperationPoiVendingUploadModel
class AlipayCommerceOperationPoiVen... | 27.82069 | 148 | 0.649975 |
c890c35136a3ac19dc2d1fc210df3b7c32c0d269 | 26,633 | py | Python | django_backup/management/commands/backup.py | jamesrampton/django-backup | 90e917e16989e9c009b9c09e3d5342fa51d409c5 | [
"BSD-2-Clause"
] | 53 | 2015-06-04T08:36:24.000Z | 2022-02-09T20:52:36.000Z | django_backup/management/commands/backup.py | jamesrampton/django-backup | 90e917e16989e9c009b9c09e3d5342fa51d409c5 | [
"BSD-2-Clause"
] | 25 | 2015-05-16T12:58:23.000Z | 2017-04-17T16:50:12.000Z | django_backup/management/commands/backup.py | jamesrampton/django-backup | 90e917e16989e9c009b9c09e3d5342fa51d409c5 | [
"BSD-2-Clause"
] | 18 | 2015-05-16T07:49:23.000Z | 2022-03-02T11:24:48.000Z | import os
import time
from copy import copy
from datetime import datetime
from optparse import make_option
from paramiko import SSHException
from django_backup.utils import (
GOOD_RSYNC_FLAG,
TIME_FORMAT,
decide_remove,
is_db_backup,
is_media_backup,
is_backup,
BaseBackupCommand,
DATABA... | 41.100309 | 162 | 0.584913 |
c890c8d8f676cd0f4f12d13ed1b540aa2f8e7a7a | 1,134 | py | Python | tests/test_task_defaults.py | mikeboers/aque | 4215fd01ab2a0fd88aeac7f2d69b4c888caa7aa1 | [
"BSD-3-Clause"
] | 1 | 2019-05-01T15:26:54.000Z | 2019-05-01T15:26:54.000Z | tests/test_task_defaults.py | mikeboers/aque | 4215fd01ab2a0fd88aeac7f2d69b4c888caa7aa1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_task_defaults.py | mikeboers/aque | 4215fd01ab2a0fd88aeac7f2d69b4c888caa7aa1 | [
"BSD-3-Clause"
] | null | null | null | from . import *
class TestDefaults(BrokerTestCase):
def test_basic_submit(self):
f = self.queue.submit_ex(name=self.id() + '.0', pattern=None)
self.assertTrue(f.id)
self.assertEqual(self.broker.fetch(f.id)['status'], 'pending')
self.assertEqual(self.broker.fetch(f.id)['priority'],... | 39.103448 | 92 | 0.611111 |
c890e5c3b07b54ece4545432395e679f2dec16dc | 5,134 | py | Python | cubelang/cube_runtime.py | poletaevvlad/CubeLang | 06f34e7204f4656589eb33c4afe660383704861f | [
"MIT"
] | 1 | 2019-12-04T04:02:11.000Z | 2019-12-04T04:02:11.000Z | cubelang/cube_runtime.py | poletaevvlad/CubeLang | 06f34e7204f4656589eb33c4afe660383704861f | [
"MIT"
] | null | null | null | cubelang/cube_runtime.py | poletaevvlad/CubeLang | 06f34e7204f4656589eb33c4afe660383704861f | [
"MIT"
] | null | null | null | from typing import Callable, Optional, List, Union
from collections import deque
import sys
from .actions import Turn, Action, Rotate
from .compiler import types
from .cube import Cube
from .orientation import Orientation, Side, Color
from .pattern import Pattern
from .stdlib import Library
from .execution.rt_error im... | 38.893939 | 92 | 0.647448 |
c891001439f606d7fd2bcce66be91b1113a65a22 | 2,366 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/task_step_properties.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"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 ... | 38.786885 | 107 | 0.650042 |
c8911e7f6c9e03d33364b276951257e122574e30 | 10,330 | py | Python | arjuna/tpi/parser/yaml.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/tpi/parser/yaml.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna/tpi/parser/yaml.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 30.382353 | 147 | 0.599419 |
c8911f38bbb94f801d332ba341ec110f24efad61 | 561 | py | Python | tests/platform_tests/conftest.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/conftest.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/conftest.py | vincent201881/sonic-mgmt | 4f02bb5f91600ae5180ace1620a718caf02c63a1 | [
"Apache-2.0"
] | null | null | null | import pytest
from tests.common.fixtures.advanced_reboot import get_advanced_reboot
from .args.advanced_reboot_args import add_advanced_reboot_args
from .args.cont_warm_reboot_args import add_cont_warm_reboot_args
@pytest.fixture(autouse=True, scope="module")
def skip_on_simx(duthost):
platform = duthost.facts["... | 31.166667 | 69 | 0.798574 |
c891233351edea8490ea61929a50395ea26455ef | 1,877 | py | Python | qa327/backend.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | qa327/backend.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | qa327/backend.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | from qa327.models import db, User, Tickets
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
"""
This file defines all backend logic that interacts with database and other services
"""
def get_user(email):
"""
Get a user by a given email
:param email:... | 29.328125 | 95 | 0.69366 |
c8912ad675ee2bfeca1bff43105ecc250144dbe5 | 56 | py | Python | nvk_ds/__init__.py | audrus1917/nvk_ds | f9c8f64f1e937c18a75b7565c0fa29026a638dd3 | [
"Apache-2.0"
] | null | null | null | nvk_ds/__init__.py | audrus1917/nvk_ds | f9c8f64f1e937c18a75b7565c0fa29026a638dd3 | [
"Apache-2.0"
] | null | null | null | nvk_ds/__init__.py | audrus1917/nvk_ds | f9c8f64f1e937c18a75b7565c0fa29026a638dd3 | [
"Apache-2.0"
] | null | null | null | """
The ``Prefect`` small datasources data package.
"""
| 14 | 47 | 0.660714 |
c8913fa8696c94c530ff99289245fa8f011b091b | 1,551 | py | Python | tests/python/pants_test/backend/jvm/tasks/test_jvm_bundle_integration.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_jvm_bundle_integration.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/jvm/tasks/test_jvm_bundle_integration.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants_test.pants_run_integration_test import PantsRunIntegrationTest
class BundleI... | 44.314286 | 101 | 0.729207 |
c8915d11523d478917fb42e483ba737937aaf782 | 6,243 | py | Python | neat/population.py | SamanKhamesian/Hybrid-Self-Attention-NEAT | 9064e9e5c5fbbbc961980b53064b9fb3ae321288 | [
"Apache-2.0"
] | 5 | 2021-12-15T19:29:18.000Z | 2022-02-13T23:13:44.000Z | neat/population.py | SamanKhamesian/Hybrid-Self-Attention-NEAT | 9064e9e5c5fbbbc961980b53064b9fb3ae321288 | [
"Apache-2.0"
] | 1 | 2022-03-06T13:40:30.000Z | 2022-03-06T13:40:30.000Z | neat/population.py | SamanKhamesian/Hybrid-Self-Attention-NEAT | 9064e9e5c5fbbbc961980b53064b9fb3ae321288 | [
"Apache-2.0"
] | null | null | null | """Implements the core evolution algorithm."""
from __future__ import print_function
from neat.math_util import mean
from neat.reporting import ReporterSet
from neat.six_util import iteritems, itervalues
class CompleteExtinctionException(Exception):
pass
class Population(object):
"""
This class impleme... | 43.055172 | 96 | 0.613807 |
c891628e45050323ca5175959fb4c0b911cb5278 | 13,415 | py | Python | std/captum/41.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/captum/41.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/captum/41.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Captum Robustness with Image Classification
#
#
# This tutorial demonstrates how to apply robustness tooling in captum.robust including adversarial attacks (FGSM and PGD) as well as robustness metrics to measure attack effectiveness and generate counterfactual examples.
#
#... | 36.453804 | 315 | 0.736787 |
c8917df2fd921f933b513e8d9a324333aea8e915 | 2,341 | py | Python | sizeresponse/main.py | gjheij/experiments | 4eddce164a9e48823f5807ce5037d785b5224417 | [
"MIT"
] | null | null | null | sizeresponse/main.py | gjheij/experiments | 4eddce164a9e48823f5807ce5037d785b5224417 | [
"MIT"
] | null | null | null | sizeresponse/main.py | gjheij/experiments | 4eddce164a9e48823f5807ce5037d785b5224417 | [
"MIT"
] | null | null | null | import argparse
from datetime import datetime
import os
from psychopy import logging
from session import SizeResponseSession
opj = os.path.join
opd = os.path.dirname
# parse arguments
parser = argparse.ArgumentParser()
parser.add_argument('subject', default=None, nargs='?')
parser.add_argument('session', default=None,... | 34.426471 | 120 | 0.657839 |
c891b076526ced468822382a35dbe83e12c9f0d9 | 4,411 | py | Python | lib/FeedbackMatrix.py | bcrafton/ssdfa | 661f9059184fde6ba7ad1ca710c5b5a1954c5ea6 | [
"MIT"
] | 10 | 2019-01-23T17:07:59.000Z | 2021-07-13T10:18:10.000Z | semantic-segmentation/lib/FeedbackMatrix.py | bcrafton/icsrl-deep-learning | e3616982d1dda5f978d61d6591c91cb0da76ab02 | [
"MIT"
] | 1 | 2019-07-30T00:55:58.000Z | 2019-09-17T13:31:48.000Z | semantic-segmentation/lib/FeedbackMatrix.py | bcrafton/icsrl-deep-learning | e3616982d1dda5f978d61d6591c91cb0da76ab02 | [
"MIT"
] | 1 | 2019-07-28T17:28:30.000Z | 2019-07-28T17:28:30.000Z |
import numpy as np
import math
def matrix_rank(mat):
return np.linalg.matrix_rank(B)
def matrix_sparsity(mat):
# we want to make sure all the [10]s have some sparisty.
# so we transpose the matrix from [10, 100] -> [100, 10] so that way we can look at the first [10]
# summing along the 0 axis, su... | 29.406667 | 102 | 0.563364 |
c891ceb445a367413847c613fe47ecd9cca72801 | 15,319 | py | Python | model_utils.py | pwldj/Bio_XLNet_CRF | 536053e9d74abdb2ee56000a8a779ffc1c0dd0fc | [
"Apache-2.0"
] | null | null | null | model_utils.py | pwldj/Bio_XLNet_CRF | 536053e9d74abdb2ee56000a8a779ffc1c0dd0fc | [
"Apache-2.0"
] | 2 | 2022-03-07T07:27:13.000Z | 2022-03-07T07:27:15.000Z | model_utils.py | pwldj/MTL-BioNER | 3fb336f517346daeec6a716fa6a657a421754bdb | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import re
import numpy as np
import six
from os.path import join
from six.moves import zip
from absl import flags
import tensorflow as tf
def configure_tpu(FLAGS):
if FLAGS.... | 38.48995 | 88 | 0.628305 |
c89211cd25a1de2cf1243a46906e745852d225cc | 4,731 | py | Python | httpsig/sign.py | kouk/httpsig | 9f4a2472ce7df70cac48287d4a57334db0683f6b | [
"MIT"
] | null | null | null | httpsig/sign.py | kouk/httpsig | 9f4a2472ce7df70cac48287d4a57334db0683f6b | [
"MIT"
] | null | null | null | httpsig/sign.py | kouk/httpsig | 9f4a2472ce7df70cac48287d4a57334db0683f6b | [
"MIT"
] | null | null | null | import base64
from Crypto.Hash import HMAC
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from .utils import generate_message, sig, is_rsa, CaseInsensitiveDict, ALGORITHMS, HASHES, HttpSigException
class Signer(object):
"""
When using an RSA algo, the secret is a PEM-encoded privat... | 39.099174 | 124 | 0.652293 |
c89265752038826945c193630d18d2bb359f7001 | 845 | py | Python | mmaction/models/heads/__init__.py | rikichou/mmaction2 | a4db04003e7a87e68436e940178ea4c1d1b77ef0 | [
"Apache-2.0"
] | null | null | null | mmaction/models/heads/__init__.py | rikichou/mmaction2 | a4db04003e7a87e68436e940178ea4c1d1b77ef0 | [
"Apache-2.0"
] | null | null | null | mmaction/models/heads/__init__.py | rikichou/mmaction2 | a4db04003e7a87e68436e940178ea4c1d1b77ef0 | [
"Apache-2.0"
] | null | null | null | from .audio_tsn_head import AudioTSNHead
from .base import BaseHead
from .bbox_head import BBoxHeadAVA
from .fbo_head import FBOHead
from .i3d_head import I3DHead
from .lfb_infer_head import LFBInferHead
from .misc_head import ACRNHead
from .roi_head import AVARoIHead
from .slowfast_head import SlowFastHead
from .ssn_h... | 33.8 | 84 | 0.784615 |
c8926b5898f3b94864afdde1475be2828b46093a | 34,834 | py | Python | salt/modules/boto3_route53.py | ari/salt | 05de98e237719b4f0cc68f08871ffaa532eddec5 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto3_route53.py | ari/salt | 05de98e237719b4f0cc68f08871ffaa532eddec5 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto3_route53.py | ari/salt | 05de98e237719b4f0cc68f08871ffaa532eddec5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Execution module for Amazon Route53 written against Boto 3
.. versionadded:: Nitrogen
:configuration: This module accepts explicit route53 credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then automatically obtai... | 39.404977 | 238 | 0.618591 |
c89279da7464d83e5699894608fc0a030db67686 | 6,938 | py | Python | Test25_words/test25_train.py | hooloong/My_TensorFlow | ef115989035b9ae14938dca47c0814b0d16dd6ba | [
"MIT"
] | 3 | 2018-07-29T17:31:58.000Z | 2019-06-27T10:36:34.000Z | Test25_words/test25_train.py | hooloong/My_TensorFlow | ef115989035b9ae14938dca47c0814b0d16dd6ba | [
"MIT"
] | null | null | null | Test25_words/test25_train.py | hooloong/My_TensorFlow | ef115989035b9ae14938dca47c0814b0d16dd6ba | [
"MIT"
] | 1 | 2019-02-18T02:27:39.000Z | 2019-02-18T02:27:39.000Z | import tensorflow as tf
import pickle
import numpy as np
import ast
from collections import defaultdict
train_data = 'train.vec'
valid_data = 'valid.vec'
word2idx, content_length, question_length, vocab_size = pickle.load(open('vocab.data', "rb"))
print(content_length, question_length, vocab_size)
batch_size = 64
t... | 41.053254 | 120 | 0.604785 |
c8929d76b8ae45eb198d9088de60ad694070ebf1 | 767 | py | Python | sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/aio/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/aio/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/aio/__init__.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 ... | 47.9375 | 114 | 0.628422 |
c892a01f7f185882fd4a6af40e2c046a4b5b7718 | 5,244 | py | Python | tensorbay/geometry/point_list.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | 2 | 2021-08-23T08:30:15.000Z | 2021-08-30T03:18:41.000Z | tensorbay/geometry/point_list.py | yyy624297803/tensorbay-python-sdk | 58cca7e16264c7ce7e3059a9dd974886b3abd917 | [
"MIT"
] | null | null | null | tensorbay/geometry/point_list.py | yyy624297803/tensorbay-python-sdk | 58cca7e16264c7ce7e3059a9dd974886b3abd917 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
"""PointList2D, MultiPointList2D.
:class:`PointList2D` contains a list of 2D points.
:class:`MultiPointList2D` contains multiple 2D point lists.
"""
from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar
from ..utility... | 27.746032 | 98 | 0.54405 |
c892a51806cd536c7cc7f9e560a4c7a6835bb30f | 113 | py | Python | week10/config.py | mikequaid/DR | 3f54ad37d841cd910cffae11176db783681c2479 | [
"Apache-2.0"
] | null | null | null | week10/config.py | mikequaid/DR | 3f54ad37d841cd910cffae11176db783681c2479 | [
"Apache-2.0"
] | null | null | null | week10/config.py | mikequaid/DR | 3f54ad37d841cd910cffae11176db783681c2479 | [
"Apache-2.0"
] | null | null | null |
mysql={
'host':"localhost",
'username':'root',
'password':'',
'database': 'datarepresentation'
} | 16.142857 | 36 | 0.566372 |
c892a92f5b2d7d18019ee3d9b889bb314946ae48 | 63,936 | py | Python | tensorflow/compiler/tests/binary_ops_test.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 615 | 2018-04-14T22:04:13.000Z | 2022-03-31T12:46:50.000Z | tensorflow/compiler/tests/binary_ops_test.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 1,167 | 2018-05-15T15:26:33.000Z | 2022-03-31T18:58:41.000Z | tensorflow/compiler/tests/binary_ops_test.py | ROCmSoftwarePlatform/tensorflow-upstream | 8bd1e3fcaee378945b11c96ed1474d8b890232fc | [
"Apache-2.0"
] | 93 | 2018-04-11T02:46:16.000Z | 2022-03-31T12:46:16.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.125224 | 104 | 0.505646 |
c892eb72fe20bd60736c1e924dc6dc294cc38226 | 1,106 | py | Python | tests/test_reader_tsv.py | psd/openregister | 7aa831464f2917c5be7a5ae34ff4c0de96451811 | [
"MIT"
] | null | null | null | tests/test_reader_tsv.py | psd/openregister | 7aa831464f2917c5be7a5ae34ff4c0de96451811 | [
"MIT"
] | null | null | null | tests/test_reader_tsv.py | psd/openregister | 7aa831464f2917c5be7a5ae34ff4c0de96451811 | [
"MIT"
] | null | null | null | import pytest
import io
from openregister.representations.tsv import reader
def test_reader_zero_items():
stream = io.StringIO("")
with pytest.raises(StopIteration):
next(reader(stream))
def test_reader_one_item():
stream = io.StringIO("name\n" "one\n")
items = reader(stream)
assert ite... | 25.72093 | 75 | 0.646474 |
c892f3c1a4ec7eea90fde1b16df1349ee2008a91 | 469 | py | Python | tests/integration/test_charm.py | dstathis/grafana-agent-operator | f78f45ac204d26e40a129262e5ac68cb0f963c1d | [
"Apache-2.0"
] | null | null | null | tests/integration/test_charm.py | dstathis/grafana-agent-operator | f78f45ac204d26e40a129262e5ac68cb0f963c1d | [
"Apache-2.0"
] | null | null | null | tests/integration/test_charm.py | dstathis/grafana-agent-operator | f78f45ac204d26e40a129262e5ac68cb0f963c1d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
import pytest
@pytest.mark.abort_on_fail
async def test_build_and_deploy(ops_test):
my_charm = await ops_test.build_charm(".")
await ops_test.model.deploy(
f"{my_charm.parents[0]}/grafana-agent-k8s_ubunt... | 27.588235 | 76 | 0.727079 |
c89318ef1b8d57e90a72a854db32691a0ad8416d | 3,229 | py | Python | getdata/migrations/0001_initial.py | togetherchicago/chi77 | 09dab3454596d7f461eed0ae7eb9250308f88581 | [
"MIT"
] | 2 | 2018-02-11T02:42:08.000Z | 2018-02-26T06:02:07.000Z | getdata/migrations/0001_initial.py | togetherchicago/chi77 | 09dab3454596d7f461eed0ae7eb9250308f88581 | [
"MIT"
] | 9 | 2018-11-14T00:59:03.000Z | 2022-02-26T06:52:13.000Z | getdata/migrations/0001_initial.py | togetherchicago/chi77 | 09dab3454596d7f461eed0ae7eb9250308f88581 | [
"MIT"
] | 6 | 2018-02-05T20:02:40.000Z | 2018-03-09T23:20:40.000Z | # Generated by Django 2.0.2 on 2019-09-25 22:16
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
n... | 45.478873 | 147 | 0.587488 |
c89327d5c775455f06f746e5f55325a2dc70cefd | 2,550 | py | Python | docs/conf.py | CMeza99/lcs | e43d5c0e5c5d99ee931b1ab2ebe54e8d3783fd66 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | CMeza99/lcs | e43d5c0e5c5d99ee931b1ab2ebe54e8d3783fd66 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | CMeza99/lcs | e43d5c0e5c5d99ee931b1ab2ebe54e8d3783fd66 | [
"Apache-2.0"
] | null | null | null | """Configuration file for the Sphinx documentation builder.
Documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
"""
# pylint: disable=invalid-name
import re
from datetime import datetime
from importlib import import_module
from pathlib import Path
import sphinx_rtd_theme # pylint: disable=u... | 25.757576 | 86 | 0.639608 |
c8932e825d23f17cd28a08ba1a636a1804878efe | 94,357 | py | Python | python/openlattice/api/dataset_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/openlattice/api/dataset_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/openlattice/api/dataset_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility l... | 49.897938 | 227 | 0.620325 |
c8938ddb4ffeea8aa27f522c8b14e6e6a7272c7f | 24,720 | py | Python | nytxw_puz/puz.py | GodTamIt/nytxw_puz_cli | af3a37427299f24bcbc6ca48e1d8d18be314a80b | [
"BSD-2-Clause"
] | null | null | null | nytxw_puz/puz.py | GodTamIt/nytxw_puz_cli | af3a37427299f24bcbc6ca48e1d8d18be314a80b | [
"BSD-2-Clause"
] | null | null | null | nytxw_puz/puz.py | GodTamIt/nytxw_puz_cli | af3a37427299f24bcbc6ca48e1d8d18be314a80b | [
"BSD-2-Clause"
] | 1 | 2022-03-24T23:52:12.000Z | 2022-03-24T23:52:12.000Z | #!/usr/bin/env python3
# This implementation is modified from
# https://github.com/alexdej/puzpy/
# Removes py2 support, and adds the ability to add
# rebus clues to a new file
import functools
import operator
import math
import string
import struct
__title__ = "puzpy"
__version__ = "0.2.3"
__author__ = "Alex DeJarn... | 30.331288 | 88 | 0.581877 |
c89396037bd56facdaae0e2cf967491230c97635 | 19,682 | py | Python | soco/plugins/wimp.py | oyvindmal/SocoWebService | 3cb8f4c08109d07dced4b09621acaf5ac41c732b | [
"MIT"
] | 2 | 2015-08-08T22:26:39.000Z | 2015-08-16T13:59:04.000Z | soco/plugins/wimp.py | silky/SoCo | 6f318df953ebd11d472bba6c85c9b58840d2fed3 | [
"MIT"
] | null | null | null | soco/plugins/wimp.py | silky/SoCo | 6f318df953ebd11d472bba6c85c9b58840d2fed3 | [
"MIT"
] | 1 | 2021-07-18T03:19:07.000Z | 2021-07-18T03:19:07.000Z | # -*- coding: utf-8 -*-
# pylint: disable=R0913,W0142,fixme
""" Plugin for the Wimp music service (Service ID 20) """
from __future__ import unicode_literals
import socket
import locale
import requests
from ..services import MusicServices
from ..xml import XML
from ..data_structures import get_ms_item, MSTrack, MSA... | 37.065913 | 79 | 0.621482 |
c8939b6523ddc3e7a9fd8625c26176a2ef5dd22a | 23,312 | py | Python | metadata-ingestion/tests/unit/test_airflow.py | cuong-pham/datahub | cb4eb001758f55622add0f4dc3650cf483609cba | [
"Apache-2.0"
] | 1,603 | 2016-03-03T17:21:03.000Z | 2020-01-22T22:12:02.000Z | metadata-ingestion/tests/unit/test_airflow.py | cuong-pham/datahub | cb4eb001758f55622add0f4dc3650cf483609cba | [
"Apache-2.0"
] | 1,157 | 2016-03-03T19:29:22.000Z | 2020-01-20T14:41:59.000Z | metadata-ingestion/tests/unit/test_airflow.py | cuong-pham/datahub | cb4eb001758f55622add0f4dc3650cf483609cba | [
"Apache-2.0"
] | 570 | 2016-03-03T17:21:05.000Z | 2020-01-21T06:54:10.000Z | import datetime
import json
import os
import sys
from contextlib import contextmanager
from typing import Iterator
from unittest import mock
from unittest.mock import Mock
import airflow.configuration
import airflow.version
import packaging.version
import pytest
from airflow.lineage import apply_lineage, prepare_linea... | 40.123924 | 120 | 0.622298 |
c893ae4d07cdeda0241c2a46df909107af4a77e1 | 2,141 | py | Python | algorithms/huffman.py | Chyroc/homework | b1ee8e9629b4dbb6c46a550d710157702d57b00b | [
"MIT"
] | null | null | null | algorithms/huffman.py | Chyroc/homework | b1ee8e9629b4dbb6c46a550d710157702d57b00b | [
"MIT"
] | 1 | 2018-05-23T02:12:16.000Z | 2018-05-23T02:12:31.000Z | algorithms/huffman.py | Chyroc/homework | b1ee8e9629b4dbb6c46a550d710157702d57b00b | [
"MIT"
] | null | null | null | # 定义节点
class Node:
def __init__(self, weight=0, left=None, right=None):
# 权重
self.weight = weight
# 左右子树
self.left = left
self.right = right
# 是否是原生数据
self.is_original = True
# 按权值排序
def sort(list):
# 根据权重对list排序
# 因为哈夫曼树算法,要求的就是将两个权重最小的加起来
ret... | 21.626263 | 63 | 0.571228 |
c893b965bed8cc0f52ce571fc032992d4cb80f30 | 3,851 | py | Python | applications/tenant/signals.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | applications/tenant/signals.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | applications/tenant/signals.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.apps import apps
from django.conf import settings
from django.db.models.signals import post_save, m2m_changed
from django.contrib.auth import get_user_model
from mighty.apps import MightyConfig
from mighty.applications.tenant.apps import TenantConfig
from mighty.applications.tenant import get_tenant_model
... | 45.305882 | 137 | 0.661127 |
c893f1a11cb8b669ab414a63a013735535906ec9 | 1,414 | py | Python | src/cell.py | saran-sasidharan/cfd-py | 295ebaf6df4ef02d9dc381f8e3cad0b3f528d7b2 | [
"MIT"
] | null | null | null | src/cell.py | saran-sasidharan/cfd-py | 295ebaf6df4ef02d9dc381f8e3cad0b3f528d7b2 | [
"MIT"
] | null | null | null | src/cell.py | saran-sasidharan/cfd-py | 295ebaf6df4ef02d9dc381f8e3cad0b3f528d7b2 | [
"MIT"
] | 1 | 2019-11-02T23:43:41.000Z | 2019-11-02T23:43:41.000Z | import numpy as np
class Cell(object):
def __init__(self, id, faces, facesigns):
# Properties
self.id = id
self.centroid = np.zeros(3, dtype=float)
self.volume = 0.0
self.nFaces = len(faces)
self.faces = faces
self.facesigns = np.array(facesigns, dtype=float)
self.nodes = []
#... | 26.185185 | 61 | 0.637907 |
c8941aaae3da2c1115e7d16eb0b1f5c0913c6680 | 16,585 | py | Python | ggsolver/stptb/solvers.py | abhibp1993/ggsolver | 5d448b2b5e5763bdbe571f23a6504cdeca73b88e | [
"BSD-3-Clause"
] | null | null | null | ggsolver/stptb/solvers.py | abhibp1993/ggsolver | 5d448b2b5e5763bdbe571f23a6504cdeca73b88e | [
"BSD-3-Clause"
] | null | null | null | ggsolver/stptb/solvers.py | abhibp1993/ggsolver | 5d448b2b5e5763bdbe571f23a6504cdeca73b88e | [
"BSD-3-Clause"
] | null | null | null | """
Algorithms to compute almost-sure winning, losing and positive winning regions, strategies for a player in game on MDP.
References:
* L. de Alfaro and T. A. Henzinger, "Concurrent omega-regular games," Proceedings Fifteenth Annual IEEE
Symposium on Logic in Computer Science (Cat. No.99CB36332), 2000, p... | 39.394299 | 119 | 0.564064 |
c8942b5b9426177880f4cb634cdc2490a05a6245 | 4,034 | py | Python | signal/transforms.py | indranilsinharoy/iutils | 1b102029306fa2947d69d8ca80d976d143f3d068 | [
"MIT"
] | null | null | null | signal/transforms.py | indranilsinharoy/iutils | 1b102029306fa2947d69d8ca80d976d143f3d068 | [
"MIT"
] | null | null | null | signal/transforms.py | indranilsinharoy/iutils | 1b102029306fa2947d69d8ca80d976d143f3d068 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#--------------------------------------------------------------------------
# Name: transformutils.py
# Purpose: collection of utilities for transformations based
# calculations such as FFT, etc.
#
# Author: Indranil Sinharoy
#
# Created: 11/20/2013
# L... | 33.616667 | 85 | 0.573376 |
c8943b391e6ea1ccadda6778cd071a8bda13c2e0 | 2,573 | py | Python | python-code/opengl-learning/glumpy-learning/filter-compose.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 13 | 2018-09-07T02:29:07.000Z | 2021-06-18T08:40:09.000Z | python-code/opengl-learning/glumpy-learning/filter-compose.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | null | null | null | python-code/opengl-learning/glumpy-learning/filter-compose.py | juxiangwu/image-processing | c644ef3386973b2b983c6b6b08f15dc8d52cd39f | [
"Apache-2.0"
] | 4 | 2019-06-20T00:09:39.000Z | 2021-07-15T10:14:36.000Z | # -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import numpy as np
from glumpy.geometry import pri... | 25.475248 | 81 | 0.613292 |
c894722be925cadc95a3070a7697610d5bac9160 | 123,759 | py | Python | python/openlattice/api/search_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/openlattice/api/search_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/openlattice/api/search_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility l... | 47.23626 | 330 | 0.609135 |
c89492da4ce0b091acd6d8cfef65525b711cc16b | 10,736 | py | Python | catalyst/core/callbacks/metrics.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/core/callbacks/metrics.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/core/callbacks/metrics.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Dict, List, Union
from abc import ABC, abstractmethod
from collections import defaultdict
import logging
import torch
from catalyst.core import Callback, CallbackNode, CallbackOrder, State, utils
from catalyst.utils import meters
logger = logging.getLogger(__name__)
class _MetricC... | 32.337349 | 79 | 0.578428 |
c894af91192e29f158afb558dde4369c6abfffd8 | 4,639 | py | Python | sugaroid/web/websugaroid/websugaroid/settings.py | vardaan-raj/sugaroid | d0476fb9c44a73fee2e0de45162f2b1ac86452aa | [
"MIT"
] | 4 | 2020-09-28T13:52:40.000Z | 2020-10-30T15:24:50.000Z | sugaroid/web/websugaroid/websugaroid/settings.py | sreyasaju/sugaroid | d58e06fb664daa16fda1bf23cc73068efcd5634c | [
"MIT"
] | null | null | null | sugaroid/web/websugaroid/websugaroid/settings.py | sreyasaju/sugaroid | d58e06fb664daa16fda1bf23cc73068efcd5634c | [
"MIT"
] | null | null | null | """
MIT License
Sugaroid Artificial Inteligence
Chatbot Core
Copyright (c) 2020-2021 Srevin Saju
Copyright (c) 2021 The Sugaroid Project
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 re... | 28.635802 | 91 | 0.723647 |
c894b30a2da9c6cac16e7cd264f3b0e8aa2f9d2f | 5,598 | py | Python | wappstoiot/schema/iot_schema.py | Wappsto/python-wappsto-iot | 3dfcf208d0b374a29438b00ce153e01d57f43fde | [
"MIT"
] | null | null | null | wappstoiot/schema/iot_schema.py | Wappsto/python-wappsto-iot | 3dfcf208d0b374a29438b00ce153e01d57f43fde | [
"MIT"
] | null | null | null | wappstoiot/schema/iot_schema.py | Wappsto/python-wappsto-iot | 3dfcf208d0b374a29438b00ce153e01d57f43fde | [
"MIT"
] | null | null | null | import uuid
import datetime
from enum import Enum
from itertools import zip_longest
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
# from typing import Type
from typing import Union
from pydantic import BaseModel
from pydantic import Extra
... | 25.445455 | 80 | 0.605573 |
c894c4f2c27e3e24cd4a333e9519ec2f6187fa75 | 758 | py | Python | lewis_emulators/fzj_dd_fermi_chopper/states.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/fzj_dd_fermi_chopper/states.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/fzj_dd_fermi_chopper/states.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from lewis.core import approaches
from lewis.core.statemachine import State
# FZJ Digital Drive Fermi Chopper Controller
class StartedState(State):
"""
Device is in started state.
"""
NAME = 'Started'
def in_state(self, dt):
device = self._context
device.frequency = approaches.li... | 26.137931 | 96 | 0.670185 |
c894eb28e3aa8ea09e3254d0467ebc35f881b323 | 409 | py | Python | gaphor/storage/diagramitems.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | 1 | 2020-11-27T12:39:15.000Z | 2020-11-27T12:39:15.000Z | gaphor/storage/diagramitems.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | null | null | null | gaphor/storage/diagramitems.py | MarianelaSena/gaphor | f1ccc2e2ae98d7fad54f6dd9271e8e10fbb2e324 | [
"Apache-2.0"
] | 3 | 2020-01-23T14:13:59.000Z | 2020-02-18T18:21:47.000Z | """
All Item's defined in the diagram package. This module
makes it easier to load a diagram item.
"""
from gaphor.diagram.actions import *
from gaphor.diagram.classes import *
from gaphor.diagram.components import *
from gaphor.diagram.general import *
from gaphor.diagram.interactions import *
from gaphor.diagram.pro... | 29.214286 | 54 | 0.792176 |
c8950030d722a566ef9e64f332cf2d08d9cd2f18 | 7,584 | py | Python | tests/components/media_player/test_sonos.py | mweinelt/home-assistant | cc0d0a38d7f24885e5146bd0826fa8ba3e2b39a1 | [
"MIT"
] | null | null | null | tests/components/media_player/test_sonos.py | mweinelt/home-assistant | cc0d0a38d7f24885e5146bd0826fa8ba3e2b39a1 | [
"MIT"
] | null | null | null | tests/components/media_player/test_sonos.py | mweinelt/home-assistant | cc0d0a38d7f24885e5146bd0826fa8ba3e2b39a1 | [
"MIT"
] | null | null | null | """The tests for the Demo Media player platform."""
import unittest
import soco.snapshot
from unittest import mock
import soco
from homeassistant.components.media_player import sonos
from tests.common import get_test_home_assistant
ENTITY_ID = 'media_player.kitchen'
class socoDiscoverMock():
"""Mock class for ... | 37.176471 | 79 | 0.635153 |
c8950e5c610134482a4dfda66dd7df0ade3b8d9b | 6,565 | py | Python | sitator/dynamics/MergeSitesByDynamics.py | lekah/sitator | 0f9c84989758eb7b76be8104a94a8d6decd27b55 | [
"MIT"
] | 8 | 2018-10-05T18:02:24.000Z | 2021-02-22T20:24:58.000Z | sitator/dynamics/MergeSitesByDynamics.py | lekah/sitator | 0f9c84989758eb7b76be8104a94a8d6decd27b55 | [
"MIT"
] | 6 | 2019-02-21T04:33:01.000Z | 2021-01-06T20:05:25.000Z | sitator/dynamics/MergeSitesByDynamics.py | lekah/sitator | 0f9c84989758eb7b76be8104a94a8d6decd27b55 | [
"MIT"
] | 6 | 2018-08-11T21:43:59.000Z | 2021-12-21T06:32:12.000Z | import numpy as np
from sitator.dynamics import JumpAnalysis
from sitator.util import PBCCalculator
from sitator.network.merging import MergeSites
from sitator.util.mcl import markov_clustering
import logging
logger = logging.getLogger(__name__)
class MergeSitesByDynamics(MergeSites):
"""Merges sites using dyna... | 42.62987 | 149 | 0.650876 |
c89531599c5781c65a2faa35074dbf295309b80c | 6,495 | py | Python | program_synthesis/naps/uast/uast_to_cpp/program_converter.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 123 | 2018-06-09T00:49:39.000Z | 2022-03-09T05:41:20.000Z | program_synthesis/naps/uast/uast_to_cpp/program_converter.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 9 | 2018-06-12T01:01:17.000Z | 2022-03-18T09:06:39.000Z | program_synthesis/naps/uast/uast_to_cpp/program_converter.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 24 | 2018-06-09T00:42:46.000Z | 2021-09-29T08:23:32.000Z | """Converts UAST program to C++.
Note, we might later need to replace all string's with wstring's and all char's with wchar_t's, see:
https://stackoverflow.com/a/402918
"""
import copy
from program_synthesis.naps.uast.uast_to_cpp.libs_to_include import convert_libs
from program_synthesis.naps.uast.uast_to_cpp.decl_ext... | 39.846626 | 118 | 0.565358 |
c895a0ffffdfee9e1085e0000731d716f6638e7b | 455 | py | Python | main.py | Zacks7348/Sunny-Side-Up | dd57959c2e8b9920528d19e667b8c84c9d0acd2f | [
"MIT"
] | null | null | null | main.py | Zacks7348/Sunny-Side-Up | dd57959c2e8b9920528d19e667b8c84c9d0acd2f | [
"MIT"
] | 3 | 2021-06-08T20:51:56.000Z | 2022-01-13T02:07:15.000Z | main.py | Zacks7348/Sunny-Side-Up | dd57959c2e8b9920528d19e667b8c84c9d0acd2f | [
"MIT"
] | null | null | null | """
Sunny Side Up
Date Modified: January 26, 2020
Author: Zacks7348, Lvis47, Lfigu042
"""
from gui.gui import run
from data import fetch_data
import plotter as p
#Takes in user input and plots data
year1, dataset, city, year2 = run()
data1 = fetch_data(dataset, city, year1)
data2 = fetch_data(dataset, city, year2)... | 19.782609 | 52 | 0.723077 |
c895b14b0460cd53e94a3effda4c37af5205783f | 128 | py | Python | smartva/config.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | smartva/config.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | smartva/config.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | import sys
import os
if getattr(sys, 'frozen', None):
basedir = sys._MEIPASS
else:
basedir = os.path.dirname(__file__)
| 16 | 39 | 0.695313 |
c8962e03fff15fb06d2435525fdce74a18147abe | 909 | py | Python | setup.py | elcorto/psweep | b1d372ba19f1d98744e04a1576211d51123272b1 | [
"BSD-3-Clause"
] | 6 | 2020-03-24T07:24:37.000Z | 2021-07-29T07:18:59.000Z | setup.py | elcorto/psweep | b1d372ba19f1d98744e04a1576211d51123272b1 | [
"BSD-3-Clause"
] | 2 | 2019-08-20T22:14:18.000Z | 2022-03-11T09:16:59.000Z | setup.py | elcorto/psweep | b1d372ba19f1d98744e04a1576211d51123272b1 | [
"BSD-3-Clause"
] | 1 | 2020-02-22T12:13:13.000Z | 2020-02-22T12:13:13.000Z | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
bindir = "bin"
with open(os.path.join(here, "README.md")) as fd:
long_description = fd.read()
setup(
name="psweep",
version="0.5.1",
description=(
"loop like a pro, make parameter studies fu... | 32.464286 | 78 | 0.683168 |
c8963dfb385b2ca6ba57f0bbc5e074d689b17993 | 10,900 | py | Python | stone/backends/swift_client.py | mghatak/stone | bade48e44c88481a2386a6b00e7b49f6908d06e2 | [
"MIT"
] | null | null | null | stone/backends/swift_client.py | mghatak/stone | bade48e44c88481a2386a6b00e7b49f6908d06e2 | [
"MIT"
] | null | null | null | stone/backends/swift_client.py | mghatak/stone | bade48e44c88481a2386a6b00e7b49f6908d06e2 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import json
from stone.ir import (
is_struct_type,
is_union_type,
is_void_type,
)
from stone.backends.swift import (
base,
fmt_serial_type,
stone_warning,
SwiftBaseBackend,
undocumented,
)
from stone.bac... | 38.652482 | 100 | 0.630092 |
c8964798f4ce2f43c416d26613ecf7c5fe12bcec | 12,314 | py | Python | tensorlayer/layers/utils.py | thangvubk/tensorlayer | fcf7bb2f14caf6e1336b54b772c5227587b5f51d | [
"Apache-2.0"
] | null | null | null | tensorlayer/layers/utils.py | thangvubk/tensorlayer | fcf7bb2f14caf6e1336b54b772c5227587b5f51d | [
"Apache-2.0"
] | null | null | null | tensorlayer/layers/utils.py | thangvubk/tensorlayer | fcf7bb2f14caf6e1336b54b772c5227587b5f51d | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorflow.python.ops.rnn_cell import LSTMStateTuple
from tensorlayer import logging
from tensorlayer.decorators import deprecated
from tensorlayer.decorators import deprecated_alias
__all__ = [
'cabs',
'clear_layers_name',
'comput... | 28.438799 | 118 | 0.638866 |
c89666378b970d753ead3335f5f5236dac03a88f | 142 | py | Python | lewis_emulators/tpg300/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/tpg300/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/tpg300/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from .device import SimulatedTpg300
from ..lewis_versions import LEWIS_LATEST
framework_version = LEWIS_LATEST
__all__ = ['SimulatedTpg300']
| 23.666667 | 41 | 0.830986 |
c89671565e5ec166e072124b10ed8aa83e78d515 | 697 | py | Python | models/project_manager.py | jlgoh/labeldat | 057248a22c7f022110d712dbcb61befd40e62760 | [
"MIT"
] | 1 | 2021-09-07T06:34:54.000Z | 2021-09-07T06:34:54.000Z | models/project_manager.py | wilsonteng97/labeldat | bdca5df0af55bdd460807808861de25d762b28da | [
"MIT"
] | 5 | 2021-09-08T02:44:59.000Z | 2022-02-27T10:55:29.000Z | models/project_manager.py | wilsonteng97/labeldat | bdca5df0af55bdd460807808861de25d762b28da | [
"MIT"
] | 1 | 2020-12-31T11:03:39.000Z | 2020-12-31T11:03:39.000Z | from extensions import db
class ProjectManager(db.Model):
# 1(Project)-to-many(ProjectManager)
project_id = db.Column(db.String(80), db.ForeignKey('project.id'), primary_key=True, nullable=False)
# 1(User)-to-many(ProjectManager)
user_id = db.Column(db.String(80), db.ForeignKey('user.id'), primary_key... | 36.684211 | 104 | 0.657102 |
c896c76a4df1da6cfd25e923118c1aad68217c3c | 473 | py | Python | demos/tutorial_shapes_managed.py | talwai/jygsaw | 70847c797ff1fb3034bf9d6f95fa6dce1b9056f7 | [
"WTFPL"
] | 2 | 2017-11-21T03:04:47.000Z | 2020-03-10T11:05:15.000Z | demos/tutorial_shapes_managed.py | talwai/jygsaw | 70847c797ff1fb3034bf9d6f95fa6dce1b9056f7 | [
"WTFPL"
] | null | null | null | demos/tutorial_shapes_managed.py | talwai/jygsaw | 70847c797ff1fb3034bf9d6f95fa6dce1b9056f7 | [
"WTFPL"
] | null | null | null | # tutorial_shapes_managed.py
#
# Jygsaw demo - draws some shapes
#
# Written by Janet Kim for Jygsaw
from jygsaw.graphics import *
canvas(700, 300)
background(BLUE)
def draw():
circle(350, 150, 50, color=RED)
point(350, 150)
rect(0, 0, 150, 75, color=ORANGE)
polygon([(450, 250), (650, 250), (500, 30... | 20.565217 | 63 | 0.67019 |
c89716d769380fbb9c9c79484ffea4b879e9f796 | 14,536 | py | Python | 10.ResNet/ResNet.py | crazyyanchao/TensorFlow-HelloWorld | 73cd470a8122df9d7724e7957b4bae5c9ac76ff4 | [
"Apache-2.0"
] | 23 | 2017-04-26T05:26:52.000Z | 2022-03-30T11:08:38.000Z | 10.ResNet/ResNet.py | crazyyanchao/TensorFlow-HelloWorld | 73cd470a8122df9d7724e7957b4bae5c9ac76ff4 | [
"Apache-2.0"
] | null | null | null | 10.ResNet/ResNet.py | crazyyanchao/TensorFlow-HelloWorld | 73cd470a8122df9d7724e7957b4bae5c9ac76ff4 | [
"Apache-2.0"
] | 26 | 2017-04-26T05:26:59.000Z | 2022-02-19T09:29:07.000Z | # coding:UTF-8
"""
Typical use:
from tensorflow.contrib.slim.nets import resnet_v2
ResNet-101 for image classification into 1000 classes:
# inputs has shape [batch, 224, 224, 3]
with slim.arg_scope(resnet_v2.resnet_arg_scope(is_training)):
net, end_points = resnet_v2.resnet_v2_101(inputs, 1000)
ResN... | 38.659574 | 121 | 0.620528 |
c8973485e55e4dc30de61fc0b26f513da819f266 | 10,329 | py | Python | vuln_check/wapitiCore/net/xss_utils.py | erick-maina/was | 3b89b9539a5d5daaaca5ab12d96e920c6a67dd55 | [
"MIT"
] | 2 | 2020-03-21T19:36:14.000Z | 2020-09-30T09:18:20.000Z | vuln_check/wapitiCore/net/xss_utils.py | erick-maina/was | 3b89b9539a5d5daaaca5ab12d96e920c6a67dd55 | [
"MIT"
] | null | null | null | vuln_check/wapitiCore/net/xss_utils.py | erick-maina/was | 3b89b9539a5d5daaaca5ab12d96e920c6a67dd55 | [
"MIT"
] | null | null | null | import re
from bs4 import BeautifulSoup, element
# Everything under those tags will be treated as text
NONEXEC_PARENTS = {
"iframe",
"noframes",
"noembed",
"noscript",
"plaintext",
"style",
"template",
"textarea",
"title",
"xmp"
}
CSP_HEADERS = {"content-security-policy", "x-c... | 39.423664 | 115 | 0.544002 |
c89761a02d3f18321cfb4b9046f3b674f5a2bc64 | 5,913 | py | Python | dqn/exercise/dqn_agent.py | aopina1/DRLND-Course | 1140e101221cfcee16a24d146b4f86cd79d53832 | [
"MIT"
] | null | null | null | dqn/exercise/dqn_agent.py | aopina1/DRLND-Course | 1140e101221cfcee16a24d146b4f86cd79d53832 | [
"MIT"
] | 7 | 2019-12-16T22:13:37.000Z | 2022-02-10T01:05:42.000Z | dqn/exercise/dqn_agent.py | aopina1/DRLND-Course | 1140e101221cfcee16a24d146b4f86cd79d53832 | [
"MIT"
] | null | null | null | import numpy as np
import random
from collections import namedtuple, deque
from model import QNetwork
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5) # replay buffer size
BATCH_SIZE = 64 # minibatch size
GAMMA = 0.99 # discount factor
T... | 40.5 | 128 | 0.604769 |
c8978000a7a50e403a99e2e7257cead4e327d661 | 1,778 | py | Python | icontrol/exceptions.py | hafixo/f5-icontrol-rest-python | dc707498e71a8c8e859d1428e61826f004a9116a | [
"Apache-2.0"
] | 35 | 2016-01-19T01:56:20.000Z | 2020-09-03T23:59:40.000Z | icontrol/exceptions.py | hafixo/f5-icontrol-rest-python | dc707498e71a8c8e859d1428e61826f004a9116a | [
"Apache-2.0"
] | 90 | 2016-01-13T22:53:15.000Z | 2020-09-14T22:59:08.000Z | icontrol/exceptions.py | hafixo/f5-icontrol-rest-python | dc707498e71a8c8e859d1428e61826f004a9116a | [
"Apache-2.0"
] | 34 | 2016-01-13T23:38:45.000Z | 2021-06-15T17:35:29.000Z | # Copyright 2015-2016 F5 Networks 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... | 29.633333 | 76 | 0.742407 |
c89789cee53b7e2968ed03c49744f70c0578970d | 2,770 | py | Python | examples/ottog_preds.py | SimonCarozza/autolrn | d0875844a3e9b4fc22510ef320aa498e339b6192 | [
"MIT"
] | null | null | null | examples/ottog_preds.py | SimonCarozza/autolrn | d0875844a3e9b4fc22510ef320aa498e339b6192 | [
"MIT"
] | null | null | null | examples/ottog_preds.py | SimonCarozza/autolrn | d0875844a3e9b4fc22510ef320aa498e339b6192 | [
"MIT"
] | null | null | null | from pandas import read_csv, DataFrame
import os
from autolrn.encoding import labelenc as lc
from keras.models import load_model
from sklearn.externals import joblib as jl
# import sklearn
import numpy as np
from random import sample
# autolrn classification's module
from autolrn.classification import predict as pr
fr... | 25.648148 | 78 | 0.69278 |
c8979cbb0896849daff56f191da5483a535adc7f | 6,454 | py | Python | firetower/util/log_watcher.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | 3 | 2015-11-08T11:30:56.000Z | 2019-11-20T07:31:47.000Z | firetower/util/log_watcher.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | null | null | null | firetower/util/log_watcher.py | gmcquillan/firetower | 7eafcaea3d428807e1b5578bd325466e47211092 | [
"MIT"
] | null | null | null | ## {{{ http://code.activestate.com/recipes/577968/ (r3)
#!/usr/bin/env python
"""
Real time log files watcher supporting log rotation.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
"""
import os
import time
import errno
import stat
class LogWatcher(object):
"""Looks for changes in all ... | 30.443396 | 75 | 0.517973 |
c897aa5a4979107c9891895c11aa6ffe030f27a6 | 2,594 | py | Python | plugins/sdm/lib/platform/ms_teams_platform.py | strongdm/accessbot | 0c8bed9e5ff7ee5515ff584b0704d87b744a56df | [
"Apache-2.0"
] | 16 | 2021-06-17T20:09:43.000Z | 2022-03-23T17:42:02.000Z | plugins/sdm/lib/platform/ms_teams_platform.py | strongdm/accessbot | 0c8bed9e5ff7ee5515ff584b0704d87b744a56df | [
"Apache-2.0"
] | 73 | 2021-05-05T18:40:30.000Z | 2022-03-30T04:55:39.000Z | plugins/sdm/lib/platform/ms_teams_platform.py | strongdm/accessbot | 0c8bed9e5ff7ee5515ff584b0704d87b744a56df | [
"Apache-2.0"
] | 11 | 2021-07-23T17:23:14.000Z | 2022-03-23T13:40:47.000Z | import re
from .base_platform import BasePlatform
class MSTeamsPlatform(BasePlatform):
def activate(self):
webserver = self._bot.get_plugin('Webserver')
webserver.configure(webserver.get_configuration_template())
webserver.activate()
def deactivate(self):
self._bot.get_plugin... | 35.534247 | 115 | 0.668466 |
c897ac14edc8ea2c72a39f96c2523fd37d569538 | 2,919 | py | Python | ncclient/transport/third_party/junos/ioproc.py | mikiec84/ncclient | 7662666aac957fcf6aeb50c05f6b9816179cfd23 | [
"Apache-2.0"
] | 4 | 2020-01-20T06:46:33.000Z | 2021-07-28T21:53:29.000Z | ncclient/transport/third_party/junos/ioproc.py | mikiec84/ncclient | 7662666aac957fcf6aeb50c05f6b9816179cfd23 | [
"Apache-2.0"
] | 8 | 2020-02-05T14:17:32.000Z | 2021-09-23T23:27:46.000Z | ncclient/transport/third_party/junos/ioproc.py | mikiec84/ncclient | 7662666aac957fcf6aeb50c05f6b9816179cfd23 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import re
if sys.version < '3':
from cStringIO import StringIO
else:
from io import StringIO
from select import select
if sys.version>='2.7':
from subprocess import Popen, check_output, PIPE, STDOUT
else:
from subprocess import Popen, PIPE, STDOUT
from ncclient.transport.errors im... | 33.170455 | 208 | 0.589585 |
c8980de059ca702049845f79ae7e26d9c12d40f8 | 20,619 | py | Python | neural_sp/datasets/asr.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | neural_sp/datasets/asr.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | neural_sp/datasets/asr.py | Cescfangs/neural_sp | 2c12d25d2078d3dacdb80c5c367c2e90feba7b6c | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Base class for loading dataset for ASR.
In this class, all data will be loaded at each step.
You can use the multi-GPU version.
"""
import codecs
i... | 41.654545 | 135 | 0.558853 |
c8981fc12bbc9b1bba0158e6208a220608762d4e | 18,189 | py | Python | AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py | Jackerty/o3de | f521a288cf020d166949c1dc243c4938539b5244 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-28T08:06:58.000Z | 2022-03-28T08:06:58.000Z | AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py | Jackerty/o3de | f521a288cf020d166949c1dc243c4938539b5244 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main.py | Jackerty/o3de | f521a288cf020d166949c1dc243c4938539b5244 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
import os
import sys
import inspect
from ly_test_tools import LAUNCHERS
from ly_test_tools.o3de.... | 51.673295 | 138 | 0.7979 |
c8983a38a1283fefc09b3967e540d45b5058a92b | 15,626 | py | Python | tensorflow_federated/python/core/impl/function_utils_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | 2 | 2019-07-09T10:04:39.000Z | 2019-10-02T05:10:16.000Z | tensorflow_federated/python/core/impl/function_utils_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/function_utils_test.py | xueyuuu/federated | ad617401324c133eb838e4e0af7442a4dfa71d6e | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 39.760814 | 103 | 0.607001 |
c89844a93c950c3e4f7fe7b4b2950c43448da582 | 3,676 | py | Python | train_STE.py | GaroneHuang/EraseNet | 62d955a815be074e1370ad04b7549b8abcbe8daa | [
"MIT"
] | null | null | null | train_STE.py | GaroneHuang/EraseNet | 62d955a815be074e1370ad04b7549b8abcbe8daa | [
"MIT"
] | null | null | null | train_STE.py | GaroneHuang/EraseNet | 62d955a815be074e1370ad04b7549b8abcbe8daa | [
"MIT"
] | null | null | null | import os
import math
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
from PIL import Image
import numpy as np
from torch.autograd import Variable
from torchvision.utils import save_image
from torchvision import datasets
from torch.utils.data import Da... | 30.131148 | 112 | 0.663765 |
c89857f503ca4f1faf4e069dfdfdd87d8bb44b0b | 889 | py | Python | 08_WinningestMethods/M5_competition/phdinds2024_entry/PATHS.py | leolorenzoii/time_series_handbook | 88e5763886043104f916ccd4b13c719f181603c7 | [
"MIT"
] | 2 | 2021-12-16T16:28:51.000Z | 2021-12-17T07:20:53.000Z | 08_WinningestMethods/M5_competition/phdinds2024_entry/PATHS.py | leolorenzoii/time_series_handbook | 88e5763886043104f916ccd4b13c719f181603c7 | [
"MIT"
] | null | null | null | 08_WinningestMethods/M5_competition/phdinds2024_entry/PATHS.py | leolorenzoii/time_series_handbook | 88e5763886043104f916ccd4b13c719f181603c7 | [
"MIT"
] | null | null | null | import os
# data_root = '../../..'
data_root = '~/time_series_handbook'
raw_data_dir = 'data/m5/raw'
train_path = os.path.join(data_root, raw_data_dir, 'sales_train_evaluation.csv')
test_path = os.path.join(data_root, raw_data_dir, 'sales_test_evaluation.csv')
prices_path = os.path.join(data_root, raw_data_dir, 'sell... | 44.45 | 96 | 0.782902 |
c8989b8794ccc4d358cbd965d4fd18afae4fe752 | 272 | py | Python | schemas/address.py | Zechee/flask-commodity | 14f586f918a4a84ee9f8a79dc4bea1bb323b2d05 | [
"MIT"
] | null | null | null | schemas/address.py | Zechee/flask-commodity | 14f586f918a4a84ee9f8a79dc4bea1bb323b2d05 | [
"MIT"
] | null | null | null | schemas/address.py | Zechee/flask-commodity | 14f586f918a4a84ee9f8a79dc4bea1bb323b2d05 | [
"MIT"
] | null | null | null | from ma import ma
from models.address import AddressModel
class AddressSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = AddressModel
dump_only = ("id")
include_relationships = True
include_fk = True
load_instance = True
| 19.428571 | 45 | 0.669118 |
c898a4865b1f97d65088d84cac1805eb2199d4ec | 8,847 | py | Python | tensorflow/contrib/learn/python/learn/estimators/svm.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 8 | 2017-04-20T18:08:52.000Z | 2021-10-21T11:19:02.000Z | tensorflow/contrib/learn/python/learn/estimators/svm.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/svm.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 9 | 2017-02-02T03:29:29.000Z | 2021-02-10T17:04:21.000Z | # Copyright 2016 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... | 41.535211 | 84 | 0.695151 |
c898a613515a063a2d71c96f92453af55f016189 | 43,394 | py | Python | novaclient/v2/servers.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/novaclient/v2/servers.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/novaclient/v2/servers.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | 34.938808 | 79 | 0.575909 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.