hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a0d093369bc2e08d213744c334aad38732708d6 | 180 | py | Python | wfs/urls.py | vascop/django-wfs | e13e3fcba574de3da94d9081f603efaffe972f14 | [
"Apache-2.0"
] | 6 | 2015-06-22T12:42:45.000Z | 2018-04-04T10:09:57.000Z | wfs/urls.py | vascop/django-wfs | e13e3fcba574de3da94d9081f603efaffe972f14 | [
"Apache-2.0"
] | 2 | 2016-06-17T18:51:15.000Z | 2017-06-26T11:35:07.000Z | wfs/urls.py | vascop/django-wfs | e13e3fcba574de3da94d9081f603efaffe972f14 | [
"Apache-2.0"
] | 8 | 2016-06-06T21:15:05.000Z | 2022-02-11T20:54:39.000Z | from django.conf.urls import patterns, url
from wfs.views import global_handler
# APP
urlpatterns = patterns('',
url(r'^(?P<service_id>\d+)/$', global_handler, name='wfs'),
)
| 22.5 | 63 | 0.7 |
4a0d09580fb41f704f58e31a206ea6a16472ee3d | 1,289 | py | Python | addons/portal/models/mail_message.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/portal/models/mail_message.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/portal/models/mail_message.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class MailMessage(models.Model):
_inherit = 'mail.message'
@api.multi
def portal_message_format(self):
return self._portal_message_format([
'id', 'body', 'd... | 39.060606 | 117 | 0.641583 |
4a0d096da73fba95c401e45c95bc833c188ed183 | 1,275 | py | Python | backend/users/migrations/0002_auto_20210901_1337.py | crowdbotics-apps/multireligionval-30247 | 1e3bfa08e7445a4c337e293457736825b978bfc0 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/migrations/0002_auto_20210901_1337.py | crowdbotics-apps/multireligionval-30247 | 1e3bfa08e7445a4c337e293457736825b978bfc0 | [
"FTL",
"AML",
"RSA-MD"
] | 8 | 2021-09-06T08:23:45.000Z | 2022-03-20T15:32:52.000Z | backend/users/migrations/0002_auto_20210901_1337.py | crowdbotics-apps/multireligionval-30247 | 1e3bfa08e7445a4c337e293457736825b978bfc0 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.24 on 2021-09-01 13:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="user",
name="last_updated",
... | 28.977273 | 75 | 0.560784 |
4a0d0a70f5a88c30f0199ee89a0cbcdeb49bd0ea | 1,625 | py | Python | memcached_mon/memcached_alarm.py | yyuunn0044/oss-hubblemon | f90635f7b66defd1515516fcec61973fa75a6f84 | [
"Apache-2.0"
] | 62 | 2015-10-01T09:01:58.000Z | 2021-07-09T14:47:38.000Z | memcached_mon/memcached_alarm.py | yyuunn0044/oss-hubblemon | f90635f7b66defd1515516fcec61973fa75a6f84 | [
"Apache-2.0"
] | 13 | 2015-10-01T14:07:15.000Z | 2019-10-12T18:54:52.000Z | memcached_mon/memcached_alarm.py | yyuunn0044/oss-hubblemon | f90635f7b66defd1515516fcec61973fa75a6f84 | [
"Apache-2.0"
] | 38 | 2015-10-01T09:10:00.000Z | 2021-12-02T12:35:03.000Z |
#
# Hubblemon - Yet another general purpose system monitor
#
# Copyright 2015 NAVER Corp.
#
# 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
#
# U... | 27.083333 | 95 | 0.736615 |
4a0d0d2e9c32e451ab378a68610cdbea25cdc552 | 3,463 | py | Python | BacterialTyper/report/get_promoter.py | HCGB-IGTP/BacterialTyper | 215e29a0381d4ae616cf0a6462a04117dc30e293 | [
"MIT"
] | 2 | 2021-03-11T08:50:06.000Z | 2021-12-16T14:35:37.000Z | BacterialTyper/report/get_promoter.py | HCGB-IGTP/BacterialTyper | 215e29a0381d4ae616cf0a6462a04117dc30e293 | [
"MIT"
] | 5 | 2021-06-15T11:49:26.000Z | 2022-03-12T00:58:37.000Z | BacterialTyper/report/get_promoter.py | HCGB-IGTP/BacterialTyper | 215e29a0381d4ae616cf0a6462a04117dc30e293 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
##########################################################
## Jose F. Sanchez ##
## Copyright (C) 2019-2020 Lauro Sumoy Lab, IGTP, Spain ##
##########################################################
"""
Retrieves promoter sequences for gene ids from profile an... | 35.336735 | 126 | 0.559342 |
4a0d0d36fd5646cf3a36a6ee8dc1ca256856d3c9 | 618 | py | Python | tests/gpt_hhcell.py | borismarin/org.geppetto.model.apigen | ed099ac64301de11570779e5e294b7a210a0e0b2 | [
"MIT"
] | null | null | null | tests/gpt_hhcell.py | borismarin/org.geppetto.model.apigen | ed099ac64301de11570779e5e294b7a210a0e0b2 | [
"MIT"
] | null | null | null | tests/gpt_hhcell.py | borismarin/org.geppetto.model.apigen | ed099ac64301de11570779e5e294b7a210a0e0b2 | [
"MIT"
] | null | null | null | """
This module will be generated when the API for a given Geppetto Library is
requested (it will be made avaiable along with the exported lib .json).
It should have the same name as the library.
This shields the user from internals (such as the json file itself), so that
the domain classes are prominent.
"""
from os.p... | 41.2 | 77 | 0.76699 |
4a0d0d393b2f0bd577a9dd65620b00513229c8b9 | 33,868 | py | Python | win/pywinauto/unittests/test_common_controls.py | sk8darr/BrowserRefresh-Sublime | daee0eda6480c07f8636ed24e5c555d24e088886 | [
"MIT",
"Unlicense"
] | 191 | 2015-01-02T12:17:07.000Z | 2021-05-26T09:26:05.000Z | win/pywinauto/unittests/test_common_controls.py | sk8darr/BrowserRefresh-Sublime | daee0eda6480c07f8636ed24e5c555d24e088886 | [
"MIT",
"Unlicense"
] | 48 | 2015-01-14T00:57:36.000Z | 2021-04-06T21:45:42.000Z | win/pywinauto/unittests/test_common_controls.py | sk8darr/BrowserRefresh-Sublime | daee0eda6480c07f8636ed24e5c555d24e088886 | [
"MIT",
"Unlicense"
] | 36 | 2015-01-14T18:54:25.000Z | 2021-07-18T10:54:42.000Z | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at you... | 32.440613 | 93 | 0.610635 |
4a0d0d8b9574b20433b22df71b53c400f9d77b7f | 4,937 | py | Python | python/qitoolchain/test/test_toolchain.py | vbarbaresi/qibuild | eab6b815fe0af49ea5c41ccddcd0dff2363410e1 | [
"BSD-3-Clause"
] | null | null | null | python/qitoolchain/test/test_toolchain.py | vbarbaresi/qibuild | eab6b815fe0af49ea5c41ccddcd0dff2363410e1 | [
"BSD-3-Clause"
] | null | null | null | python/qitoolchain/test/test_toolchain.py | vbarbaresi/qibuild | eab6b815fe0af49ea5c41ccddcd0dff2363410e1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYING file.
import os
import qisrc.git
from qisrc.test.conftest import git_server, svn_server # pylint: disable=unused-import
import qitoolchain.toolchain
# pyli... | 34.524476 | 92 | 0.709135 |
4a0d0e6021b3bc05e29e5ef1045277ac81e364fc | 457 | py | Python | tests/common.py | vepkenez/python-fedex | b1356c67b42e8e98724c31e8addc406b187d765d | [
"BSD-3-Clause"
] | 1 | 2018-07-07T03:43:30.000Z | 2018-07-07T03:43:30.000Z | tests/common.py | vepkenez/python-fedex | b1356c67b42e8e98724c31e8addc406b187d765d | [
"BSD-3-Clause"
] | 1 | 2022-01-12T21:23:31.000Z | 2022-01-12T21:23:54.000Z | tests/common.py | vepkenez/python-fedex | b1356c67b42e8e98724c31e8addc406b187d765d | [
"BSD-3-Clause"
] | 1 | 2022-01-08T13:18:01.000Z | 2022-01-08T13:18:01.000Z | """
This module contains common definitions and functions used within the
test suite.
"""
from fedex.config import FedexConfig
def get_fedex_config():
"""
Returns a basic FedexConfig to test with.
"""
# Test server (Enter your credentials here)
return FedexConfig(key='',
pas... | 25.388889 | 69 | 0.571116 |
4a0d0eaa4dcb978e9f2a02a85553fa7619791f46 | 2,484 | py | Python | pytwitch/streamtip.py | jfkinslow/pytwitch | db80eb22d244463fa868b8ef73dc70a5dfe936b6 | [
"MIT"
] | 1 | 2019-07-04T19:33:30.000Z | 2019-07-04T19:33:30.000Z | pytwitch/streamtip.py | jfkinslow/pytwitch | db80eb22d244463fa868b8ef73dc70a5dfe936b6 | [
"MIT"
] | null | null | null | pytwitch/streamtip.py | jfkinslow/pytwitch | db80eb22d244463fa868b8ef73dc70a5dfe936b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import requests
from .utils import Utils
utils = Utils()
class StreamTip():
def __init__(self):
self.endpoints = {
'tips': 'https://streamtip.com/api/tips'
}
def get_tips(self, **kwargs):
# Default values, set every time you call the function
self.payload = {
'date_from': '2013-... | 29.927711 | 119 | 0.640097 |
4a0d0eac153280329c017037f11fc8e15c655a8c | 373 | py | Python | aiocloudpayments/endpoints/notifications/get.py | drforse/aiocloudpayments | 25b8827250279335d037754dca6978bc79c9b18d | [
"MIT"
] | null | null | null | aiocloudpayments/endpoints/notifications/get.py | drforse/aiocloudpayments | 25b8827250279335d037754dca6978bc79c9b18d | [
"MIT"
] | null | null | null | aiocloudpayments/endpoints/notifications/get.py | drforse/aiocloudpayments | 25b8827250279335d037754dca6978bc79c9b18d | [
"MIT"
] | null | null | null | from ..base import CpEndpoint, Request
from ...types.notification_info import NotificationInfo
class CpNotificationsGetEndpoint(CpEndpoint):
__returning__ = NotificationInfo
type: str
def build_request(self) -> Request:
return Request(
endpoint=f"site/notifications/{self.type}/get",
... | 24.866667 | 59 | 0.699732 |
4a0d0f00061dbe6e988b6f2764b818142efef4eb | 569 | py | Python | ex22_suffixarray/test_sarray.py | techieguy007/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 466 | 2016-11-01T19:40:59.000Z | 2022-03-23T16:34:13.000Z | ex22_suffixarray/test_sarray.py | Desperaaado/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 2 | 2017-09-20T09:01:53.000Z | 2017-09-21T15:03:56.000Z | ex22_suffixarray/test_sarray.py | Desperaaado/learn-more-python-the-hard-way-solutions | 7886c860f69d69739a41d6490b8dc3fa777f227b | [
"Zed",
"Unlicense"
] | 241 | 2017-06-17T08:02:26.000Z | 2022-03-30T09:09:39.000Z | from sarray import SuffixArray
def test_SuffixArray():
finder = SuffixArray("abracadabra")
assert finder.search("ra") == (9,9)
assert finder.search("abra") == (1,7)
assert finder.search("cadabra") == (7,4)
assert finder.find_shortest("abra") == 7
assert finder.find_shortest("a") == 10
as... | 28.45 | 68 | 0.620387 |
4a0d0f4c535d72cbce237435f4079db94d1a2a73 | 24,475 | py | Python | aprsd/plugins/email.py | emresaglam/aprsd | 5e50792e805c0f8f6f034c7dc010f6918e9b64a7 | [
"Apache-2.0"
] | null | null | null | aprsd/plugins/email.py | emresaglam/aprsd | 5e50792e805c0f8f6f034c7dc010f6918e9b64a7 | [
"Apache-2.0"
] | null | null | null | aprsd/plugins/email.py | emresaglam/aprsd | 5e50792e805c0f8f6f034c7dc010f6918e9b64a7 | [
"Apache-2.0"
] | null | null | null | import datetime
import email
from email.mime.text import MIMEText
import imaplib
import logging
import re
import smtplib
import threading
import time
import imapclient
from validate_email import validate_email
from aprsd import messaging, plugin, stats, threads, trace
LOG = logging.getLogger("APRSD")
class EmailI... | 34.765625 | 82 | 0.521675 |
4a0d1199764a4cc2d0735941b5ada6aaf319335e | 282 | py | Python | testing/test_fillable.py | mshriver/widgetastic.core | fe823c1e09079807e8c138a683b64ae7b02a8e74 | [
"Apache-2.0"
] | 1 | 2020-08-13T01:34:30.000Z | 2020-08-13T01:34:30.000Z | testing/test_fillable.py | mshriver/widgetastic.core | fe823c1e09079807e8c138a683b64ae7b02a8e74 | [
"Apache-2.0"
] | null | null | null | testing/test_fillable.py | mshriver/widgetastic.core | fe823c1e09079807e8c138a683b64ae7b02a8e74 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from widgetastic.utils import Fillable
def test_basic_fillable():
class MyFillable(Fillable):
def as_fill_value(self):
return 'foo'
x = MyFillable()
assert Fillable.coerce(x) == 'foo'
assert Fillable.coerce(123) == 123
| 21.692308 | 38 | 0.634752 |
4a0d11a43324f3832c9e088f0cc47de0365d1dc7 | 7,897 | py | Python | tools/configen/tests/test_generate.py | samuelstanton/hydra | 9bf7800157692795090f3695efe136bbbd6fef1d | [
"MIT"
] | 1 | 2022-01-28T06:59:29.000Z | 2022-01-28T06:59:29.000Z | tools/configen/tests/test_generate.py | samuelstanton/hydra | 9bf7800157692795090f3695efe136bbbd6fef1d | [
"MIT"
] | null | null | null | tools/configen/tests/test_generate.py | samuelstanton/hydra | 9bf7800157692795090f3695efe136bbbd6fef1d | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from textwrap import dedent
from difflib import unified_diff
from pathlib import Path
from typing import Any
from pytest import mark, param
from hydra.utils import get_class, instantiate, ConvertMode
from omegaconf import OmegaConf
from configen... | 28.406475 | 111 | 0.545144 |
4a0d11d7fb2a96dd3391fab76588d7c786d8a5a9 | 629 | py | Python | manage.py | Ten-AI/gc-backend | 4a16b23d3f7f7397214f581dab4965a09ff9fb58 | [
"MIT"
] | null | null | null | manage.py | Ten-AI/gc-backend | 4a16b23d3f7f7397214f581dab4965a09ff9fb58 | [
"MIT"
] | 5 | 2020-06-05T20:06:55.000Z | 2021-09-22T18:12:16.000Z | manage.py | Ten-AI/gc-backend | 4a16b23d3f7f7397214f581dab4965a09ff9fb58 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'gcbackend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 |
4a0d11d91e9dde921e86814b0b0f8f06ee6df762 | 547 | py | Python | tests/test_rep_pitch_reaper.py | JoFrhwld/python-acoustic-similarity | 50f71835532010b2fedf14b0ca3a52d88a9ab380 | [
"MIT"
] | 5 | 2018-01-15T22:06:20.000Z | 2022-02-21T07:02:40.000Z | tests/test_rep_pitch_reaper.py | JoFrhwld/python-acoustic-similarity | 50f71835532010b2fedf14b0ca3a52d88a9ab380 | [
"MIT"
] | null | null | null | tests/test_rep_pitch_reaper.py | JoFrhwld/python-acoustic-similarity | 50f71835532010b2fedf14b0ca3a52d88a9ab380 | [
"MIT"
] | 2 | 2019-11-28T17:06:27.000Z | 2019-12-05T22:57:28.000Z |
import pytest
from acousticsim.analysis.pitch.reaper import file_to_pitch_reaper
from numpy.testing import assert_array_almost_equal
@pytest.mark.xfail
def test_reaper(noise_path, y_path, reaperpath):
rep = file_to_pitch_reaper(noise_path, reaper_path = reaperpath, time_step = 0.01, min_pitch=75, max_pitch=600... | 32.176471 | 115 | 0.751371 |
4a0d11e7c3e2c23486b4e75c821f8823212d10c0 | 1,409 | py | Python | servo/data/atlas_rev5.py | neverware-mirrors/hdctools | dd7f911bb9051e615af7fcb71d921bd481f934fb | [
"BSD-3-Clause"
] | null | null | null | servo/data/atlas_rev5.py | neverware-mirrors/hdctools | dd7f911bb9051e615af7fcb71d921bd481f934fb | [
"BSD-3-Clause"
] | null | null | null | servo/data/atlas_rev5.py | neverware-mirrors/hdctools | dd7f911bb9051e615af7fcb71d921bd481f934fb | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
config_type='sweetberry'
revs = [5]
inas = [
('sweetberry', '0x40:3', 'pp975_io', 7.7, 0.100, 'j2', True), # R111
('sweetberry', '0x40:1'... | 54.192308 | 79 | 0.536551 |
4a0d120f367cf17744f4a86183760547e189c566 | 752 | py | Python | OldIPs/OldIPs.py | psteiwer/RPiTools | 96cdaa7a46d366e201c3d1d2a15d0424bf0c295a | [
"MIT"
] | null | null | null | OldIPs/OldIPs.py | psteiwer/RPiTools | 96cdaa7a46d366e201c3d1d2a15d0424bf0c295a | [
"MIT"
] | null | null | null | OldIPs/OldIPs.py | psteiwer/RPiTools | 96cdaa7a46d366e201c3d1d2a15d0424bf0c295a | [
"MIT"
] | null | null | null | import json
import subprocess
with open("OldIPs.json","r") as oldipsfile:
oldips=json.load(oldipsfile)
oldexternal=oldips["External"]
oldinternal=oldips["Internal"]
print oldexternal
print oldinternal
retval=subprocess.check_output(["ifconfig","wlan0"])
newinternal=retval[retval.find("i... | 23.5 | 77 | 0.670213 |
4a0d1231444dc23028014773b10892947030e837 | 24,798 | py | Python | pandas/core/indexes/timedeltas.py | zhezherun/pandas | 36c1104b7ad9761e020f7e8198eb60da4045d169 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/timedeltas.py | zhezherun/pandas | 36c1104b7ad9761e020f7e8198eb60da4045d169 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/timedeltas.py | zhezherun/pandas | 36c1104b7ad9761e020f7e8198eb60da4045d169 | [
"BSD-3-Clause"
] | null | null | null | """ implement the TimedeltaIndex """
from datetime import datetime
import numpy as np
from pandas._libs import (
NaT, Timedelta, index as libindex, join as libjoin, lib)
import pandas.compat as compat
from pandas.util._decorators import Appender, Substitution
from pandas.core.dtypes.common import (
_TD_DTYPE... | 34.251381 | 84 | 0.594322 |
4a0d16a4936025f54b6da1482d355bde72223a28 | 1,070 | py | Python | spacy/__init__.py | lineality/spaCy | 1aa2d4dac9ef414b3388743c40cc65e4880f115a | [
"MIT"
] | 4 | 2020-02-21T16:12:01.000Z | 2020-02-21T17:04:12.000Z | spacy/__init__.py | Jorgecardenas1/spaCy | fb73d4943a91d18cd36ded98994a932515f4bf05 | [
"MIT"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | spacy/__init__.py | Jorgecardenas1/spaCy | fb73d4943a91d18cd36ded98994a932515f4bf05 | [
"MIT"
] | 1 | 2021-01-12T17:44:11.000Z | 2021-01-12T17:44:11.000Z | # coding: utf8
from __future__ import unicode_literals
import warnings
import sys
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
# These are imported as part of the API
from thinc.neural.util import prefer_gpu, require_gpu
f... | 26.75 | 69 | 0.761682 |
4a0d18c33014b0b734f776f28d625f88da0b1134 | 5,781 | py | Python | classes/primitives.py | darrengarvey/classy_blocks | ac7e520223a9e3f079e8824857bb04e90f125386 | [
"MIT"
] | null | null | null | classes/primitives.py | darrengarvey/classy_blocks | ac7e520223a9e3f079e8824857bb04e90f125386 | [
"MIT"
] | null | null | null | classes/primitives.py | darrengarvey/classy_blocks | ac7e520223a9e3f079e8824857bb04e90f125386 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from ..util import functions as f
from ..util import constants
class WrongEdgeTypeException(Exception):
def __init__(self, edge_type, *args, **kwargs):
raise Exception(f"Wrong edge type: {edge_type}", *args, **kwargs)
class Vertex():
""" point with an index ... | 31.418478 | 88 | 0.553019 |
4a0d1969c2230b6872cdc7c9569436b5a6ed0753 | 1,982 | py | Python | hdanalysis/core/Segmentation.py | LLNL/NDDAV | c378bc4e36bac737d03469c8da5281c933af77d5 | [
"BSD-3-Clause"
] | 2 | 2020-03-23T12:52:41.000Z | 2021-01-04T11:24:42.000Z | hdanalysis/core/Segmentation.py | LLNL/NDDAV | c378bc4e36bac737d03469c8da5281c933af77d5 | [
"BSD-3-Clause"
] | null | null | null | hdanalysis/core/Segmentation.py | LLNL/NDDAV | c378bc4e36bac737d03469c8da5281c933af77d5 | [
"BSD-3-Clause"
] | 1 | 2021-01-19T08:35:37.000Z | 2021-01-19T08:35:37.000Z | from .Signal import *
from .HDDataObject import *
from .HDData import *
class Segment(list):
def __init__(self,arg):
if isinstance(arg,Segment):
list.__init__(self,arg)
self.representative = int(arg.representative)
elif isinstance(arg,list) or isinstance(arg, np.ndarray):
... | 26.426667 | 73 | 0.594854 |
4a0d1b3b3ccbef105f87be4b453efe80069cd72f | 1,319 | py | Python | code/reprohist.py | josemac95/umucv | f0f8de17141f4adcb4966281c3f83539ebda5f0b | [
"BSD-3-Clause"
] | null | null | null | code/reprohist.py | josemac95/umucv | f0f8de17141f4adcb4966281c3f83539ebda5f0b | [
"BSD-3-Clause"
] | null | null | null | code/reprohist.py | josemac95/umucv | f0f8de17141f4adcb4966281c3f83539ebda5f0b | [
"BSD-3-Clause"
] | null | null | null | # Ejemplo de reproyección de histograma
# Seleccionando un roi y pulsando c se captura el modelo de
# color de la región en forma de histograma y se muestra
# la verosimilitud de cada pixel de la imagen en ese modelo.
import numpy as np
import cv2 as cv
from umucv.util import ROI
from umucv.stream import autoStream
... | 29.311111 | 91 | 0.56558 |
4a0d1c5834f965fd5cb6aa4188b05db71a2adc0d | 3,089 | py | Python | backend/rumergy_backend/rumergy/views/meter_view.py | Firefly-Tech/rumergy-webapp | 859054bd9ee710a11b393027bb9cb1bad55d0f00 | [
"MIT"
] | 1 | 2021-11-08T00:28:37.000Z | 2021-11-08T00:28:37.000Z | backend/rumergy_backend/rumergy/views/meter_view.py | Firefly-Tech/rumergy-webapp | 859054bd9ee710a11b393027bb9cb1bad55d0f00 | [
"MIT"
] | 1 | 2021-11-02T02:17:37.000Z | 2021-11-02T02:17:37.000Z | backend/rumergy_backend/rumergy/views/meter_view.py | Firefly-Tech/rumergy-webapp | 859054bd9ee710a11b393027bb9cb1bad55d0f00 | [
"MIT"
] | 1 | 2021-10-18T22:27:04.000Z | 2021-10-18T22:27:04.000Z | from datetime import datetime
from rest_framework import viewsets
from rest_framework import permissions
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import status
from rumergy_backend.rumergy.serializers import MeterSerializer, MeterDataSerializer
from r... | 38.135802 | 87 | 0.679184 |
4a0d1d6cfe35dab228cf64345b5155e5307bdc03 | 8,184 | py | Python | server/database.py | XbeYoung/SimpleChatServer | 45a8badcffea7c7ae351562793a93c70a1d5e89b | [
"MIT"
] | 2 | 2018-06-18T13:01:25.000Z | 2018-08-24T06:03:37.000Z | server/database.py | XbeYoung/SimpleChatServer | 45a8badcffea7c7ae351562793a93c70a1d5e89b | [
"MIT"
] | null | null | null | server/database.py | XbeYoung/SimpleChatServer | 45a8badcffea7c7ae351562793a93c70a1d5e89b | [
"MIT"
] | null | null | null | from multiprocessing import Lock
from threading import Timer
from user import *
from utils import use_log
import json
import os
import shutil
__all__ = ['Database']
class Database(object):
def __init__(self):
raise Exception('please use Database.create_db')
def query_user_pwd(self, user_id: str, pw... | 29.545126 | 87 | 0.578935 |
4a0d1e5a1d7ca9dc701083830da84e30e8cfce56 | 563 | py | Python | tests_scripts/QuickTest/Quick_Test_Helpers.py | vineethreddyramasa/uno-community-partnership | 694886b7ad7fa98f6dbb24b03476962cfadebc70 | [
"MIT"
] | 13 | 2018-08-30T16:03:18.000Z | 2019-11-25T07:08:43.000Z | tests_scripts/QuickTest/Quick_Test_Helpers.py | vineethreddyramasa/uno-community-partnership | 694886b7ad7fa98f6dbb24b03476962cfadebc70 | [
"MIT"
] | 814 | 2018-08-30T02:28:55.000Z | 2022-03-11T23:31:45.000Z | tests_scripts/QuickTest/Quick_Test_Helpers.py | vineethreddyramasa/uno-community-partnership | 694886b7ad7fa98f6dbb24b03476962cfadebc70 | [
"MIT"
] | 6 | 2018-09-16T05:35:49.000Z | 2019-10-17T02:44:19.000Z | from tests_scripts import QuickTest
from tests_scripts import *
# creating object of the class
login = QuickTest.QuickTest()
# Pass the appropriate user name and password from __init__.py file
# login.test_Quick_Login(admin_user,admin_pwd)
# login.test_Quick_Logout(campus_partner_user,campus_partner_pwd)
# login.test... | 29.631579 | 85 | 0.847247 |
4a0d1e87f3ecbb67fe15d6ada53ec9feb54a5a01 | 69,459 | py | Python | Src/StdLib/Lib/subprocess.py | aisk/ironpython3 | d492fd811a0cee4d0a07cd46f02a29a3c90d964b | [
"Apache-2.0"
] | 1,872 | 2015-01-02T18:56:47.000Z | 2022-03-31T07:34:39.000Z | Src/StdLib/Lib/subprocess.py | aisk/ironpython3 | d492fd811a0cee4d0a07cd46f02a29a3c90d964b | [
"Apache-2.0"
] | 675 | 2015-02-27T09:01:01.000Z | 2022-03-31T14:03:25.000Z | Assets/StreamingAssets/Python/Lib/subprocess.py | Vito217/PharoVRIDE | 4ff964a72107a251224d3a632859c0af28ef50e0 | [
"MIT"
] | 278 | 2015-01-02T03:48:20.000Z | 2022-03-29T20:40:44.000Z | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""subprocess - Subpr... | 37.97649 | 101 | 0.566435 |
4a0d1ec62044b574586e0e19ab387b41e05d5b29 | 5,640 | py | Python | amipy/middlewares/HttpProxy.py | 01ly/Amipy | 254ef5cf1b34f9671ec8eecc3ee61633644b3ff8 | [
"MIT"
] | 24 | 2019-03-06T17:27:39.000Z | 2021-02-27T16:56:51.000Z | amipy/middlewares/HttpProxy.py | 01ly/Amipy | 254ef5cf1b34f9671ec8eecc3ee61633644b3ff8 | [
"MIT"
] | 1 | 2020-03-28T12:43:23.000Z | 2020-03-30T04:59:44.000Z | amipy/middlewares/HttpProxy.py | 01ly/Amipy | 254ef5cf1b34f9671ec8eecc3ee61633644b3ff8 | [
"MIT"
] | 13 | 2019-07-30T17:17:49.000Z | 2021-07-23T08:10:36.000Z |
import amipy
from amipy.middlewares import Middleware
from amipy.util.proxy import gen_proxy,\
is_proxy_valid,extract_ip_port
from amipy.log import getLogger
from w3lib.url import parse_url,is_url
class HttpProxyMiddleware(Middleware):
inited = False
invalid_pool = {}
proxy_pool = set()
logger = ... | 40.57554 | 97 | 0.552305 |
4a0d1f0eb947de63e3cd69c44954f974da4fef4f | 5,027 | py | Python | Ideas/Tennis Project/Source Code/Camera.py | hsspratt/Nott-Hawkeye1 | 178f4f0fef62e8699f6057d9d50adfd61a851047 | [
"MIT"
] | null | null | null | Ideas/Tennis Project/Source Code/Camera.py | hsspratt/Nott-Hawkeye1 | 178f4f0fef62e8699f6057d9d50adfd61a851047 | [
"MIT"
] | 1 | 2021-11-11T22:15:36.000Z | 2021-11-11T22:15:36.000Z | Ideas/Tennis Project/Source Code/Camera.py | hsspratt/Nott-Hawkeye1 | 178f4f0fef62e8699f6057d9d50adfd61a851047 | [
"MIT"
] | null | null | null |
import cv2
import numpy as np
class Camera:
CameraMatrix = [];
DistCoeffs = [];
Position = [];
RotationVec = [];
TranslationVec = [];
CourtCorners = [];
Homog = [];
# HALF_COURT_X = 4.115;
HALF_COURT_X = 5.485
HALF_COURT_Z = 11.885;
WORLD_POINTS = np.asarray([[-HALF_COURT_X, 0... | 34.668966 | 193 | 0.603143 |
4a0d1f287ad55a7cd09dbb7aed88a719e3221062 | 687 | py | Python | rapid/master/data/database/__init__.py | m2bright/rapid | fd66515105ca9773c5da8562a878c6b0bfa4487a | [
"Apache-2.0"
] | 4 | 2018-04-12T20:16:04.000Z | 2020-03-03T08:09:19.000Z | rapid/master/data/database/__init__.py | m2bright/rapid | fd66515105ca9773c5da8562a878c6b0bfa4487a | [
"Apache-2.0"
] | 69 | 2019-03-13T21:30:51.000Z | 2021-12-08T16:54:05.000Z | rapid/master/data/database/__init__.py | m2bright/rapid | fd66515105ca9773c5da8562a878c6b0bfa4487a | [
"Apache-2.0"
] | 4 | 2020-03-03T08:09:20.000Z | 2020-07-20T22:06:28.000Z | """
Copyright (c) 2015 Michael Bright and Bamboo HR LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | 32.714286 | 73 | 0.767103 |
4a0d1f57b9ec81f43b31bb56dade35879cda34ab | 3,458 | py | Python | backend/project/app/extension/history/travel_reimburse.py | goodyttoor/tcl_v7 | ceb545fa3f0e3eaf3a1a43c7e4a2102014b82a47 | [
"MIT"
] | null | null | null | backend/project/app/extension/history/travel_reimburse.py | goodyttoor/tcl_v7 | ceb545fa3f0e3eaf3a1a43c7e4a2102014b82a47 | [
"MIT"
] | null | null | null | backend/project/app/extension/history/travel_reimburse.py | goodyttoor/tcl_v7 | ceb545fa3f0e3eaf3a1a43c7e4a2102014b82a47 | [
"MIT"
] | null | null | null | from datetime import datetime, date
from decimal import Decimal
from typing import Optional, List
from fastapi import APIRouter, Depends
from sqlmodel import Field, SQLModel
from ...db import get_session
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
router = APIRouter()
class Histo... | 40.209302 | 140 | 0.80509 |
4a0d1f7fdbb645a36bcac8198715d5a4ca1a2c61 | 13,143 | py | Python | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | LightBitsLabs/mongo | 9480ef00a8df2464457ab0f31c7a336f882e8ec1 | [
"Apache-2.0"
] | 25 | 2016-12-07T09:39:51.000Z | 2021-12-16T11:17:37.000Z | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | LightBitsLabs/mongo | 9480ef00a8df2464457ab0f31c7a336f882e8ec1 | [
"Apache-2.0"
] | null | null | null | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | LightBitsLabs/mongo | 9480ef00a8df2464457ab0f31c7a336f882e8ec1 | [
"Apache-2.0"
] | 23 | 2017-01-22T03:35:26.000Z | 2021-12-16T11:17:39.000Z | """
Sharded cluster fixture for executing JSTests against.
"""
from __future__ import absolute_import
import copy
import os.path
import time
import pymongo
from . import interface
from . import standalone
from . import replicaset
from ... import config
from ... import core
from ... import errors
from ... import log... | 37.876081 | 100 | 0.586015 |
4a0d1fb24bd599c6ec7538c2c8fbed3de905740d | 16,119 | py | Python | test/test_sox_compatibility.py | astaff/audio | 27a0f7653bc2918e314b4225782d2b29ef31ae4a | [
"BSD-2-Clause"
] | null | null | null | test/test_sox_compatibility.py | astaff/audio | 27a0f7653bc2918e314b4225782d2b29ef31ae4a | [
"BSD-2-Clause"
] | null | null | null | test/test_sox_compatibility.py | astaff/audio | 27a0f7653bc2918e314b4225782d2b29ef31ae4a | [
"BSD-2-Clause"
] | null | null | null | import unittest
import torch
import torchaudio
import torchaudio.functional as F
import torchaudio.transforms as T
import common_utils
from common_utils import AudioBackendScope, BACKENDS
class TestFunctionalFiltering(unittest.TestCase):
@unittest.skipIf("sox" not in BACKENDS, "sox not available")
@AudioBac... | 39.410758 | 115 | 0.68503 |
4a0d20694f511a9f532ca9f3e7c9627cb54cb268 | 537 | py | Python | .history/Object Oriented Programming/Line_20200511100046.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | 1 | 2020-05-18T17:50:00.000Z | 2020-05-18T17:50:00.000Z | .history/Object Oriented Programming/Line_20200511100046.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | null | null | null | .history/Object Oriented Programming/Line_20200511100046.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | null | null | null | from .dirFile import Header1
from os import system, name
def clear():
if name == 'nt':
_ = system('cls')
clear()
import math
class Line:
def __init__(self,coor1,coor2):
self.coor1 = coor1
self.coor2 = coor2
def distance(self):
x1,y1 = self.coor1
x2,y2... | 18.517241 | 45 | 0.577281 |
4a0d20bd16095cdc6af1829eb5314d6f87bab719 | 118 | py | Python | 30/00/0.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | 30/00/0.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | 32 | 2017-09-01T00:52:17.000Z | 2017-10-01T00:30:02.000Z | 30/00/0.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | from decimal import *
print((-7) % 4)
print(Decimal(-7) % Decimal(4))
print(-7 // 4)
print(Decimal(-7) // Decimal(4))
| 19.666667 | 32 | 0.618644 |
4a0d239c19168232b944ca5751fecc23536e05de | 7,446 | py | Python | config.py | yiftachn/Survival-Analysis | 2fbdaa8bd2c52a54b10143929f35539492fb76a8 | [
"MIT"
] | null | null | null | config.py | yiftachn/Survival-Analysis | 2fbdaa8bd2c52a54b10143929f35539492fb76a8 | [
"MIT"
] | null | null | null | config.py | yiftachn/Survival-Analysis | 2fbdaa8bd2c52a54b10143929f35539492fb76a8 | [
"MIT"
] | null | null | null | import pathlib
PROJECT_ROOT_DIR = pathlib.PurePath(__file__).parent
SURVIVAL_ANALYSIS_DATA_PATH = PROJECT_ROOT_DIR / 'data/survival_analysis.xlsx'
DESC_DATA_PATH = PROJECT_ROOT_DIR / 'data/desc.xlsx'
FEATURES_TO_DROP = ["Primay pathology:", "liver", "complications___other", "resections___none", "anastomosis___none",
... | 58.629921 | 624 | 0.620467 |
4a0d23df43361d5481fbe6a9ad26891d0f2d03c6 | 541 | py | Python | analysis.py | mirosa25/ITI-202-Final-Project | b46e7ffccf43a52ee0e72b889c5aac6887228dc2 | [
"MIT"
] | null | null | null | analysis.py | mirosa25/ITI-202-Final-Project | b46e7ffccf43a52ee0e72b889c5aac6887228dc2 | [
"MIT"
] | null | null | null | analysis.py | mirosa25/ITI-202-Final-Project | b46e7ffccf43a52ee0e72b889c5aac6887228dc2 | [
"MIT"
] | null | null | null | from textblob import TextBlob
def getPolarity(fileForAnalysis: str):
mood = ""
polarity_score = 0
file = open(fileForAnalysis, mode="r", encoding="utf8")
data = file.read()
#Creating the blob object
text = TextBlob(data)
#Getting a polarity score
polarity_score = text.sentiment.pol... | 19.321429 | 59 | 0.621072 |
4a0d25b99d72417249a9829fb083233f0e8c31bd | 317 | py | Python | bot/utils/text_shortner.py | Awesome-RJ/Emilia | 80200e60aea176a7e70b4cc50b085fd84bcaf3ea | [
"MIT"
] | 8 | 2021-01-23T13:58:36.000Z | 2021-12-27T07:46:47.000Z | bot/utils/text_shortner.py | Awesome-RJ/Emilia | 80200e60aea176a7e70b4cc50b085fd84bcaf3ea | [
"MIT"
] | null | null | null | bot/utils/text_shortner.py | Awesome-RJ/Emilia | 80200e60aea176a7e70b4cc50b085fd84bcaf3ea | [
"MIT"
] | 7 | 2021-02-15T08:26:15.000Z | 2022-01-29T05:57:54.000Z | def make_short(description, thumb, mal_url):
if len(description) < 750:
description += f"\n[R]({thumb})[ead more!]({mal_url})"
return description
else:
description = description[:751]
description += f"[...]({thumb})\n[Read more!]({mal_url})"
return description
| 35.222222 | 66 | 0.580442 |
4a0d27e3d4e99ed121076bc37cfcd631b5ad417a | 10,555 | py | Python | connmonitor/connmonitor.py | Comcast/connvitals-monitor | 165f12f32801916584ab1939a3fd3d9280368632 | [
"Apache-2.0"
] | 10 | 2018-06-01T20:17:47.000Z | 2022-02-25T04:41:03.000Z | connmonitor/connmonitor.py | Comcast/connvitals-monitor | 165f12f32801916584ab1939a3fd3d9280368632 | [
"Apache-2.0"
] | 3 | 2018-06-27T14:28:34.000Z | 2018-07-31T15:18:57.000Z | connmonitor/connmonitor.py | Comcast/connvitals-monitor | 165f12f32801916584ab1939a3fd3d9280368632 | [
"Apache-2.0"
] | 2 | 2019-02-02T05:33:09.000Z | 2019-12-10T19:06:49.000Z | # Copyright 2018 Comcast Cable Communications Management, 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... | 27.203608 | 130 | 0.684036 |
4a0d27eeb43b0d0601b95c16aea651620c1250dc | 3,147 | py | Python | gmflow/utils.py | haofeixu/gmflow | d304e5e516c11df378d63808d6679aea43bc564a | [
"Apache-2.0"
] | 58 | 2021-11-26T01:00:22.000Z | 2022-03-31T18:44:58.000Z | gmflow/utils.py | haofeixu/gmflow | d304e5e516c11df378d63808d6679aea43bc564a | [
"Apache-2.0"
] | 1 | 2022-03-15T02:16:57.000Z | 2022-03-30T15:16:58.000Z | gmflow/utils.py | haofeixu/gmflow | d304e5e516c11df378d63808d6679aea43bc564a | [
"Apache-2.0"
] | null | null | null | import torch
from .position import PositionEmbeddingSine
def split_feature(feature,
num_splits=2,
channel_last=False,
):
if channel_last: # [B, H, W, C]
b, h, w, c = feature.size()
assert h % num_splits == 0 and w % num_splits == 0
... | 36.172414 | 115 | 0.564347 |
4a0d2904189026f86ce5ed600346afdeac0b3bb2 | 1,772 | py | Python | aliyun-python-sdk-companyreg/aliyunsdkcompanyreg/request/v20201022/GetQuarterIncomeStatementInfoRequest.py | jorsonzen/aliyun-openapi-python-sdk | 0afbfa8e5f9e19455695aa799f7dcc1cd853d827 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-companyreg/aliyunsdkcompanyreg/request/v20201022/GetQuarterIncomeStatementInfoRequest.py | jorsonzen/aliyun-openapi-python-sdk | 0afbfa8e5f9e19455695aa799f7dcc1cd853d827 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-companyreg/aliyunsdkcompanyreg/request/v20201022/GetQuarterIncomeStatementInfoRequest.py | jorsonzen/aliyun-openapi-python-sdk | 0afbfa8e5f9e19455695aa799f7dcc1cd853d827 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.44 | 102 | 0.764108 |
4a0d2996d11c864fbea1223ed2859d6466171a1c | 103 | py | Python | 10. Inheritance - Exercise/restaurant_05/project/beverage/tea.py | elenaborisova/Python-OOP | 584882c08f84045b12322917f0716c7c7bd9befc | [
"MIT"
] | 1 | 2021-03-27T16:56:30.000Z | 2021-03-27T16:56:30.000Z | 10. Inheritance - Exercise/restaurant_05/project/beverage/tea.py | elenaborisova/Python-OOP | 584882c08f84045b12322917f0716c7c7bd9befc | [
"MIT"
] | null | null | null | 10. Inheritance - Exercise/restaurant_05/project/beverage/tea.py | elenaborisova/Python-OOP | 584882c08f84045b12322917f0716c7c7bd9befc | [
"MIT"
] | 1 | 2021-03-15T14:50:39.000Z | 2021-03-15T14:50:39.000Z | from restaurant_05.project.beverage.hot_beverage import HotBeverage
class Tea(HotBeverage):
pass
| 17.166667 | 67 | 0.815534 |
4a0d2a3a4f7bb1da2d414175b17939d9b25a5bb3 | 3,771 | py | Python | lib/com/config.py | dingzg/onepanel | 2adaadb1d54caef4615020532bd82b6e1f20c5df | [
"Apache-2.0"
] | 2 | 2019-05-09T07:34:17.000Z | 2020-10-25T17:57:12.000Z | lib/com/config.py | dingzg/onepanel | 2adaadb1d54caef4615020532bd82b6e1f20c5df | [
"Apache-2.0"
] | null | null | null | lib/com/config.py | dingzg/onepanel | 2adaadb1d54caef4615020532bd82b6e1f20c5df | [
"Apache-2.0"
] | 5 | 2018-03-19T07:51:31.000Z | 2022-03-03T07:10:55.000Z | #!/usr/bin/env python2.6
#-*- coding: utf-8 -*-
# Copyright [OnePanel]
#
# 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 b... | 31.689076 | 76 | 0.52612 |
4a0d2af70fb9ba41e5bdb328f81694de0a4da975 | 1,707 | py | Python | djx/example/src/iris.py | dkollective/djx | 39b3f522cec63c0d37a5942705133383f429ca23 | [
"MIT"
] | null | null | null | djx/example/src/iris.py | dkollective/djx | 39b3f522cec63c0d37a5942705133383f429ca23 | [
"MIT"
] | null | null | null | djx/example/src/iris.py | dkollective/djx | 39b3f522cec63c0d37a5942705133383f429ca23 | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.model_selection import KFold
from sklearn.ensemble import RandomForestClassifier
from structlog.threadlocal import (
bind_threadlocal
)
import structlog
log = structlog.get_logger()
def cv_fit_save(model_args, dataset_args, cross_val_args, save):
log.info('load dataset')
X... | 32.207547 | 140 | 0.679555 |
4a0d2c027a02f66ccf562f74d79f925acb5bdf83 | 354 | py | Python | yacman/exceptions.py | vreuter/yacman | 2cd07351e4f0d418a5cd092d256cbfe476ccc5b5 | [
"BSD-2-Clause"
] | null | null | null | yacman/exceptions.py | vreuter/yacman | 2cd07351e4f0d418a5cd092d256cbfe476ccc5b5 | [
"BSD-2-Clause"
] | null | null | null | yacman/exceptions.py | vreuter/yacman | 2cd07351e4f0d418a5cd092d256cbfe476ccc5b5 | [
"BSD-2-Clause"
] | null | null | null | """ Package exception types """
__all__ = ["FileFormatError", "AliasError", "UndefinedAliasError"]
class FileFormatError(Exception):
""" Exception for invalid file format. """
pass
class AliasError(Exception):
""" Alias related error. """
pass
class UndefinedAliasError(AliasError):
""" Alias ... | 16.857143 | 66 | 0.666667 |
4a0d2d5fe46a28949d600c4935808940d51e627d | 4,787 | py | Python | olympics/olympics-api.py | Rodrick12123/cs257-1 | de2a74f71627d02d8a9b5090af35b5b18d71ac94 | [
"MIT"
] | null | null | null | olympics/olympics-api.py | Rodrick12123/cs257-1 | de2a74f71627d02d8a9b5090af35b5b18d71ac94 | [
"MIT"
] | null | null | null | olympics/olympics-api.py | Rodrick12123/cs257-1 | de2a74f71627d02d8a9b5090af35b5b18d71ac94 | [
"MIT"
] | 1 | 2021-12-04T00:12:04.000Z | 2021-12-04T00:12:04.000Z | #Written by Thea Traw
import sys
import argparse
import flask
import json
import psycopg2
import config
app = flask.Flask(__name__)
#this class is to handle the interactions with the database
class Querier:
def __init__(self):
try:
connection = psycopg2.connect(database=config.database, use... | 32.127517 | 193 | 0.668059 |
4a0d2d89c339242d88560f366aaa8ba046a94b15 | 1,635 | py | Python | pointnet2/data_utils/mirror_partial.py | ZhaoyangLyu/Point_Diffusion_Refinement | 857fcd176dcc9c1a93a9fec27390502fa6c9e29d | [
"Apache-2.0"
] | 24 | 2021-12-29T11:28:34.000Z | 2022-03-27T15:20:46.000Z | pointnet2/data_utils/mirror_partial.py | ZhaoyangLyu/Point_Diffusion_Refinement | 857fcd176dcc9c1a93a9fec27390502fa6c9e29d | [
"Apache-2.0"
] | null | null | null | pointnet2/data_utils/mirror_partial.py | ZhaoyangLyu/Point_Diffusion_Refinement | 857fcd176dcc9c1a93a9fec27390502fa6c9e29d | [
"Apache-2.0"
] | 2 | 2022-03-06T12:58:24.000Z | 2022-03-15T06:18:38.000Z | import torch
import copy
from pointnet2_ops import pointnet2_utils
def mirror(partial, axis=1):
# partial is of shape B,N,3
partial_mirror = copy.deepcopy(partial)
partial_mirror[:,:,axis] = -partial_mirror[:,:,axis]
return partial_mirror
def down_sample_points(xyz, npoints):
# xyz is o... | 36.333333 | 118 | 0.650765 |
4a0d2d93f7c61f511883b6df4aa31b98616b3ec4 | 6,405 | py | Python | tensorflow/python/compat/compat.py | penguin219/tensorflow | 2717bde837d0a3d75f5e0eda7cb388bd86dc710e | [
"Apache-2.0"
] | 1 | 2019-01-05T13:16:10.000Z | 2019-01-05T13:16:10.000Z | tensorflow/python/compat/compat.py | penguin219/tensorflow | 2717bde837d0a3d75f5e0eda7cb388bd86dc710e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/compat/compat.py | penguin219/tensorflow | 2717bde837d0a3d75f5e0eda7cb388bd86dc710e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.983146 | 80 | 0.753005 |
4a0d2e2d042d3806aa183d0955fbc0cda2fbd41e | 15,420 | py | Python | otter/test/models/test_interface.py | alex/otter | e46316634ae4c211f7436aa4d41321ac1edba0af | [
"Apache-2.0"
] | 1 | 2015-11-08T12:58:44.000Z | 2015-11-08T12:58:44.000Z | otter/test/models/test_interface.py | alex/otter | e46316634ae4c211f7436aa4d41321ac1edba0af | [
"Apache-2.0"
] | null | null | null | otter/test/models/test_interface.py | alex/otter | e46316634ae4c211f7436aa4d41321ac1edba0af | [
"Apache-2.0"
] | null | null | null | """
Tests for :mod:`otter.models.interface`
"""
from collections import namedtuple
import mock
from zope.interface.verify import verifyObject
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from otter.models.interface import (
GroupState, IScalingGroup, IScalingGroupCollection, I... | 37.067308 | 85 | 0.611543 |
4a0d2ee07b836a14eb9a96a7de93413081162962 | 1,156 | py | Python | 2016_ice-ctf/intercept-convo-2-crypto/brute-reverse-indexes.py | Skinner927/ctf_history | 97cc65ccd1e1f6e7f94b12be467dc5f236799c1b | [
"Unlicense"
] | null | null | null | 2016_ice-ctf/intercept-convo-2-crypto/brute-reverse-indexes.py | Skinner927/ctf_history | 97cc65ccd1e1f6e7f94b12be467dc5f236799c1b | [
"Unlicense"
] | null | null | null | 2016_ice-ctf/intercept-convo-2-crypto/brute-reverse-indexes.py | Skinner927/ctf_history | 97cc65ccd1e1f6e7f94b12be467dc5f236799c1b | [
"Unlicense"
] | null | null | null | import random
import base64
import os
P = [27, 35, 50, 11, 8, 20, 44, 30, 6, 1, 5, 2, 33, 16, 36, 64, 3, 61, 54, 25, 12, 21, 26, 10, 57, 53, 38, 56, 58, 37, 43, 17, 42, 47, 4, 14, 7, 46, 34, 19, 23, 40, 63, 18, 45, 60, 13, 15, 22, 9, 62, 51, 32, 55, 29, 24, 41, 39, 49, 52, 48, 28, 31, 59]
S = [68, 172, 225, 210, 148, 1... | 44.461538 | 300 | 0.524221 |
4a0d30b84753f51c8922139b024c92a3547ab69d | 4,216 | py | Python | final.py | ssadel/preposal-sadel | 33073df3867f25a802c226440906901e988a101f | [
"MIT"
] | null | null | null | final.py | ssadel/preposal-sadel | 33073df3867f25a802c226440906901e988a101f | [
"MIT"
] | null | null | null | final.py | ssadel/preposal-sadel | 33073df3867f25a802c226440906901e988a101f | [
"MIT"
] | null | null | null |
def image():
root = Tk()
canvas = Canvas(root, width = 600, height = 600)
canvas.pack()
img = PhotoImage(file="/Users/sidneysadel/Downloads/final proj/gui/roulette2.png")
canvas.create_image(20,20, anchor=NW, image=img)
exit_button = Button(root, text="Exit", command=root.dest... | 25.39759 | 90 | 0.546727 |
4a0d336db861ff6b49da1fdfc88f995ef0baaea5 | 40,944 | py | Python | evennia/settings_default.py | MattyBear/https-github.com-evennia-evennia | 003afad7c03c91b9d85a3f1317019f688e2274c8 | [
"BSD-3-Clause"
] | null | null | null | evennia/settings_default.py | MattyBear/https-github.com-evennia-evennia | 003afad7c03c91b9d85a3f1317019f688e2274c8 | [
"BSD-3-Clause"
] | 4 | 2021-06-08T23:38:31.000Z | 2022-02-11T03:48:07.000Z | evennia/settings_default.py | pmwheatley/evennia | 2cf26e9d092e16473626a4a6374de7323d0e473a | [
"BSD-3-Clause"
] | null | null | null | """
Master configuration file for Evennia.
NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE!
All settings changes should be done by copy-pasting the variable and
its value to <gamedir>/conf/settings.py.
Hint: Don't copy&paste over more from this file than you actually want
to change. Anything you don't copy&paste... | 50.361624 | 114 | 0.70997 |
4a0d347bdce66370865d0d95e58035316f106581 | 2,098 | py | Python | roger/api.py | talbor49/Poet | ac53f1716880c99e7c99f6b01f242d3f54b108b4 | [
"MIT"
] | null | null | null | roger/api.py | talbor49/Poet | ac53f1716880c99e7c99f6b01f242d3f54b108b4 | [
"MIT"
] | null | null | null | roger/api.py | talbor49/Poet | ac53f1716880c99e7c99f6b01f242d3f54b108b4 | [
"MIT"
] | null | null | null | import logging
import roger.store
import roger.model
import roger.training
import roger.token
import roger.generator
import roger.util
def generate(database, seed_word='', lines=10, auto_punctuation=True):
store = roger.store.SQLiteStore(path=database)
model = roger.model.MarkovModel(store=store)
genera... | 25.277108 | 83 | 0.65348 |
4a0d34dd48953a09d3cdfcf1bb072d10eb5918e5 | 5,842 | py | Python | train.py | skipper17/pytorch-AdaIN | 1f53ae2c5c5edb7879efcc21fe467c4de3f89abe | [
"MIT"
] | null | null | null | train.py | skipper17/pytorch-AdaIN | 1f53ae2c5c5edb7879efcc21fe467c4de3f89abe | [
"MIT"
] | null | null | null | train.py | skipper17/pytorch-AdaIN | 1f53ae2c5c5edb7879efcc21fe467c4de3f89abe | [
"MIT"
] | null | null | null | import argparse
from pathlib import Path
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.utils.data as data
from PIL import Image, ImageFile
from torchvision.transforms.transforms import Resize
from tensorboardX import SummaryWriter
from torchvision import transforms
from tqdm impo... | 37.210191 | 87 | 0.705751 |
4a0d359081dc39b8835fd896ae595b30c1ad1738 | 317 | py | Python | filebox/wsgi.py | sharmaeklavya2/Filebox | 49919fe69104c1b93a03de53c9205fb796103cea | [
"MIT"
] | 10 | 2015-11-09T07:29:12.000Z | 2021-05-12T09:17:49.000Z | filebox/wsgi.py | sharmaeklavya2/Filebox | 49919fe69104c1b93a03de53c9205fb796103cea | [
"MIT"
] | 9 | 2015-11-28T07:57:15.000Z | 2017-05-22T18:16:17.000Z | filebox/wsgi.py | sharmaeklavya2/Filebox | 49919fe69104c1b93a03de53c9205fb796103cea | [
"MIT"
] | 2 | 2015-12-19T08:25:35.000Z | 2019-10-17T16:58:23.000Z | import os
from django.core.wsgi import get_wsgi_application
CONF_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = os.path.dirname(CONF_DIR)
CONF_DIR_NAME = os.path.relpath(CONF_DIR, BASE_DIR)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", CONF_DIR_NAME+".settings")
application = get_wsgi_application()
| 31.7 | 74 | 0.81388 |
4a0d360a8ba3f784ca2b472096a8acd6b66c95fb | 29 | py | Python | portfolio/Python/scrapy/officespot/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/officespot/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/officespot/__init__.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | ACCOUNT_NAME = 'Office Spot'
| 14.5 | 28 | 0.758621 |
4a0d36c7416de15d8fe5e098908c4c3b1ba21ad3 | 20,611 | py | Python | pyleecan/Classes/LUTdq.py | thalesmaoa/pyleecan | c4fdc6362fdeba3d0766d5d1df3ff9c97c3f9fa3 | [
"Apache-2.0"
] | 1 | 2021-11-10T11:52:57.000Z | 2021-11-10T11:52:57.000Z | pyleecan/Classes/LUTdq.py | thalesmaoa/pyleecan | c4fdc6362fdeba3d0766d5d1df3ff9c97c3f9fa3 | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/LUTdq.py | thalesmaoa/pyleecan | c4fdc6362fdeba3d0766d5d1df3ff9c97c3f9fa3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Simulation/LUTdq.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/LUTdq
"""
from os import linesep
from sys import getsizeof
from lo... | 35.172355 | 107 | 0.598224 |
4a0d36d731d7162ba4430fe9a677d8eec04a431d | 19,669 | py | Python | ver1_0/openassembly/pirate_comments/templatetags/commenttags.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | 1 | 2015-11-05T08:22:19.000Z | 2015-11-05T08:22:19.000Z | ver1_0/openassembly/pirate_comments/templatetags/commenttags.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | null | null | null | ver1_0/openassembly/pirate_comments/templatetags/commenttags.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | 1 | 2018-02-03T18:25:41.000Z | 2018-02-03T18:25:41.000Z | from django import template
from django import forms
from django.http import HttpResponse, HttpResponseRedirect
from django.utils import simplejson
from pirate_comments.models import Comment
from django.db import transaction
from django.middleware import csrf
from django.contrib.contenttypes.models import ContentType
f... | 50.824289 | 1,118 | 0.649398 |
4a0d375e7bd73962423362ee02ff07de8affc40c | 8,573 | py | Python | spiketoolkit/postprocessing/features.py | teristam/spiketoolk | 0ae7adabce46cf620c3627ee0093d890996ef355 | [
"MIT"
] | 55 | 2018-11-26T21:57:45.000Z | 2021-06-14T15:27:50.000Z | spiketoolkit/postprocessing/features.py | teristam/spiketoolk | 0ae7adabce46cf620c3627ee0093d890996ef355 | [
"MIT"
] | 364 | 2018-11-26T21:57:08.000Z | 2021-07-27T12:29:28.000Z | spiketoolkit/postprocessing/features.py | teristam/spiketoolk | 0ae7adabce46cf620c3627ee0093d890996ef355 | [
"MIT"
] | 40 | 2018-11-23T12:33:44.000Z | 2021-09-28T10:27:07.000Z | """
Uses the functions in SpikeInterface/spikefeatures to compute
unit template features
"""
import pandas
import spikefeatures as sf
from scipy.signal import resample_poly
from .postprocessing_tools import get_unit_templates, get_unit_max_channels
from .utils import update_all_param_dicts_with_kwargs, select_max_chan... | 44.651042 | 116 | 0.641782 |
4a0d3773bb42e09959968f8a3b0e8d9b155af8a7 | 6,004 | py | Python | src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 32 | 2021-01-07T15:09:56.000Z | 2022-01-30T05:49:23.000Z | src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 228 | 2020-09-03T14:03:54.000Z | 2022-03-31T20:16:12.000Z | src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py | DataDog/datadog-api-client-python | de2fc57dbde9acf4b8c8eef94ac29911227a62a2 | [
"Apache-2.0"
] | 12 | 2020-09-15T21:36:03.000Z | 2022-03-31T17:13:17.000Z | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 42.28169 | 291 | 0.590107 |
4a0d377c5f0ca6b1d7f07eea18b1510e17bad676 | 5,149 | py | Python | examples/python/mba.py | cityofwang/intel-cmt-cat | 0f86ac6bb909ee1a35a9930da2d05b00dd70ca89 | [
"BSD-3-Clause"
] | 1 | 2022-02-27T05:46:11.000Z | 2022-02-27T05:46:11.000Z | examples/python/mba.py | cityofwang/intel-cmt-cat | 0f86ac6bb909ee1a35a9930da2d05b00dd70ca89 | [
"BSD-3-Clause"
] | null | null | null | examples/python/mba.py | cityofwang/intel-cmt-cat | 0f86ac6bb909ee1a35a9930da2d05b00dd70ca89 | [
"BSD-3-Clause"
] | null | null | null | ################################################################################
# BSD LICENSE
#
# Copyright(c) 2019-2022 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# *... | 29.763006 | 80 | 0.638376 |
4a0d3b40a39181b6bed568aee1acb795ce558405 | 3,692 | py | Python | items_list_spider/items_list_spider/settings.py | toannguyen3105/pdt-crawler-cstrade | 264fa649cbbbf5100c2ad73636269ded0c31d91d | [
"Apache-2.0"
] | null | null | null | items_list_spider/items_list_spider/settings.py | toannguyen3105/pdt-crawler-cstrade | 264fa649cbbbf5100c2ad73636269ded0c31d91d | [
"Apache-2.0"
] | null | null | null | items_list_spider/items_list_spider/settings.py | toannguyen3105/pdt-crawler-cstrade | 264fa649cbbbf5100c2ad73636269ded0c31d91d | [
"Apache-2.0"
] | null | null | null | from decouple import config
# Scrapy settings for items_list_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org... | 35.84466 | 103 | 0.778169 |
4a0d3c543d811225e091d6f52ae2cd71c4520643 | 428 | py | Python | Taller estructuras de control selectivo/punto#7.py | GabrielRojas74/Talleres-AyP | 346b87ddc118b4c8f45fe083f63b4bacb5d01d19 | [
"MIT"
] | null | null | null | Taller estructuras de control selectivo/punto#7.py | GabrielRojas74/Talleres-AyP | 346b87ddc118b4c8f45fe083f63b4bacb5d01d19 | [
"MIT"
] | null | null | null | Taller estructuras de control selectivo/punto#7.py | GabrielRojas74/Talleres-AyP | 346b87ddc118b4c8f45fe083f63b4bacb5d01d19 | [
"MIT"
] | null | null | null | """
entradas:
km_recorridos-->float-->kr
Salidas:
Tarifa-->float-->valor
"""
kr = float(input("escriba la distancia recorrida en Km: "))
if(kr <= 300 and kr > 0):
valor = 50000
print("el valor a pagar es $"+str(valor))
elif(kr > 300 and kr <= 1000):
valor = (70000+((kr-300)*30000))
print("el valor a pagar es $"... | 25.176471 | 59 | 0.626168 |
4a0d3d2124a7b5d087f65cbe75ed1c4b5560297e | 998 | py | Python | testcases/elichika_tests/node/Links/NStepBiLSTM.py | vermashresth/chainer-compiler | 5f5ad365d14398d6ae0214fa012eb10360db8e7e | [
"MIT"
] | 116 | 2019-01-25T03:54:44.000Z | 2022-03-08T00:11:14.000Z | testcases/elichika_tests/node/Links/NStepBiLSTM.py | vermashresth/chainer-compiler | 5f5ad365d14398d6ae0214fa012eb10360db8e7e | [
"MIT"
] | 431 | 2019-01-25T10:18:44.000Z | 2020-06-17T05:28:55.000Z | testcases/elichika_tests/node/Links/NStepBiLSTM.py | vermashresth/chainer-compiler | 5f5ad365d14398d6ae0214fa012eb10360db8e7e | [
"MIT"
] | 26 | 2019-01-25T07:21:09.000Z | 2021-11-26T04:24:35.000Z | # coding: utf-8
import chainer
import chainer.links as L
from chainer_compiler.elichika import testtools
# Network definition
class A(chainer.Chain):
def __init__(self, n_layer, n_in, n_out):
super(A, self).__init__()
with self.init_scope():
self.l1 = L.NStepBiLSTM(n_layer, n_in, n_... | 20.367347 | 70 | 0.581162 |
4a0d3e1f3936e66bd0d8a26b3207e1ad8099ff2b | 2,569 | py | Python | python/translate/split_rules.py | ywkim0606/gtsam_python | d786d57f9a604f4f48b73b94ffa45cfdcc9cba88 | [
"BSD-2-Clause"
] | null | null | null | python/translate/split_rules.py | ywkim0606/gtsam_python | d786d57f9a604f4f48b73b94ffa45cfdcc9cba88 | [
"BSD-2-Clause"
] | null | null | null | python/translate/split_rules.py | ywkim0606/gtsam_python | d786d57f9a604f4f48b73b94ffa45cfdcc9cba88 | [
"BSD-2-Clause"
] | null | null | null | # split_rules: Split rules whose conditions fall into different "connected
# components" (where to conditions are related if they share a variabe) into
# several rules, one for each connected component and one high-level rule.
from pddl_to_prolog import Rule, get_variables
import graph
import greedy_join
import pddl
... | 37.231884 | 78 | 0.694044 |
4a0d3e85cd7443c0ff4de14235cba7f39557cf6c | 2,015 | py | Python | runs/kubernetes/start_keepalived.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 2 | 2020-07-24T14:19:57.000Z | 2020-08-10T18:30:08.000Z | runs/kubernetes/start_keepalived.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | null | null | null | runs/kubernetes/start_keepalived.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 1 | 2021-07-09T10:29:11.000Z | 2021-07-09T10:29:11.000Z | """
时间:2020/6/16
作者:lurui
功能:在master部署并启动keepalived
时间:2020/6/17
作者:lurui
修改:基路径 basedir = os.path.dirname(os.path.dirname(os.getcwd())),改为调用者路径 basedir = os.path.abspath('.')
"""
import os
import subprocess
import time
def start_keepalived():
basedir = os.path.abspath('.')
keepalived_path = basedir + '/dep... | 34.152542 | 211 | 0.69727 |
4a0d3ec2a24a0d6af275f8a86d62eb5ab9ce8e9e | 2,822 | py | Python | indexer.py | sidkhwl/leetcoding | 41ab4da566e0259e4082f9a2c47d1672fbbd36aa | [
"MIT"
] | null | null | null | indexer.py | sidkhwl/leetcoding | 41ab4da566e0259e4082f9a2c47d1672fbbd36aa | [
"MIT"
] | null | null | null | indexer.py | sidkhwl/leetcoding | 41ab4da566e0259e4082f9a2c47d1672fbbd36aa | [
"MIT"
] | null | null | null | from os import listdir, makedirs, walk
from os.path import isfile, join, splitext, isdir
import shutil
indexes = []
topics = set()
def extractAttributes(filename):
indexEntry = []
with open(filename) as f:
data = f.readlines()
indexEntry.append(int(data[0][5:].split('\\')[0]))
indexEn... | 29.092784 | 172 | 0.537916 |
4a0d3ed6ba27066efef3d882eccc2a1ced48fe50 | 1,121 | py | Python | client_apis/python/test/test_introspection_api.py | alikins/galaxy-api-swaggerhub | 5d6d4070cd6964c6d6217cad6743de89cf4eac24 | [
"MIT"
] | null | null | null | client_apis/python/test/test_introspection_api.py | alikins/galaxy-api-swaggerhub | 5d6d4070cd6964c6d6217cad6743de89cf4eac24 | [
"MIT"
] | 3 | 2020-07-17T10:18:45.000Z | 2022-01-22T05:24:05.000Z | client_apis/python/test/test_introspection_api.py | alikins/galaxy-api-swaggerhub | 5d6d4070cd6964c6d6217cad6743de89cf4eac24 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Galaxy 3.2 API (wip)
Galaxy 3.2 API (wip) # noqa: E501
The version of the OpenAPI document: 1.2.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.api.introspection_api import Int... | 20.381818 | 88 | 0.646744 |
4a0d3f5f1130ea482e63583dd1885184ee76fae2 | 2,166 | py | Python | src/sima/report/reportfragmentreference.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/report/reportfragmentreference.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/report/reportfragmentreference.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | # This an autogenerated file
#
# Generated with ReportFragmentReference
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.reportfragmentreference import ReportFragmentReferenceBlueprint
from typing import Dict
from sima.sima.moao import MOAO
from s... | 26.096386 | 80 | 0.614958 |
4a0d3f5f24ea55a1c9b71888f84f03f3dee6acf9 | 1,600 | py | Python | python_flask/tools/mock.py | taiypeo/blog-crud | 842f0accff2e6c3ed53d186d6ce3b3e25a3598f3 | [
"MIT"
] | null | null | null | python_flask/tools/mock.py | taiypeo/blog-crud | 842f0accff2e6c3ed53d186d6ce3b3e25a3598f3 | [
"MIT"
] | null | null | null | python_flask/tools/mock.py | taiypeo/blog-crud | 842f0accff2e6c3ed53d186d6ce3b3e25a3598f3 | [
"MIT"
] | null | null | null | import sys
sys.path.append("..")
from app import db
from app.models import User, BlogPost
u1 = User(username="admin", is_admin=True)
u1.set_password("12345")
u2 = User(username="user1")
u2.set_password("12345")
u3 = User(username="Hackerman")
u3.set_password("12345")
post1 = BlogPost(
title="Welcome to this bl... | 21.333333 | 164 | 0.61875 |
4a0d3fa3e840871e80e9506ad5d8f281591f5266 | 5,623 | py | Python | google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py | Linzee/python-datacatalog | 9fcf86f026e29db264fee9a1b63701976ed5ade7 | [
"Apache-2.0"
] | null | null | null | google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py | Linzee/python-datacatalog | 9fcf86f026e29db264fee9a1b63701976ed5ade7 | [
"Apache-2.0"
] | null | null | null | google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py | Linzee/python-datacatalog | 9fcf86f026e29db264fee9a1b63701976ed5ade7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/datacatalog_v1beta1/proto/timestamps.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pr... | 39.048611 | 759 | 0.703006 |
4a0d41c57f3f5b3f6aa88ecd6d7c63c23e720c1c | 21,084 | py | Python | CPG_core/osc/oscillator_4.py | Jerryxiaoyu/maml_rl_v2 | 6091f996ff1be8e80d80331e510087868461b8e6 | [
"MIT"
] | null | null | null | CPG_core/osc/oscillator_4.py | Jerryxiaoyu/maml_rl_v2 | 6091f996ff1be8e80d80331e510087868461b8e6 | [
"MIT"
] | null | null | null | CPG_core/osc/oscillator_4.py | Jerryxiaoyu/maml_rl_v2 | 6091f996ff1be8e80d80331e510087868461b8e6 | [
"MIT"
] | null | null | null | # Script with no feedback
# This script is used for evaluating the gait
# 将权值函数修改为优化参数, 相邻驱动 与构型文件相同
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import os
import time
import math
from utils import log
# Different from original script
from robot_mujoco.monitor_thread im... | 43.83368 | 157 | 0.523525 |
4a0d41caeb3d3f89be8d62323e7ceddad38156c2 | 113 | py | Python | run_dev.py | LandRegistry/mint-alpha | 0ba9f8696243b3f47b4e2cd1cfd211ef505f9074 | [
"MIT"
] | null | null | null | run_dev.py | LandRegistry/mint-alpha | 0ba9f8696243b3f47b4e2cd1cfd211ef505f9074 | [
"MIT"
] | null | null | null | run_dev.py | LandRegistry/mint-alpha | 0ba9f8696243b3f47b4e2cd1cfd211ef505f9074 | [
"MIT"
] | 1 | 2021-04-11T06:07:09.000Z | 2021-04-11T06:07:09.000Z | from themint.server import app
import os
app.run(host="0.0.0.0", port=int(os.getenv('PORT', 8001)), debug=True)
| 22.6 | 70 | 0.707965 |
4a0d4230edf032b1e43ef100b2abb90af972e5fb | 1,962 | py | Python | App.py | dsmarcot2018/imdb-poster-maker | de3e4769b69cc2fe23abf7a4198afa5c78007533 | [
"MIT"
] | null | null | null | App.py | dsmarcot2018/imdb-poster-maker | de3e4769b69cc2fe23abf7a4198afa5c78007533 | [
"MIT"
] | null | null | null | App.py | dsmarcot2018/imdb-poster-maker | de3e4769b69cc2fe23abf7a4198afa5c78007533 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
import requests
import json
app = Flask(__name__)
@app.route('/')
@app.route('/<show_title>'
'<show_image_height>'
'<show_image_imageUrl>'
'<show_image_width>'
'show_rank'
'show_yr')
def overlay(show_title=None,
... | 30.184615 | 88 | 0.555046 |
4a0d427148fe8c886f94030380deeccb03fbfac7 | 4,415 | py | Python | reconcile/gitlab_members.py | mmclanerh/qontract-reconcile | 57f3d5a38e6811843c234754df083d7bb35787bb | [
"Apache-2.0"
] | null | null | null | reconcile/gitlab_members.py | mmclanerh/qontract-reconcile | 57f3d5a38e6811843c234754df083d7bb35787bb | [
"Apache-2.0"
] | null | null | null | reconcile/gitlab_members.py | mmclanerh/qontract-reconcile | 57f3d5a38e6811843c234754df083d7bb35787bb | [
"Apache-2.0"
] | null | null | null | import logging
import reconcile.utils.gql as gql
import reconcile.queries as queries
from reconcile.utils.gitlab_api import GitLabApi
USERS_QUERY = """
{
users: users_v1 {
org_username
roles {
permissions {
... on PermissionGitlabGroupMembership_v1 {
name
group
... | 28.483871 | 74 | 0.545866 |
4a0d442b319770f9bea8a9ffeb125b7e04e8e443 | 1,125 | py | Python | DeepLearning/shared/proj_test.py | SeanSyue/TensorflowReferences | 2c93f4c770e2713ef4769f287e022d03e7097188 | [
"MIT"
] | null | null | null | DeepLearning/shared/proj_test.py | SeanSyue/TensorflowReferences | 2c93f4c770e2713ef4769f287e022d03e7097188 | [
"MIT"
] | null | null | null | DeepLearning/shared/proj_test.py | SeanSyue/TensorflowReferences | 2c93f4c770e2713ef4769f287e022d03e7097188 | [
"MIT"
] | null | null | null | import tensorflow as tf
from DeepLearning.project_train import neural_network, NODE_LIST, FEATURE_COUNT, LABEL_COUNT, data_splitter
# 直接導入參數
model_filepath = 'C:/bank/checkpoint/.ckpt'
TEST_FILE = 'C:/bank/double_up7_test.csv'
reshape_features, _, key = data_splitter(TEST_FILE, FEATURE_COUNT, LABEL_COUNT)
... | 32.142857 | 108 | 0.725333 |
4a0d445c74930d93279befdd1847843e22bf1dcc | 40 | py | Python | test_fixtures/general_repo_origin/file_with_main_function.py | SerejkaSJ/fiasko_bro | dfb8c30109f317c1e5b6d211e002fd148695809e | [
"MIT"
] | 25 | 2018-01-24T10:45:35.000Z | 2020-12-05T21:47:20.000Z | test_fixtures/general_repo_origin/file_with_main_function.py | SerejkaSJ/fiasko_bro | dfb8c30109f317c1e5b6d211e002fd148695809e | [
"MIT"
] | 110 | 2018-01-21T12:25:13.000Z | 2021-06-10T19:27:22.000Z | test_fixtures/general_repo_origin/file_with_main_function.py | SerejkaSJ/fiasko_bro | dfb8c30109f317c1e5b6d211e002fd148695809e | [
"MIT"
] | 13 | 2017-12-12T22:19:01.000Z | 2019-01-29T18:08:05.000Z | import sys
def main():
sys.exit()
| 6.666667 | 14 | 0.575 |
4a0d44a44e25238810b1bf1cb2d38c992d752696 | 3,522 | py | Python | lib/django-0.96/django/core/cache/backends/db.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-0.96/django/core/cache/backends/db.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-0.96/django/core/cache/backends/db.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | "Database cache backend."
from django.core.cache.backends.base import BaseCache
from django.db import connection, transaction, DatabaseError
import base64, time
from datetime import datetime
try:
import cPickle as pickle
except ImportError:
import pickle
class CacheClass(BaseCache):
def __init__(self, tab... | 42.433735 | 140 | 0.612436 |
4a0d45171ed64afbabccbcf12b36427e0c5a387f | 515 | py | Python | disk/tests/metrics.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | disk/tests/metrics.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | disk/tests/metrics.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | 1 | 2021-06-21T19:21:51.000Z | 2021-06-21T19:21:51.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
CORE_GAUGES = {
'system.disk.total': 5,
'system.disk.used': 4,
'system.disk.free': 1,
'system.disk.in_use': .80,
}
CORE_RATES = {
'system.disk.write_time_pct': 9.0,
'system.disk.read_time_p... | 24.52381 | 59 | 0.648544 |
4a0d475f2c712f852574673987537faa21037d6d | 104,289 | py | Python | cinder/tests/test_volume.py | jiyeonjoo/cdms-cinder | d79b282159a75f57c04801648b981d924f453fdd | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_volume.py | jiyeonjoo/cdms-cinder | d79b282159a75f57c04801648b981d924f453fdd | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_volume.py | jiyeonjoo/cdms-cinder | d79b282159a75f57c04801648b981d924f453fdd | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 43.635565 | 79 | 0.576686 |
4a0d4802b0fab2d47300247d8fd10fd03424790f | 2,271 | py | Python | src/camera_ops.py | thomasmburke/PersonalizedGreeter | 3d8c1958b61a584f268b23076e3b335de14d59ba | [
"MIT"
] | null | null | null | src/camera_ops.py | thomasmburke/PersonalizedGreeter | 3d8c1958b61a584f268b23076e3b335de14d59ba | [
"MIT"
] | null | null | null | src/camera_ops.py | thomasmburke/PersonalizedGreeter | 3d8c1958b61a584f268b23076e3b335de14d59ba | [
"MIT"
] | null | null | null | from picamera import PiCamera
from time import sleep
from imutils.video import VideoStream, FPS
import cv2
import imutils
import logging
import os
# Set logger
logger = logging.getLogger(__name__)
class CameraOps:
"""
CameraOps: Responsible for taking a picture of the person and streaming
the photo ba... | 41.290909 | 107 | 0.61823 |
4a0d4b31411f2e8aa0adcc5ae85511f2d2496b80 | 8,237 | py | Python | web/tests/chatnotifications.py | Shivam7-1/playhvz | 555e2e7e33ac01541481087ee26a4aab850bad90 | [
"Apache-2.0"
] | 23 | 2017-07-01T16:36:15.000Z | 2022-03-30T17:12:48.000Z | web/tests/chatnotifications.py | Shivam7-1/playhvz | 555e2e7e33ac01541481087ee26a4aab850bad90 | [
"Apache-2.0"
] | 25 | 2017-06-30T08:22:00.000Z | 2021-09-02T16:15:21.000Z | web/tests/chatnotifications.py | Shivam7-1/playhvz | 555e2e7e33ac01541481087ee26a4aab850bad90 | [
"Apache-2.0"
] | 30 | 2017-06-30T01:04:30.000Z | 2021-07-12T06:09:24.000Z | #!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 48.739645 | 343 | 0.731213 |
4a0d4cacd276b2cfa31f0bd4b1ae2d74748eb035 | 8,993 | py | Python | cadCAD/engine/simulation.py | oscardavidtorres1994/cadCAD | 229e2dac585eb6c1644cf277e3a7807883f10d13 | [
"MIT"
] | 1 | 2021-11-22T23:11:15.000Z | 2021-11-22T23:11:15.000Z | cadCAD/engine/simulation.py | oscardavidtorres1994/cadCAD | 229e2dac585eb6c1644cf277e3a7807883f10d13 | [
"MIT"
] | null | null | null | cadCAD/engine/simulation.py | oscardavidtorres1994/cadCAD | 229e2dac585eb6c1644cf277e3a7807883f10d13 | [
"MIT"
] | 1 | 2021-11-22T23:11:03.000Z | 2021-11-22T23:11:03.000Z | from typing import Any, Callable, Dict, List, Tuple
from pathos.pools import ThreadPool as TPool
from functools import reduce
from types import MappingProxyType
from copy import deepcopy
from functools import reduce
from funcy import curry
from cadCAD.engine.utils import engine_exception
from cadCAD.utils import flatt... | 36.556911 | 130 | 0.571889 |
4a0d4d010513538efefbed49ea2acf11a3997470 | 11,034 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/hoverlabel/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/hoverlabel/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/hoverlabel/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000'... | 34.373832 | 82 | 0.564165 |
4a0d4d711b386171ed6f74804a89e00dac23636b | 228 | py | Python | pythainlp/spell/tltk.py | Gorlph/pythainlp | 6135ba5f490e00640de902a0d5c65a4537739d98 | [
"Apache-2.0"
] | 125 | 2016-06-27T06:16:38.000Z | 2017-10-14T08:02:26.000Z | pythainlp/spell/tltk.py | Gorlph/pythainlp | 6135ba5f490e00640de902a0d5c65a4537739d98 | [
"Apache-2.0"
] | 48 | 2016-08-31T02:01:03.000Z | 2017-10-07T16:33:47.000Z | pythainlp/spell/tltk.py | Gorlph/pythainlp | 6135ba5f490e00640de902a0d5c65a4537739d98 | [
"Apache-2.0"
] | 40 | 2016-06-27T00:19:12.000Z | 2017-10-16T06:32:20.000Z | """
TLTK
Thai Language Toolkit
:See Also:
* \
https://pypi.org/project/tltk/
"""
from tltk.nlp import spell_candidates
from typing import List
def spell(text: str) -> List[str]:
return spell_candidates(text)
| 14.25 | 38 | 0.675439 |
4a0d4ecc5727ca47bd368ecd9a76e13b8aace76b | 629 | py | Python | backend/manage.py | tiagodomp/tiagoflix | 87b36450e55d0c9b8de9321b6cb4d44bb9fe31ce | [
"MIT"
] | null | null | null | backend/manage.py | tiagodomp/tiagoflix | 87b36450e55d0c9b8de9321b6cb4d44bb9fe31ce | [
"MIT"
] | 9 | 2020-06-05T20:17:54.000Z | 2022-02-26T21:54:45.000Z | backend/manage.py | tiagodomp/tiagoflix | 87b36450e55d0c9b8de9321b6cb4d44bb9fe31ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tiagoflix.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 |
4a0d502351ff469f1d032d259350051ca02eccf5 | 7,572 | py | Python | qiskit_finance/circuit/library/probability_distributions/lognormal.py | clausia/qiskit-finance | 925c386c4833a253ab5daceeca47806ef1f5034d | [
"Apache-2.0"
] | 1 | 2021-10-04T20:54:59.000Z | 2021-10-04T20:54:59.000Z | qiskit_finance/circuit/library/probability_distributions/lognormal.py | clausia/qiskit-finance | 925c386c4833a253ab5daceeca47806ef1f5034d | [
"Apache-2.0"
] | null | null | null | qiskit_finance/circuit/library/probability_distributions/lognormal.py | clausia/qiskit-finance | 925c386c4833a253ab5daceeca47806ef1f5034d | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 40.92973 | 119 | 0.619387 |
4a0d50bfa58f077d67e2f99e5c3d01ce6d36a293 | 4,269 | py | Python | models/fista.py | VITA-Group/HyperLISTA | 6ce0db8108fbbdd2bfe7779e91034037ac246681 | [
"MIT"
] | 5 | 2021-11-01T20:12:51.000Z | 2022-03-28T16:45:34.000Z | models/fista.py | VITA-Group/HyperLISTA | 6ce0db8108fbbdd2bfe7779e91034037ac246681 | [
"MIT"
] | 1 | 2021-11-09T17:07:00.000Z | 2021-11-09T17:07:00.000Z | models/fista.py | VITA-Group/HyperLISTA | 6ce0db8108fbbdd2bfe7779e91034037ac246681 | [
"MIT"
] | 1 | 2021-11-24T08:47:41.000Z | 2021-11-24T08:47:41.000Z | """
file: models/lista.py
author: Xiaohan Chen
last modified: 2021.05.28
Implementation LISTA with support selection.
"""
import math
import torch
import numpy as np
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from .utils import shrink, shrink_ss... | 32.097744 | 83 | 0.569923 |
4a0d516b24ea4a2a638e2376fcf3c88fbbab20d6 | 12,264 | py | Python | pybie2d/kernels/low_level/modified_helmholtz.py | dbstein/pybie2d | 1c2d6c05f6dbb4f1ab4476d3824f4dde20f90d58 | [
"Apache-2.0"
] | 11 | 2018-10-26T17:34:29.000Z | 2020-04-27T21:21:33.000Z | pybie2d/kernels/low_level/modified_helmholtz.py | dbstein/pybie2d | 1c2d6c05f6dbb4f1ab4476d3824f4dde20f90d58 | [
"Apache-2.0"
] | null | null | null | pybie2d/kernels/low_level/modified_helmholtz.py | dbstein/pybie2d | 1c2d6c05f6dbb4f1ab4476d3824f4dde20f90d58 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import numexpr as ne
import numba
import scipy as sp
import scipy.special
import warnings
from ... import have_fmm
if have_fmm:
from ... import FMM
# from ...misc.numba_special_functions import _numba_k0, _numba_k1, numba_k0, numba_k1
from ...misc.function_generator_functions import _fg_k0 as _n... | 42.289655 | 95 | 0.608203 |
4a0d51c14d047ef60ffa5d5087ccd769cc5bb6f5 | 28,006 | py | Python | nipype/interfaces/fsl/tests/test_dti.py | FredLoney/nipype | ceaa28dcbfe29ca4373479c897da9fc958167ccd | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_dti.py | FredLoney/nipype | ceaa28dcbfe29ca4373479c897da9fc958167ccd | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_dti.py | FredLoney/nipype | ceaa28dcbfe29ca4373479c897da9fc958167ccd | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import tempfile
import shutil
from tempfile import mkdtemp
from shutil import rmtree
import numpy as np
import nibabel as nb
from nose import with_setup
from nipype.testing import ( assert_eq... | 39.668555 | 110 | 0.539884 |
4a0d51d9f8af54d1f2bd007edd1fd992fb40e32c | 2,083 | py | Python | example/example/urls.py | ButchershopCreative/django-oauth-toolkit | 54fa2c63624babaad8593a95f397355dba40224d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | example/example/urls.py | ButchershopCreative/django-oauth-toolkit | 54fa2c63624babaad8593a95f397355dba40224d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | example/example/urls.py | ButchershopCreative/django-oauth-toolkit | 54fa2c63624babaad8593a95f397355dba40224d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.core.urlresolvers import reverse_lazy
from django.views.generic import TemplateView
from oauth2_provider import VERSION
from .views import (
ConsumerView, ConsumerExchangeView, ConsumerDoneView, ApiEndpoint, ApiClientV... | 29.757143 | 95 | 0.647144 |
4a0d522ab35c31e71b677800ab4813fbf796f129 | 954 | py | Python | veditor/utils/_loggers.py | iwasakishuto/PyVideoEditor | 878d7bf7126eab6606e6e7537454e495244595d2 | [
"MIT"
] | null | null | null | veditor/utils/_loggers.py | iwasakishuto/PyVideoEditor | 878d7bf7126eab6606e6e7537454e495244595d2 | [
"MIT"
] | null | null | null | veditor/utils/_loggers.py | iwasakishuto/PyVideoEditor | 878d7bf7126eab6606e6e7537454e495244595d2 | [
"MIT"
] | null | null | null | # coding: utf-8
import logging
import logging.config
from typing import Optional
from ..utils._colorings import toACCENT
__all__ = ["get_logger"]
_loggers = {}
def get_logger(name: Optional[str] = None) -> logging.Logger:
"""Return a logger with the specified name, creating it if necessary.
Args:
... | 27.257143 | 132 | 0.681342 |
4a0d52646e8910adf3b6344206e75902d78e42ca | 1,799 | py | Python | habu/cli/cmd_data_extract_domain.py | riccigrj/habu | 336a5d771edd318b01a94a9b793e2706ad4ccd2e | [
"BSD-3-Clause"
] | 461 | 2017-05-27T15:35:13.000Z | 2019-11-30T23:13:15.000Z | habu/cli/cmd_data_extract_domain.py | kobbycyber/habu | cda99c8df97fe669c8e45148615ba546b1f8226e | [
"BSD-3-Clause"
] | 10 | 2017-10-12T09:43:23.000Z | 2019-06-21T17:25:09.000Z | habu/cli/cmd_data_extract_domain.py | kobbycyber/habu | cda99c8df97fe669c8e45148615ba546b1f8226e | [
"BSD-3-Clause"
] | 108 | 2017-09-23T19:55:23.000Z | 2019-11-30T19:08:32.000Z | #!/usr/bin/env python3
import json
import logging
import socket
import tldextract
import click
import regex as re
from habu.lib import dnsx
def extract_domain(data):
regexp = re.compile(r"([a-zA-Z0-9_.-]+)")
match = regexp.finditer(data)
result = set()
for m in match:
candidate = m.gro... | 22.4875 | 104 | 0.625347 |
4a0d52754843d5ba15b222b921345e1eb04b949f | 342 | py | Python | modeanalytics/migrations/0004_remove_modereportmodel_space.py | jesuejunior/django-modeanalytics | 17dae1a9f7481e0caf5d77074512e767b47988f1 | [
"BSD-3-Clause"
] | 3 | 2020-03-19T03:04:50.000Z | 2020-05-21T15:58:18.000Z | modeanalytics/migrations/0004_remove_modereportmodel_space.py | jesuejunior/django-modeanalytics | 17dae1a9f7481e0caf5d77074512e767b47988f1 | [
"BSD-3-Clause"
] | 7 | 2020-04-13T15:52:37.000Z | 2021-09-22T18:47:39.000Z | modeanalytics/migrations/0004_remove_modereportmodel_space.py | jesuejunior/django-modeanalytics | 17dae1a9f7481e0caf5d77074512e767b47988f1 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-23 00:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('modeanalytics', '0003_auto_20200319_0226'),
]
operations = [
migrations.RemoveField(
model_name='modereportmodel',
name='spa... | 19 | 53 | 0.608187 |
4a0d540893bc1dd01ace426ace2d7b3f3b241e1a | 1,437 | py | Python | spritesticker/utils.py | jahodfra/spritesticker | 7dbfd2e08e1186a301468e07a544c07269de108d | [
"MIT"
] | null | null | null | spritesticker/utils.py | jahodfra/spritesticker | 7dbfd2e08e1186a301468e07a544c07269de108d | [
"MIT"
] | null | null | null | spritesticker/utils.py | jahodfra/spritesticker | 7dbfd2e08e1186a301468e07a544c07269de108d | [
"MIT"
] | null | null | null | '''
usefull functions of all possible kinds
'''
def gcd(x, y):
'''computes greatest common divisor
>>> gcd(12, 10)
2
>>> gcd(60, 120)
60
>>> gcd(29, 13)
1
'''
while True:
if y > x:
y, x = x, y
if y == 0:
return x
x, y = y, x % y
def l... | 19.16 | 80 | 0.497564 |
4a0d540db2de3dcd85e9e69bbd925fe1090d1112 | 5,527 | py | Python | autocorr.py | greenkidneybean/INoDS-model | 8a327f122e180e6bd9583b8bbbf88345c260ee4d | [
"MIT"
] | 1 | 2021-05-24T23:36:18.000Z | 2021-05-24T23:36:18.000Z | autocorr.py | greenkidneybean/INoDS-model | 8a327f122e180e6bd9583b8bbbf88345c260ee4d | [
"MIT"
] | null | null | null | autocorr.py | greenkidneybean/INoDS-model | 8a327f122e180e6bd9583b8bbbf88345c260ee4d | [
"MIT"
] | null | null | null | from emcee import PTSampler
import numpy as np
#from emcee.autocorr import AutocorrError, function
############################################################
def function(w, axis=0, fast=False):
"""Estimate the autocorrelation function of a time series using the FFT.
Args:
w: The time series. If multi... | 42.515385 | 117 | 0.566311 |
4a0d54d86620306058e24d5b23121687c8605144 | 6,474 | py | Python | utils/losses.py | saramsv/CCT | 27b4fd838a174a3c0fca582aa163e5bd426b055a | [
"MIT"
] | null | null | null | utils/losses.py | saramsv/CCT | 27b4fd838a174a3c0fca582aa163e5bd426b055a | [
"MIT"
] | null | null | null | utils/losses.py | saramsv/CCT | 27b4fd838a174a3c0fca582aa163e5bd426b055a | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from utils import ramps
class consistency_weight(object):
"""
ramp_types = ['sigmoid_rampup', 'linear_rampup', 'cosine_rampup', 'log_rampup', 'exp_rampup']
"""
def __init__(self, final_w, iters_per_epoch, rampup_sta... | 40.974684 | 116 | 0.670992 |
4a0d55799a11dca5e4af14f992228444aa755f73 | 1,056 | py | Python | tests/core/accounts/test_create_geth_account.py | themagicmountain/py-geth | 41d572d41ccb147a966aaf50a14d50886b1a6cc8 | [
"MIT"
] | 1 | 2019-08-29T07:38:47.000Z | 2019-08-29T07:38:47.000Z | tests/core/accounts/test_create_geth_account.py | themagicmountain/py-geth | 41d572d41ccb147a966aaf50a14d50886b1a6cc8 | [
"MIT"
] | null | null | null | tests/core/accounts/test_create_geth_account.py | themagicmountain/py-geth | 41d572d41ccb147a966aaf50a14d50886b1a6cc8 | [
"MIT"
] | 1 | 2020-11-19T05:18:08.000Z | 2020-11-19T05:18:08.000Z | import os
import shutil
import pytest
from geth.chain import (
get_chain_data_dir,
)
from geth.accounts import (
create_new_account,
get_accounts,
)
def test_create_new_account_with_text_password(tmpdir):
data_dir = str(tmpdir.mkdir("data-dir"))
assert not get_accounts(data_dir)
account_0 ... | 25.142857 | 75 | 0.745265 |
4a0d562417bcdbaaafe7a89777394811e7adf899 | 164 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_LinearTrend_Seasonal_DayOfWeek_AR.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_LinearTrend_Seasonal_DayOfWeek_AR.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_LinearTrend_Seasonal_DayOfWeek_AR.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['LinearTrend'] , ['Seasonal_DayOfWeek'] , ['AR'] ); | 41 | 91 | 0.762195 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.