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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21e6a5d3fd0c146b9f7f1b35b70302a1e6b0c423 | 1,718 | py | Python | 2020/16/a.py | cj-wong/advent | f6a489773f488f5daf49caa9d652b1886608b928 | [
"MIT"
] | null | null | null | 2020/16/a.py | cj-wong/advent | f6a489773f488f5daf49caa9d652b1886608b928 | [
"MIT"
] | null | null | null | 2020/16/a.py | cj-wong/advent | f6a489773f488f5daf49caa9d652b1886608b928 | [
"MIT"
] | null | null | null | import re
from collections import defaultdict
from typing import List
import config
RULE_RE = re.compile(r'^[a-z]+: [0-9].*$')
def find_sum_all_invalid_values(notes: List[str]) -> int:
"""Parse train ticket for validity and add all invalid values.
Ignore your own ticket for this function.
Args:
... | 26.84375 | 73 | 0.576251 |
21e6c105cf2e8bc04ba2e6b593fe2fbfafed802a | 4,474 | py | Python | babynames.py | xilix5688/StanCode | 12041459f04c0fe20917dcec3cfff4ed4ae682f3 | [
"MIT"
] | null | null | null | babynames.py | xilix5688/StanCode | 12041459f04c0fe20917dcec3cfff4ed4ae682f3 | [
"MIT"
] | null | null | null | babynames.py | xilix5688/StanCode | 12041459f04c0fe20917dcec3cfff4ed4ae682f3 | [
"MIT"
] | null | null | null | """
SC101 Baby Names Project
Adapted from Nick Parlante's Baby Names assignment by
Jerry Liao.
"""
import sys
def add_data_for_name(name_data, year, rank, name):
"""
Adds the given year and rank to the associated name in the name_data dict.
Input:
name_data (dict): dict holding baby name data
... | 30.855172 | 84 | 0.63992 |
21e6c3c9732f808c408af32433dc32c7aef02a5a | 12,907 | py | Python | coffea/nanoevents/methods/nanoaod.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 77 | 2019-06-09T14:23:33.000Z | 2022-03-22T21:34:01.000Z | coffea/nanoevents/methods/nanoaod.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 353 | 2019-06-05T23:54:39.000Z | 2022-03-31T21:21:47.000Z | coffea/nanoevents/methods/nanoaod.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 71 | 2019-06-07T02:04:11.000Z | 2022-03-05T21:03:45.000Z | """Mixins for the CMS NanoAOD schema"""
import awkward
from coffea.nanoevents.methods import base, vector, candidate
behavior = {}
behavior.update(base.behavior)
# vector behavior is included in candidate behavior
behavior.update(candidate.behavior)
class _NanoAODEvents(behavior["NanoEvents"]):
def __repr__(sel... | 27.0587 | 107 | 0.670334 |
21e6d8e3ecfebd2af725d2547b293985def702cc | 1,030 | py | Python | depth_first_search/302_smallest_rectangle_enclosing_black_pixels.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | depth_first_search/302_smallest_rectangle_enclosing_black_pixels.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | depth_first_search/302_smallest_rectangle_enclosing_black_pixels.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | class Solution(object):
def __init__(self):
self.top = None
self.bottom = None
self.left = None
self.right = None
def minArea(self, image, x, y):
"""
:type image: List[List[str]]
:type x: int
:type y: int
:rtype: int
"""
i... | 25.121951 | 93 | 0.438835 |
21e6f4353e56c42ab1954491ce18ab7da1e147b1 | 107 | py | Python | app/asgi.py | dixonwhitmire/fastapi-template | eb67b80420c9fe6265190ca1003f18859709fe58 | [
"Apache-2.0"
] | null | null | null | app/asgi.py | dixonwhitmire/fastapi-template | eb67b80420c9fe6265190ca1003f18859709fe58 | [
"Apache-2.0"
] | null | null | null | app/asgi.py | dixonwhitmire/fastapi-template | eb67b80420c9fe6265190ca1003f18859709fe58 | [
"Apache-2.0"
] | null | null | null | """
asgi.py
Loads the app attribute for ASGI processing
"""
from app.main import get_app
app = get_app()
| 11.888889 | 43 | 0.719626 |
21e71e3aaf9555e52a4f9e15912eb52dc3632eb3 | 228 | py | Python | informant/__init__.py | rovanleeuwen/informant | fc1da2bfb166620f81aab78b3418ada90f7be083 | [
"Apache-2.0"
] | null | null | null | informant/__init__.py | rovanleeuwen/informant | fc1da2bfb166620f81aab78b3418ada90f7be083 | [
"Apache-2.0"
] | null | null | null | informant/__init__.py | rovanleeuwen/informant | fc1da2bfb166620f81aab78b3418ada90f7be083 | [
"Apache-2.0"
] | null | null | null | import gettext
#: Version information (major, minor, revision[, 'dev']).
version_info = (0, 0, 2)
#: Version string 'major.minor.revision'.
version = __version__ = ".".join(map(str, version_info))
gettext.install('informant')
| 25.333333 | 57 | 0.70614 |
21e73cb9f97ea39809765f59ceebdbb52f6486a4 | 8,342 | py | Python | python/openassetio/hostAPI/transactions.py | carmenpinto/OpenAssetIO | 62e6f30f658684e4ea73bf4aa3b0156399989c89 | [
"Apache-2.0"
] | null | null | null | python/openassetio/hostAPI/transactions.py | carmenpinto/OpenAssetIO | 62e6f30f658684e4ea73bf4aa3b0156399989c89 | [
"Apache-2.0"
] | null | null | null | python/openassetio/hostAPI/transactions.py | carmenpinto/OpenAssetIO | 62e6f30f658684e4ea73bf4aa3b0156399989c89 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013-2021 The Foundry Visionmongers 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 app... | 36.427948 | 91 | 0.685687 |
21e752d63c4310e555a3316263296e29ad273dfc | 15,534 | py | Python | myia/compile/transform.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | myia/compile/transform.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | myia/compile/transform.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Transforms a graph into lower-level code."""
from .. import xtype
from ..abstract import AbstractHandle, AbstractTuple, to_abstract
from ..ir import Apply, Constant, Graph, toposort
from ..operations import Primitive, primitives as P
from ..utils import SymbolicKeyInstance
from .vm import FinalVM
i64 = xtype.Int[6... | 33.121535 | 79 | 0.486353 |
21e7551393a2a151a24cacda7c516ab4fc8f5949 | 257 | py | Python | artemis/general/global_names.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 235 | 2016-08-26T14:18:51.000Z | 2022-03-13T10:54:39.000Z | artemis/general/global_names.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 112 | 2016-04-30T11:48:38.000Z | 2021-01-12T20:17:32.000Z | artemis/general/global_names.py | peteroconnor-bc/artemis | ad2871fae7d986bf10580eec27aee5b7315adad5 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2016-11-05T19:09:19.000Z | 2021-09-13T07:35:40.000Z | import itertools
_NAME_GENERATORS = {}
def create_global_name(format_str):
if format_str not in _NAME_GENERATORS:
_NAME_GENERATORS[format_str] = (format_str.format(i) for i in itertools.count(0))
return next(_NAME_GENERATORS[format_str])
| 25.7 | 89 | 0.758755 |
21e775b7a5f85d9aefbd8877fbee365469f6aa89 | 27,399 | py | Python | tests/functional/test_lambda_trigger_events.py | jamesls/aws-lambda-powertools-python | 52314e6d3b002d2d8bbacf3d1348e161b8e727b2 | [
"MIT-0"
] | null | null | null | tests/functional/test_lambda_trigger_events.py | jamesls/aws-lambda-powertools-python | 52314e6d3b002d2d8bbacf3d1348e161b8e727b2 | [
"MIT-0"
] | null | null | null | tests/functional/test_lambda_trigger_events.py | jamesls/aws-lambda-powertools-python | 52314e6d3b002d2d8bbacf3d1348e161b8e727b2 | [
"MIT-0"
] | null | null | null | import base64
import json
import os
from secrets import compare_digest
from urllib.parse import quote_plus
from aws_lambda_powertools.utilities.data_classes import (
ALBEvent,
APIGatewayProxyEvent,
APIGatewayProxyEventV2,
CloudWatchLogsEvent,
EventBridgeEvent,
KinesisStreamEvent,
S3Event,
... | 43.216088 | 120 | 0.741158 |
21e77c8a399dfccb63ed30c5a0a39f7bb369bfa1 | 737 | py | Python | supriya/ugens/MidEQ.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/MidEQ.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/MidEQ.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import collections
from supriya import CalculationRate
from supriya.ugens.Filter import Filter
class MidEQ(Filter):
"""
A parametric filter.
::
>>> source = supriya.ugens.In.ar(bus=0)
>>> mid_eq = supriya.ugens.MidEQ.ar(
... db=0,
... frequency=440,
... ... | 21.676471 | 81 | 0.572592 |
21e7f488e112ec39aa00358c177c26abbac1c129 | 12,319 | py | Python | python/ct/client/monitor.py | San3132308912/certificate-transparency | 16bbaac317c6daff057ab7214852fc8d9d89dccd | [
"Apache-2.0"
] | null | null | null | python/ct/client/monitor.py | San3132308912/certificate-transparency | 16bbaac317c6daff057ab7214852fc8d9d89dccd | [
"Apache-2.0"
] | null | null | null | python/ct/client/monitor.py | San3132308912/certificate-transparency | 16bbaac317c6daff057ab7214852fc8d9d89dccd | [
"Apache-2.0"
] | null | null | null | import itertools
import gflags
import logging
import os
from ct.client import log_client
from ct.client import state
from ct.client import temp_db
from ct.crypto import error
from ct.crypto import merkle
from ct.proto import client_pb2
FLAGS = gflags.FLAGS
gflags.DEFINE_integer("entry_write_batch_size", 1000, "Maxim... | 43.224561 | 80 | 0.617745 |
21e813862867fa55386512b190fd1f48727c0176 | 4,573 | py | Python | master/Code_McCaffreyCNTK0218/seeds_dnn.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | master/Code_McCaffreyCNTK0218/seeds_dnn.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | master/Code_McCaffreyCNTK0218/seeds_dnn.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | # seeds_dnn.py
# classify wheat seed variety
import numpy as np
import cntk as C
def create_reader(path, is_training, input_dim, output_dim):
strm_x = C.io.StreamDef(field='properties',
shape=input_dim, is_sparse=False)
strm_y = C.io.StreamDef(field='variety',
shape=output_dim, is_sparse=False)
streams ... | 31.756944 | 88 | 0.6733 |
21e820d8fc16c904505fd56452e50bc917009e19 | 22,572 | py | Python | pysoa/server/autoreload.py | arareko/pysoa | a90e428558500cf692f7f6e33fd358dd2779c328 | [
"Apache-2.0"
] | 91 | 2017-05-08T22:41:33.000Z | 2022-02-09T11:37:07.000Z | pysoa/server/autoreload.py | arareko/pysoa | a90e428558500cf692f7f6e33fd358dd2779c328 | [
"Apache-2.0"
] | 63 | 2017-06-14T20:08:49.000Z | 2021-06-16T23:08:25.000Z | pysoa/server/autoreload.py | arareko/pysoa | a90e428558500cf692f7f6e33fd358dd2779c328 | [
"Apache-2.0"
] | 26 | 2017-10-13T23:23:13.000Z | 2022-01-11T16:58:17.000Z | """
Autoreloading Launcher
Borrowed/adapted from Django Autoreload Utility (https://github.com/django/django/...autoreload.py)
Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org).
Some taken from Ian Bicking's Paste (http://pythonpaste.org/).
Portions copyright (c) 2004, CherryPy Team (team@che... | 47.025 | 120 | 0.664939 |
21e8282103776a8df659c5714db9bbe5cba22545 | 8,608 | py | Python | catalyst/contrib/dl/callbacks/knn.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/contrib/dl/callbacks/knn.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | catalyst/contrib/dl/callbacks/knn.py | balakhonoff/catalyst | 82d904aee97045efbaef3963e36c2ce5173ddac4 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List
from math import ceil
import numpy as np
from scipy import stats
from sklearn.metrics import (
accuracy_score,
f1_score,
precision_score,
recall_score,
)
from sklearn.neighbors import NearestNeighbors
import torch
from catalyst.dl import Callback, CallbackOrder, State
... | 32.360902 | 78 | 0.539847 |
21e839c2364948b64c550bfc86b034ef14a62744 | 3,823 | py | Python | stocky-devel/stocky/rfidserver.py | cfe-lab/stocky | 6c4114551d9b61c5ba3db2c237e995fecdd2f6b3 | [
"Apache-2.0"
] | 1 | 2020-05-13T17:39:59.000Z | 2020-05-13T17:39:59.000Z | stocky-devel/stocky/rfidserver.py | cfe-lab/stocky | 6c4114551d9b61c5ba3db2c237e995fecdd2f6b3 | [
"Apache-2.0"
] | 1 | 2018-09-18T19:39:24.000Z | 2019-02-04T23:52:59.000Z | stocky-devel/stocky/rfidserver.py | cfe-lab/stocky | 6c4114551d9b61c5ba3db2c237e995fecdd2f6b3 | [
"Apache-2.0"
] | null | null | null | # The stocky RFID server main program using Flask socket
# See the runrfidserver.sh script in this directory for how to launch the program.
import typing
from geventwebsocket import websocket
import serverlib.serverconfig as serverconfig
import serverlib.commlink as commlink
import serverlib.stockyserver as stockyser... | 37.480392 | 97 | 0.712006 |
21e8686ab6b05e148bacc80418f9561ff559778c | 3,362 | py | Python | sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_linked_entities_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_linked_entities_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_linked_entities_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
FILE:... | 39.093023 | 103 | 0.678168 |
21e88a527c8239ca6e1a43cf0b2ee21b955e71e5 | 3,597 | py | Python | src/infi/instruct/string.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 2 | 2015-01-12T21:16:06.000Z | 2019-12-12T05:59:56.000Z | src/infi/instruct/string.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-02-24T09:18:00.000Z | 2021-06-16T12:55:19.000Z | src/infi/instruct/string.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-01-07T12:37:54.000Z | 2018-02-08T15:07:17.000Z | from .base import Marshal, ConstReader, FixedSizer, EMPTY_CONTEXT, MinMax
from .errors import InstructError, InvalidValueError
from ._compat import pad
PADDING_DIRECTION_NONE = 0
PADDING_DIRECTION_RIGHT = 1
PADDING_DIRECTION_LEFT = 2
PADDING_DIRECTION_BOTH = 3
def _strip(obj, dir, padding):
if dir == PADDING_D... | 43.337349 | 158 | 0.706978 |
21e88fa44c33acb08bdbda4c87a7a8417d4328c6 | 602 | py | Python | systems/playout/pb_system_3_6_b4.py | Julian-Theis/AVATAR | 24fcd6eaa26f413be528a160d865d5d7e49a780b | [
"MIT"
] | 7 | 2020-12-22T12:09:14.000Z | 2022-03-29T12:50:35.000Z | systems/playout/pb_system_3_6_b4.py | ProminentLab/AVATAR | a20c767d8739a52f538927b4ec3d528952263d5a | [
"MIT"
] | 10 | 2020-11-13T17:45:59.000Z | 2022-02-10T00:50:38.000Z | systems/playout/pb_system_3_6_b4.py | ProminentLab/AVATAR | a20c767d8739a52f538927b4ec3d528952263d5a | [
"MIT"
] | 2 | 2020-03-26T22:27:27.000Z | 2020-07-07T22:36:41.000Z | from util.playout import biased_playout_b4
import os
from conf.settings import DATA_PATH
WORK_PATH = os.path.abspath(os.getcwd())
if __name__ == "__main__":
pn = "data/systems/pb_system_3_6.pnml"
f_pop = "data/variants/pb_system_3_6_b4_pop.txt"
f_train = "data/variants/pb_system_3_6_b4_train.txt"
f_t... | 40.133333 | 115 | 0.774086 |
21e89e6fd66f1f66cbe1906dff9256dc829505ab | 2,295 | py | Python | bridger/notifications/consumers.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | bridger/notifications/consumers.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | bridger/notifications/consumers.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | from channels.db import database_sync_to_async
from django.contrib.auth import get_user_model
from django.utils import timezone
from bridger.websockets.consumers import AsyncAuthenticatedJsonWebsocketConsumer
from .models import Notification
@database_sync_to_async
def get_notification(notification_id):
return ... | 42.5 | 119 | 0.746405 |
21e89eea2204725cac9cd0425aca9e5871a27d18 | 1,335 | py | Python | kopf/structs/memos.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/structs/memos.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | kopf/structs/memos.py | ankitdobhal/kopf | 2765eda2a08e7e42195446cc23f02ba91603db53 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Union
# Used for type-checking of embedded operators, where it can have any type.
# It is usually of type `Memo` -- but the framework must not rely on that.
# `Memo`, despite inheritance from `object`, is added to enable IDE completions.
AnyMemo = Union["Memo", object]
class Memo(Dict[A... | 27.244898 | 80 | 0.605993 |
21e8a2e5ffe838d892a547d463cee91d5e3e5218 | 1,454 | py | Python | diameterOfBinaryTree.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | 1 | 2019-08-29T01:12:47.000Z | 2019-08-29T01:12:47.000Z | diameterOfBinaryTree.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | diameterOfBinaryTree.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
@project : LeetCode
@File : diameterOfBinaryTree.py
@Contact : 9824373@qq.com
@Desc :
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2020-03-10 zhan 1.0 None
'''
# Definition f... | 23.836066 | 71 | 0.568088 |
21e8a8b41d9c0f1d623bf68d88817dcd728714e9 | 3,071 | py | Python | src/htrun/host_tests_plugins/module_copy_pyocd.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 37 | 2015-09-10T13:52:40.000Z | 2021-11-17T11:53:30.000Z | src/htrun/host_tests_plugins/module_copy_pyocd.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 270 | 2015-09-09T13:00:53.000Z | 2021-12-16T17:39:05.000Z | src/htrun/host_tests_plugins/module_copy_pyocd.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 51 | 2015-09-04T13:16:47.000Z | 2021-11-18T15:40:03.000Z | #
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Flash a firmware image to a device using PyOCD."""
import os
from .host_test_plugins import HostTestPluginBase
try:
from pyocd.core.helpers import ConnectHelper
from pyocd.flash.file_programmer... | 30.71 | 87 | 0.622599 |
21e8f16a674f9e26f8c4f9d54dcfa858416f18b3 | 4,798 | py | Python | loss/mse_loss.py | zhouzhenghong-gt/self-supervised-3D-DSA-reconstruction-SSDR-network | f1d7b147636927cd798f359c36d9084c2614ceed | [
"MIT"
] | 3 | 2021-12-02T04:14:06.000Z | 2022-01-05T06:33:55.000Z | loss/mse_loss.py | zhouzhenghong-gt/self-supervised-3D-DSA-reconstruction-SSDR-network | f1d7b147636927cd798f359c36d9084c2614ceed | [
"MIT"
] | 1 | 2021-12-17T11:03:54.000Z | 2021-12-20T07:22:04.000Z | loss/mse_loss.py | zhouzhenghong-gt/self-supervised-3D-DSA-reconstructio-network | f1d7b147636927cd798f359c36d9084c2614ceed | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
import SimpleITK as sitk
def resize_image_itk(itkimage, newSize, resamplemethod=sitk.sitkNearestNeighbor):
resampler = sitk.ResampleImageFilter()
originSize = itkimage.GetSize()
originSpacing = itkimage.GetSp... | 39.327869 | 106 | 0.594831 |
21e96d4bb6df763bcff727476350955333dbd92e | 19,738 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/operations/_virtual_machine_scale_set_extensions_operations.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.447115 | 234 | 0.684821 |
21e973df554dfe12f919850841d5dadee8c76bce | 75 | py | Python | utils/__init__.py | Lorna-Liu/ultrasound_vsumm_RL | 469214c6c9ef7fb8ecdeb29b831307b5be877d5a | [
"MIT"
] | 17 | 2020-09-12T03:28:42.000Z | 2021-11-15T12:10:31.000Z | utils/__init__.py | Lorna-Liu/ultrasound_vsumm_RL | 469214c6c9ef7fb8ecdeb29b831307b5be877d5a | [
"MIT"
] | 3 | 2020-10-16T08:52:05.000Z | 2022-03-22T02:59:55.000Z | utils/__init__.py | Lorna-Liu/ultrasound_vsumm_RL | 469214c6c9ef7fb8ecdeb29b831307b5be877d5a | [
"MIT"
] | 1 | 2021-06-02T11:41:12.000Z | 2021-06-02T11:41:12.000Z | from file_process import *
from knapsack import *
from vsum_tools import *
| 18.75 | 26 | 0.8 |
21e9756da9ad64dedebc20f988692a9add3867ae | 92,188 | py | Python | pandas/tseries/tests/test_period.py | hhuuggoo/pandas | f87ab95c2ecd1be6a3e3acec8f5d81e7f3c8e4bd | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tseries/tests/test_period.py | hhuuggoo/pandas | f87ab95c2ecd1be6a3e3acec8f5d81e7f3c8e4bd | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tseries/tests/test_period.py | hhuuggoo/pandas | f87ab95c2ecd1be6a3e3acec8f5d81e7f3c8e4bd | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | """Tests suite for Period handling.
Parts derived from scikits.timeseries code, original authors:
- Pierre Gerard-Marchant & Matt Knox
- pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com
"""
from datetime import datetime, date, timedelta
from numpy.ma.testutils import assert_equal
from pandas import Timesta... | 40.046916 | 111 | 0.591986 |
21e99bb1a89b38f5b0c8152103046a1e7201456e | 1,714 | py | Python | setup.py | FernandoGaGu/Ant-Colony-Optimisation | e1a1ee27f55c63c768964e80f38020f1aef664d7 | [
"BSD-3-Clause"
] | 1 | 2021-09-09T04:14:06.000Z | 2021-09-09T04:14:06.000Z | setup.py | FernandoGaGu/Ant-Colony-Optimisation | e1a1ee27f55c63c768964e80f38020f1aef664d7 | [
"BSD-3-Clause"
] | null | null | null | setup.py | FernandoGaGu/Ant-Colony-Optimisation | e1a1ee27f55c63c768964e80f38020f1aef664d7 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import find_packages, setup
import numpy
from Cython.Build import cythonize
with open("README.md", 'r') as f:
long_description = f.read()
# python setup.py build_ext -i
setup(name='antco',
version='0.1.8',
license='BSD3',
description='Ant Colony Optimization framework',
a... | 35.708333 | 106 | 0.546674 |
21e9c44dab1f07bed51beb80ba99cb9babbef9f7 | 3,994 | py | Python | nft/nft.py | danieldrichards/NFT | 4dd031e66fa2f3949fb9bb7f434e89fdf74ac09b | [
"Ruby"
] | null | null | null | nft/nft.py | danieldrichards/NFT | 4dd031e66fa2f3949fb9bb7f434e89fdf74ac09b | [
"Ruby"
] | null | null | null | nft/nft.py | danieldrichards/NFT | 4dd031e66fa2f3949fb9bb7f434e89fdf74ac09b | [
"Ruby"
] | 1 | 2021-11-20T01:49:35.000Z | 2021-11-20T01:49:35.000Z | from os import listdir
from os.path import isfile, join, exists
from plumbum.cmd import chmod
import os
import pickle
import yaml
import datetime
__version__ = '2.4'
def absolute_filename(relative_filename):
dir_path = os.path.dirname(os.path.realpath(__file__))
if relative_filename is None:
return di... | 29.585185 | 89 | 0.643215 |
21e9c8bb687774111430b3b7d5e0c5d92d9283c1 | 1,244 | py | Python | api/terminal/terminal/apps/auth/route.py | WeBankPartners/wecube-plugins-terminal | 25e255e42f4bfe810085a94a81abb4a021aa3163 | [
"Apache-2.0"
] | 8 | 2021-05-08T02:00:28.000Z | 2021-09-10T10:46:02.000Z | api/terminal/terminal/apps/auth/route.py | WeBankPartners/wecube-plugins-terminal | 25e255e42f4bfe810085a94a81abb4a021aa3163 | [
"Apache-2.0"
] | 6 | 2021-02-02T07:58:00.000Z | 2021-08-18T02:30:10.000Z | api/terminal/terminal/apps/auth/route.py | WeBankPartners/wecube-plugins-terminal | 25e255e42f4bfe810085a94a81abb4a021aa3163 | [
"Apache-2.0"
] | 1 | 2022-02-11T13:55:29.000Z | 2022-02-11T13:55:29.000Z | # coding=utf-8
from __future__ import absolute_import
from terminal.apps.auth import controller
def add_routes(api):
# 不需要登陆
api.add_route('/terminal/v1/login', controller.Token())
api.add_route('/terminal/v1/refresh-token', controller.TokenRefresh())
# 登陆但不需要权限校验
api.add_route('/terminal/v1/use... | 46.074074 | 96 | 0.71865 |
21e9cd8f0d6562d49db160158241786d81057dcd | 369 | py | Python | rapi2awsiot_gateway/utils.py | bert386/smart-charger-cloud | ec224ed2ea0e7f6b6f842f9cc0c1e55d6fdd308c | [
"Apache-2.0"
] | null | null | null | rapi2awsiot_gateway/utils.py | bert386/smart-charger-cloud | ec224ed2ea0e7f6b6f842f9cc0c1e55d6fdd308c | [
"Apache-2.0"
] | null | null | null | rapi2awsiot_gateway/utils.py | bert386/smart-charger-cloud | ec224ed2ea0e7f6b6f842f9cc0c1e55d6fdd308c | [
"Apache-2.0"
] | null | null | null | import os
import sys
import time
import datetime
import csv
import xml.etree.ElementTree
import random, string
conf_file_name = "config.xml"
### function to generate random string for Mqtt clientid
def randomword(length):
return ''.join(random.choice(string.ascii_uppercase + string.digits) for i in range(length))... | 23.0625 | 95 | 0.769648 |
21e9df5991762f526fb958321b2a63c8e04522d3 | 1,978 | py | Python | Twitch/removeStream.py | Aggis15/T4NK0R | 05d1791e51f50bcb44c56ca936e5a11b7de21fb1 | [
"MIT"
] | null | null | null | Twitch/removeStream.py | Aggis15/T4NK0R | 05d1791e51f50bcb44c56ca936e5a11b7de21fb1 | [
"MIT"
] | null | null | null | Twitch/removeStream.py | Aggis15/T4NK0R | 05d1791e51f50bcb44c56ca936e5a11b7de21fb1 | [
"MIT"
] | null | null | null | from discord.ext import commands
from discord.commands import slash_command, Option, permissions
import json
import os
from dotenv import load_dotenv
import logging
import requests as r
load_dotenv()
# Initiate json
file = open("config.json")
data = json.load(file)
# Logging
logging.basicConfig(
filename="./logs... | 27.859155 | 93 | 0.65723 |
21e9f551288bc84a6ab39dde57b518a4c10d5419 | 2,606 | py | Python | src/data/get_data.py | shanakaChathu/churn_mlops | e6823d1aad2528b3c9886ed2e5dd4ca9f6e8952a | [
"MIT"
] | null | null | null | src/data/get_data.py | shanakaChathu/churn_mlops | e6823d1aad2528b3c9886ed2e5dd4ca9f6e8952a | [
"MIT"
] | null | null | null | src/data/get_data.py | shanakaChathu/churn_mlops | e6823d1aad2528b3c9886ed2e5dd4ca9f6e8952a | [
"MIT"
] | null | null | null | import yaml
import argparse
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
def read_params(config_path):
"""
read parameters from the params.yaml file
input: params.yaml location
output: parameters as dictionary
"""
with open(config_path) as yaml_f... | 35.69863 | 111 | 0.727552 |
21e9fdee4b5fc8ea89d5b2bfa01965c6271b9337 | 1,361 | py | Python | ExtentionPackages/pysnmp/proto/rfc3411.py | hongsofwing/PyQYT-master | 9a112d9adbf9885a8b7535b7ef7759b60a0f9a29 | [
"CNRI-Python"
] | null | null | null | ExtentionPackages/pysnmp/proto/rfc3411.py | hongsofwing/PyQYT-master | 9a112d9adbf9885a8b7535b7ef7759b60a0f9a29 | [
"CNRI-Python"
] | null | null | null | ExtentionPackages/pysnmp/proto/rfc3411.py | hongsofwing/PyQYT-master | 9a112d9adbf9885a8b7535b7ef7759b60a0f9a29 | [
"CNRI-Python"
] | null | null | null | #
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
from pysnmp.proto import rfc1157, rfc1905
readClassPDUs = {
rfc1157.GetRequestPDU.tagSet: 1,
rfc1157.GetNextRequestPDU.tagSet: 1,
rfc1905.GetRequestPDU.tagSet: ... | 24.303571 | 55 | 0.728141 |
21e9ff73a8cac9f458f1e051793f032b69c103d3 | 5,012 | py | Python | GANomaly/Coders.py | yindaheng98/GANomaly-Tensorflow | 8ba5fada15c9b8aae697b7ea5839d5c665ed0150 | [
"Apache-2.0"
] | 6 | 2019-01-16T05:22:33.000Z | 2022-01-14T11:25:30.000Z | GANomaly/Coders.py | yindaheng98/GANomaly-Tensorflow | 8ba5fada15c9b8aae697b7ea5839d5c665ed0150 | [
"Apache-2.0"
] | 3 | 2018-11-25T11:53:54.000Z | 2020-04-13T09:28:35.000Z | GANomaly/Coders.py | yindaheng98/GANomaly-Tensorflow | 8ba5fada15c9b8aae697b7ea5839d5c665ed0150 | [
"Apache-2.0"
] | 2 | 2018-10-30T13:59:42.000Z | 2018-12-26T07:38:22.000Z | import tensorflow as tf
def Encoder(x, n_hidden_channel=16, n_extra_layer=0):
"""
编码器
:param x: 输入
:param n_hidden_channel: 隐藏层通道数
:param n_extra_layer: 额外层层数
:return: 输出
"""
shape = x.get_shape().as_list()
channel = x.get_shape().as_list()[3]
shape = shape[1]
assert x.get... | 42.474576 | 112 | 0.621109 |
21ea1c8cee7a14c8bd0f7781f0dfd425b6c20cf6 | 9,626 | py | Python | lib/MapManager.py | brennerm/EvolutronicLife | 5f8bef5dea8f64fb3e76889d9c600962400558cd | [
"MIT"
] | 4 | 2015-12-12T03:11:23.000Z | 2018-02-18T18:39:44.000Z | lib/MapManager.py | brennerm/EvolutronicLife | 5f8bef5dea8f64fb3e76889d9c600962400558cd | [
"MIT"
] | null | null | null | lib/MapManager.py | brennerm/EvolutronicLife | 5f8bef5dea8f64fb3e76889d9c600962400558cd | [
"MIT"
] | 2 | 2016-06-12T20:30:16.000Z | 2018-05-12T15:32:19.000Z | # -*- coding: utf-8 -*-
from Tile import Tile
from Entities import *
import globals as global_vars
_entity_dict = {
"ʷ": Vegetation,
"ʬ": Vegetation,
"Y": Vegetation,
'Ϋ': RainForest,
'ϔ': RainForest,
"җ": SmallHerbivore,
"Җ": BigHerbivore,
"Ӝ": SmartHerbivore,
"ԅ": SmallCarnivore,... | 32.741497 | 98 | 0.614274 |
21ea526a885a2c05c16dac03020428a40e73d2f4 | 5,792 | py | Python | tests/test_lib_cli.py | kusanagi/kusanagi-sdk-python | 4fd6843f39fa271afc7588b5ec58e7758b09fd61 | [
"MIT"
] | 1 | 2022-02-24T19:02:28.000Z | 2022-02-24T19:02:28.000Z | tests/test_lib_cli.py | jeronimoalbi/kusanagi-sdk-python | 4fd6843f39fa271afc7588b5ec58e7758b09fd61 | [
"MIT"
] | null | null | null | tests/test_lib_cli.py | jeronimoalbi/kusanagi-sdk-python | 4fd6843f39fa271afc7588b5ec58e7758b09fd61 | [
"MIT"
] | 1 | 2021-05-16T17:40:21.000Z | 2021-05-16T17:40:21.000Z | # Python 3 SDK for the KUSANAGI(tm) framework (http://kusanagi.io)
# Copyright (c) 2016-2021 KUSANAGI S.L. All rights reserved.
#
# Distributed under the MIT license.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
import pytest
def test_l... | 33.287356 | 87 | 0.645028 |
21ea576b43c3bc3e072e1e9b4a4b473b2aca2fd3 | 9,362 | py | Python | docs/conf.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 231 | 2016-05-30T02:34:45.000Z | 2022-03-28T17:00:29.000Z | docs/conf.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 77 | 2016-03-23T16:28:34.000Z | 2021-09-30T22:08:03.000Z | docs/conf.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 103 | 2016-08-10T19:53:09.000Z | 2022-03-16T16:34:38.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# supplychainpy documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 5 19:12:15 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in thi... | 32.171821 | 81 | 0.719932 |
21ea6c8eadc8aacd21dfe79f2f3f7c77973cfcf2 | 754 | py | Python | python/p1042.py | forewing/lc | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | [
"CC0-1.0"
] | null | null | null | python/p1042.py | forewing/lc | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | [
"CC0-1.0"
] | null | null | null | python/p1042.py | forewing/lc | 314468a1a3bb7d38eccf1f34b0d1b7da04a34784 | [
"CC0-1.0"
] | null | null | null | class Solution:
def gardenNoAdj(self, n: int, paths: List[List[int]]) -> List[int]:
self.map = [0] * n
self.edges = [[] for _ in range(n)]
for path in paths:
self.edges[path[0]-1].append(path[1]-1)
self.edges[path[1]-1].append(path[0]-1)
self.n = n
s... | 24.322581 | 71 | 0.480106 |
21ea8c2fae3ab7e05de5de146e294cc53d5bc799 | 12,204 | py | Python | tests/test_translator.py | zheya08/adx-db-api | 2b9e6cde94eabc464fa78d257b50480248eb43fb | [
"Apache-2.0"
] | 2 | 2021-11-16T15:06:19.000Z | 2021-12-15T02:59:48.000Z | tests/test_translator.py | zheya08/adx-db-api | 2b9e6cde94eabc464fa78d257b50480248eb43fb | [
"Apache-2.0"
] | null | null | null | tests/test_translator.py | zheya08/adx-db-api | 2b9e6cde94eabc464fa78d257b50480248eb43fb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from adx_db.parse import parse
from .context import translate
class TranslationTestSuite(unittest.TestCase):
"""
some test cases are from https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/sqlcheatsheet
"""
def test_select_column(self):
... | 38.498423 | 307 | 0.617175 |
21ea9f6661d14c7365121990b6c7ac3754818496 | 4,720 | py | Python | submarine-sdk/pysubmarine/submarine/experiment/exceptions.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | null | null | null | submarine-sdk/pysubmarine/submarine/experiment/exceptions.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | null | null | null | submarine-sdk/pysubmarine/submarine/experiment/exceptions.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 1 | 2022-03-14T02:36:21.000Z | 2022-03-14T02:36:21.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 use ... | 36.030534 | 289 | 0.623517 |
21eaa4300e6936195a6720189d9870075c97269c | 4,414 | py | Python | gym_tensorflow/tf_env.py | chenyu93/ape-x | a98bb0d0e3f451f6443adedfdd47e8351e312f35 | [
"Apache-2.0"
] | 185 | 2018-08-29T00:10:40.000Z | 2022-03-23T04:51:20.000Z | gym_tensorflow/tf_env.py | chenyu93/ape-x | a98bb0d0e3f451f6443adedfdd47e8351e312f35 | [
"Apache-2.0"
] | 5 | 2018-09-03T19:08:30.000Z | 2020-02-19T14:10:02.000Z | gym_tensorflow/tf_env.py | chenyu93/ape-x | a98bb0d0e3f451f6443adedfdd47e8351e312f35 | [
"Apache-2.0"
] | 23 | 2018-08-29T22:40:36.000Z | 2022-03-01T08:25:28.000Z | '''
Copyright (c) 2018 Uber Technologies, 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 writ... | 34.484375 | 156 | 0.655641 |
21eab204a4066be9b2b739a25afbbf02dc8fbcc1 | 1,342 | py | Python | proxy/http/codes.py | GDGSNF/proxy.py | 3ee2824217286df3c108beadf3185eee35c28b49 | [
"BSD-3-Clause"
] | null | null | null | proxy/http/codes.py | GDGSNF/proxy.py | 3ee2824217286df3c108beadf3185eee35c28b49 | [
"BSD-3-Clause"
] | null | null | null | proxy/http/codes.py | GDGSNF/proxy.py | 3ee2824217286df3c108beadf3185eee35c28b49 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | 26.84 | 86 | 0.564083 |
21eacd5c1fa68bcf5b7beedabe8fb4fd2ae7201c | 2,141 | py | Python | app/tests/checkout_backend/test_commands.py | jcazallasc/lana-python-challenge | 134ef30b6dcc7c323c90df8992b194741f071d95 | [
"MIT"
] | null | null | null | app/tests/checkout_backend/test_commands.py | jcazallasc/lana-python-challenge | 134ef30b6dcc7c323c90df8992b194741f071d95 | [
"MIT"
] | null | null | null | app/tests/checkout_backend/test_commands.py | jcazallasc/lana-python-challenge | 134ef30b6dcc7c323c90df8992b194741f071d95 | [
"MIT"
] | null | null | null | import csv
from django.core.management import call_command
from django.test import TestCase
from checkout_backend.adapters.django.offer_repository import DjangoOfferRepository
from checkout_backend.adapters.django.product_repository import DjangoProductRepository
from checkout_backend.management.commands.utils import... | 28.171053 | 87 | 0.667445 |
21eada7ba672c36b2fa34d8c8b2972ada044f372 | 847 | py | Python | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.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 ... | 44.578947 | 114 | 0.651712 |
21eb000cdd72f2f00d23a8d65931fa3382deae79 | 5,915 | py | Python | src/compas/geometry/_primitives/ellipse.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | 2 | 2021-03-17T18:14:22.000Z | 2021-09-19T13:50:02.000Z | src/compas/geometry/_primitives/ellipse.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | src/compas/geometry/_primitives/ellipse.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
# from math import pi
from compas.geometry._primitives import Primitive
from compas.geometry._primitives import Plane
__all__ = ['Ellipse']
class Ellipse(Primitive):
"""A ellipse is defined by a plane ... | 27.769953 | 117 | 0.507523 |
21eb0142345755c518434887ad53e3986ae41455 | 4,923 | py | Python | exatrkx/src/tfgraphs/utils.py | sbconlon/exatrkx-iml2020 | 5101a3bae5a15e8e0557837a8d0b9fd9e122a026 | [
"Apache-2.0"
] | 6 | 2020-10-27T21:42:27.000Z | 2021-04-18T02:06:30.000Z | exatrkx/src/tfgraphs/utils.py | sbconlon/exatrkx-iml2020 | 5101a3bae5a15e8e0557837a8d0b9fd9e122a026 | [
"Apache-2.0"
] | null | null | null | exatrkx/src/tfgraphs/utils.py | sbconlon/exatrkx-iml2020 | 5101a3bae5a15e8e0557837a8d0b9fd9e122a026 | [
"Apache-2.0"
] | 6 | 2020-11-04T23:45:10.000Z | 2021-03-26T09:06:00.000Z | import matplotlib.pyplot as plt
import sklearn.metrics
import networkx as nx
import numpy as np
import pandas as pd
fontsize=16
minor_size=14
def get_pos(Gp):
pos = {}
for node in Gp.nodes():
r, phi, z = Gp.nodes[node]['pos'][:3]
x = r * np.cos(phi)
y = r * np.sin(phi)
pos[nod... | 36.466667 | 110 | 0.617713 |
21eb145ef8c5990076c8f0bc82184329a11efdd1 | 441 | py | Python | maquinaria/maquinas/views/maquinas.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/maquinas/views/maquinas.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/maquinas/views/maquinas.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | """Vista de maquinas"""
#Django REST Framework
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
#Serializers
from maquinaria.maquinas.serializers import MaquinaModelSerializer
#Models
from maquinaria.maquinas.models import Maquina
class MaquinaViewSet(viewsets.ModelViewSet... | 25.941176 | 66 | 0.839002 |
21eb392ef203202a0c13a274574b3570f4b6a3fc | 269 | py | Python | tql/utils/string/replace.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | tql/utils/string/replace.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | tql/utils/string/replace.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
__title__ = 'replace'
__author__ = 'JieYuan'
__mtime__ = '2019-05-06'
"""
def replace(s, dic):
return s.translate(str.maketrans(dic))
if __name__ == '__main__':
print(replace('abcd', {'a': '8', 'd': '88'}))
| 15.823529 | 49 | 0.591078 |
21eb7698c916ac0f319108d21bbfe601777aff72 | 24,069 | py | Python | kivy/uix/actionbar.py | hakanardo/kivy | 707b4aa35bfb79577bd87dfc23aa527f0eb03640 | [
"MIT"
] | 317 | 2015-07-30T07:47:41.000Z | 2022-03-30T00:38:39.000Z | kivy/uix/actionbar.py | hakanardo/kivy | 707b4aa35bfb79577bd87dfc23aa527f0eb03640 | [
"MIT"
] | 42 | 2015-07-30T10:32:46.000Z | 2021-11-23T02:44:47.000Z | kivy/uix/actionbar.py | hakanardo/kivy | 707b4aa35bfb79577bd87dfc23aa527f0eb03640 | [
"MIT"
] | 69 | 2015-08-04T03:27:30.000Z | 2021-12-27T09:53:26.000Z | '''
Action Bar
==========
.. versionadded:: 1.8.0
.. image:: images/actionbar.png
:align: right
The ActionBar widget is like Android's ActionBar, where items are stacked
horizontally.
The :class:`ActionBar` will contain one :class:`ActionView` and many
:class:`ContextualActionView`\s.
An :class:`ActionView` wil... | 33.662937 | 79 | 0.641364 |
21eb7faf78eb46dbe8f68eed1255a466d10cd409 | 19,081 | py | Python | oscar/lib/python2.7/site-packages/pygments/lexers/hdl.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pygments/lexers/hdl.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pygments/lexers/hdl.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, inc... | 49.819843 | 109 | 0.449348 |
21eb994f3b369c32a9877557a62398ae0ee4ec62 | 4,405 | py | Python | nicos_mlz/panda/devices/satbox.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/panda/devices/satbox.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/panda/devices/satbox.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 37.330508 | 79 | 0.590238 |
21ebbe7f875a5a3253f537b2d2e3db4897a002f7 | 17,792 | py | Python | hard-gists/8d1a9b14d4e9a9080ab4752608c2de61/snippet.py | dockerizeme/dockerizeme | 408f3fa3d36542d8fc1236ba1cac804de6f14b0c | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/8d1a9b14d4e9a9080ab4752608c2de61/snippet.py | dockerizeme/dockerizeme | 408f3fa3d36542d8fc1236ba1cac804de6f14b0c | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/8d1a9b14d4e9a9080ab4752608c2de61/snippet.py | dockerizeme/dockerizeme | 408f3fa3d36542d8fc1236ba1cac804de6f14b0c | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
###############################################################################
# This script uploads a file to an AWS S3 bucket. It will optionally use KMS
# envelope encryption to encrypt a file on the client side before uploading
# to AWS S3.
#
# Envelope encryption fetches a data key from KMS... | 45.620513 | 106 | 0.582228 |
21ebc1a2c9e92d744e2e9de84f93455f855778f7 | 2,779 | py | Python | experiments/vitchyr/nips2018/rl_with_full_state/full_state_sawyer_reach/sparse_her_td3.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/nips2018/rl_with_full_state/full_state_sawyer_reach/sparse_her_td3.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/nips2018/rl_with_full_state/full_state_sawyer_reach/sparse_her_td3.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import rlkit.misc.hyperparameter as hyp
from rlkit.data_management.her_replay_buffer import RelabelingReplayBuffer
from rlkit.envs.mujoco.sawyer_gripper_env import SawyerXYEnv
from rlkit.envs.mujoco.sawyer_reach_env import SawyerReachXYEnv
from rlkit.launchers.experiments.vitchyr.multitask import her_td3_experiment
fro... | 30.538462 | 100 | 0.571788 |
21ebfa1ebb44559b8fc79808d2c1311d1dd5f66d | 1,751 | py | Python | test/unit/gen_libs/validate_date.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | test/unit/gen_libs/validate_date.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | test/unit/gen_libs/validate_date.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: validate_date.py
Description: Unit testing of validate_date in gen_libs.py.
Usage:
test/unit/gen_libs/validate_date.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
import... | 17 | 79 | 0.632781 |
21ec11444aa7b76a2a18608fcaecb63ac085348f | 7,189 | py | Python | Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import json
import logging
import sys
import os
from webkitpy.benchmark_runner.benchmark_builder import BenchmarkBuilder
from webkitpy.benchmark_runner.benchmark_results import BenchmarkResults
from webkitpy.benchmark_runner.browser_driver.browser_driver_factory import BrowserDriverFactory
if ... | 42.791667 | 200 | 0.607178 |
21ec17e8a90267aa75a79b267dc8746f615d47eb | 9,644 | py | Python | tests/test_argparse.py | scartill/cmd2 | 1b4e1e25f84bcc800a5f369783c3c3448a42361e | [
"MIT"
] | 1 | 2021-07-06T23:59:46.000Z | 2021-07-06T23:59:46.000Z | tests/test_argparse.py | scartill/cmd2 | 1b4e1e25f84bcc800a5f369783c3c3448a42361e | [
"MIT"
] | null | null | null | tests/test_argparse.py | scartill/cmd2 | 1b4e1e25f84bcc800a5f369783c3c3448a42361e | [
"MIT"
] | null | null | null | # coding=utf-8
# flake8: noqa E302
"""
Cmd2 testing for argument parsing
"""
import argparse
import pytest
import cmd2
from cmd2.utils import StdSim
from .conftest import run_cmd
# Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit)
try:
import gnureadline as re... | 35.586716 | 104 | 0.66881 |
21ec1c9577501d85c36b5a876e70d7d7cfebd12f | 3,861 | py | Python | portal/apps/photologue_ladiaria/migrations/0001_initial.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/apps/photologue_ladiaria/migrations/0001_initial.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/apps/photologue_ladiaria/migrations/0001_initial.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-08-20 04:12
from __future__ import unicode_literals
import core.utils
from django.db import migrations, models
import django.db.models.deletion
import photologue.models
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 52.175676 | 218 | 0.617198 |
21ec60e793fc857fe915137673d2659bf35b0a03 | 2,953 | py | Python | steps/validation.py | chris414862/TrilingualLossProj | fead084748b5391e8558167466844368ef5293ab | [
"BSD-3-Clause"
] | null | null | null | steps/validation.py | chris414862/TrilingualLossProj | fead084748b5391e8558167466844368ef5293ab | [
"BSD-3-Clause"
] | null | null | null | steps/validation.py | chris414862/TrilingualLossProj | fead084748b5391e8558167466844368ef5293ab | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
import time
from collections import defaultdict
from .utils.validation_utils import curate_and_print_recalls, curate_and_print_recalls
from .utils.general_utils import get_target_multiling_data
def validate(image_model,audio_models, val_loader, device, args):
if device is None... | 42.797101 | 160 | 0.675246 |
21ec66458d8213284a7d562431e124f5bafeb7ba | 1,203 | py | Python | aeronet/dataset/utils.py | BarzaH/aeronetlib | 542382737ed1fada0fca50ad061e46d7993e7e65 | [
"MIT"
] | null | null | null | aeronet/dataset/utils.py | BarzaH/aeronetlib | 542382737ed1fada0fca50ad061e46d7993e7e65 | [
"MIT"
] | null | null | null | aeronet/dataset/utils.py | BarzaH/aeronetlib | 542382737ed1fada0fca50ad061e46d7993e7e65 | [
"MIT"
] | null | null | null | import os
import re
import glob
from warnings import warn
def parse_directory(directory, names, extensions=('tif', 'tiff', 'TIF', 'TIFF')):
"""
Extract necessary filenames
Args:
directory: str
names: tuple of str, band or file names, e.g. ['RED', '101']
extensions: tuple of str, al... | 37.59375 | 120 | 0.610141 |
21ecb6ad2cc1ebc75e5a7854f54aac9d97770d5a | 10,404 | py | Python | geosoft/gxapi/GX3DN.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 25 | 2017-07-14T06:39:37.000Z | 2022-03-09T21:39:51.000Z | geosoft/gxapi/GX3DN.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 100 | 2016-12-13T17:30:41.000Z | 2021-08-01T20:21:13.000Z | geosoft/gxapi/GX3DN.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 28 | 2016-12-12T17:34:40.000Z | 2022-03-16T15:39:39.000Z | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### end... | 27.378947 | 197 | 0.59506 |
21ecc5d0085758d58c0b784d3054d9a81db0e093 | 806 | py | Python | info_proj/manage.py | adamkwolf/handwriting_cnn | 83cee31622b98f95660e5f09b9d4cf4f53b519ba | [
"Apache-2.0"
] | 1 | 2020-07-23T11:43:06.000Z | 2020-07-23T11:43:06.000Z | info_proj/manage.py | adamkwolf/handwriting_cnn | 83cee31622b98f95660e5f09b9d4cf4f53b519ba | [
"Apache-2.0"
] | 30 | 2020-07-27T14:32:43.000Z | 2020-12-10T12:53:35.000Z | manage.py | fjThomasStanley/AutisticaPlatformPrototype | c846103af043dfd436d8c5ec5c53ea226d3d5ea0 | [
"MIT"
] | 5 | 2020-07-23T12:07:35.000Z | 2020-08-28T10:41:07.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main_app.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... | 35.043478 | 77 | 0.64268 |
21ecffdabfc03d0d76990a5afb95801cf7f4b2a1 | 4,942 | py | Python | search_params.py | jercoco/QSQF | 6c435f8d4e1baf1937b06a52e63446f9a29f5ad8 | [
"Apache-2.0"
] | null | null | null | search_params.py | jercoco/QSQF | 6c435f8d4e1baf1937b06a52e63446f9a29f5ad8 | [
"Apache-2.0"
] | null | null | null | search_params.py | jercoco/QSQF | 6c435f8d4e1baf1937b06a52e63446f9a29f5ad8 | [
"Apache-2.0"
] | null | null | null | import os
import sys
#import math
import json
import logging
import multiprocessing
from copy import copy
from itertools import product
from subprocess import check_call
import numpy as np
import utils
import pickle
import time
logger = logging.getLogger('DeepAR.Searcher')
utils.set_logger('param_search.log')
PYTHO... | 35.811594 | 107 | 0.638608 |
21ed317de487dea8e7e2a3a59e9bb7f4861501e9 | 7,194 | py | Python | ocrCore.py | alset333/PDFImagesOCR | ffaf79a3d32cdfabed2ffc57167929bd795f5407 | [
"BSD-3-Clause"
] | 2 | 2016-02-04T18:43:12.000Z | 2020-04-03T03:08:32.000Z | ocrCore.py | alset333/PDFImagesOCR | ffaf79a3d32cdfabed2ffc57167929bd795f5407 | [
"BSD-3-Clause"
] | 1 | 2016-02-22T18:15:36.000Z | 2016-02-22T18:15:36.000Z | ocrCore.py | alset333/PDFImagesOCR | ffaf79a3d32cdfabed2ffc57167929bd795f5407 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import os, tempfile, shutil, platform
import time
import subprocess, multiprocessing
__author__ = 'Peter Maar'
__version__ = '0.2.0' # Doesn't let the user OCR a file again. Also, Windows support now included, but as a WIP -- Warning: Rather buggy. Does not work nearly as well as on Mac/Linux/... | 47.019608 | 229 | 0.625521 |
21ed5235629bb8174135c520edcf79fff09d060c | 12,114 | py | Python | coco_assistant/coco_assistant.py | hlydecker/COCO-Assistant | cfdacf67a3acd711eaea23f6310192f087f82f23 | [
"MIT"
] | 1 | 2020-06-27T08:34:53.000Z | 2020-06-27T08:34:53.000Z | coco_assistant/coco_assistant.py | hlydecker/COCO-Assistant | cfdacf67a3acd711eaea23f6310192f087f82f23 | [
"MIT"
] | null | null | null | coco_assistant/coco_assistant.py | hlydecker/COCO-Assistant | cfdacf67a3acd711eaea23f6310192f087f82f23 | [
"MIT"
] | null | null | null | import ast
import json
import logging
import os
import shutil
from pycocotools.coco import COCO
from tqdm import tqdm
from . import coco_stats as stats
from . import coco_visualiser as cocovis
from coco_assistant.utils import *
logging.basicConfig(level=logging.ERROR)
logging.getLogger().setLevel(logging.WARNING)
l... | 36.932927 | 127 | 0.571075 |
21eda5a235e5b708a9e2e093decdb41f2d614b47 | 1,676 | py | Python | savu/test/travis/plugin_tests/basic_operations/rescale_intensity_statistics_test.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | null | null | null | savu/test/travis/plugin_tests/basic_operations/rescale_intensity_statistics_test.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | null | null | null | savu/test/travis/plugin_tests/basic_operations/rescale_intensity_statistics_test.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Diamond Light Source 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 ap... | 33.52 | 86 | 0.74463 |
21edcaf19e5356026c63c55a331d6d2b442b8ec1 | 160 | py | Python | brainpywer/__init__.py | BrainPywer/BrainPywer | 6e2571f43e158b419e4cac10b7b5a39f19c874c2 | [
"MIT"
] | 3 | 2016-10-09T23:48:24.000Z | 2016-11-07T09:08:34.000Z | brainpywer/__init__.py | BrainPywer/BrainPywer | 6e2571f43e158b419e4cac10b7b5a39f19c874c2 | [
"MIT"
] | null | null | null | brainpywer/__init__.py | BrainPywer/BrainPywer | 6e2571f43e158b419e4cac10b7b5a39f19c874c2 | [
"MIT"
] | null | null | null | """
"""
__title__ = 'BrainPywer'
__author__ = 'BrainPywer Team'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-2016 BrainPywer Team'
__version__ = '0.1.0' | 20 | 53 | 0.71875 |
21edf8502f5cb83e1371f7c491c239e72f90d1ee | 3,755 | py | Python | combine_ppn_outputs_odim.py | fmidev/fmippn-merge-output | 00867cc09547f89c2ee67e314fba954698819401 | [
"MIT"
] | null | null | null | combine_ppn_outputs_odim.py | fmidev/fmippn-merge-output | 00867cc09547f89c2ee67e314fba954698819401 | [
"MIT"
] | null | null | null | combine_ppn_outputs_odim.py | fmidev/fmippn-merge-output | 00867cc09547f89c2ee67e314fba954698819401 | [
"MIT"
] | null | null | null | import os
import h5py
import argparse
import numpy as np
# Tuuli Perttula 2020
# tuuli.perttula@fmi.fi
def combine_fmippn_h5_files(f1,f2):
""" This function combines two FMIPPN HDF5 ODIM format output files.
Ensemble members from file2 are added to file1. The names of
ensemble members from file2 are modi... | 36.105769 | 118 | 0.666578 |
21edffc08da85d23f6d296b71224b54af3a383a8 | 6,765 | py | Python | packages/celer-web-app/scripts/validateimport.py | iTNTPiston/celer | 2208fc42fc24ff204ff4029be2c52f6c3034c1c2 | [
"MIT"
] | null | null | null | packages/celer-web-app/scripts/validateimport.py | iTNTPiston/celer | 2208fc42fc24ff204ff4029be2c52f6c3034c1c2 | [
"MIT"
] | null | null | null | packages/celer-web-app/scripts/validateimport.py | iTNTPiston/celer | 2208fc42fc24ff204ff4029be2c52f6c3034c1c2 | [
"MIT"
] | null | null | null | """Validation Imports"""
# There are 3 types of allowed imports
# External dependencies: react, query-string, etc
# Internal packages: app/services, ui/root, etc
# Relative directories: starting with .
# The imports should be grouped in the order of External -> Internal -> Relative
# Within each group, the imports sho... | 36.370968 | 90 | 0.586992 |
21ee069d1d80990109183b837e5979e6965aca62 | 2,269 | py | Python | h/services/user_update.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | h/services/user_update.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:38:24.000Z | 2022-03-02T05:45:01.000Z | h/services/user_update.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sqlalchemy.exc import SQLAlchemyError
from h.services.exceptions import ConflictError, ValidationError
class UserUpdateService:
def __init__(self, session):
"""
Create a new UserUpdateService
:param session: the SQLAl... | 31.957746 | 93 | 0.583517 |
21ee11095fdb772822fa2796a520a4ca22a5b5b6 | 14,240 | py | Python | src/visitpy/visit_flow/flow/src/filters/pyocl_env.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/src/filters/pyocl_env.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/src/filters/pyocl_env.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: pyocl_env.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 4/21/2012
description:... | 36.606684 | 95 | 0.567556 |
21ee30982e79207bd9c7b40230537bae4ffda8de | 3,159 | py | Python | login_system/user.py | Unicorn-Code-Inc/PyLogin | 3b8ce697f633423278e1a8969f56bf278860b8ca | [
"MIT"
] | 1 | 2020-12-31T01:13:34.000Z | 2020-12-31T01:13:34.000Z | login_system/user.py | Unicorn-Code-Inc/PyLogin | 3b8ce697f633423278e1a8969f56bf278860b8ca | [
"MIT"
] | null | null | null | login_system/user.py | Unicorn-Code-Inc/PyLogin | 3b8ce697f633423278e1a8969f56bf278860b8ca | [
"MIT"
] | null | null | null | from secrets import compare_digest
from functools import cached_property
import sqlite3
from system.data_user import User as du
from system.sql import SQLCommands as sqlc
from system.info_types import InfoTypes as it
class User:
""" A real implementation of the user data class """
def __init__(sel... | 30.669903 | 75 | 0.576132 |
21ee96c69bc9725fe3a87f13b1b9030771ef6a67 | 2,547 | py | Python | transformer/request.py | jsabak/Transformer | c96ff1bed109f114f7c69143c85ee362e5f518d1 | [
"MIT"
] | null | null | null | transformer/request.py | jsabak/Transformer | c96ff1bed109f114f7c69143c85ee362e5f518d1 | [
"MIT"
] | null | null | null | transformer/request.py | jsabak/Transformer | c96ff1bed109f114f7c69143c85ee362e5f518d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
A representation of a HAR Request.
"""
import enum
from datetime import datetime
from typing import Iterator, NamedTuple, List
from urllib.parse import urlparse, SplitResult
import pendulum
from transformer.naming import to_identifier
class HttpMethod(enum.Enum):
"""
Enumeration... | 22.539823 | 70 | 0.536317 |
21eea667cc1d2b5102d5db05d6c7230385928ce5 | 5,737 | py | Python | python/openlattice/models/app_role.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/openlattice/models/app_role.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/openlattice/models/app_role.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
"""
import pprint
import re # noqa: F401
import six
from openlattice.configuration import Configuration
... | 25.384956 | 136 | 0.559003 |
21eead1fade5f641c8117d37be72fe8f865efdd1 | 475 | py | Python | anagram.py | abkumarggn/python-learning-1 | df45396cd14f5762053728760953b3806d0069b6 | [
"Apache-2.0"
] | null | null | null | anagram.py | abkumarggn/python-learning-1 | df45396cd14f5762053728760953b3806d0069b6 | [
"Apache-2.0"
] | null | null | null | anagram.py | abkumarggn/python-learning-1 | df45396cd14f5762053728760953b3806d0069b6 | [
"Apache-2.0"
] | null | null | null | '''
str1=input("Enter the first :")
str2=input("Enter the second :")
count1=0
i=0
while(i<len(str1)):
count1=count1+ord(str1[i])
i+=1
print(count1)
count2=0
i=0
while(i<len(str2)):
count2=count2+ord(str2[i])
i=i+1
print(count2)
if(count1==count2):
print("Anagrams")
else:
print("Not Anagrams")
... | 16.37931 | 32 | 0.637895 |
21eeb5105733e531378530705a1b7dc5dd2a6beb | 2,089 | py | Python | dapper/mods/Lorenz63/mandel2016.py | myying/DAPPER | 2f92fcb5610f9b2d44bb077ac5ed5438ac5fd6b3 | [
"MIT"
] | 1 | 2022-01-03T19:08:32.000Z | 2022-01-03T19:08:32.000Z | dapper/mods/Lorenz63/mandel2016.py | myying/DAPPER | 2f92fcb5610f9b2d44bb077ac5ed5438ac5fd6b3 | [
"MIT"
] | null | null | null | dapper/mods/Lorenz63/mandel2016.py | myying/DAPPER | 2f92fcb5610f9b2d44bb077ac5ed5438ac5fd6b3 | [
"MIT"
] | null | null | null | """Settings from `bib.mandel2016hybrid`."""
import dapper.mods as modelling
from dapper.mods.Lorenz63.sakov2012 import HMM
# HMM.t = modelling.Chronology(0.01,KObs=10**5,BurnIn=500), with dkObs in [5:55].
# But it's pretty safe to shorten the BurnIn and KObs.
HMM.Obs = modelling.Operator(**{
'M': 3,
'model':... | 36.649123 | 82 | 0.588798 |
21eed341c4e8fb26b8bcfb45d0476f7f213c46a4 | 689 | py | Python | gnocchi/storage/null.py | ISCAS-VDI/gnocchi-base | c5ed96a6fb8d925702f410c1382eb36bd991443b | [
"Apache-2.0"
] | null | null | null | gnocchi/storage/null.py | ISCAS-VDI/gnocchi-base | c5ed96a6fb8d925702f410c1382eb36bd991443b | [
"Apache-2.0"
] | null | null | null | gnocchi/storage/null.py | ISCAS-VDI/gnocchi-base | c5ed96a6fb8d925702f410c1382eb36bd991443b | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2014-2015 eNovance
#
# 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... | 32.809524 | 75 | 0.750363 |
21eedea0f8dbfa08c1ebb0c8a267a46e6286ca59 | 19,369 | py | Python | deep-neuroevolution/es_distributed/es.py | Miffyli/policy-supervectors | 358284805e5bc96b95cae15e9741571e46d84bc9 | [
"MIT"
] | 17 | 2020-12-02T15:27:03.000Z | 2022-01-14T06:42:14.000Z | deep-neuroevolution/es_distributed/es.py | Miffyli/policy-supervectors | 358284805e5bc96b95cae15e9741571e46d84bc9 | [
"MIT"
] | null | null | null | deep-neuroevolution/es_distributed/es.py | Miffyli/policy-supervectors | 358284805e5bc96b95cae15e9741571e46d84bc9 | [
"MIT"
] | null | null | null | import logging
import time
from collections import namedtuple
import numpy as np
from .dist import MasterClient, WorkerClient
logger = logging.getLogger(__name__)
Config = namedtuple('Config', [
'l2coeff', 'noise_stdev', 'episodes_per_batch', 'timesteps_per_batch',
'calc_obstat_prob', 'eval_prob', 'snapsho... | 43.138085 | 153 | 0.644742 |
21eefe86f788c8a7ee764fa3fc3db28e0c501175 | 2,021 | py | Python | sjtwo-c/site_scons/site_tools/codegen/site_packages/can/interfaces/kvaser/structures.py | seanlinc/Playmate | 077877d172dd6b7beab910c52ec95ee300bc6480 | [
"Apache-2.0"
] | 2 | 2020-04-04T21:09:56.000Z | 2020-04-08T17:00:58.000Z | sjtwo-c/site_scons/site_tools/codegen/site_packages/can/interfaces/kvaser/structures.py | seanlinc/Playmate | 077877d172dd6b7beab910c52ec95ee300bc6480 | [
"Apache-2.0"
] | 13 | 2020-04-11T21:50:57.000Z | 2020-04-19T03:19:48.000Z | sjtwo-c/site_scons/site_tools/codegen/site_packages/can/interfaces/kvaser/structures.py | seanlinc/Playmate | 077877d172dd6b7beab910c52ec95ee300bc6480 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Contains Python equivalents of the structures in CANLIB's canlib.h,
with some supporting functionality specific to Python.
"""
import ctypes
class BusStatistics(ctypes.Structure):
"""
This structure is used with the method :meth:`KvaserBus.get_stats`.
.. seealso:: :meth:`KvaserBus.... | 27.310811 | 116 | 0.599208 |
21ef39007994ac324ea001380d26711ba37b507c | 16,903 | py | Python | src/rexpy/batch.py | douglasdavis/rexpy | 94eb997c7bc0e07c262555a7710c0a33e146801d | [
"BSD-3-Clause"
] | null | null | null | src/rexpy/batch.py | douglasdavis/rexpy | 94eb997c7bc0e07c262555a7710c0a33e146801d | [
"BSD-3-Clause"
] | null | null | null | src/rexpy/batch.py | douglasdavis/rexpy | 94eb997c7bc0e07c262555a7710c0a33e146801d | [
"BSD-3-Clause"
] | null | null | null | """Module for handling batch steps."""
# stdlib
import multiprocessing
import subprocess
import os
import shutil
from functools import wraps
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
# rexpy
import rexpy.pycondor as pycondor
from rexpy.confparse import (
regions_from,
system... | 26.287714 | 95 | 0.629592 |
21ef49f01ba1ff628b9a5fa29e68f1a5b9e68ac3 | 21,858 | py | Python | readthedocs/doc_builder/backends/sphinx.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 2,092 | 2019-06-29T07:47:30.000Z | 2022-03-31T14:54:59.000Z | readthedocs/doc_builder/backends/sphinx.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 2,389 | 2019-06-29T04:22:55.000Z | 2022-03-31T22:57:49.000Z | readthedocs/doc_builder/backends/sphinx.py | mehrdad-khojastefar/readthedocs.org | b958bb8d04c454324d612345890b13af54a19eb6 | [
"MIT"
] | 1,185 | 2019-06-29T21:49:31.000Z | 2022-03-30T09:57:15.000Z | """
Sphinx_ backend for building docs.
.. _Sphinx: http://www.sphinx-doc.org/
"""
import codecs
import itertools
import structlog
import os
import shutil
import zipfile
from glob import glob
from pathlib import Path
from django.conf import settings
from django.template import loader as template_loader
from django.tem... | 32.968326 | 100 | 0.560253 |
21ef5dfe903779ad6e68078729607b4d35f22493 | 13,127 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_compute_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_compute_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_compute_management_client.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 ... | 67.664948 | 861 | 0.795841 |
21ef6a8943e490f646fcb6af4f65e3812e50df4f | 11,512 | py | Python | scripts/StreamingQueryDNADatabase.py | dkoslicki/CMash | 1485a0cde4685c52ae8cfb8bdaa5d1bad77eaac3 | [
"BSD-3-Clause"
] | 35 | 2017-09-08T12:44:42.000Z | 2022-02-16T23:05:38.000Z | scripts/StreamingQueryDNADatabase.py | dkoslicki/CMash | 1485a0cde4685c52ae8cfb8bdaa5d1bad77eaac3 | [
"BSD-3-Clause"
] | 30 | 2018-07-31T04:11:18.000Z | 2020-04-17T19:40:13.000Z | scripts/StreamingQueryDNADatabase.py | dkoslicki/CMash | 1485a0cde4685c52ae8cfb8bdaa5d1bad77eaac3 | [
"BSD-3-Clause"
] | 8 | 2017-09-13T07:44:16.000Z | 2021-04-08T16:53:56.000Z | #! /usr/bin/env python
import khmer
import numpy as np
import os
import sys
import multiprocessing
import pandas as pd
import argparse
from argparse import ArgumentTypeError
import re
import matplotlib.pyplot as plt
import timeit
from itertools import islice
# The following is for ease of development (so I don't need ... | 38.630872 | 149 | 0.744006 |
21ef78cd03c0fb756c6fabcf74af5dfd5428e301 | 1,679 | py | Python | examples/chatbot/config_data.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | 2 | 2021-01-01T12:07:27.000Z | 2021-09-10T03:57:18.000Z | examples/chatbot/config_data.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | 13 | 2019-12-01T04:51:38.000Z | 2020-02-11T23:55:11.000Z | examples/chatbot/config_data.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | max_seq_length = 128
pickle_data_dir = "data/"
train_batch_size = 16
eval_batch_size = 128
test_batch_size = 128
num_train_data = 131424
max_train_epoch = 1
warmup_proportion = 0.1
display_steps = 50
eval_steps = 500 # Eval on the dev set every eval_steps; -1 to disable
feature_types = {
# Reading features from ... | 28.457627 | 71 | 0.655747 |
21ef7c451c4a6e8e17713129963b18706ad423f6 | 11,821 | py | Python | configs/wxcs/cascade_rcnn_r101_fpn_dcn_1x_wxcs.py | mgnfcnt-ec/mmdet | 46647fba610dfb396569d7910058c707d67d4ec4 | [
"Apache-2.0"
] | 1 | 2022-03-01T02:46:52.000Z | 2022-03-01T02:46:52.000Z | configs/wxcs/cascade_rcnn_r101_fpn_dcn_1x_wxcs.py | mgnfcnt-ec/mmdet | 46647fba610dfb396569d7910058c707d67d4ec4 | [
"Apache-2.0"
] | null | null | null | configs/wxcs/cascade_rcnn_r101_fpn_dcn_1x_wxcs.py | mgnfcnt-ec/mmdet | 46647fba610dfb396569d7910058c707d67d4ec4 | [
"Apache-2.0"
] | null | null | null | # fp16 settings
fp16 = dict(loss_scale=512.)
# model settings
model = dict(
type='CascadeRCNN',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', re... | 32.297814 | 86 | 0.499281 |
21ef96709a55b5fbd7600ed5ff33a3b273e49a0a | 18,592 | py | Python | test/test_sysinfo.py | provegard/diskgraph | 3dfec610164ef678ad44a4fbafa96bb2fb8bdb6a | [
"BSD-3-Clause"
] | 1 | 2021-05-12T01:42:36.000Z | 2021-05-12T01:42:36.000Z | test/test_sysinfo.py | provegard/diskgraph | 3dfec610164ef678ad44a4fbafa96bb2fb8bdb6a | [
"BSD-3-Clause"
] | null | null | null | test/test_sysinfo.py | provegard/diskgraph | 3dfec610164ef678ad44a4fbafa96bb2fb8bdb6a | [
"BSD-3-Clause"
] | null | null | null | import re
import unittest
from diskgraph.sysinfo import *
from mock import patch, MagicMock, Mock
from cStringIO import StringIO
from diskgraph.check import Checker
from subprocess import CalledProcessError
def checker_mock(b):
c = Mock(spec=Checker)
c.has_mdstat.return_value = b
c.has_df_command.return_va... | 41.5 | 127 | 0.677012 |
21efb9bba40542842d14147b6ba0d5ddb5f3d46b | 9,277 | py | Python | brax/training/learner.py | belkakari/brax | 464aff88bed7c6b805a2397ef9c8f33de66be8b9 | [
"Apache-2.0"
] | null | null | null | brax/training/learner.py | belkakari/brax | 464aff88bed7c6b805a2397ef9c8f33de66be8b9 | [
"Apache-2.0"
] | null | null | null | brax/training/learner.py | belkakari/brax | 464aff88bed7c6b805a2397ef9c8f33de66be8b9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Brax 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 by applicable law or agreed to in wri... | 42.360731 | 80 | 0.681255 |
21efe07e3d5e311599c124ac72f09197e478af0d | 714 | py | Python | python_modules/dagster-test/dagster_test/toys/log_s3.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-test/dagster_test/toys/log_s3.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-test/dagster_test/toys/log_s3.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | 1 | 2019-09-11T03:02:27.000Z | 2019-09-11T03:02:27.000Z | from dagster import AssetKey, AssetMaterialization, Field, MetadataValue, Output, pipeline, solid
@solid(
config_schema={
"bucket": Field(str, is_required=True),
"s3_key": Field(str, is_required=True),
}
)
def read_s3_key(context):
s3_key = context.solid_config["s3_key"]
bucket = conte... | 28.56 | 97 | 0.676471 |
21efff631d094e9780d518e1279c558b4501e676 | 4,448 | py | Python | alexa.py | msukmanowsky/pyalexalambda | a9d2e271408807e51198ffa63946688465a68620 | [
"MIT"
] | 1 | 2018-01-03T17:35:54.000Z | 2018-01-03T17:35:54.000Z | alexa.py | msukmanowsky/pyalexalambda | a9d2e271408807e51198ffa63946688465a68620 | [
"MIT"
] | null | null | null | alexa.py | msukmanowsky/pyalexalambda | a9d2e271408807e51198ffa63946688465a68620 | [
"MIT"
] | null | null | null | import datetime as dt
import logging
import re
from functools import wraps
from typing import Callable, Union
from threading import local
g = local()
log = logging.getLogger('alexa')
def statement(s: str, reprompt: str = None, card_title: str = None, should_end_session: bool = True) -> dict:
'''Return a plain-t... | 29.263158 | 109 | 0.574191 |
21f0139c50d566c2ab755f38e8973715c0b4baa8 | 9,876 | py | Python | fastai/vision/learner.py | richlipkin/fastai | 4ba76892da5e0a6763a6d0b47395798fcbd0016b | [
"Apache-2.0"
] | null | null | null | fastai/vision/learner.py | richlipkin/fastai | 4ba76892da5e0a6763a6d0b47395798fcbd0016b | [
"Apache-2.0"
] | null | null | null | fastai/vision/learner.py | richlipkin/fastai | 4ba76892da5e0a6763a6d0b47395798fcbd0016b | [
"Apache-2.0"
] | null | null | null | "`Learner` support for computer vision"
from ..torch_core import *
from ..basic_train import *
from ..basic_data import *
from .image import *
from . import models
from ..callback import *
from ..layers import *
from ..callbacks.hooks import *
from ..train import ClassificationInterpretation
__all__ = ['create_cnn', '... | 53.673913 | 221 | 0.683171 |
21f043093ec8ec2f2fddf47d80de112a2a343ad4 | 2,004 | py | Python | setup.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T11:31:59.000Z | 2021-01-21T11:31:59.000Z | setup.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | setup.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null |
from distutils.core import setup
import os
import itertools
import glob
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
print
print """This setup.py is not complete, it is only here"""
print """so that the docs can be built on read-the-docs."""
print """Please see the morphforg... | 27.081081 | 108 | 0.614271 |
21f0637d1127c95c22740baf7cb9366059c6e4cc | 2,111 | py | Python | tests/instagram/test_pro_models.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | null | null | null | tests/instagram/test_pro_models.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | null | null | null | tests/instagram/test_pro_models.py | Socian-Ltd/python-facebook-1 | e9a4f626b37541103c9534a29342ef6033c09c06 | [
"Apache-2.0"
] | 1 | 2021-08-25T05:34:14.000Z | 2021-08-25T05:34:14.000Z | import json
import unittest
import pyfacebook.models as models
class IgProModelTest(unittest.TestCase):
BASE_PATH = "testdata/instagram/models/"
with open(BASE_PATH + 'ig_user.json', 'rb') as f:
IG_USER = json.loads(f.read().decode('utf-8'))
with open(BASE_PATH + 'ig_media.json', 'rb') as f:
... | 35.183333 | 88 | 0.663667 |
21f07c746128fd72a1d7fc2d2010be6ed6900996 | 362 | py | Python | owtf/utils/app.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/utils/app.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/utils/app.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | import tornado.web
from owtf.db.database import Session, get_db_engine
class Application(tornado.web.Application):
def __init__(self, *args, **kwargs):
Session.configure(bind=get_db_engine())
self.session = Session()
self.sentry_client = kwargs.pop("sentry_client", None)
super(App... | 30.166667 | 62 | 0.701657 |
21f093eb19cc3bc3e242076f72eac7a4a2c8f922 | 16,484 | py | Python | src/feinsum/make_einsum.py | kaushikcfd/feinsum | 2d9c2bb44a113b32aab17da3c4f6fbebdad4bef1 | [
"MIT"
] | null | null | null | src/feinsum/make_einsum.py | kaushikcfd/feinsum | 2d9c2bb44a113b32aab17da3c4f6fbebdad4bef1 | [
"MIT"
] | 8 | 2022-02-04T18:36:46.000Z | 2022-03-05T19:21:37.000Z | src/feinsum/make_einsum.py | kaushikcfd/feinsum | 2d9c2bb44a113b32aab17da3c4f6fbebdad4bef1 | [
"MIT"
] | null | null | null | """
.. currentmodule:: feinsum.make_einsum
.. autofunction:: einsum
.. autofunction:: fused_einsum
"""
__copyright__ = """
Copyright (C) 2020 Andreas Kloeckner
Copyright (C) 2020 Matt Wala
Copyright (C) 2020 Xiaoyu Wei
Copyright (C) 2022 Kaushik Kulkarni
"""
__license__ = """
Permission is hereby granted, free of ch... | 40.401961 | 85 | 0.599733 |
21f09d1d3ba6cbaa24decc64a2b2e70b18ea4291 | 987 | py | Python | backend/slicedtv/urls.py | suzanpradhan/slicedtv | 0d78dae366cd50647d5c40ec921e97a7a03047b2 | [
"BSD-3-Clause"
] | 1 | 2020-11-22T11:10:31.000Z | 2020-11-22T11:10:31.000Z | backend/slicedtv/urls.py | suzanpradhan/slicedtv | 0d78dae366cd50647d5c40ec921e97a7a03047b2 | [
"BSD-3-Clause"
] | 1 | 2020-12-08T05:25:54.000Z | 2020-12-08T05:42:40.000Z | backend/slicedtv/urls.py | suzanpradhan/slicedtv | 0d78dae366cd50647d5c40ec921e97a7a03047b2 | [
"BSD-3-Clause"
] | null | null | null | """slicedtv URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | 36.555556 | 77 | 0.685917 |
21f0c3487cac7f71ac3746364aedf810db8b35fe | 15,193 | py | Python | python_pb2/go/chromium/org/luci/buildbucket/proto/service_config_pb2.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | python_pb2/go/chromium/org/luci/buildbucket/proto/service_config_pb2.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | python_pb2/go/chromium/org/luci/buildbucket/proto/service_config_pb2.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: go.chromium.org/luci/buildbucket/proto/service_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
fr... | 42.202778 | 1,482 | 0.765023 |
21f0dc0328c7b7e262c186b735fda5a06eea1ef4 | 24,701 | py | Python | bugzoo/mgr/container.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | null | null | null | bugzoo/mgr/container.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | null | null | null | bugzoo/mgr/container.py | pdreiter/BugZoo | e164ee67ff8bd3addfcc87b5e38ff1774992196b | [
"MIT"
] | null | null | null | from typing import Iterator, List, Optional, Dict, Union, Iterable
from ipaddress import IPv4Address, IPv6Address
from tempfile import NamedTemporaryFile
from timeit import default_timer as timer
import sys
import time
import subprocess
import ipaddress
import tempfile
import os
import uuid
import copy
import logging
... | 39.207937 | 127 | 0.566414 |
21f0f643431e5a34eb802ccc0c97233992e87259 | 1,880 | py | Python | pytttapi/test_game.py | klmcwhirter/plonk-pi-explore-py | f4cc9cc905d734082878f5a4f46ceeb45d36a96f | [
"MIT"
] | null | null | null | pytttapi/test_game.py | klmcwhirter/plonk-pi-explore-py | f4cc9cc905d734082878f5a4f46ceeb45d36a96f | [
"MIT"
] | null | null | null | pytttapi/test_game.py | klmcwhirter/plonk-pi-explore-py | f4cc9cc905d734082878f5a4f46ceeb45d36a96f | [
"MIT"
] | null | null | null | """game.py tests"""
import pytest
from .game import Game
@pytest.fixture
def tie_vector():
"""returns a Tie vector"""
return [
0, 0, 1,
1, 1, 0,
0, 0, 1
]
def test_Game_can_construct():
"""as stated"""
g = Game()
assert g is not None
def test_Game_hydrates_game_if_... | 18.989899 | 57 | 0.60266 |
21f1015f31ac7a60fb0f5d5a6923af6cad9d6864 | 89 | py | Python | tests/conftest.py | b-biswas/BlendingToolKit | 2e85da4df99a84bcdff1d85ed66eb8589eb72499 | [
"MIT"
] | 16 | 2018-12-08T07:51:49.000Z | 2022-03-27T16:52:00.000Z | tests/conftest.py | b-biswas/BlendingToolKit | 2e85da4df99a84bcdff1d85ed66eb8589eb72499 | [
"MIT"
] | 252 | 2018-10-29T20:23:40.000Z | 2022-03-28T20:45:37.000Z | tests/conftest.py | b-biswas/BlendingToolKit | 2e85da4df99a84bcdff1d85ed66eb8589eb72499 | [
"MIT"
] | 8 | 2019-01-02T07:40:59.000Z | 2021-01-21T03:10:04.000Z | from pathlib import Path
data_dir = Path(__file__).parent.joinpath("../data").resolve()
| 22.25 | 62 | 0.741573 |
21f11b8d66c37efe50482953ecd5d3f2d3ca2209 | 18,281 | py | Python | nmt/train.py | abhishekyana/nmt | 20dff79d0bd0e7a286a8063d0194fbc7903bbee3 | [
"Apache-2.0"
] | 1 | 2017-12-12T05:25:56.000Z | 2017-12-12T05:25:56.000Z | nmt/train.py | RaikaSurendra/nmt | 20dff79d0bd0e7a286a8063d0194fbc7903bbee3 | [
"Apache-2.0"
] | null | null | null | nmt/train.py | RaikaSurendra/nmt | 20dff79d0bd0e7a286a8063d0194fbc7903bbee3 | [
"Apache-2.0"
] | 1 | 2021-03-11T10:46:19.000Z | 2021-03-11T10:46:19.000Z | # Copyright 2017 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 a... | 36.782696 | 80 | 0.696351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.