hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72c9473f5a74cfc413bfff5dcd64a65bbdbdacc0 | 6,059 | py | Python | credits.py | Zandor300/LicenseGenerator-iOS | 9d9ef6cc270b9cd4830dffa62e5d52aa02636437 | [
"MIT"
] | null | null | null | credits.py | Zandor300/LicenseGenerator-iOS | 9d9ef6cc270b9cd4830dffa62e5d52aa02636437 | [
"MIT"
] | null | null | null | credits.py | Zandor300/LicenseGenerator-iOS | 9d9ef6cc270b9cd4830dffa62e5d52aa02636437 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# coding: utf-8
"""
Recursively searches the input directory for 'LICENSE.*' files and compiles
them into a Settings.bundle friendly plist. Inspired by JosephH
and Sean's comments on stackoverflow: http://stackoverflow.com/q/6428353
:usage: ./credits.py -s project/ -o project/Settin... | 35.641176 | 134 | 0.619739 |
46ad37e921611e2ce23fb6c1ba9e423b937a55f0 | 13,576 | py | Python | pyiron_base/master/list.py | pmrv/pyiron_base | af1729708a8226575ca2c84f574e7cb046b7f7cd | [
"BSD-3-Clause"
] | null | null | null | pyiron_base/master/list.py | pmrv/pyiron_base | af1729708a8226575ca2c84f574e7cb046b7f7cd | [
"BSD-3-Clause"
] | null | null | null | pyiron_base/master/list.py | pmrv/pyiron_base | af1729708a8226575ca2c84f574e7cb046b7f7cd | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
from pyiron_base.generic.parameters import GenericParameters
from pyiron_base.job.... | 36.299465 | 120 | 0.593768 |
1042e319b1bf3fdf58988192ad772ebf7d219293 | 14,290 | py | Python | quantum/db/servicetype_db.py | yamt/neutron | f94126739a48993efaf1d1439dcd3dadb0c69742 | [
"Apache-2.0"
] | null | null | null | quantum/db/servicetype_db.py | yamt/neutron | f94126739a48993efaf1d1439dcd3dadb0c69742 | [
"Apache-2.0"
] | null | null | null | quantum/db/servicetype_db.py | yamt/neutron | f94126739a48993efaf1d1439dcd3dadb0c69742 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | 43.43465 | 79 | 0.612736 |
907d0532835f58d56c08190ccc90ad4473a10146 | 625 | py | Python | h2o-py/tests/testdir_jira/pyunit_pubdev_1839_citi_bike_small_repro.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_jira/pyunit_pubdev_1839_citi_bike_small_repro.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_jira/pyunit_pubdev_1839_citi_bike_small_repro.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
def pubdev_1839():
train = h2o.import_file(pyunit_utils.locate("smalldata/jira/pubdev_1839_repro_train.csv"))
test = h2o.import_file(pyunit_utils.locate("smalldata/ji... | 28.409091 | 112 | 0.76 |
33a336212a606737a78f7e66dd3e776556fe4796 | 564 | py | Python | scripts/npc/skin_edel1.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 9 | 2021-04-26T11:59:29.000Z | 2021-12-20T13:15:27.000Z | scripts/npc/skin_edel1.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/npc/skin_edel1.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 6 | 2021-07-14T06:32:05.000Z | 2022-02-06T02:32:56.000Z | # Mel Nomie (2150004) | Edelstein (310000000)
options = []
#These values will crash the client when attempting to load them onto character
nullSkins = [6, 7, 8]
for skin in range(14):
#Skip past null skin values
if skin in nullSkins:
continue
options.append(skin)
answer = sm.sendAskAvatar("We hav... | 31.333333 | 80 | 0.725177 |
ee7c25cbe7880d5ba156f97c5ac4d7e94ae9e0c4 | 40,307 | py | Python | src/rogerthat/bizz/system.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/bizz/system.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/bizz/system.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | 42.250524 | 121 | 0.701814 |
c616546b57d758f2fe8ffd796ee112610d37416d | 10,984 | py | Python | dizoo/league_demo/league_demo_ppo_main.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | null | null | null | dizoo/league_demo/league_demo_ppo_main.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | null | null | null | dizoo/league_demo/league_demo_ppo_main.py | sailxjx/DI-engine | c6763f8e2ba885a2a02f611195a1b5f8b50bff00 | [
"Apache-2.0"
] | null | null | null | import os
import copy
import gym
import numpy as np
import torch
from tensorboardX import SummaryWriter
from ding.config import compile_config
from ding.worker import BaseLearner, BattleEpisodeSerialCollector, BattleInteractionSerialEvaluator, NaiveReplayBuffer
from ding.envs import BaseEnvManager, DingEnvWrapper
from... | 42.573643 | 118 | 0.673798 |
1cda3cc8e27e7cdf267ecb53e7c56b9a24abecc8 | 311 | py | Python | fairseq/models/delta/__init__.py | xiaodashuaiya/fairseq-with-delta | 53b01ecc841de31649e6e937efc2ac91606e93f4 | [
"MIT"
] | null | null | null | fairseq/models/delta/__init__.py | xiaodashuaiya/fairseq-with-delta | 53b01ecc841de31649e6e937efc2ac91606e93f4 | [
"MIT"
] | null | null | null | fairseq/models/delta/__init__.py | xiaodashuaiya/fairseq-with-delta | 53b01ecc841de31649e6e937efc2ac91606e93f4 | [
"MIT"
] | null | null | null | from fairseq.models.delta import two_delta
from fairseq.models.delta import square_delta
from fairseq.models.delta import square_delta_fillpre
from fairseq.models.delta import square_delta_dif5
__all__ = ['two_delta',
'square_delta',
'square_delta_dif5',
'square_delta_fillpre',]
| 31.1 | 53 | 0.755627 |
4d331319c0d86ca6696992e2cd606eca5db89d14 | 368 | py | Python | app.py | baudo2048/AIA-FT-N921-003 | 03d447fcaf4c4d5052c4a5a2784b1f126a2d4af3 | [
"MIT"
] | null | null | null | app.py | baudo2048/AIA-FT-N921-003 | 03d447fcaf4c4d5052c4a5a2784b1f126a2d4af3 | [
"MIT"
] | null | null | null | app.py | baudo2048/AIA-FT-N921-003 | 03d447fcaf4c4d5052c4a5a2784b1f126a2d4af3 | [
"MIT"
] | null | null | null | from flask import Flask
from flask import render_template
import json
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/events')
def events():
x = {
"name": "John",
"age": 30,
"city": "New York"
}
return json.dum... | 14.72 | 37 | 0.586957 |
907b6f77ae94e9d36d8ae5f533e2d684638a86c9 | 3,587 | py | Python | discovery-provider/src/queries/get_playlists.py | mikedotexe/audius-protocol | 04743c727b2ae244c9e72b172291b1ce968c5af0 | [
"Apache-2.0"
] | null | null | null | discovery-provider/src/queries/get_playlists.py | mikedotexe/audius-protocol | 04743c727b2ae244c9e72b172291b1ce968c5af0 | [
"Apache-2.0"
] | null | null | null | discovery-provider/src/queries/get_playlists.py | mikedotexe/audius-protocol | 04743c727b2ae244c9e72b172291b1ce968c5af0 | [
"Apache-2.0"
] | null | null | null | import logging # pylint: disable=C0302
import sqlalchemy
from sqlalchemy import desc
from src import exceptions
from src.models import Playlist, RepostType, SaveType
from src.utils import helpers
from src.utils.db_session import get_db_read_replica
from src.queries.query_helpers import get_current_user_id, paginate_qu... | 40.303371 | 114 | 0.610538 |
89dfde9ba55f1172dd5920cf07757cf3285fb4a0 | 29,818 | py | Python | test/tneanet.py | roks/snap-python | e316dfae8f0b7707756e0a6bf4237d448259d2d2 | [
"BSD-3-Clause"
] | null | null | null | test/tneanet.py | roks/snap-python | e316dfae8f0b7707756e0a6bf4237d448259d2d2 | [
"BSD-3-Clause"
] | null | null | null | test/tneanet.py | roks/snap-python | e316dfae8f0b7707756e0a6bf4237d448259d2d2 | [
"BSD-3-Clause"
] | 1 | 2019-11-11T20:25:19.000Z | 2019-11-11T20:25:19.000Z | import random
import sys
import snap
def PrintGStats(s, Graph):
'''
Print graph statistics
'''
print("graph %s, nodes %d, edges %d, empty %s" % (
s, Graph.GetNodes(), Graph.GetEdges(),
"yes" if Graph.Empty() else "no"))
def DefaultConstructor():
'''
Test the default construct... | 34.273563 | 97 | 0.602522 |
2c8abab5e8a8a4453e0956293585a7e0c8129cf8 | 896 | py | Python | openacademy/__manifest__.py | TECNOSOFTWARESAS/openacademy-project | 8dc81242573343afef850d4c6773d592b3ff8c48 | [
"Apache-2.0"
] | null | null | null | openacademy/__manifest__.py | TECNOSOFTWARESAS/openacademy-project | 8dc81242573343afef850d4c6773d592b3ff8c48 | [
"Apache-2.0"
] | null | null | null | openacademy/__manifest__.py | TECNOSOFTWARESAS/openacademy-project | 8dc81242573343afef850d4c6773d592b3ff8c48 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name': "Open Academy",
'summary': """Manage trainings""",
'description': """
Open Academy module for managing trainings:
- training courses
- training sessions
- attendees registration
""",
'author': "TECNOSOFTWARE S.A.S",
... | 23.578947 | 92 | 0.574777 |
074a5fb7865c2fac90f131586a9b8fdb4e6c5335 | 853 | py | Python | doc/source/contributor/create/examples/resource/fake.py | nicolasochem/openstacksdk | 34ea72ce5b0b7f16a038ca57b2a9f1ec2f90ce00 | [
"Apache-2.0"
] | null | null | null | doc/source/contributor/create/examples/resource/fake.py | nicolasochem/openstacksdk | 34ea72ce5b0b7f16a038ca57b2a9f1ec2f90ce00 | [
"Apache-2.0"
] | null | null | null | doc/source/contributor/create/examples/resource/fake.py | nicolasochem/openstacksdk | 34ea72ce5b0b7f16a038ca57b2a9f1ec2f90ce00 | [
"Apache-2.0"
] | null | null | null | # Apache 2 header omitted for brevity
from openstack.fake import fake_service
from openstack import resource
class Fake(resource.Resource):
resource_key = "resource"
resources_key = "resources"
base_path = "/fake"
service = fake_service.FakeService()
allow_create = True
allow_get = True
... | 29.413793 | 60 | 0.689332 |
e65159e57a510bb8f253e0f02e07c2bccdf6290f | 5,331 | py | Python | dival/reconstructors/networks/iterative.py | MBaltz/dival | b7c10ed471d05242312a7d4916900c92e0c36cdb | [
"MIT"
] | 42 | 2019-08-06T11:41:14.000Z | 2022-03-21T08:57:41.000Z | dival/reconstructors/networks/iterative.py | MBaltz/dival | b7c10ed471d05242312a7d4916900c92e0c36cdb | [
"MIT"
] | 17 | 2019-12-03T22:02:32.000Z | 2021-09-04T07:29:46.000Z | dival/reconstructors/networks/iterative.py | MBaltz/dival | b7c10ed471d05242312a7d4916900c92e0c36cdb | [
"MIT"
] | 8 | 2019-10-07T09:21:55.000Z | 2022-02-24T09:08:01.000Z | import torch
import torch.nn as nn
class IterativeBlock(nn.Module):
def __init__(self, n_in=3, n_out=1, n_memory=5, n_layer=3, internal_ch=32,
kernel_size=3, batch_norm=True, prelu=False, lrelu_coeff=0.2):
super(IterativeBlock, self).__init__()
assert kernel_size % 2 == 1
... | 43.341463 | 79 | 0.574376 |
45cd282aea39b9368f39b1ea3fce96e94d4f76b2 | 9,143 | py | Python | fbchat/_file.py | madsmtm/fbchat | c6a505fc3e3aa306080b91127f73fecf8186f543 | [
"BSD-3-Clause"
] | 1 | 2020-09-06T09:32:33.000Z | 2020-09-06T09:32:33.000Z | fbchat/_file.py | madsmtm/fbchat | c6a505fc3e3aa306080b91127f73fecf8186f543 | [
"BSD-3-Clause"
] | null | null | null | fbchat/_file.py | madsmtm/fbchat | c6a505fc3e3aa306080b91127f73fecf8186f543 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import attr
from ._attachment import Attachment
@attr.s(cmp=False)
class FileAttachment(Attachment):
"""Represents a file that has been sent as a Facebook attachment"""
#: Url where you can download the file
url = attr.ib(None)
#: Size ... | 32.888489 | 88 | 0.640381 |
bafd76f7d84ff267f7ba0f8af6ec36d8a9364190 | 467 | py | Python | project/server/__init__.py | androiddrew/jwt-auth | 4d2c457ff765fc8503fa9f4ceb0c6432072dee1b | [
"MIT"
] | null | null | null | project/server/__init__.py | androiddrew/jwt-auth | 4d2c457ff765fc8503fa9f4ceb0c6432072dee1b | [
"MIT"
] | null | null | null | project/server/__init__.py | androiddrew/jwt-auth | 4d2c457ff765fc8503fa9f4ceb0c6432072dee1b | [
"MIT"
] | null | null | null | # project/server/__init__.py
import os
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app_settings = os.getenv(
'APP_SETTINGS',
'project.server.config.DevelopmentConfig'
)
app.config.from_object(app_settings)
bcrypt = Bcrypt(app)
db = S... | 20.304348 | 52 | 0.802998 |
5e7dc4c107dc9b6b9e28402ecc5b14b662447a53 | 3,624 | py | Python | examples/dialogue/plato-2/readers/plato_reader.py | JeremyZhao1998/PaddleNLP | 5a34684a7f0c8a186043fed386be4b62cb85fb15 | [
"Apache-2.0"
] | 7,091 | 2021-02-05T13:56:25.000Z | 2022-03-31T11:42:50.000Z | examples/dialogue/plato-2/readers/plato_reader.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | 844 | 2021-02-10T01:09:29.000Z | 2022-03-31T12:12:58.000Z | examples/dialogue/plato-2/readers/plato_reader.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | 1,035 | 2021-02-05T14:26:48.000Z | 2022-03-31T11:42:57.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.824176 | 80 | 0.641556 |
13a34bf6f91e3df6c380dd1fea5486777ccf1071 | 11,956 | py | Python | pythonFiles/visualstudio_py_testlauncher.py | lhl2617/vscode-python | 1208bab6ccf362f57f9a0634bf1b02012dae2f26 | [
"MIT"
] | 1 | 2021-08-18T13:35:38.000Z | 2021-08-18T13:35:38.000Z | pythonFiles/visualstudio_py_testlauncher.py | lhl2617/vscode-python | 1208bab6ccf362f57f9a0634bf1b02012dae2f26 | [
"MIT"
] | 29 | 2021-08-06T11:15:54.000Z | 2022-03-01T23:22:23.000Z | pythonFiles/visualstudio_py_testlauncher.py | meetaco/vscode-python | 873397538c7b399f1083cece3194be439b71bc93 | [
"MIT"
] | null | null | null | # Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# 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
#
# THIS ... | 30.422392 | 93 | 0.564403 |
c2ca7c9e3d73464bb03dd9f52f3cc52798ecc4f0 | 5,452 | py | Python | tests/integration/test_predicates.py | dAnjou/mbtest | 51a49b7c4dfdf61e65cae8230bff0579aca23945 | [
"MIT"
] | 26 | 2018-10-10T16:29:59.000Z | 2021-12-28T00:07:57.000Z | tests/integration/test_predicates.py | dAnjou/mbtest | 51a49b7c4dfdf61e65cae8230bff0579aca23945 | [
"MIT"
] | 54 | 2019-02-02T08:16:04.000Z | 2022-03-03T07:16:59.000Z | tests/integration/test_predicates.py | dAnjou/mbtest | 51a49b7c4dfdf61e65cae8230bff0579aca23945 | [
"MIT"
] | 14 | 2019-02-01T23:08:07.000Z | 2021-12-16T11:28:30.000Z | # encoding=utf-8
import logging
import os
from decimal import Decimal
import pytest
import requests
from brunns.matchers.response import is_response
from hamcrest import assert_that, not_
from mbtest.imposters import Imposter, InjectionPredicate, Predicate, Response, Stub
logger = logging.getLogger(__name__)
def t... | 34.506329 | 95 | 0.634629 |
5b11969b0146dc802bc358284ad705db15f1a25e | 17,527 | py | Python | spleeter/dataset.py | Sawyer0928/spleeter | 7476776909061c6276649e472f2a7c89147a81ee | [
"MIT"
] | 1 | 2020-12-18T13:47:26.000Z | 2020-12-18T13:47:26.000Z | spleeter/dataset.py | Sawyer0928/spleeter | 7476776909061c6276649e472f2a7c89147a81ee | [
"MIT"
] | null | null | null | spleeter/dataset.py | Sawyer0928/spleeter | 7476776909061c6276649e472f2a7c89147a81ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf8
"""
Module for building data preprocessing pipeline using the tensorflow
data API. Data preprocessing such as audio loading, spectrogram
computation, cropping, feature caching or data augmentation is done
using a tensorflow dataset object that output a tuple (input_... | 38.352298 | 78 | 0.617048 |
06c66fc16fccd046e5d5e688ddc5320a254128e5 | 7,714 | py | Python | saas/backend/api/authorization/serializers.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | saas/backend/api/authorization/serializers.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | saas/backend/api/authorization/serializers.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 38.188119 | 116 | 0.724656 |
9777c51bc7b6d15c33ed125f2627b58029e0e482 | 19,719 | py | Python | library/ceph_volume.py | r0bobo/ceph-ansible | e655038743a16e75cb993d1a26c7be755a65ca45 | [
"Apache-2.0"
] | null | null | null | library/ceph_volume.py | r0bobo/ceph-ansible | e655038743a16e75cb993d1a26c7be755a65ca45 | [
"Apache-2.0"
] | null | null | null | library/ceph_volume.py | r0bobo/ceph-ansible | e655038743a16e75cb993d1a26c7be755a65ca45 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import datetime
import copy
import json
import os
import six
ANSIBLE_METADATA = {
'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ceph_volume
short_description: Create ceph OSDs with ceph-volume
description:
- Using th... | 29.256677 | 155 | 0.597241 |
d8b18427ed6e29e630206fae2e9e027eaa7ef2fa | 1,187 | py | Python | src/clava/output.py | strfx/clava | 0518412e03a2a19bd89c4bbfbd217a4e4c874abf | [
"MIT"
] | 3 | 2021-08-31T23:11:14.000Z | 2021-12-16T13:26:35.000Z | src/clava/output.py | strfx/clava | 0518412e03a2a19bd89c4bbfbd217a4e4c874abf | [
"MIT"
] | null | null | null | src/clava/output.py | strfx/clava | 0518412e03a2a19bd89c4bbfbd217a4e4c874abf | [
"MIT"
] | null | null | null | """
Convert generated signature into an actually usable signature (i.e., Yara).
"""
from capstone import CS_ARCH_X86
from mkyara import YaraGenerator
from clava import __version__
def generate_yara_rule(name: str, sequences, mode: int) -> str:
""" Returns signature formatted as a Yara rule. """
# Metadata s... | 31.236842 | 78 | 0.670598 |
ecb33fbc6e8a37667a379806f2ddac716ce2b7d5 | 20,951 | py | Python | python_packages_static/flopy/modflowlgr/mflgr.py | usgs/neversink_workflow | acd61435b8553e38d4a903c8cd7a3afc612446f9 | [
"CC0-1.0"
] | null | null | null | python_packages_static/flopy/modflowlgr/mflgr.py | usgs/neversink_workflow | acd61435b8553e38d4a903c8cd7a3afc612446f9 | [
"CC0-1.0"
] | null | null | null | python_packages_static/flopy/modflowlgr/mflgr.py | usgs/neversink_workflow | acd61435b8553e38d4a903c8cd7a3afc612446f9 | [
"CC0-1.0"
] | null | null | null | """
mf module. Contains the ModflowGlobal, ModflowList, and Modflow classes.
"""
import os
import sys
from ..mbase import BaseModel
from ..modflow import Modflow
class LgrChild:
def __init__(
self,
ishflg=1,
ibflg=59,
iucbhsv=0,
iucbfsv=0,
mxlgriter=20,
... | 29.179666 | 89 | 0.495537 |
064d9eb45bfde8d7a0f7105123bbd74df0fce659 | 609 | py | Python | catalog/migrations/0003_bookinstance_borrower.py | pcsteppan/django_tiny_library | a4084c01aa3bcb5a3215ce9e6d429cd54d52c64d | [
"MIT"
] | null | null | null | catalog/migrations/0003_bookinstance_borrower.py | pcsteppan/django_tiny_library | a4084c01aa3bcb5a3215ce9e6d429cd54d52c64d | [
"MIT"
] | null | null | null | catalog/migrations/0003_bookinstance_borrower.py | pcsteppan/django_tiny_library | a4084c01aa3bcb5a3215ce9e6d429cd54d52c64d | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-03-20 02:03
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0002_auto_201... | 27.681818 | 134 | 0.683087 |
0d93f489a5c4f4771fd08cf0b55878143f34bec3 | 15,476 | py | Python | bokeh/embed/standalone.py | mminhaaj/interactivebokeh1 | 94ad0933dd7c8f198e65aaabea6eb01dc7e96b59 | [
"BSD-3-Clause"
] | 1 | 2020-03-21T04:11:51.000Z | 2020-03-21T04:11:51.000Z | bokeh/embed/standalone.py | BiYandong110/bokeh | 1171a567e3513ea50162d48a049ee187f673b784 | [
"BSD-3-Clause"
] | 2 | 2021-05-08T11:43:21.000Z | 2021-05-10T19:16:43.000Z | bokeh/embed/standalone.py | BiYandong110/bokeh | 1171a567e3513ea50162d48a049ee187f673b784 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 35.907193 | 138 | 0.600155 |
3e0dc4449129d7b4e3a4e025bed1ac729c652efd | 12,462 | py | Python | qa/rpc-tests/util.py | delionproject/delion | ebbbc9c8eacabbcce82a6da352e342c2b0c1de4d | [
"MIT"
] | null | null | null | qa/rpc-tests/util.py | delionproject/delion | ebbbc9c8eacabbcce82a6da352e342c2b0c1de4d | [
"MIT"
] | null | null | null | qa/rpc-tests/util.py | delionproject/delion | ebbbc9c8eacabbcce82a6da352e342c2b0c1de4d | [
"MIT"
] | null | null | null | # Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2014-2015 The Dash developers
# Copyright (c) 2015-2017 The PIVX developers
# Copyright (c) 2017-2018 The Delion developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-lic... | 35.913545 | 106 | 0.648211 |
35ffdbd61bce24758eb9bbcb848fadafb7b9d412 | 1,470 | py | Python | aoc/day02p2.py | thousandlegs/aoc2021 | 9950c53432637d2c680652ca19f8ae6b3e2cbbc0 | [
"MIT"
] | null | null | null | aoc/day02p2.py | thousandlegs/aoc2021 | 9950c53432637d2c680652ca19f8ae6b3e2cbbc0 | [
"MIT"
] | null | null | null | aoc/day02p2.py | thousandlegs/aoc2021 | 9950c53432637d2c680652ca19f8ae6b3e2cbbc0 | [
"MIT"
] | null | null | null | import numpy
from . import aoclib
# 'x' is forward and back
# 'd' is depth, increasing downward
class SubPosition:
def __init__(self, x=0, d=0, aim=0):
self.aim = aim
self.x = x
self.d = d
def forward(self, dist):
self.x += dist
self.d += dist * self.aim
def up(self, a):
self.down(-a... | 19.342105 | 85 | 0.634694 |
dd318a6bbf465a4d4f4463b7564510a278595753 | 642 | py | Python | migrations/versions/70c0e46c6068_.py | Philipp-Bode/hackHPI2018 | 2212a7b7697f45da561fce6e06b8ae7274b9f2ce | [
"MIT"
] | 2 | 2018-05-27T18:52:10.000Z | 2018-05-28T10:27:48.000Z | migrations/versions/70c0e46c6068_.py | Foodprint-HPI/hackHPI2018 | 2212a7b7697f45da561fce6e06b8ae7274b9f2ce | [
"MIT"
] | 1 | 2018-09-20T07:36:52.000Z | 2018-09-20T07:56:41.000Z | migrations/versions/70c0e46c6068_.py | Foodprint-HPI/hackHPI2018 | 2212a7b7697f45da561fce6e06b8ae7274b9f2ce | [
"MIT"
] | null | null | null | """empty message
Revision ID: 70c0e46c6068
Revises: 0a1a1fcb6302
Create Date: 2018-05-26 20:41:54.607552
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '70c0e46c6068'
down_revision = '0a1a1fcb6302'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.137931 | 65 | 0.691589 |
0f2a92e7c6f98d76bee2d16ca208f030cd84d47b | 5,000 | py | Python | GUI/gui.py | NeloBorcram/OEC_Assignment3_2018 | b8dea646005e77135092a222e594126647d021db | [
"MIT"
] | null | null | null | GUI/gui.py | NeloBorcram/OEC_Assignment3_2018 | b8dea646005e77135092a222e594126647d021db | [
"MIT"
] | null | null | null | GUI/gui.py | NeloBorcram/OEC_Assignment3_2018 | b8dea646005e77135092a222e594126647d021db | [
"MIT"
] | null | null | null | import time
from tkinter import *
from tkinter import messagebox
class MainWindow(object):
""" This class contains the apps GUI and it's behavior.
Args:
com_start_callback (func_pointer): function to call when 'Start Com' is clicked.
com_stop_callback (func_pointer): function to call when 'St... | 38.461538 | 149 | 0.63 |
4c042938e94459e2050dd055387194cf403c826d | 15,061 | py | Python | hanlp/components/distillation/losses.py | antfootAlex/HanLP | e8044b27ae1de54b9070db08549853d3ca8271e2 | [
"Apache-2.0"
] | 27,208 | 2015-03-27T10:25:45.000Z | 2022-03-31T13:26:32.000Z | hanlp/components/distillation/losses.py | hushaoyun/HanLP | 967b52404c9d0adbc0cff2699690c127ecfca36e | [
"Apache-2.0"
] | 1,674 | 2015-03-30T06:36:44.000Z | 2022-03-16T01:52:56.000Z | hanlp/components/distillation/losses.py | hushaoyun/HanLP | 967b52404c9d0adbc0cff2699690c127ecfca36e | [
"Apache-2.0"
] | 7,710 | 2015-03-27T08:07:57.000Z | 2022-03-31T14:57:23.000Z | # Adopted from https://github.com/airaria/TextBrewer
# Apache License Version 2.0
import torch
import torch.nn.functional as F
from hanlp_common.configurable import AutoConfigurable
def kd_mse_loss(logits_S, logits_T, temperature=1):
'''
Calculate the mse loss between logits_S and logits_T
:param logit... | 52.660839 | 510 | 0.670805 |
ebce1c9a0e1886e84ec0e4edef91009b2d89829e | 4,462 | py | Python | utils.py | martenc/tensorflow-tweet-generator | c5ee7bfbb2c9df6e139665ccd96c022efd34b837 | [
"MIT"
] | null | null | null | utils.py | martenc/tensorflow-tweet-generator | c5ee7bfbb2c9df6e139665ccd96c022efd34b837 | [
"MIT"
] | null | null | null | utils.py | martenc/tensorflow-tweet-generator | c5ee7bfbb2c9df6e139665ccd96c022efd34b837 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import collections
from six.moves import cPickle
import numpy as np
import re
import itertools
class TextLoader():
def __init__(self, data_dir, batch_size, seq_length):
self.data_dir = data_dir
self.batch_size = batch_size
self.seq_length = seq_length
... | 39.140351 | 92 | 0.592111 |
30addf3eceace703f01af5a1d2ccd8492ec02ebd | 2,163 | py | Python | test/lazy/test_toeplitz_lazy_tensor.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 2,673 | 2018-02-19T22:28:58.000Z | 2022-03-31T13:22:28.000Z | test/lazy/test_toeplitz_lazy_tensor.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 1,415 | 2018-02-19T20:38:20.000Z | 2022-03-30T12:53:13.000Z | test/lazy/test_toeplitz_lazy_tensor.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 467 | 2018-03-07T02:06:05.000Z | 2022-03-27T07:05:44.000Z | #!/usr/bin/env python3
import unittest
import torch
import gpytorch.utils.toeplitz as toeplitz
from gpytorch.lazy import ToeplitzLazyTensor
from gpytorch.test.lazy_tensor_test_case import LazyTensorTestCase
class TestToeplitzLazyTensor(LazyTensorTestCase, unittest.TestCase):
seed = 1
def create_lazy_tenso... | 34.333333 | 115 | 0.672677 |
49d9a20aa3fb539b1f74ea46bc409d6ac7709a14 | 1,870 | py | Python | receitas/api/migrations/0004_auto_20151023_2347.py | willwfsp/receitas-backend | 0c420594a621ce0636422827647de842acf47cc0 | [
"MIT"
] | null | null | null | receitas/api/migrations/0004_auto_20151023_2347.py | willwfsp/receitas-backend | 0c420594a621ce0636422827647de842acf47cc0 | [
"MIT"
] | null | null | null | receitas/api/migrations/0004_auto_20151023_2347.py | willwfsp/receitas-backend | 0c420594a621ce0636422827647de842acf47cc0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0003_receita'),
]
operations = [
migrations.RenameField(
model_name='receita',
old_name='titl... | 28.333333 | 81 | 0.531016 |
a9c63f05ed490714d45270a3699d7a8887a425d2 | 2,696 | py | Python | Application14/Diabetes_DT.py | PRASAD-DANGARE/Machine_Learning-Applications | e2fa540d44993dc0750d95ce6ad686facd3bb769 | [
"MIT"
] | 2 | 2021-06-07T07:55:35.000Z | 2021-07-12T07:59:13.000Z | Application14/Diabetes_DT.py | PRASAD-DANGARE/Machine_Learning-Applications | e2fa540d44993dc0750d95ce6ad686facd3bb769 | [
"MIT"
] | null | null | null | Application14/Diabetes_DT.py | PRASAD-DANGARE/Machine_Learning-Applications | e2fa540d44993dc0750d95ce6ad686facd3bb769 | [
"MIT"
] | 1 | 2021-07-29T04:30:00.000Z | 2021-07-29T04:30:00.000Z | '''
Classifier : Decision Tree
DataSet : diabetes.csv
Features : Glucose, BMI etc
Labels : ----
Author : Prasad Dangare
Date : 30 June 2021
'''
#========================
#
# Imports
#
#========================
import pandas as pd
import numpy as np
import matp... | 28.680851 | 110 | 0.551558 |
b6dcfe954b5248156a19576d5fefc887c738b644 | 1,113 | py | Python | Python/water-and-jug-problem.py | ruikunl/LeetCode | dae98754eb02d68139028f72f894411a3ed12305 | [
"MIT"
] | 4 | 2019-08-06T01:55:23.000Z | 2021-12-12T21:04:01.000Z | Python/water-and-jug-problem.py | ruikunl/LeetCode | dae98754eb02d68139028f72f894411a3ed12305 | [
"MIT"
] | null | null | null | Python/water-and-jug-problem.py | ruikunl/LeetCode | dae98754eb02d68139028f72f894411a3ed12305 | [
"MIT"
] | 8 | 2020-02-20T08:21:12.000Z | 2022-02-17T05:53:21.000Z | # Time: O(logn), n is the max of (x, y)
# Space: O(1)
# You are given two jugs with capacities x and y litres.
# There is an infinite amount of water supply available.
# You need to determine whether it is possible to
# measure exactly z litres using these two jugs.
#
# Operations allowed:
#
# Fill any of the jugs c... | 25.883721 | 66 | 0.560647 |
265b8f7d1e2e9478f54b904be3cab95353beb550 | 2,337 | py | Python | paste/basic.py | jufo-ufo/Google-CTF-2020 | 49f77831ba2035a608bc3e28bd7926b2d4263234 | [
"MIT"
] | 2 | 2020-12-15T20:57:51.000Z | 2021-03-14T15:29:20.000Z | network/basic.py | AlexanderHD27/toolkit | f927c616fadc2c5be57dccc326243b6aa1bffb14 | [
"MIT"
] | null | null | null | network/basic.py | AlexanderHD27/toolkit | f927c616fadc2c5be57dccc326243b6aa1bffb14 | [
"MIT"
] | null | null | null | import socket
import threading
def recvall(sock, BUFF_SIZE = 2048):
data = b""
while True:
part = sock.recv(BUFF_SIZE)
data += part
if len(part) < BUFF_SIZE:
break
return data
class Client:
def __init__(self, host, port):
self... | 28.851852 | 93 | 0.568678 |
8e08988ea4cf640459c26fd2030ac36550909e58 | 5,320 | py | Python | main.py | biomadeira/gae_pubmed2rss | c033c8088249fcb67ed5ef5d1c0f236bd7cbf57a | [
"MIT"
] | null | null | null | main.py | biomadeira/gae_pubmed2rss | c033c8088249fcb67ed5ef5d1c0f236bd7cbf57a | [
"MIT"
] | null | null | null | main.py | biomadeira/gae_pubmed2rss | c033c8088249fcb67ed5ef5d1c0f236bd7cbf57a | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
-------
main.py
-------
Main methods (views + routes) implemented in the API.
.. moduleauthor:: Fabio Madeira
:module_version: 1.0
:created_on: 28-02-2015
"""
import webapp2
import logging
import os
import jinja2
import urllib
from tools import *
from google.appeng... | 34.771242 | 117 | 0.664098 |
b86ccab4f428c25be42792609e5e4a7c1836f32a | 1,770 | py | Python | steamapi/session.py | ranjeetrai07/PySteam | bbbcf1df982a82b97cafde554b13d22a7e6e21c0 | [
"MIT"
] | 11 | 2016-03-07T17:17:04.000Z | 2021-12-06T18:50:04.000Z | steamapi/session.py | ranjeetrai07/PySteam | bbbcf1df982a82b97cafde554b13d22a7e6e21c0 | [
"MIT"
] | 5 | 2016-11-07T02:51:33.000Z | 2018-07-31T06:58:28.000Z | steamapi/session.py | ranjeetrai07/PySteam | bbbcf1df982a82b97cafde554b13d22a7e6e21c0 | [
"MIT"
] | 6 | 2017-01-24T23:25:03.000Z | 2022-01-16T00:34:57.000Z | from .utils import emit
import requests
import re
import logging
logger = logging.getLogger(__name__)
session = requests.Session()
_mobileHeaders = {
"X-Requested-With": "com.valvesoftware.android.steam.community",
"referer": "https://steamcommunity.com/mobilelogin?oauth_client_id=DE45CD61&oauth_scope=read_pr... | 31.052632 | 194 | 0.699435 |
cee48a20a981ad9df13e4220337806dce6cf2929 | 239 | py | Python | pacote-download/Ex53.py | nkonai/Curso-em-video-Python | c05a60b3daa7d448e1e7f0d4d23f62df5d2c8df2 | [
"MIT"
] | null | null | null | pacote-download/Ex53.py | nkonai/Curso-em-video-Python | c05a60b3daa7d448e1e7f0d4d23f62df5d2c8df2 | [
"MIT"
] | null | null | null | pacote-download/Ex53.py | nkonai/Curso-em-video-Python | c05a60b3daa7d448e1e7f0d4d23f62df5d2c8df2 | [
"MIT"
] | null | null | null | f = str(input('Digite uma frase: '))
f = f.strip().replace(' ','').lower()
s = 0
for c in range(0,len(f)):
if f[c] == (f[-(1 + c)]):
s = s + 1
if s == len(f):
print('E um palindromo')
else:
print('Nao e um palindromo')
| 21.727273 | 37 | 0.502092 |
44b720a212361714bf02678b168a1c8922a0499d | 162 | py | Python | tests/api/test_1_connectivity.py | jonzxz/project-piscator | 588c8b1ac9355f9a82ac449fdbeaa1ef7eb441ef | [
"MIT"
] | null | null | null | tests/api/test_1_connectivity.py | jonzxz/project-piscator | 588c8b1ac9355f9a82ac449fdbeaa1ef7eb441ef | [
"MIT"
] | null | null | null | tests/api/test_1_connectivity.py | jonzxz/project-piscator | 588c8b1ac9355f9a82ac449fdbeaa1ef7eb441ef | [
"MIT"
] | 1 | 2021-02-18T03:08:21.000Z | 2021-02-18T03:08:21.000Z | import pytest
def test_index(client):
res = client.get('/')
assert res.status_code == 200
assert b'The Email Phishing Detection Service' in res.data
| 23.142857 | 62 | 0.703704 |
de48b0124935af35344504f500ab9f1644567758 | 656 | py | Python | Youtube/Funtions/nested_and_nonlocal.py | namelew/PythonExercices | e6701dddf163b616987fc9edd8b9ef8e9a207e84 | [
"MIT"
] | null | null | null | Youtube/Funtions/nested_and_nonlocal.py | namelew/PythonExercices | e6701dddf163b616987fc9edd8b9ef8e9a207e84 | [
"MIT"
] | 1 | 2020-11-09T17:20:58.000Z | 2020-11-09T17:21:10.000Z | Youtube/Funtions/nested_and_nonlocal.py | namelew/PythonExercices | e6701dddf163b616987fc9edd8b9ef8e9a207e84 | [
"MIT"
] | null | null | null | # nested
# função declarada dentro de outra função
def f1():
x = 3000
def f2():
print(x)
f2()
# uso 1:
def exp(n):
def base(x):
return x ** n
return base
f = exp(3) # define o valor de n e f se torna um espelho de base
print(f(10)) # 10 elevado a 3
# nonlocal
# permite alterar o val... | 23.428571 | 79 | 0.612805 |
ea93edd9778ade974d2d31e3f3214184c771e19d | 3,345 | py | Python | interface/K12edu/files/test.py | aoruilin/SeleniumBase | 304fd7a23661ebf561da47d4cd8f7365dba519ca | [
"MIT"
] | null | null | null | interface/K12edu/files/test.py | aoruilin/SeleniumBase | 304fd7a23661ebf561da47d4cd8f7365dba519ca | [
"MIT"
] | null | null | null | interface/K12edu/files/test.py | aoruilin/SeleniumBase | 304fd7a23661ebf561da47d4cd8f7365dba519ca | [
"MIT"
] | null | null | null | if __name__ == '__main__':
# coding=utf8
# 12306查票爬虫
import requests, json
import sys
# 获取地址代码
# https://kyfw.12306.cn/otn/resources/js/framework/favorite_name.js
url = 'https://kyfw.12306.cn/otn/resources/js/framework/station_name.js?station_version=1.9025'
url_tmp = str(requests.get(... | 40.301205 | 148 | 0.495665 |
3ab13670410ebcb80903a9c081e6b29ca5b700b2 | 2,986 | py | Python | db/alembic/env.py | zomglings/moonstream | 954f6014f782157ff3d708d0697457c4306a6588 | [
"Apache-2.0"
] | 67 | 2021-07-22T11:09:30.000Z | 2022-03-30T07:38:19.000Z | db/alembic/env.py | zomglings/moonstream | 954f6014f782157ff3d708d0697457c4306a6588 | [
"Apache-2.0"
] | 246 | 2021-07-19T15:40:59.000Z | 2022-03-24T20:30:55.000Z | db/alembic/env.py | zomglings/moonstream | 954f6014f782157ff3d708d0697457c4306a6588 | [
"Apache-2.0"
] | 21 | 2021-07-25T18:36:05.000Z | 2022-03-30T16:30:24.000Z | from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# Th... | 27.145455 | 69 | 0.716678 |
e8f37358b1651d62530b10769c207026184d0314 | 2,784 | py | Python | scripts/benchmark_createopts.py | perrygeo/climatedata | 5449c25e800cf15b0785d4caf629fb971fcc8f7e | [
"BSD-3-Clause"
] | 5 | 2016-01-21T17:46:31.000Z | 2021-04-20T17:13:00.000Z | scripts/benchmark_createopts.py | perrygeo/climatedata | 5449c25e800cf15b0785d4caf629fb971fcc8f7e | [
"BSD-3-Clause"
] | null | null | null | scripts/benchmark_createopts.py | perrygeo/climatedata | 5449c25e800cf15b0785d4caf629fb971fcc8f7e | [
"BSD-3-Clause"
] | 1 | 2015-09-02T15:14:46.000Z | 2015-09-02T15:14:46.000Z | import pandas
import os
import rasterio
from statistics import median # python 3.4 only
from subprocess import check_output
def tiny_window(dataset, x, y):
r, c = dataset.index(x, y)
return ((r, r+1), (c, c+1))
def make_stack(paths, variable, period, month, rcp):
outpath = "/tmp/{}_{}_{}_{}_stack.tif".... | 30.26087 | 100 | 0.538075 |
fefd5e4dfb4e68b10b28fd3486b0c697e0416bb0 | 2,983 | py | Python | No_1021_Remove Outermost Parentheses/remove_outermost_parentheses.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 32 | 2020-01-05T13:37:16.000Z | 2022-03-26T07:27:09.000Z | No_1021_Remove Outermost Parentheses/remove_outermost_parentheses.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | null | null | null | No_1021_Remove Outermost Parentheses/remove_outermost_parentheses.py | coderMaruf/leetcode-1 | 20ffe26e43999e44c8acf9800acb371a49bb5853 | [
"MIT"
] | 8 | 2020-06-18T16:17:27.000Z | 2022-03-15T23:58:18.000Z | '''
Description:
A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strings, and + represents string concatenation. For example, "", "()", "(())()", and "(()(()))" are all valid parentheses strings.
A valid parentheses string S is primitive if it is nonempt... | 25.279661 | 241 | 0.538384 |
78aa534a42849301cba4018ce5e2f3efa6a352bb | 85 | py | Python | aoc_types.py | d4yvie/advent_of_code_2021 | bb74b9dc7b23c5ba338dcd8d2e698c7ea4e34c59 | [
"Apache-2.0"
] | null | null | null | aoc_types.py | d4yvie/advent_of_code_2021 | bb74b9dc7b23c5ba338dcd8d2e698c7ea4e34c59 | [
"Apache-2.0"
] | null | null | null | aoc_types.py | d4yvie/advent_of_code_2021 | bb74b9dc7b23c5ba338dcd8d2e698c7ea4e34c59 | [
"Apache-2.0"
] | null | null | null | Vector2D = tuple[int, int]
Vector3D = tuple[int, int, int]
VectorX = tuple[int, ...]
| 21.25 | 31 | 0.658824 |
7b3aa0e517d1179ea479ea80dfdb031507e294f4 | 266 | py | Python | venv/Lib/site-packages/PyOpenGL-3.0.1/tests/deprecations.py | temelkirci/Motion_Editor | a8b8d4c4d2dcc9be28385600f56066cef92a38ad | [
"MIT"
] | 1 | 2022-03-02T17:07:20.000Z | 2022-03-02T17:07:20.000Z | venv/Lib/site-packages/PyOpenGL-3.0.1/tests/deprecations.py | temelkirci/RealTime_6DOF_Motion_Editor | a8b8d4c4d2dcc9be28385600f56066cef92a38ad | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PyOpenGL-3.0.1/tests/deprecations.py | temelkirci/RealTime_6DOF_Motion_Editor | a8b8d4c4d2dcc9be28385600f56066cef92a38ad | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import unittest
class TestFCO( unittest.TestCase ):
def test_fco_import( self ):
import OpenGL
OpenGL.FORWARD_COMPATIBLE_ONLY = True
from OpenGL import GL, GLU, GLUT
if __name__ == "__main__":
unittest.main()
| 22.166667 | 45 | 0.672932 |
2cb1c400ee07ea7e8df8ea68be0725b1803a5582 | 1,861 | py | Python | setup.py | cellofellow/django-ulid | 4e88a7fb7fe266b479b76f03964b53e9edb18af9 | [
"Apache-2.0"
] | 11 | 2020-08-17T18:35:07.000Z | 2022-01-22T02:48:32.000Z | setup.py | cellofellow/django-ulid | 4e88a7fb7fe266b479b76f03964b53e9edb18af9 | [
"Apache-2.0"
] | 139 | 2019-11-19T21:50:25.000Z | 2021-08-02T13:24:10.000Z | setup.py | cellofellow/django-ulid | 4e88a7fb7fe266b479b76f03964b53e9edb18af9 | [
"Apache-2.0"
] | 1 | 2021-01-14T07:10:26.000Z | 2021-01-14T07:10:26.000Z | """
django_ulid
~~~~~~~~~~~
Universally Unique Lexicographically Sortable Identifier (ULID) support in Django.
:copyright: (c) 2019 Andrew Hawker.
:license: Apache 2.0, see LICENSE for more details.
"""
import ast
import re
try:
from setuptools import setup
except ImportError:
from distu... | 29.078125 | 100 | 0.623858 |
2a363de0bd04c0cc058efe50741cd21ff4ebe3ed | 20,306 | py | Python | google/cloud/compute_v1/services/regions/client.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | 19 | 2021-02-10T21:17:20.000Z | 2022-02-20T03:16:36.000Z | google/cloud/compute_v1/services/regions/client.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | 121 | 2021-01-08T23:46:58.000Z | 2022-03-26T04:34:36.000Z | google/cloud/compute_v1/services/regions/client.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | 20 | 2021-01-08T23:14:16.000Z | 2022-02-25T01:27:20.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 41.610656 | 106 | 0.631094 |
cc1800e231541b435d01d83de180fa395b99cdb2 | 7,176 | py | Python | util/visualizer.py | IrinaM21/ChestXRayVis | 13e8f2767406b924f38695b79b7cf80abf0ef755 | [
"MIT"
] | 2 | 2021-04-06T03:45:12.000Z | 2021-04-12T17:27:05.000Z | util/visualizer.py | IrinaM21/ChestXRayVis | 13e8f2767406b924f38695b79b7cf80abf0ef755 | [
"MIT"
] | null | null | null | util/visualizer.py | IrinaM21/ChestXRayVis | 13e8f2767406b924f38695b79b7cf80abf0ef755 | [
"MIT"
] | null | null | null | import numpy as np
import os
import ntpath
import time
from . import util
from . import html
class Visualizer():
def __init__(self, opt):
# self.opt = opt
self.display_id = opt.display_id
self.use_html = opt.isTrain and not opt.no_html
self.win_size = opt.display_winsize
se... | 43.228916 | 96 | 0.531633 |
31927af0e741f5c1907fd222ebc9b718ab0cb1ce | 9,901 | py | Python | transfocate/transfocator.py | ZLLentz/transfocate | 4811681dad373481653fa6cda9e4909527dfa916 | [
"BSD-3-Clause-LBNL"
] | null | null | null | transfocate/transfocator.py | ZLLentz/transfocate | 4811681dad373481653fa6cda9e4909527dfa916 | [
"BSD-3-Clause-LBNL"
] | null | null | null | transfocate/transfocator.py | ZLLentz/transfocate | 4811681dad373481653fa6cda9e4909527dfa916 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import math
import logging
from pcdsdevices.device_types import IMS
from ophyd import Device, EpicsSignalRO, Component as Cpt, FormattedComponent, EpicsSignal
from ophyd.status import wait as status_wait
from .lens import Lens, LensConnect, LensTripLimits
from .calculator import Calculator
from functools import wraps... | 32.676568 | 109 | 0.621856 |
ec97dff49c50f396b56aa8eb1fd7b61ceccbeb4f | 2,934 | py | Python | examples/xml/polymorphic_array.py | edustaff/spyne | 27f2061325d29a55803fb47b1b37978ab21ea240 | [
"BSD-3-Clause"
] | 786 | 2015-01-04T10:46:28.000Z | 2022-03-31T19:24:35.000Z | examples/xml/polymorphic_array.py | edustaff/spyne | 27f2061325d29a55803fb47b1b37978ab21ea240 | [
"BSD-3-Clause"
] | 248 | 2015-01-01T21:52:47.000Z | 2022-03-09T08:55:04.000Z | examples/xml/polymorphic_array.py | edustaff/spyne | 27f2061325d29a55803fb47b1b37978ab21ea240 | [
"BSD-3-Clause"
] | 210 | 2015-01-10T14:20:31.000Z | 2022-03-09T08:38:43.000Z | #!/usr/bin/env python
# encoding: utf8
#
# Copyright © Burak Arslan <burak at arskom dot com dot tr>,
# Arskom Ltd. http://www.arskom.com.tr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | 31.548387 | 80 | 0.679618 |
747933251c3cfeb3816636cdf8ca5cf1bf3b49cb | 942 | py | Python | src/pyff/i18n.py | rhoerbe/pyFF | 85933ed9cc9f720c9432d5e4c3114895cefd3579 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/pyff/i18n.py | rhoerbe/pyFF | 85933ed9cc9f720c9432d5e4c3114895cefd3579 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | src/pyff/i18n.py | rhoerbe/pyFF | 85933ed9cc9f720c9432d5e4c3114895cefd3579 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | __author__ = 'leifj'
# -*- coding: utf-8 -*-
import gettext
import cherrypy
import locale
import os
import six
# Change this variable to your app name!
# The translation files will be under
# @LOCALE_DIR@/@LANGUAGE@/LC_MESSAGES/@APP_NAME@.mo
APP_NAME = "pyFF"
# This is ok for maemo. Not sure in a regular desktop:
... | 26.166667 | 101 | 0.7431 |
7a5e89e05b49ed0954b7441e96daa9df27cb4dbb | 4,261 | py | Python | setup.py | Souravsp/BeamPipelinePython | f1b263b690a73059b173180ad372ecc16b3bb5ba | [
"MIT"
] | 1 | 2020-01-20T21:11:45.000Z | 2020-01-20T21:11:45.000Z | setup.py | Souravsp/BeamPipelinePython | f1b263b690a73059b173180ad372ecc16b3bb5ba | [
"MIT"
] | null | null | null | setup.py | Souravsp/BeamPipelinePython | f1b263b690a73059b173180ad372ecc16b3bb5ba | [
"MIT"
] | 1 | 2020-06-24T04:23:59.000Z | 2020-06-24T04:23:59.000Z |
"""Apache Beam SDK for Python setup file."""
from distutils.version import StrictVersion
import os
import platform
import shutil
import warnings
import setuptools
from pkg_resources import get_distribution, DistributionNotFound
def get_version():
global_names = {}
exec(open(os.path.normpath('version.py')).r... | 29.590278 | 77 | 0.682234 |
a5e36c857eade3d2c608d2a69c4bc3f080c9c13d | 3,619 | py | Python | py/common/utils.py | pombredanne/debin | 9abb5215b54077da1e9479bfcbc56cd860aac370 | [
"Apache-2.0"
] | 322 | 2018-12-06T03:32:37.000Z | 2022-03-30T06:01:03.000Z | py/common/utils.py | pombredanne/debin | 9abb5215b54077da1e9479bfcbc56cd860aac370 | [
"Apache-2.0"
] | 20 | 2019-01-30T20:22:33.000Z | 2022-01-24T11:40:37.000Z | py/common/utils.py | pombredanne/debin | 9abb5215b54077da1e9479bfcbc56cd860aac370 | [
"Apache-2.0"
] | 49 | 2019-02-13T00:25:19.000Z | 2022-03-25T05:32:56.000Z | import os
import ctypes
from common import constants
get_char = constants.PRINTABLE.__getitem__
def write_progress(msg, binary):
if binary.config.PROGRESS_PATH != '':
with open(binary.config.PROGRESS_PATH, 'w') as w:
w.write(msg)
def adapt_int_width(n, width, signed=True):
n = int(n)
... | 24.452703 | 94 | 0.57281 |
3c8989c1f6be9e6cb93582ecab051774f165c976 | 2,365 | py | Python | modules/gitbox/files/bin/gitlock.py | isabella232/infrastructure-puppet | 5fcb3429d47688b605c6b9f33e453c639af0d20c | [
"Apache-2.0"
] | 121 | 2015-01-23T20:42:14.000Z | 2022-02-28T23:36:46.000Z | modules/gitbox/files/bin/gitlock.py | isabella232/infrastructure-puppet | 5fcb3429d47688b605c6b9f33e453c639af0d20c | [
"Apache-2.0"
] | 206 | 2015-01-01T00:34:12.000Z | 2022-01-20T20:15:59.000Z | modules/gitbox/files/bin/gitlock.py | isabella232/infrastructure-puppet | 5fcb3429d47688b605c6b9f33e453c639af0d20c | [
"Apache-2.0"
] | 167 | 2015-04-15T21:13:19.000Z | 2021-11-07T21:16:59.000Z | #!/usr/bin/env python3
import os
import sys
import subprocess
import time
import getpass
GIT_ROOT = "/x1/repos/asf"
def lock(l):
""" Locks or unlocks all repos. If unlocking, also syncs with github first """
repos = sorted([f for f in os.listdir(GI... | 34.779412 | 86 | 0.446089 |
8a7e07d3d7eb4999a2c69179a7d9478aa63e0c7a | 9,669 | py | Python | lib/modules/SimulationBackend/spimosim_server.py | pasgra/spimosim | be7ca0cd58160305d64b9bd9d489974968e3c9e8 | [
"MIT"
] | 2 | 2021-04-07T15:46:14.000Z | 2021-08-05T15:56:50.000Z | lib/modules/SimulationBackend/spimosim_server.py | pasgra/spimosim | be7ca0cd58160305d64b9bd9d489974968e3c9e8 | [
"MIT"
] | null | null | null | lib/modules/SimulationBackend/spimosim_server.py | pasgra/spimosim | be7ca0cd58160305d64b9bd9d489974968e3c9e8 | [
"MIT"
] | null | null | null | import tornado.web
import tornado.httpserver
import tornado.ioloop
import tornado.websocket
import tornado.options
import json
import time
from queue import Queue
import numpy as np
import random
from copy import deepcopy
import traceback
class InvalidParameterException(Exception):
def __init__(self, invalid_param... | 37.332046 | 186 | 0.586927 |
ed3d7f7c1a314080561e054d4d963870b1885cc6 | 2,884 | py | Python | docs/source/user_guide/sqlite/examples/load_table.py | antonlydell/Pandemy | e64e836ca35dff926ee6abf93cc2cd9aa2feb798 | [
"MIT"
] | null | null | null | docs/source/user_guide/sqlite/examples/load_table.py | antonlydell/Pandemy | e64e836ca35dff926ee6abf93cc2cd9aa2feb798 | [
"MIT"
] | 1 | 2022-02-12T21:21:00.000Z | 2022-02-12T21:21:00.000Z | docs/source/user_guide/sqlite/examples/load_table.py | antonlydell/Pandemy | e64e836ca35dff926ee6abf93cc2cd9aa2feb798 | [
"MIT"
] | null | null | null | r"""Example of using the load_table method of the DatabaseManager.
This example is present in the section "Load a DataFrame from a table"
in the SQLite part of the documentation.
"""
# ===============================================================
# Imports
# =========================================================... | 31.347826 | 98 | 0.564147 |
410eec60accc108883b4c2dcb68cf949b4155cee | 540 | py | Python | carreras/manage.py | Jerts/TubularesDjango | 7b858149fee516840c612cadb6edb2c51681a29d | [
"bzip2-1.0.6"
] | null | null | null | carreras/manage.py | Jerts/TubularesDjango | 7b858149fee516840c612cadb6edb2c51681a29d | [
"bzip2-1.0.6"
] | null | null | null | carreras/manage.py | Jerts/TubularesDjango | 7b858149fee516840c612cadb6edb2c51681a29d | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'carreras.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 |
779554a598577abdaca543d6e6a2787abe20fa1c | 2,617 | py | Python | ml/rl/models/convolutional_network.py | mikepsinn/Horizon | 4ce123062320c0297b80135e0b63759c02bf5699 | [
"BSD-3-Clause"
] | 2 | 2020-07-07T07:12:25.000Z | 2021-06-29T01:47:25.000Z | ml/rl/models/convolutional_network.py | weiddeng/Horizon | 0e7fe9d742c408e1b42803b42e104efbc56bae5b | [
"BSD-3-Clause"
] | 1 | 2021-08-25T16:13:32.000Z | 2021-08-25T16:13:32.000Z | ml/rl/models/convolutional_network.py | weiddeng/Horizon | 0e7fe9d742c408e1b42803b42e104efbc56bae5b | [
"BSD-3-Clause"
] | 1 | 2018-11-04T08:50:41.000Z | 2018-11-04T08:50:41.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from ml.rl.models.fully_connected_network import FullyConnectedNetwork
logger =... | 34.893333 | 84 | 0.617119 |
2935383ee771b233c1e0f0e3e15acbf15cb682e5 | 672 | py | Python | app/core/management/commands/wait_for_db.py | nikolamatijas/recipe-python-api | eba36b4e9b988bf5101ad2cd6d9fbfe7c735cad6 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | nikolamatijas/recipe-python-api | eba36b4e9b988bf5101ad2cd6d9fbfe7c735cad6 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | nikolamatijas/recipe-python-api | eba36b4e9b988bf5101ad2cd6d9fbfe7c735cad6 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database in available"""
def handle(self, *args, **options):
self.stdout.write('WAITING... | 33.6 | 78 | 0.651786 |
fa1dabe145dc13683f90bed73cfbd5ffded7f187 | 1,182 | py | Python | nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py | nicholsn/nipype | 6601b00aac39d17bb9fb3a6801f5a740a6ebb1e3 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.utils import SwapDimensions
def test_SwapDimensions_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(n... | 26.266667 | 78 | 0.658206 |
98a966fa2ffa55278dd0b936deeb2448bd8764b3 | 1,587 | py | Python | examples/ex03_proc/test/ProcVRTL_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | examples/ex03_proc/test/ProcVRTL_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | examples/ex03_proc/test/ProcVRTL_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | """
=========================================================================
ProcVRTL_test.py
=========================================================================
Includes test cases for the translated TinyRV0 processor.
Author : Shunning Jiang, Yanghui Ou
Date : June 15, 2019
"""
import random
import pytest
... | 26.016393 | 74 | 0.575299 |
c7cb456251059a270e9a2be8d553fc90a5592693 | 778 | py | Python | Handler.py | mattduan/codegen | 1917c27744da765d07aa1800fb1cd34737d49ba6 | [
"BSD-3-Clause"
] | 1 | 2015-03-11T11:21:14.000Z | 2015-03-11T11:21:14.000Z | Handler.py | mattduan/codegen | 1917c27744da765d07aa1800fb1cd34737d49ba6 | [
"BSD-3-Clause"
] | null | null | null | Handler.py | mattduan/codegen | 1917c27744da765d07aa1800fb1cd34737d49ba6 | [
"BSD-3-Clause"
] | null | null | null | #######################################################################
#
# Copyright (c) 2005 Guoqiang Duan. All Rights Reserved.
#
#######################################################################
"""
Handler is used to handle output string.
"""
__version__='$Revision: 1709 $'[11:-2]
__author__ = "Duan Guoqia... | 21.027027 | 71 | 0.529563 |
407a2992293783da0c414dac31a440b4afdd7872 | 1,400 | py | Python | spark_auto_mapper_fhir/value_sets/example_inactive.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | 1 | 2021-11-18T18:06:45.000Z | 2021-11-18T18:06:45.000Z | spark_auto_mapper_fhir/value_sets/example_inactive.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/example_inactive.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 35 | 84 | 0.763571 |
8255a5544a950ccf33bebf007db81561f710a76a | 2,024 | py | Python | chess/pgnview.py | tpott/pub_musings | 7d617a1fbed7c6f47fb5236fcf5cb9baffef4bce | [
"MIT"
] | null | null | null | chess/pgnview.py | tpott/pub_musings | 7d617a1fbed7c6f47fb5236fcf5cb9baffef4bce | [
"MIT"
] | 1 | 2021-11-28T20:55:29.000Z | 2021-11-28T20:55:29.000Z | chess/pgnview.py | tpott/pub_musings | 7d617a1fbed7c6f47fb5236fcf5cb9baffef4bce | [
"MIT"
] | null | null | null | # pgnview.py
# Trevor Pottinger
# Mon Feb 18 14:34:30 PST 2019
import argparse
import chess
import chess.pgn
import curses
import sys
import time
if sys.version_info >= (3, 5):
from typing import (Any, Callable, Optional)
def main(pgn_file, freq, log_file):
# type: (str, float, Optional[str]) -> Callable[[A... | 25.620253 | 93 | 0.554842 |
cf7e8d20fb23bf45d89b28bde6775b55f8bd257b | 573 | py | Python | pyvivint/exceptions.py | ovirs/pyvivint | aa8d68fcbdd8928e8ddbc2807a4710c2cd98ed51 | [
"MIT"
] | 3 | 2021-02-19T20:53:37.000Z | 2021-06-11T18:05:56.000Z | pyvivint/exceptions.py | ovirs/pyvivint | aa8d68fcbdd8928e8ddbc2807a4710c2cd98ed51 | [
"MIT"
] | 10 | 2020-06-18T16:09:08.000Z | 2021-09-03T20:26:44.000Z | pyvivint/exceptions.py | ovirs/pyvivint | aa8d68fcbdd8928e8ddbc2807a4710c2cd98ed51 | [
"MIT"
] | 2 | 2020-03-08T20:56:14.000Z | 2021-01-17T19:10:30.000Z | """The exceptions used by the pyvivint library."""
class VivintError(Exception):
"""General pyvivint exception occurred."""
class VivintSkyApiError(VivintError):
"""VivintSky API related exception occurred."""
class VivintSkyApiAuthenticationError(VivintSkyApiError):
"""VivintSky API authentication re... | 26.045455 | 62 | 0.771379 |
4db02f718064bd5932968ff2517b42af0d955ad1 | 6,511 | py | Python | oscar/util/selection.py | Xaxetrov/OSCAR | f3a264e2bc7d4253756b11b0dbaa58c4f9ea82a6 | [
"Apache-2.0"
] | 5 | 2017-10-11T18:08:13.000Z | 2018-06-11T09:23:03.000Z | oscar/util/selection.py | Xaxetrov/OSCAR | f3a264e2bc7d4253756b11b0dbaa58c4f9ea82a6 | [
"Apache-2.0"
] | 2 | 2018-04-18T16:25:20.000Z | 2019-04-26T14:49:52.000Z | oscar/util/selection.py | Xaxetrov/OSCAR | f3a264e2bc7d4253756b11b0dbaa58c4f9ea82a6 | [
"Apache-2.0"
] | null | null | null | import random
import numpy as np
from scipy.signal import convolve2d
from oscar.constants import *
from oscar.meta_action.meta_action_error import *
from oscar.shared.env import Env
from oscar.shared.screen import Screen
RANDOM_CENTER_JUMP_LIMIT = 3
RANDOM_CENTER_MOVE_FACTOR = 2
RANDOM_CENTER_ITERATION_LIMIT = 5
de... | 46.177305 | 120 | 0.663953 |
57c7524d010ce4f2ac67027e7ba6cba76faece57 | 4,097 | py | Python | src/models/original_e3d_lstm_net.py | kevinstan/video_prediction | e33429385aacc762bea3c298350ac08b7e76f835 | [
"Apache-2.0"
] | 7 | 2019-11-30T09:07:07.000Z | 2021-08-18T14:31:24.000Z | src/models/original_e3d_lstm_net.py | kevinstan/video_prediction | e33429385aacc762bea3c298350ac08b7e76f835 | [
"Apache-2.0"
] | 2 | 2020-04-24T13:43:03.000Z | 2020-05-01T10:12:52.000Z | src/models/original_e3d_lstm_net.py | kevinstan/video_prediction | e33429385aacc762bea3c298350ac08b7e76f835 | [
"Apache-2.0"
] | 1 | 2019-09-05T02:59:40.000Z | 2019-09-05T02:59:40.000Z | # Copyright 2019 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 ... | 36.580357 | 109 | 0.623139 |
22959708530776cee82f98bd1ff61788f693389f | 563 | py | Python | search/binary_search.py | thinhnguyenuit/dsa | d412eaac757e3383de0ccd9fd7c57478758bdaa7 | [
"Apache-2.0"
] | 1 | 2021-05-26T11:02:38.000Z | 2021-05-26T11:02:38.000Z | search/binary_search.py | thinhnguyenuit/dsa | d412eaac757e3383de0ccd9fd7c57478758bdaa7 | [
"Apache-2.0"
] | null | null | null | search/binary_search.py | thinhnguyenuit/dsa | d412eaac757e3383de0ccd9fd7c57478758bdaa7 | [
"Apache-2.0"
] | 1 | 2021-05-26T11:02:39.000Z | 2021-05-26T11:02:39.000Z | def binary_search(arr, k):
"""
Implement nonrecursive binary search
:param arr: an array sorted in ascending order
:param k: seach key K
:return: an index of array element that is equal to k
"""
l = 0
r = len(arr) - 1
while l <= r:
m = (l+r) // 2
if k == arr[m]:
... | 22.52 | 57 | 0.48135 |
b80f1ccfed897f29e2d0dc344c32fbc80223fcb5 | 5,639 | py | Python | code/mqa_raid_physical_drive_metrics.py | danielsinai/mqa-prometheus | 1c62249978bdf12f15e62a188161079972296c62 | [
"Apache-2.0"
] | 2 | 2021-06-30T17:31:02.000Z | 2022-02-13T04:47:30.000Z | code/mqa_raid_physical_drive_metrics.py | danielsinai/mqa-prometheus | 1c62249978bdf12f15e62a188161079972296c62 | [
"Apache-2.0"
] | 1 | 2021-12-06T20:45:21.000Z | 2021-12-06T20:45:21.000Z | code/mqa_raid_physical_drive_metrics.py | danielsinai/mqa-prometheus | 1c62249978bdf12f15e62a188161079972296c62 | [
"Apache-2.0"
] | 3 | 2021-06-10T11:28:14.000Z | 2022-03-08T17:18:09.000Z | # Copyright 2021 Oliver "Fitch" Fisse (fitchos@protonmail.com)
#
# 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 applic... | 60.634409 | 354 | 0.642135 |
915aafc6154ec46c273279bac3928fcc1607fea5 | 21,110 | py | Python | func/cal.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | func/cal.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | func/cal.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.nn as gnn
import pandas as pd
from sklearn.metrics import r2_score
from torch.utils.data import Dataset
from matplotlib.collections import LineCollection
device = "cuda:0" if torc... | 39.092593 | 109 | 0.584178 |
00e61bf3ff035496541b96bbe576ecb62503a0f3 | 583 | py | Python | click_project/commands/log.py | hobeika/click-project | 216da0a3b3551cc06324c98f295c90176380f201 | [
"MIT"
] | null | null | null | click_project/commands/log.py | hobeika/click-project | 216da0a3b3551cc06324c98f295c90176380f201 | [
"MIT"
] | 1 | 2021-03-17T10:39:54.000Z | 2021-03-17T10:40:39.000Z | click_project/commands/log.py | hobeika/click-project | 216da0a3b3551cc06324c98f295c90176380f201 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function, absolute_import
import click
from click_project.log import LOG_LEVELS, get_logger
from click_project.decorators import command, argument, option
LOGGER = get_logger(__name__)
@command(ignore_unknown_options=True, handle_dry_run=Tr... | 29.15 | 96 | 0.737564 |
767357a9bc569b443e1b4c3a98b2628d922942d0 | 12,198 | py | Python | SpatialModelEditor.py | fermi-lat/modelEditor | 20a4a7e48b9faa0765dbbae11a59afbbcaa37c66 | [
"BSD-3-Clause"
] | null | null | null | SpatialModelEditor.py | fermi-lat/modelEditor | 20a4a7e48b9faa0765dbbae11a59afbbcaa37c66 | [
"BSD-3-Clause"
] | 4 | 2019-03-20T09:21:45.000Z | 2020-05-29T17:17:22.000Z | SpatialModelEditor.py | fermi-lat/modelEditor | 20a4a7e48b9faa0765dbbae11a59afbbcaa37c66 | [
"BSD-3-Clause"
] | null | null | null | # $Id: SpatialModelEditor.py,v 1.1.1.1.6.2 2017/02/01 04:22:14 jasercio Exp $
#******************************************************************************
# Import external modules.
# Standard modules
from tkinter.filedialog import Open
import tkinter
# Third-party modules
import Pmw
# Project modules
from Elem... | 30.571429 | 79 | 0.562141 |
ae62ccb2bcd03e6bb63d56b19c1f2036de764720 | 10,220 | py | Python | src/cloudformation_to_terraform/spec/route53.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | src/cloudformation_to_terraform/spec/route53.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | src/cloudformation_to_terraform/spec/route53.py | wheerd/cloudformation-to-terraform | 5411b33293e1f7d7673bb5d4cb52ff0537240db3 | [
"MIT"
] | null | null | null | from . import *
class AWS_Route53_HostedZone_HostedZoneTag(CloudFormationProperty):
def write(self, w):
with w.block("hosted_zone_tag"):
self.property(w, "Key", "key", StringValueConverter())
self.property(w, "Value", "value", StringValueConverter())
class AWS_Route53_HostedZone_... | 52.142857 | 183 | 0.682094 |
4315a9d78fc7de1a5d84192caaacd74894ad505e | 411 | py | Python | Python Projects/shows/show_app/models.py | that-other-alexa/bootcamp-projects | 68c1fc700c879b2742f33241998e815fe54dea99 | [
"MIT"
] | null | null | null | Python Projects/shows/show_app/models.py | that-other-alexa/bootcamp-projects | 68c1fc700c879b2742f33241998e815fe54dea99 | [
"MIT"
] | null | null | null | Python Projects/shows/show_app/models.py | that-other-alexa/bootcamp-projects | 68c1fc700c879b2742f33241998e815fe54dea99 | [
"MIT"
] | null | null | null | from django.db import models
import datetime
class show(models.Model):
title = models.CharField(max_length=255, blank=False, unique=True)
network = models.CharField(max_length=255, blank=False)
desc = models.CharField(max_length=255)
release_date = models.DateField(null=True)
created_at = mode... | 31.615385 | 70 | 0.751825 |
0bdb49696c2165ecc7611f57598982365905679c | 7,914 | py | Python | spoofcheck.py | Kr0ff/spoofcheck | 6db3aa27af609a766d6a46d0ee5fa051ef0c6a62 | [
"MIT"
] | 1 | 2022-01-04T02:12:18.000Z | 2022-01-04T02:12:18.000Z | spoofcheck.py | Kr0ff/spoofcheck | 6db3aa27af609a766d6a46d0ee5fa051ef0c6a62 | [
"MIT"
] | null | null | null | spoofcheck.py | Kr0ff/spoofcheck | 6db3aa27af609a766d6a46d0ee5fa051ef0c6a62 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import sys
import logging
try:
from libs.emailprotectionslib import dmarc as dmarclib
from libs.emailprotectionslib import spf as spflib
from colorama import init as color_init
import argparse
except ImportError as e:
print(f"[X] Some libraries are missing - {e}\r\n")
... | 32.040486 | 114 | 0.690675 |
8dec2828bf31e53095b13d2d39dcbbc77deae96b | 1,204 | py | Python | centrifuge/main.py | datadonK23/Engine | 8f69747fcf18325d1e72dc1ee970e1367db66f68 | [
"Apache-2.0"
] | 15 | 2018-05-04T21:17:39.000Z | 2021-11-14T11:41:34.000Z | centrifuge/main.py | datadonK23/Engine | 8f69747fcf18325d1e72dc1ee970e1367db66f68 | [
"Apache-2.0"
] | 10 | 2018-07-19T16:06:57.000Z | 2018-10-12T09:33:32.000Z | centrifuge/main.py | datadonK23/Engine | 8f69747fcf18325d1e72dc1ee970e1367db66f68 | [
"Apache-2.0"
] | 4 | 2018-04-25T12:34:28.000Z | 2020-04-09T15:19:19.000Z | #!/usr/bin/env python3
"""
Module Docstring
"""
__author__ = "Your Name"
__version__ = "0.1.0"
__license__ = "MIT"
import argparse
from logzero import logger
def main(args):
""" Main entry point of the app """
logger.info("hello world")
logger.info(args)
if __name__ == "__main__":
""" This is exec... | 24.571429 | 75 | 0.630399 |
5d57f4ed7bd1dbdd20ccd0b2f4db7b7412defbf1 | 14,785 | py | Python | Arvore Splay (TP3 B)/mainBSplay-vRelatorio.py | DFTF-PConsole/AED-Labs-Arvores-LEI | 2149b4f6058fb581282c5c5d813ae99e233e453b | [
"MIT"
] | null | null | null | Arvore Splay (TP3 B)/mainBSplay-vRelatorio.py | DFTF-PConsole/AED-Labs-Arvores-LEI | 2149b4f6058fb581282c5c5d813ae99e233e453b | [
"MIT"
] | null | null | null | Arvore Splay (TP3 B)/mainBSplay-vRelatorio.py | DFTF-PConsole/AED-Labs-Arvores-LEI | 2149b4f6058fb581282c5c5d813ae99e233e453b | [
"MIT"
] | null | null | null | # #### NOTAS #### V1 Abordagem: Percorre ate as folhas, insere, e depois traz-lo para a raz (splaying)
# Possui Pesquisa Binaria em Arrays
# Arvore Splay
# *** VERSAO RELATORIO ***
# #### BIBLIOTECAS ####
import sys
import time
import msvcrt
from io import StringIO
# #### CONSTANTES ####
CMD_IN_LINHAS = "LINHAS"
CM... | 41.765537 | 124 | 0.542712 |
1b10831821ca5ebf02325aad688547895ea8156d | 438 | py | Python | scripts/userfn.py | earthobservatory/giant_time_series | eb6fc839f62da74e82a417e404ec0d65ceacd559 | [
"Apache-2.0"
] | 1 | 2020-02-20T02:37:46.000Z | 2020-02-20T02:37:46.000Z | scripts/userfn.py | earthobservatory/giant_time_series | eb6fc839f62da74e82a417e404ec0d65ceacd559 | [
"Apache-2.0"
] | 1 | 2019-06-07T05:27:37.000Z | 2019-06-07T05:27:37.000Z | scripts/userfn.py | earthobservatory/giant_time_series | eb6fc839f62da74e82a417e404ec0d65ceacd559 | [
"Apache-2.0"
] | 1 | 2020-07-26T17:27:16.000Z | 2020-07-26T17:27:16.000Z | #!/usr/bin/env python2
import os
def makefnames(dates1, dates2, sensor):
root = os.path.join(dates1+'_'+dates2)
iname = os.path.join(root, 'merged', 'aligned.unw.vrt')
if not os.path.exists(iname):
iname = os.path.join(root, 'aligned.unw.vrt')
cname = os.path.join(root, 'merged', 'aligned.cor.... | 33.692308 | 59 | 0.643836 |
6961cc7f591d93a92c5b8ab8a35595349852677b | 2,904 | py | Python | run_grasp_evaluation.py | NVlabs/deformable_object_grasping | c39147c6ce525e90512f54c3c5386903a0e7f401 | [
"MIT"
] | 30 | 2020-12-18T22:05:10.000Z | 2021-09-27T23:45:18.000Z | run_grasp_evaluation.py | NVlabs/DefGraspSim | e6c1a9760ded188e6986cc49d0298a2c8803830d | [
"MIT"
] | 2 | 2021-12-09T18:05:22.000Z | 2022-03-20T08:26:04.000Z | run_grasp_evaluation.py | NVlabs/deformable_object_grasping | c39147c6ce525e90512f54c3c5386903a0e7f401 | [
"MIT"
] | 7 | 2021-01-16T06:23:02.000Z | 2021-09-02T16:32:19.000Z | # Copyright (c) 2020 NVIDIA Corporation
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, d... | 41.485714 | 100 | 0.72865 |
22853b3443b716bfab9e26a3692b00438b8c7551 | 160,082 | py | Python | lingvo/core/gshard_builder.py | drpngx/lingvo | adb50163814fd5dd2f07ac186adaedfe57ba4b2a | [
"Apache-2.0"
] | null | null | null | lingvo/core/gshard_builder.py | drpngx/lingvo | adb50163814fd5dd2f07ac186adaedfe57ba4b2a | [
"Apache-2.0"
] | null | null | null | lingvo/core/gshard_builder.py | drpngx/lingvo | adb50163814fd5dd2f07ac186adaedfe57ba4b2a | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 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 ... | 40.847665 | 108 | 0.630764 |
8cca94146a898f0eced5bb30fdc5ec80cc891484 | 3,517 | py | Python | ctapipe/io/mock.py | rdelosreyes/myctapipe | dad0784b60de986d5ee871e7b61a951e948998d6 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/io/mock.py | rdelosreyes/myctapipe | dad0784b60de986d5ee871e7b61a951e948998d6 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/io/mock.py | rdelosreyes/myctapipe | dad0784b60de986d5ee871e7b61a951e948998d6 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Create a mock event stream of array events
"""
import logging
from .containers import RawData, RawCameraData
from ctapipe.core import Container
from ctapipe.reco import mock
import numpy as np
from scipy.stats import norm
logger = logging.getLogger(_... | 32.564815 | 79 | 0.598521 |
209ca86c63dcd1de966ed5dee111b339c7817d40 | 10,522 | py | Python | src/olympia/users/admin.py | kumar303/addons-server | 5494bfdb4801e87220d17e35e0fa2ab4f017eac9 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/users/admin.py | kumar303/addons-server | 5494bfdb4801e87220d17e35e0fa2ab4f017eac9 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/users/admin.py | kumar303/addons-server | 5494bfdb4801e87220d17e35e0fa2ab4f017eac9 | [
"BSD-3-Clause"
] | null | null | null | import functools
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.utils import unquote
from django.db.utils import IntegrityError
from django.http import (
Http404, HttpResponseForbidden, HttpResponseNotAllowed,
HttpResponseRedirect)
from django.utils.encodi... | 39.115242 | 79 | 0.623456 |
73552ebff757556fc66434454c94c1278c5e113c | 7,506 | py | Python | fastcore/dispatch.py | jnothman/fastcore | b1c5359b2c2d2f5e32468ca536984e8bb9bc9e19 | [
"Apache-2.0"
] | 726 | 2019-12-03T00:10:29.000Z | 2022-03-27T07:44:00.000Z | fastcore/dispatch.py | jnothman/fastcore | b1c5359b2c2d2f5e32468ca536984e8bb9bc9e19 | [
"Apache-2.0"
] | 385 | 2019-12-09T14:27:02.000Z | 2022-03-31T03:44:33.000Z | fastcore/dispatch.py | jnothman/fastcore | b1c5359b2c2d2f5e32468ca536984e8bb9bc9e19 | [
"Apache-2.0"
] | 254 | 2019-12-03T20:19:53.000Z | 2022-03-16T02:10:38.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_dispatch.ipynb (unless otherwise specified).
__all__ = ['lenient_issubclass', 'sorted_topologically', 'TypeDispatch', 'DispatchReg', 'typedispatch', 'cast',
'retain_meta', 'default_set_meta', 'retain_type', 'retain_types', 'explode_types']
# Cell
from .imp... | 35.742857 | 111 | 0.626166 |
6b0dfcae2cf06f6e5274b1ac8a8bd972daf56359 | 5,135 | py | Python | kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_label_selector.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 21 | 2018-02-21T23:59:28.000Z | 2021-12-08T05:47:37.000Z | kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_label_selector.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 47 | 2018-02-01T15:35:01.000Z | 2022-02-11T07:45:54.000Z | kubevirt/models/k8s_io_apimachinery_pkg_apis_meta_v1_label_selector.py | gabriel-samfira/client-python | c2e184c3cad6797af35b0160a36ffcbba77284a7 | [
"Apache-2.0"
] | 19 | 2018-04-03T09:20:52.000Z | 2021-06-01T06:07:28.000Z | # coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class K8sIoApi... | 33.344156 | 269 | 0.635833 |
d3263b446f489034187659a122b5984efadc07c0 | 4,515 | py | Python | defoe/nlsArticles/archive_combine.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 2 | 2022-02-14T12:10:54.000Z | 2022-02-14T12:35:44.000Z | defoe/nlsArticles/archive_combine.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 17 | 2022-02-09T21:46:14.000Z | 2022-02-25T14:55:09.000Z | defoe/nlsArticles/archive_combine.py | kallewesterling/defoe | d72af2f748fd4363a4718c93bb0b0284b8cb1f3e | [
"MIT"
] | 1 | 2022-02-14T13:19:08.000Z | 2022-02-14T13:19:08.000Z | """
Abstract base class for object model representation of [ZIP] archive
of files in ALTO format.
"""
import abc
import re
import zipfile
from defoe.nlsArticles.document import Document
from defoe.spark_utils import open_stream
from os import listdir
from os.path import isfile, join
class AltoArchive(object, metacl... | 28.757962 | 88 | 0.60443 |
c448c3cf98c17ccfed371d866ed5a7af32c024d6 | 1,911 | py | Python | numerical/matrix/linear_space.py | luizmugnaini/numerical | 316ef5207a49aa5159073e6d18a0f351485f6167 | [
"MIT"
] | null | null | null | numerical/matrix/linear_space.py | luizmugnaini/numerical | 316ef5207a49aa5159073e6d18a0f351485f6167 | [
"MIT"
] | null | null | null | numerical/matrix/linear_space.py | luizmugnaini/numerical | 316ef5207a49aa5159073e6d18a0f351485f6167 | [
"MIT"
] | 3 | 2021-08-31T14:15:18.000Z | 2021-08-31T15:21:31.000Z | """
Authors: Luiz Gustavo Mugnaini Anselmo (nUSP: 11809746)
Victor Manuel Dias Saliba (nUSP: 11807702)
Luan Marc Suquet Camargo (nUSP: 11809090)
Computacao III (CCM): Ep 3 QR factorization
"""
import math
import numpy as np
class RealSpace:
"""Real Space methods"""
@classmethod
... | 32.948276 | 79 | 0.573522 |
b4d974ec9f578869984e1c9ed245231de857f4b6 | 6,665 | py | Python | 360to2d.py | danieltao/vr_sickness_flownet2 | bb5dacd43a7c91776bb36fa42960a6ff01421c40 | [
"Apache-2.0"
] | null | null | null | 360to2d.py | danieltao/vr_sickness_flownet2 | bb5dacd43a7c91776bb36fa42960a6ff01421c40 | [
"Apache-2.0"
] | null | null | null | 360to2d.py | danieltao/vr_sickness_flownet2 | bb5dacd43a7c91776bb36fa42960a6ff01421c40 | [
"Apache-2.0"
] | 2 | 2020-11-18T21:35:20.000Z | 2021-02-04T00:30:34.000Z | import os
import sys
import cv2
import numpy as np
from matplotlib.pyplot import imread, imsave
import time
class Enquirec2Perspec:
# _init_ function
# Input: 1. img: current frame of the panoramic video
def __init__(self, img):
self._img = img
[self._height, self._width, _] = s... | 46.608392 | 172 | 0.578095 |
f9296a2635644a6932091dc690bb9ed3a5f78637 | 10,792 | py | Python | pyxllib/robot/utools.py | XLPRUtils/pyUtils | 3a62c14b0658ad3c24d83f953ee0d88530b02b23 | [
"Apache-2.0"
] | null | null | null | pyxllib/robot/utools.py | XLPRUtils/pyUtils | 3a62c14b0658ad3c24d83f953ee0d88530b02b23 | [
"Apache-2.0"
] | null | null | null | pyxllib/robot/utools.py | XLPRUtils/pyUtils | 3a62c14b0658ad3c24d83f953ee0d88530b02b23 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author : 陈坤泽
# @Email : 877362867@qq.com
# @Date : 2021/04/04 17:03
""" 专门给utools的快捷命令扩展的一系列python工具库
"""
from pyxllib.prog.pupil import check_install_package
check_install_package('fire')
check_install_package('humanfriendly')
check_install_package('pandas')
check... | 33.206154 | 116 | 0.572276 |
0fd6e16c23c27a9468a1f569ad316670ee9247a6 | 1,471 | py | Python | tests/functional/services/user/user_service/settings.py | sanketsaurav/pysoa | 408786ea50bba00817723d9415ced8fa5e97967c | [
"Apache-2.0"
] | null | null | null | tests/functional/services/user/user_service/settings.py | sanketsaurav/pysoa | 408786ea50bba00817723d9415ced8fa5e97967c | [
"Apache-2.0"
] | null | null | null | tests/functional/services/user/user_service/settings.py | sanketsaurav/pysoa | 408786ea50bba00817723d9415ced8fa5e97967c | [
"Apache-2.0"
] | 1 | 2020-02-21T07:17:48.000Z | 2020-02-21T07:17:48.000Z | from pysoa.common.transport.redis_gateway.constants import REDIS_BACKEND_TYPE_SENTINEL
SECRET_KEY = 'aou8a1ud34pa8ofe4c8tce6geo78hu8o89hu8'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': 'mysql.pysoa',
'USER': 'root',
'PASSWORD': 'functionalTestPassword',
... | 29.42 | 86 | 0.587356 |
c7fa6f4d45cc83c02bb71ef86267b20457ed1629 | 7,663 | py | Python | rpython/rlib/parsing/regex.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/rlib/parsing/regex.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/rlib/parsing/regex.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | import py
import string
from rpython.rlib.parsing.deterministic import NFA
set = py.builtin.set
class RegularExpression(object):
def __init__(self):
raise NotImplementedError("abstract base class")
def make_automaton(self):
raise NotImplementedError("abstract base class")
def __a... | 33.90708 | 79 | 0.612684 |
a3cd290056b44ca0007d998b4e660c434acbc8ea | 1,366 | py | Python | tools/android/wpr/chrome_proxy_wpr_record.py | iridium-browser/iridium-browser | 907e31cf5ce5ad14d832796e3a7c11e496828959 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 575 | 2015-06-18T23:58:20.000Z | 2022-03-23T09:32:39.000Z | tools/android/wpr/chrome_proxy_wpr_record.py | iridium-browser/iridium-browser | 907e31cf5ce5ad14d832796e3a7c11e496828959 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | tools/android/wpr/chrome_proxy_wpr_record.py | DamieFC/chromium | 54ce2d3c77723697efd22cfdb02aea38f9dfa25c | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 52 | 2015-07-14T10:40:50.000Z | 2022-03-15T01:11:49.000Z | #!/usr/bin/python2
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Begins proxying requests from Chrome, recording a WPR replay file.
To use the proxy, run Chrome with the flags printed by this script.
... | 30.355556 | 75 | 0.77672 |
c1c7b780150815bf11b78021835582409566b81d | 3,140 | py | Python | setup.py | mapaction/mapactionpy_controller_dependencies | 46902e298fbf52423d8b91e5116ced64fd088f21 | [
"Unlicense"
] | null | null | null | setup.py | mapaction/mapactionpy_controller_dependencies | 46902e298fbf52423d8b91e5116ced64fd088f21 | [
"Unlicense"
] | null | null | null | setup.py | mapaction/mapactionpy_controller_dependencies | 46902e298fbf52423d8b91e5116ced64fd088f21 | [
"Unlicense"
] | null | null | null | import subprocess
import sys
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from os import path, environ
import sys
import subprocess
_base_version = '1.1'
root_dir = path.abspath(path.dirname(__file__))
def _get_requires_list... | 33.052632 | 87 | 0.650955 |
1fe9894c3bebecea4e30bfdf205cb6c099086718 | 15,484 | py | Python | aoc2019/day06/orbits.py | shoreofwonder/adventofcode | 15fd2f761533a48b456e510b0a59f7cbc64e8e91 | [
"MIT"
] | null | null | null | aoc2019/day06/orbits.py | shoreofwonder/adventofcode | 15fd2f761533a48b456e510b0a59f7cbc64e8e91 | [
"MIT"
] | null | null | null | aoc2019/day06/orbits.py | shoreofwonder/adventofcode | 15fd2f761533a48b456e510b0a59f7cbc64e8e91 | [
"MIT"
] | null | null | null |
input = """
797)67Y
W32)48L
J31)N9K
QQ3)NVL
MP6)JBY
8T3)H27
DRK)THF
BSN)7MD
Z2G)VRX
CVV)XDC
WVW)SV6
D3H)QMG
9BM)NTH
4T7)FQS
F58)D1Q
CR7)B7L
4W8)T9Z
5SB)5JB
DRJ)YQD
76X)X1Z
WC9)LNG
52C)W7J
9ZS)KM7
3RW)C8R
7RQ)TJW
HVN)ZNQ
SQK)CBT
GWC)N76
KBQ)W44
QD5)RVQ
SQF)N3K
RZ1)B2R
TB5)34W
J56)CQD
34Y)HLX
DTM)TD4
2RF)SQV
GJT)TFD
CNK... | 8.36973 | 66 | 0.737794 |
aa3450c939bdf9a4ac489f31d32d8d559db7f1e1 | 9,412 | py | Python | TSM/mmaction/apis/train.py | balaganeshmohan/Emotion-recognition | ad4816226598155c273d99fa4a4ca80953adcaa1 | [
"MIT"
] | null | null | null | TSM/mmaction/apis/train.py | balaganeshmohan/Emotion-recognition | ad4816226598155c273d99fa4a4ca80953adcaa1 | [
"MIT"
] | null | null | null | TSM/mmaction/apis/train.py | balaganeshmohan/Emotion-recognition | ad4816226598155c273d99fa4a4ca80953adcaa1 | [
"MIT"
] | null | null | null | import copy as cp
import os.path as osp
import torch
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (DistSamplerSeedHook, EpochBasedRunner, OptimizerHook,
build_optimizer, get_dist_info)
from mmcv.runner.hooks import Fp16OptimizerHook
from ..core i... | 40.921739 | 79 | 0.597323 |
c656e40f5eba57b4dc8e0afa745b1698f1cc3338 | 1,185 | py | Python | Lib/Fases/__init__.py | tiagoCabralS/Number-Guessing-Game | df1e72f3d092f6d262d703d7049cd8fcc93728e8 | [
"MIT"
] | null | null | null | Lib/Fases/__init__.py | tiagoCabralS/Number-Guessing-Game | df1e72f3d092f6d262d703d7049cd8fcc93728e8 | [
"MIT"
] | null | null | null | Lib/Fases/__init__.py | tiagoCabralS/Number-Guessing-Game | df1e72f3d092f6d262d703d7049cd8fcc93728e8 | [
"MIT"
] | null | null | null | def leiaInt(msg):
n = ''
ok = False
while not ok:
try:
n = str(input(f'{msg}'))
n = int(n)
ok = True
except:
print('\033[0;31mERRO! Digite um número inteiro válido.\033[m')
return n
def fase(maxi, ultima=False):
from random import ran... | 34.852941 | 131 | 0.553586 |
2cc1bb770eda2bcf23b307826c6ae2d23917351c | 3,940 | py | Python | scitbx/lbfgs/dev/run.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/lbfgs/dev/run.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/lbfgs/dev/run.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
from scitbx import lbfgs as scitbx_lbfgs
from scitbx.array_family import flex
from libtbx import adopt_init_args
# Rosenbrock's function, gradients and curvatures
def target(x,y):
return (1-x)**2+100*(y-x**2)**2
def grad_x(x,y):
return -2*(1-x) + 400*(-x*y+x**3)
def grad_y(x,y):
... | 30.307692 | 77 | 0.650761 |
730812b7aa8bea66898cebd58a0fb2105d05508a | 10,374 | py | Python | nextdl/extractor/rts.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | 1 | 2021-12-19T13:55:20.000Z | 2021-12-19T13:55:20.000Z | nextdl/extractor/rts.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | nextdl/extractor/rts.py | devenu85/nextdl | 0b458f556e2e0be80cb94bd9a9b1405ad2e9182d | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import (determine_ext, int_or_none, parse_duration, parse_iso8601,
unescapeHTML, urljoin)
from .srgssr import SRGSSRIE
class RTSIE(SRGSSRIE):
IE_DESC = "RTS.ch"
_VALID_URL = r"... | 38.708955 | 156 | 0.471756 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.