hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
936be74b5161c4ea335dcc47745288106a326b76 | 244 | py | Python | 1/one.py | TheFrederick-git/adventofcode2021 | a320f3bba2655afab1aad8bf2520ccb705b2fd1e | [
"MIT"
] | null | null | null | 1/one.py | TheFrederick-git/adventofcode2021 | a320f3bba2655afab1aad8bf2520ccb705b2fd1e | [
"MIT"
] | null | null | null | 1/one.py | TheFrederick-git/adventofcode2021 | a320f3bba2655afab1aad8bf2520ccb705b2fd1e | [
"MIT"
] | null | null | null | """1/1 adventofcode"""
with open("input.txt", "r", encoding="UTF-8") as i_file:
data = list(map(int, i_file.read().splitlines()))
values = ["i" if data[i] > data[i - 1] else "d" for i in range(1, len(data))]
print(values.count("i"))
| 34.857143 | 78 | 0.598361 |
936bf8ac21c955c81e134a76b9bc99cd401c8943 | 1,777 | py | Python | tests/unit/test_suites.py | anshumangoyal/testrail-api | a9b2983a59667999a8432fa0af034c1fbd07e1cc | [
"MIT"
] | 21 | 2019-04-15T07:25:48.000Z | 2022-03-19T04:21:43.000Z | tests/unit/test_suites.py | anshumangoyal/testrail-api | a9b2983a59667999a8432fa0af034c1fbd07e1cc | [
"MIT"
] | 30 | 2019-04-15T07:18:59.000Z | 2022-03-19T07:26:57.000Z | tests/unit/test_suites.py | anshumangoyal/testrail-api | a9b2983a59667999a8432fa0af034c1fbd07e1cc | [
"MIT"
] | 16 | 2019-02-21T11:59:32.000Z | 2022-02-23T17:33:16.000Z | import json
import responses
def add_suite(r):
data = json.loads(r.body.decode())
return 200, {}, json.dumps({'id': 1, 'name': data['name'], 'description': data['description']})
def test_get_suite(api, mock, host):
mock.add_callback(
responses.GET,
'{}index.php?/api/v2/get_suite/4'.form... | 28.66129 | 113 | 0.606078 |
936c207084537761cb74e16423e014f03f8143af | 149,650 | py | Python | electrum/tests/test_wallet_vertical.py | traysi/electrum-raven | b2a64a459da32afd2987149460253cfadec03384 | [
"MIT"
] | 5 | 2018-10-31T18:47:54.000Z | 2021-09-20T02:04:42.000Z | electrum/tests/test_wallet_vertical.py | project-mynt/electrum-mynt | ca1548e008854f2a3eff900a69365307cc20bd57 | [
"MIT"
] | null | null | null | electrum/tests/test_wallet_vertical.py | project-mynt/electrum-mynt | ca1548e008854f2a3eff900a69365307cc20bd57 | [
"MIT"
] | 11 | 2018-10-31T19:46:05.000Z | 2019-09-25T20:18:37.000Z | from unittest import mock
import shutil
import tempfile
from typing import Sequence
import asyncio
from electrum import storage, bitcoin, keystore
from electrum import Transaction
from electrum import SimpleConfig
from electrum.address_synchronizer import TX_HEIGHT_UNCONFIRMED, TX_HEIGHT_UNCONF_PARENT
from electrum.wa... | 90.042118 | 6,844 | 0.835209 |
936c2afb0149d4d4c99ac2a4047ee18d4be8273d | 42,077 | py | Python | salt/modules/win_file.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 1 | 2020-06-16T05:47:58.000Z | 2020-06-16T05:47:58.000Z | salt/modules/win_file.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_file.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage information about files on the minion, set/read user, group
data
:depends: - win32api
- win32file
- win32security
'''
# Import python libs
import os
import stat
import os.path
import logging
import struct
# pylint: disable=W0611
import tempfile # do not re... | 34.517637 | 137 | 0.658246 |
936c3e10ac1164368023bc41659c2ba6b458cce5 | 1,946 | py | Python | code/envs/wrappers.py | arjunchandra/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 17 | 2019-03-29T18:30:36.000Z | 2021-10-17T15:38:22.000Z | code/envs/wrappers.py | arjunchandra/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 1 | 2019-04-22T22:40:30.000Z | 2019-04-24T21:45:07.000Z | code/envs/wrappers.py | ctallec/continuous-rl | 8f3c655c6a4b2e9d15a6b052e5466c0a75191a08 | [
"MIT"
] | 5 | 2019-04-29T16:26:18.000Z | 2020-01-23T07:17:49.000Z | """Env wrappers"""
from gym import ActionWrapper, Wrapper, logger
from gym.spaces import Discrete, Box
import numpy as np
class WrapPendulum(ActionWrapper):
""" Wrap pendulum. """
@property
def action_space(self):
return Discrete(2)
@action_space.setter
def action_space(self, value):
... | 29.484848 | 98 | 0.633094 |
936c456c777eee8726e06ac780062788c912846a | 1,185 | py | Python | angrmanagement/data/jobs/variable_recovery.py | Kyle-Kyle/angr-management | 6ea65f19d813be510a38f06510b2b2148a6b5000 | [
"BSD-2-Clause"
] | 2 | 2022-01-23T21:43:54.000Z | 2022-02-02T08:20:20.000Z | angrmanagement/data/jobs/variable_recovery.py | Kyle-Kyle/angr-management | 6ea65f19d813be510a38f06510b2b2148a6b5000 | [
"BSD-2-Clause"
] | 1 | 2021-12-04T01:11:46.000Z | 2021-12-04T01:11:46.000Z | angrmanagement/data/jobs/variable_recovery.py | Kyle-Kyle/angr-management | 6ea65f19d813be510a38f06510b2b2148a6b5000 | [
"BSD-2-Clause"
] | 1 | 2021-05-17T05:46:19.000Z | 2021-05-17T05:46:19.000Z | from typing import TYPE_CHECKING
import time
from .job import Job
if TYPE_CHECKING:
from ..instance import Instance
class VariableRecoveryJob(Job):
"""
Identify variables and recover calling convention for every function.
"""
def __init__(self, on_finish=None):
super().__init__(name="Va... | 26.931818 | 115 | 0.668354 |
936c6620d6867e8378072c0b699debdeb65b05b6 | 2,538 | py | Python | functional/tests/identity/v3/test_service_provider.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | functional/tests/identity/v3/test_service_provider.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | functional/tests/identity/v3/test_service_provider.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 46.145455 | 78 | 0.660757 |
936c7bb11a7a864477f9d95ad86903008cdc40f8 | 5,908 | py | Python | src/third_party/wiredtiger/dist/api_err.py | tychoish/mongo | 0c695aa1e879af482dc3aea4768dbda223ff4592 | [
"Apache-2.0"
] | 1 | 2021-07-16T09:47:06.000Z | 2021-07-16T09:47:06.000Z | src/third_party/wiredtiger/dist/api_err.py | tychoish/mongo | 0c695aa1e879af482dc3aea4768dbda223ff4592 | [
"Apache-2.0"
] | 1 | 2015-05-29T16:12:10.000Z | 2015-05-29T16:12:10.000Z | src/third_party/wiredtiger/dist/api_err.py | tychoish/mongo | 0c695aa1e879af482dc3aea4768dbda223ff4592 | [
"Apache-2.0"
] | 1 | 2015-05-26T20:33:29.000Z | 2015-05-26T20:33:29.000Z | # Output C #defines for errors into wiredtiger.in and the associated error
# message code in strerror.c.
import re, textwrap
from dist import compare_srcfile
class Error:
def __init__(self, name, value, desc, long_desc=None, **flags):
self.name = name
self.value = value
self.desc = desc
... | 34.549708 | 80 | 0.644211 |
936cb74701b33f6f4f64ddabe3f35207a83b37c4 | 681 | py | Python | tests/integration/internal/conftest.py | Sage-Bionetworks/spccore | c63a88ef472b83be11594b820a072f6d79080a73 | [
"Apache-2.0"
] | 1 | 2019-06-13T20:47:59.000Z | 2019-06-13T20:47:59.000Z | tests/integration/internal/conftest.py | Sage-Bionetworks/spccore | c63a88ef472b83be11594b820a072f6d79080a73 | [
"Apache-2.0"
] | 12 | 2019-06-13T23:32:59.000Z | 2019-08-27T01:24:57.000Z | tests/integration/internal/conftest.py | Sage-Bionetworks/spccore | c63a88ef472b83be11594b820a072f6d79080a73 | [
"Apache-2.0"
] | 3 | 2019-06-13T20:50:01.000Z | 2019-08-29T19:34:31.000Z | import pytest
from spccore.internal.cache import *
TEST_CACHE_ROOT_DIR = "cache_integration_test"
@pytest.fixture
def cache() -> Cache:
os.makedirs(TEST_CACHE_ROOT_DIR)
cache = Cache(cache_root_dir=TEST_CACHE_ROOT_DIR)
cache.purge(from_epoch_time_to_datetime(time.time()))
yield cache
try:
... | 19.457143 | 57 | 0.679883 |
936cc44a8970d27c0a4adf67bc318526488ef394 | 12,778 | py | Python | tests/test_agent_loop.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | tests/test_agent_loop.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | tests/test_agent_loop.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 34.628726 | 88 | 0.651823 |
936cdd23ca0b096855492a5aeded05647350384b | 307 | py | Python | jaraco/windows/api/user.py | jaraco/jaraco.windows | e858172b4d5ee91233a8cc5319de99f17848f090 | [
"MIT"
] | 21 | 2016-01-31T00:58:59.000Z | 2021-05-06T22:30:56.000Z | jaraco/windows/api/user.py | jaraco/jaraco.windows | e858172b4d5ee91233a8cc5319de99f17848f090 | [
"MIT"
] | 14 | 2016-07-21T12:02:08.000Z | 2021-08-06T03:07:54.000Z | jaraco/windows/api/user.py | jaraco/jaraco.windows | e858172b4d5ee91233a8cc5319de99f17848f090 | [
"MIT"
] | 5 | 2016-06-14T04:57:04.000Z | 2021-05-06T22:30:57.000Z | import ctypes.wintypes
try:
from ctypes.wintypes import LPDWORD
except ImportError:
LPDWORD = ctypes.POINTER(ctypes.wintypes.DWORD) # type: ignore
GetUserName = ctypes.windll.advapi32.GetUserNameW
GetUserName.argtypes = ctypes.wintypes.LPWSTR, LPDWORD
GetUserName.restype = ctypes.wintypes.DWORD
| 27.909091 | 67 | 0.801303 |
936cfa8b1b93c6c388f18150163dd32678f81b33 | 116 | py | Python | src/onevision/datasets/hide/__init__.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | 2 | 2022-03-28T09:46:38.000Z | 2022-03-28T14:12:32.000Z | src/onevision/datasets/hide/__init__.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | null | null | null | src/onevision/datasets/hide/__init__.py | phlong3105/onevision | 90552b64df7213e7fbe23c80ffd8a89583289433 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from __future__ import annotations
from .hideblur import *
| 11.6 | 34 | 0.637931 |
936d1e63215869d9908fefe2321339f751ff4fa4 | 1,486 | py | Python | tdmelodic/filters/yomi/basic.py | tachi-hi/tdmelodic | 9b146c9c788eb730855376c86a8b0eab4d8438ca | [
"BSD-3-Clause"
] | 73 | 2020-09-18T06:37:11.000Z | 2022-03-15T12:40:47.000Z | tdmelodic/filters/yomi/basic.py | tachi-hi/tdmelodic | 9b146c9c788eb730855376c86a8b0eab4d8438ca | [
"BSD-3-Clause"
] | 4 | 2021-02-06T14:52:39.000Z | 2021-11-04T10:02:45.000Z | tdmelodic/filters/yomi/basic.py | tachi-hi/tdmelodic | 9b146c9c788eb730855376c86a8b0eab4d8438ca | [
"BSD-3-Clause"
] | 9 | 2020-09-18T14:49:15.000Z | 2022-03-18T02:53:54.000Z | import regex as re
def modify_longvowel_errors(line, idx_yomi=None):
line[idx_yomi] = line[idx_yomi]\
.replace("ーィ","ウィ")\
.replace("ーェ","ウェ")\
.replace("ーォ","ウォ")
return line
def modify_yomi_of_numerals(line, idx_surface=None, idx_yomi=None):
"""
数値の読みを簡易的に修正する(完全なものではない)
... | 29.72 | 79 | 0.504038 |
936d3b3daeb0e61ea6c82ae71666b5667d71ed5a | 3,967 | py | Python | index.py | tangigouez/webapp_personal_data | c36a315924a7996ad4dc9952ed8cc02dc852eb59 | [
"Apache-2.0"
] | null | null | null | index.py | tangigouez/webapp_personal_data | c36a315924a7996ad4dc9952ed8cc02dc852eb59 | [
"Apache-2.0"
] | null | null | null | index.py | tangigouez/webapp_personal_data | c36a315924a7996ad4dc9952ed8cc02dc852eb59 | [
"Apache-2.0"
] | null | null | null | import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import dash_bootstrap_components as dbc
from app import app
from apps import tab1, tab2, datauploader
from utils import GA
server = app.server
app.index_string = GA
# Create Navigation Bar appear... | 33.058333 | 90 | 0.443156 |
936d40ba636a1f95616dc8a057d08e82b10745da | 4,079 | py | Python | travis_pypi_setup.py | anaothmane/algebraic | 772c63f6a7716c52aae12df1820e147730e18f3c | [
"MIT"
] | null | null | null | travis_pypi_setup.py | anaothmane/algebraic | 772c63f6a7716c52aae12df1820e147730e18f3c | [
"MIT"
] | null | null | null | travis_pypi_setup.py | anaothmane/algebraic | 772c63f6a7716c52aae12df1820e147730e18f3c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file."""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | 31.867188 | 79 | 0.700907 |
936d53f19c4b21e01d58e24646724adac04e79d9 | 4,264 | py | Python | networks/wild_nets/wild_motion_net.py | bolianchen/pytorch_depth_from_videos_in_the_wild | 6f013154ba9f3a8de944c788a9370980e4c2b7c8 | [
"MIT"
] | 5 | 2022-02-25T04:38:16.000Z | 2022-03-28T17:38:03.000Z | networks/wild_nets/wild_motion_net.py | bolianchen/pytorch_depth_from_videos_in_the_wild | 6f013154ba9f3a8de944c788a9370980e4c2b7c8 | [
"MIT"
] | 5 | 2022-02-25T07:26:39.000Z | 2022-03-02T06:04:32.000Z | networks/wild_nets/wild_motion_net.py | bolianchen/pytorch_depth_from_videos_in_the_wild | 6f013154ba9f3a8de944c788a9370980e4c2b7c8 | [
"MIT"
] | null | null | null | # All rights reserved.
import torch
import torch.nn as nn
import torchvision.models as models
class RefinementLayer(nn.Module):
def __init__(self, num_channel, dims, num_motion_fields=3):
super(RefinementLayer, self).__init__()
self.num_channel = num_channel
self.num_mid_channel = max(4, se... | 44.884211 | 79 | 0.632739 |
936d5e3eda08adaa0997639f81af1b7ace0f0cb8 | 2,984 | py | Python | opcalendar/migrations/0022_auto_20210222_1255.py | buahaha/allianceauth-opcalendar | 44e50e06eac4b5c0e6b809e5ca2638af5e49145f | [
"MIT"
] | null | null | null | opcalendar/migrations/0022_auto_20210222_1255.py | buahaha/allianceauth-opcalendar | 44e50e06eac4b5c0e6b809e5ca2638af5e49145f | [
"MIT"
] | null | null | null | opcalendar/migrations/0022_auto_20210222_1255.py | buahaha/allianceauth-opcalendar | 44e50e06eac4b5c0e6b809e5ca2638af5e49145f | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-22 12:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("opcalendar", "0021_eventhost_logo_url"),
]
operations = [
migrations.AlterField(
model_name="eventhost",
name="commu... | 30.762887 | 87 | 0.510389 |
936d8bd4ba580c862aff1821962dd960869ef7ff | 7,327 | py | Python | python_main_training_tenet.py | deepeshhada/Tenet | 8ce8e2a36e1b6a285904741191164af5b5c3c4b5 | [
"MIT"
] | null | null | null | python_main_training_tenet.py | deepeshhada/Tenet | 8ce8e2a36e1b6a285904741191164af5b5c3c4b5 | [
"MIT"
] | null | null | null | python_main_training_tenet.py | deepeshhada/Tenet | 8ce8e2a36e1b6a285904741191164af5b5c3c4b5 | [
"MIT"
] | null | null | null | import subprocess
import numpy as np
import subprocess
def run_python(test,lr,batch_size,num_factors,num_negatives,margin,keep_prob,gnn_keep_prob,net_keep_prob,hid_units,d_k,n_heads,knn_k, num_negatives_seq):
sys_path = '/home/vijai/'
#data_path = 'tenet/data_tenet/required/spotify_small/tenet/s... | 48.203947 | 153 | 0.410809 |
936d912e3db8ebbacb3c01aa0d17a302b88a47ad | 976 | py | Python | tests/_animation/test_animation_skew_x_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | tests/_animation/test_animation_skew_x_interface.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | tests/_animation/test_animation_skew_x_interface.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | from random import randint
from retrying import retry
import apysc as ap
from apysc._display.skew_x_interface import SkewXInterface
from tests.testing_helper import assert_attrs
class TestAnimationSkewXInterface:
@retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000))
def test_animatio... | 32.533333 | 69 | 0.616803 |
936dbb025566f049143e4be9acb33f70e812948d | 451 | py | Python | experiments/chat/chat/broadcasts.py | hotwire-django/turbo-django | a8eab649f7f09f89e7cbedd72582b2ffe81abcab | [
"MIT"
] | 298 | 2020-12-23T21:28:46.000Z | 2022-03-19T11:25:23.000Z | experiments/chat/chat/broadcasts.py | hotwire-django/turbo-django | a8eab649f7f09f89e7cbedd72582b2ffe81abcab | [
"MIT"
] | 30 | 2020-12-26T14:57:40.000Z | 2022-03-28T12:44:34.000Z | experiments/chat/chat/broadcasts.py | hotwire-django/turbo-django | a8eab649f7f09f89e7cbedd72582b2ffe81abcab | [
"MIT"
] | 11 | 2020-12-24T19:50:40.000Z | 2022-01-23T15:02:58.000Z | from .models import Message
import turbo
@turbo.register(Message)
class MessageBroadcast(turbo.ModelBroadcast):
def on_save(self, message, created, *args, **kwargs):
if created:
message.room.turbo.render("chat/components/message.html", {"message": message}).append(
id="message... | 28.1875 | 99 | 0.64745 |
936e0c44e4e9cb4f1e1d0a62bc68885bf2550c6d | 12,894 | py | Python | mo_parsing/infix.py | klahnakoski/mo-parsing | 885bf3fd61430d5fa15164168b975b18988fcf9e | [
"MIT"
] | 1 | 2021-10-30T21:18:29.000Z | 2021-10-30T21:18:29.000Z | mo_parsing/infix.py | klahnakoski/mo-parsing | 885bf3fd61430d5fa15164168b975b18988fcf9e | [
"MIT"
] | 22 | 2020-04-15T14:49:30.000Z | 2021-12-22T02:49:52.000Z | mo_parsing/infix.py | klahnakoski/mo-parsing | 885bf3fd61430d5fa15164168b975b18988fcf9e | [
"MIT"
] | null | null | null | # encoding: utf-8
import re
import warnings
from mo_dots import listwrap
from mo_future import text, Iterable
from mo_imports import delay_import
from mo_parsing import whitespaces
from mo_parsing.enhancement import (
Combine,
Forward,
Group,
Suppress,
ZeroOrMore,
)
from mo_parsing.expressions imp... | 34.384 | 117 | 0.483946 |
936e242b9fdafb6e61481d42a08f8b21ec7aba8f | 3,957 | py | Python | reporting/counts_couch_vs_solr.py | ucldc/ucldc_api_data_quality | d297856e4d15beec0ae054329603bb3b3c92f43d | [
"BSD-3-Clause"
] | null | null | null | reporting/counts_couch_vs_solr.py | ucldc/ucldc_api_data_quality | d297856e4d15beec0ae054329603bb3b3c92f43d | [
"BSD-3-Clause"
] | null | null | null | reporting/counts_couch_vs_solr.py | ucldc/ucldc_api_data_quality | d297856e4d15beec0ae054329603bb3b3c92f43d | [
"BSD-3-Clause"
] | 1 | 2018-07-19T21:47:59.000Z | 2018-07-19T21:47:59.000Z | # -*- coding: utf-8 -*-
import os
import argparse
try:
import configparser
except:
import ConfigParser as configparser
import datetime
import csv
from get_solr_json import get_solr_json, create_facet_dict
import requests
solr_collection_query = {
'q': '*:*',
'facet': 'true',
'facet.field': [
... | 42.548387 | 77 | 0.66136 |
936e46ac5c1b2b7ca6c59829d579c6e7d1cd4f25 | 5,230 | py | Python | tieba/utils/mysql.py | changleibox/TiebaCrawler | d4f0af508660d4e6d38cdb410ce2711117d13f3a | [
"Apache-2.0"
] | 21 | 2018-03-15T05:41:46.000Z | 2021-07-27T00:06:15.000Z | tieba/utils/mysql.py | changleibox/TiebaCrawler | d4f0af508660d4e6d38cdb410ce2711117d13f3a | [
"Apache-2.0"
] | 3 | 2018-06-01T09:00:52.000Z | 2020-04-16T11:39:02.000Z | tieba/utils/mysql.py | changleibox/TiebaCrawler | d4f0af508660d4e6d38cdb410ce2711117d13f3a | [
"Apache-2.0"
] | 9 | 2018-06-07T02:19:33.000Z | 2021-07-29T02:55:18.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Created by box on 2018/2/24.
import pymysql
from tieba.utils import Logger
logger = Logger(__name__)
def addslashes(s):
if isinstance(type(s), unicode):
s = s.encode('utf-8')
# noinspection PyBroadException
try:
d = {'"': '\\"', "'": "\\'... | 29.217877 | 116 | 0.59044 |
936e4ec361aa7bfac684556e7dae4e138d4fe560 | 6,241 | py | Python | generated/python/proto-google-cloud-vision-v1/google/cloud/proto/vision/v1/geometry_pb2.py | landrito/api-client-staging | 140c312c9335af160efce5b37842c995308e0148 | [
"BSD-3-Clause"
] | 18 | 2016-12-08T20:47:57.000Z | 2022-01-29T19:36:04.000Z | generated/python/proto-google-cloud-vision-v1/google/cloud/proto/vision/v1/geometry_pb2.py | landrito/api-client-staging | 140c312c9335af160efce5b37842c995308e0148 | [
"BSD-3-Clause"
] | 252 | 2016-09-21T20:51:36.000Z | 2021-03-25T23:02:36.000Z | generated/python/proto-google-cloud-vision-v1/google/cloud/proto/vision/v1/geometry_pb2.py | landrito/api-client-staging | 140c312c9335af160efce5b37842c995308e0148 | [
"BSD-3-Clause"
] | 37 | 2016-09-19T21:13:16.000Z | 2022-01-29T19:36:07.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/proto/vision/v1/geometry.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... | 34.291209 | 539 | 0.745554 |
936e68fe1ad6b8a74c773504b96293d3e1cf973b | 814 | py | Python | elastic_transport/_version.py | stevepentland/elastic-transport-python | fb354acce61ca1f73939283a0653a614dcc425db | [
"Apache-2.0"
] | null | null | null | elastic_transport/_version.py | stevepentland/elastic-transport-python | fb354acce61ca1f73939283a0653a614dcc425db | [
"Apache-2.0"
] | null | null | null | elastic_transport/_version.py | stevepentland/elastic-transport-python | fb354acce61ca1f73939283a0653a614dcc425db | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 42.842105 | 64 | 0.759214 |
936e6e567ef81dfa99446055f4454c0a8492dede | 527 | py | Python | 09-functional-programming/higherorderfunctions/higher-order4.py | johnehunt/PythonCleanCode | b0ade446cc98cdc1379f06ad20cc3c6de772a2bb | [
"Apache-2.0"
] | 1 | 2020-05-11T13:58:29.000Z | 2020-05-11T13:58:29.000Z | 09-functional-programming/higherorderfunctions/higher-order4.py | johnehunt/PythonCleanCode | b0ade446cc98cdc1379f06ad20cc3c6de772a2bb | [
"Apache-2.0"
] | null | null | null | 09-functional-programming/higherorderfunctions/higher-order4.py | johnehunt/PythonCleanCode | b0ade446cc98cdc1379f06ad20cc3c6de772a2bb | [
"Apache-2.0"
] | null | null | null | def make_checker(s):
if s == 'even':
return lambda n: n % 2 == 0
elif s == 'positive':
return lambda n: n >= 0
elif s == 'negative':
return lambda n: n < 0
else:
raise ValueError('Unknown request')
f1 = make_checker('even')
f2 = make_checker('positive')
f3 = make_checke... | 17 | 43 | 0.571157 |
936e960a2c77135fda0d8afe548709318c95b427 | 879 | py | Python | conf.py | CPJKU/pers_bias | 9030208a88eb95c016f5851d3801c1e894ac648d | [
"MIT"
] | 2 | 2021-03-29T04:05:52.000Z | 2021-09-18T21:59:56.000Z | conf.py | CPJKU/pers_bias | 9030208a88eb95c016f5851d3801c1e894ac648d | [
"MIT"
] | null | null | null | conf.py | CPJKU/pers_bias | 9030208a88eb95c016f5851d3801c1e894ac648d | [
"MIT"
] | 2 | 2020-10-26T14:47:43.000Z | 2021-03-29T04:09:17.000Z | SEEDS = [
6547893,
2034976,
2345303,
]
UN_SEEDS = [
6547893,
2034976,
2345303,
7887871,
1023468,
8812394,
2132395,
4444637,
7192837,
6574836,
]
TRAITS = [
'ope',
'con',
'agr',
'ext',
'neu'
]
LEVELS = [
1,
3,
5,
10,
20,
50... | 16.584906 | 74 | 0.534699 |
936e9627a23e780ea0320f5b46e619a203b71888 | 2,341 | py | Python | simplechinese/generation.py | chenmingxiang110/SimpleChinese2 | 91f90672f25daadbfccd2ab22f026a65889705af | [
"MIT"
] | 78 | 2021-06-21T02:28:14.000Z | 2022-03-18T13:35:16.000Z | simplechinese/generation.py | chenmingxiang110/SimpleChinese2 | 91f90672f25daadbfccd2ab22f026a65889705af | [
"MIT"
] | 3 | 2021-06-30T11:03:58.000Z | 2021-09-09T10:39:27.000Z | simplechinese/generation.py | chenmingxiang110/SimpleChinese2 | 91f90672f25daadbfccd2ab22f026a65889705af | [
"MIT"
] | 24 | 2021-06-21T02:30:49.000Z | 2021-08-23T09:49:03.000Z | import os
import sys
import pickle
import numpy as np
class Generator:
def __init__(self, folder):
with open(os.path.join(folder, 'chinese_names.pickle'), 'rb') as handle:
self.males_zh, self.females_zh, self.surnames_zh = pickle.load(handle)
with open(os.path.join(folder, 'english_nam... | 41.803571 | 104 | 0.639043 |
936eca5957a5c095cc91c183817a09932316b42d | 2,180 | py | Python | pywick/callbacks/CSVLogger.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | 2 | 2020-11-28T07:56:09.000Z | 2021-11-08T09:30:39.000Z | pywick/callbacks/CSVLogger.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | null | null | null | pywick/callbacks/CSVLogger.py | ashishpatel26/pywick | 1afffd1c21c2b188836d3599e802146182757bb5 | [
"MIT"
] | null | null | null | import csv
import os
from collections import Iterable
from collections import OrderedDict
import torch
from . import Callback
__all__ = ['CSVLogger']
class CSVLogger(Callback):
"""
Logs epoch-level metrics to a CSV file
:param file: (string) path to csv file
:param separator: (string) delimiter for... | 31.142857 | 102 | 0.569266 |
936f0683fc29c257e045c8e058d647034eb5d05b | 1,327 | py | Python | app/core/models.py | justinwkUKM/django-app-api | a55231ac1d938ff3678ff06d47cfdbcc5301f371 | [
"MIT"
] | null | null | null | app/core/models.py | justinwkUKM/django-app-api | a55231ac1d938ff3678ff06d47cfdbcc5301f371 | [
"MIT"
] | 4 | 2021-03-19T01:28:34.000Z | 2021-09-22T18:49:45.000Z | app/core/models.py | justinwkUKM/django-app-api | a55231ac1d938ff3678ff06d47cfdbcc5301f371 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, \
BaseUserManager, PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
'''creates and saves a new user'''
if not email:
raise ValueEr... | 32.365854 | 76 | 0.683497 |
936f081a715110d2e8ef2bdb88e51783080b5116 | 1,492 | py | Python | query_adversarial_main.py | snji-khjuria/RelationClassificationFewShotModels | a5047f44a57a81ab3281bf1290fa149a4c456486 | [
"MIT"
] | null | null | null | query_adversarial_main.py | snji-khjuria/RelationClassificationFewShotModels | a5047f44a57a81ab3281bf1290fa149a4c456486 | [
"MIT"
] | null | null | null | query_adversarial_main.py | snji-khjuria/RelationClassificationFewShotModels | a5047f44a57a81ab3281bf1290fa149a4c456486 | [
"MIT"
] | null | null | null | import models
from fewshot_re_kit.data_loader import JSONFileDataLoader
from fewshot_re_kit.sentence_encoder import CNNSentenceEncoder
import sys
from fewshot_re_kit.adversarial_framework import FewShotAdversarialREFramework
from models.metagan_queryattentive import MetaDisc, MetaGenerator
import os
import torch
torch.... | 38.25641 | 110 | 0.773458 |
936f70bb24fa951770c853774971cec3a7004185 | 9,982 | py | Python | alipay/aop/api/domain/AnttechBlockchainFinanceTruspleCreditgrantapplySubmitModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AnttechBlockchainFinanceTruspleCreditgrantapplySubmitModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AnttechBlockchainFinanceTruspleCreditgrantapplySubmitModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.FinAttachment import FinAttachment
from alipay.aop.api.domain.CompanyInformation import CompanyInformation
from alipay.aop.api.domain.PersonInfo import PersonInfo
from alipay.aop.ap... | 39.454545 | 119 | 0.646564 |
936f74dac5b2d9dfa6df41c7282487bd101ec344 | 477 | py | Python | tests/unit/__init__.py | Lordshinjo/asyncpraw | d94d89a992d9b5b300439ea6884a9df1d95511e2 | [
"BSD-2-Clause"
] | 72 | 2020-07-14T02:02:21.000Z | 2022-03-15T13:10:02.000Z | tests/unit/__init__.py | Lordshinjo/asyncpraw | d94d89a992d9b5b300439ea6884a9df1d95511e2 | [
"BSD-2-Clause"
] | 68 | 2020-07-16T05:29:43.000Z | 2022-03-14T12:04:56.000Z | tests/unit/__init__.py | Lordshinjo/asyncpraw | d94d89a992d9b5b300439ea6884a9df1d95511e2 | [
"BSD-2-Clause"
] | 19 | 2020-07-22T15:34:30.000Z | 2022-03-27T20:28:46.000Z | """PRAW Unit test suite."""
import asynctest
from asyncpraw import Reddit
class UnitTest(asynctest.TestCase):
"""Base class for PRAW unit tests."""
async def setUp(self):
"""Setup runs before all test cases."""
self.reddit = Reddit(
client_id="dummy", client_secret="dummy", user_... | 26.5 | 72 | 0.641509 |
936fcd077975b210c205c6b9c257da2b8fc79bc7 | 653 | py | Python | deepchembed/tests/test_utilities.py | hanghu/AutoChemCluster | 2ab4ae996b300a90637b124707905201c89d74d8 | [
"MIT"
] | 2 | 2019-05-15T06:31:35.000Z | 2019-08-31T13:13:21.000Z | deepchembed/tests/test_utilities.py | hanghu/AutoChemCluster | 2ab4ae996b300a90637b124707905201c89d74d8 | [
"MIT"
] | 7 | 2019-05-02T19:01:40.000Z | 2022-02-10T00:11:00.000Z | deepchembed/tests/test_utilities.py | hanghu/AutoChemCluster | 2ab4ae996b300a90637b124707905201c89d74d8 | [
"MIT"
] | 1 | 2019-08-17T11:34:56.000Z | 2019-08-17T11:34:56.000Z | import deepchembed.tests.__init__
import utilities
import pandas as pd
#def test_utilities():
# return
def test_clean_out_of_bound():
df = [-9,0,1,99,100,101]
assert utilities.clean_out_of_bound(df).equals(pd.Series([0,0,1,99,100,100]))
return
def test_bi_class():
df = [1,3,7,8]
bound = 4
... | 17.184211 | 81 | 0.68147 |
936fe672799d81a2c0bdd17b107d176e6278aba0 | 3,876 | py | Python | sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iothubprovisioningservices/azure/mgmt/iothubprovisioningservices/models/__init__.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 35.888889 | 94 | 0.78096 |
9370018e8cf446cbbf3c22b54451a6feee80ada3 | 1,194 | py | Python | .venv/Scripts/rst2html5.py | JohanK91/MethodDice | 73a8962c762ff48da331c9212f10676f066ed940 | [
"MIT"
] | null | null | null | .venv/Scripts/rst2html5.py | JohanK91/MethodDice | 73a8962c762ff48da331c9212f10676f066ed940 | [
"MIT"
] | null | null | null | .venv/Scripts/rst2html5.py | JohanK91/MethodDice | 73a8962c762ff48da331c9212f10676f066ed940 | [
"MIT"
] | 1 | 2021-02-22T13:55:32.000Z | 2021-02-22T13:55:32.000Z | #!C:\Users\vigge\onedrive\dokument\github\methoddice\.venv\Scripts\python.exe
# -*- coding: utf8 -*-
# :Copyright: © 2015 Günter Milde.
# :License: Released under the terms of the `2-Clause BSD license`_, in short:
#
# Copying and distribution of this file, with or without modification,
# are permitted in any med... | 33.166667 | 78 | 0.723618 |
93700995c2691f0bffd61ca140e9b39e936c5486 | 15,222 | py | Python | python/medifor/v1/analyticservice.py | cameron-a-johnson/medifor | 2290ffccaace5c24b85a0595861f221dcbcf7efe | [
"Apache-2.0"
] | null | null | null | python/medifor/v1/analyticservice.py | cameron-a-johnson/medifor | 2290ffccaace5c24b85a0595861f221dcbcf7efe | [
"Apache-2.0"
] | null | null | null | python/medifor/v1/analyticservice.py | cameron-a-johnson/medifor | 2290ffccaace5c24b85a0595861f221dcbcf7efe | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division, unicode_literals, absolute_import
import base64
import contextlib
import json
import logging
import os
import select
import sys
import threading
import time
import traceback
from concurrent import futures
import medifor.v1.analytic_pb2 as analytic_pb2
import medifor.v... | 35.985816 | 126 | 0.636776 |
93704018756e7e481e1bc0dca394647f8ed43ed7 | 8,046 | py | Python | prom/utils.py | viggyfresh/prom | a918476dab1dbadced61fc088cdc36fed1685d0a | [
"MIT"
] | null | null | null | prom/utils.py | viggyfresh/prom | a918476dab1dbadced61fc088cdc36fed1685d0a | [
"MIT"
] | null | null | null | prom/utils.py | viggyfresh/prom | a918476dab1dbadced61fc088cdc36fed1685d0a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import importlib
import heapq
import itertools
import os
import sys
import codecs
from contextlib import contextmanager
from .compat import *
class Stream(object):
"""In the CLI we either want to print to s... | 30.477273 | 88 | 0.604897 |
93704c21ca063e7abfaa4ceca3a9ab580482993f | 644 | py | Python | tests/routing.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | tests/routing.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | tests/routing.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | from channels.routing import ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from channels.routing import URLRouter
from django.urls import path
from bridger.notifications.consumers import NotificationConsumer
from bridger.websockets.auth import JWTAuthMiddlewareStack
from bridger.websockets.consumers i... | 37.882353 | 80 | 0.835404 |
93706564d4ded55f126e9f408ae9eefeeff957e8 | 2,334 | py | Python | gtld_data/tools/dump_reverse_zone.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | gtld_data/tools/dump_reverse_zone.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | gtld_data/tools/dump_reverse_zone.py | NCommander/gtld-innovation-health | 5dac47ce7678f8867e056eb361b4ddddbab109bd | [
"MIT"
] | null | null | null | #!/usr/bin/env pyhton3
# Copyright 2018 Michael Casadevall <michael@casadevall.pro>
#
# 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
# ... | 40.241379 | 116 | 0.72108 |
9370750a5b34e4f4264675b690c3f24d6f2f4cda | 6,679 | py | Python | mGui/helpers/preformat.py | theodox/mGui | d2cd8c48ae1d51c9587b0aaab5b1d296a0561625 | [
"MIT"
] | 105 | 2015-01-13T10:52:55.000Z | 2022-03-23T12:49:01.000Z | mGui/helpers/preformat.py | techartorg/mGui | d2cd8c48ae1d51c9587b0aaab5b1d296a0561625 | [
"MIT"
] | 84 | 2015-01-15T14:56:08.000Z | 2019-04-15T17:03:51.000Z | mGui/helpers/preformat.py | techartorg/mGui | d2cd8c48ae1d51c9587b0aaab5b1d296a0561625 | [
"MIT"
] | 22 | 2015-01-11T11:25:37.000Z | 2021-12-24T06:34:46.000Z | """
mGui.helpers.tools
This module provides services that can be useful of r
"""
import maya.mel as mel
import constants
import mGui.core as core
from StringIO import StringIO
_is_widget = lambda helptext: 'dragCallback' in helptext
_is_layout = lambda helptext: 'childArray' in helptext
__layout_cmds = [] # filled... | 37.734463 | 119 | 0.605031 |
9370970f0e09cc38a579df0de92b0fa01788e17e | 24,997 | py | Python | HEMnet/HEMnet_test_dataset.py | BiomedicalMachineLearning/HEMnet | e9b49f09055f8af8f1a46e6645585eb42d296631 | [
"MIT"
] | 9 | 2021-04-12T12:46:05.000Z | 2022-03-08T08:04:23.000Z | HEMnet/HEMnet_test_dataset.py | BiomedicalMachineLearning/HEMnet | e9b49f09055f8af8f1a46e6645585eb42d296631 | [
"MIT"
] | null | null | null | HEMnet/HEMnet_test_dataset.py | BiomedicalMachineLearning/HEMnet | e9b49f09055f8af8f1a46e6645585eb42d296631 | [
"MIT"
] | 3 | 2021-03-23T08:48:24.000Z | 2022-03-14T02:44:31.000Z | # ------------------------------------------------------------------------
# Generate test dataset
#
# Place TP53 and H&E slides in a single directory
# TP53 slides must be named : slide_id_TP53
# e.g. patient_123_TP53.svs
# H&E slides must be named : slide_id_HandE
# e.g. patient_123_HandE.svs
#
# Exa... | 46.205176 | 159 | 0.645797 |
93709f377a5f9365596d630d7d0796faaad2d811 | 249 | py | Python | email_notification/apps.py | FRA1T/django_news | f293df7197a261d8f853a68a1579dc377c0f1d15 | [
"MIT"
] | 2 | 2020-10-31T07:01:03.000Z | 2020-10-31T07:04:13.000Z | email_notification/apps.py | GitHuber228/django_news | 63798966214848ca9ab9370ca070d1b9c89a314b | [
"MIT"
] | null | null | null | email_notification/apps.py | GitHuber228/django_news | 63798966214848ca9ab9370ca070d1b9c89a314b | [
"MIT"
] | 1 | 2020-10-31T07:04:21.000Z | 2020-10-31T07:04:21.000Z | from django.apps import AppConfig
class EmailSendConfig(AppConfig):
name = 'email_notification'
verbose_name = 'Email'
def ready(self):
"""Imports signals when app has been started"""
import email_notification.signals
| 22.636364 | 55 | 0.702811 |
9370bda8f7cf2cfeb8f399f32750f9a6c5906f90 | 1,255 | py | Python | .vagrant_provisioning/local_settings.py | kingsdigitallab/egomedia-django | 7347fc96ca52ac195b388e43204d0a0faab0c88f | [
"MIT"
] | null | null | null | .vagrant_provisioning/local_settings.py | kingsdigitallab/egomedia-django | 7347fc96ca52ac195b388e43204d0a0faab0c88f | [
"MIT"
] | 10 | 2021-04-06T18:17:44.000Z | 2022-03-01T12:21:40.000Z | .vagrant_provisioning/local_settings.py | kingsdigitallab/egomedia-django | 7347fc96ca52ac195b388e43204d0a0faab0c88f | [
"MIT"
] | null | null | null | from .base import * # noqa
DEBUG = True
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = False
DATABASES = {
'default': {
'ENGINE': db_engine,
'NAME': 'egomedia',
'USER': 'egomedia',
'PASSWORD': 'egomedia',
'ADMINUSER': 'postgres',
'HOST': 'localhost'
},
}
... | 25.612245 | 79 | 0.56255 |
93710271f3aea36ed0fc29ea94901cc83aceb779 | 748 | py | Python | hackerrank/30-days-of-code/day4-class-vs-instance.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | 1 | 2019-02-11T13:29:32.000Z | 2019-02-11T13:29:32.000Z | hackerrank/30-days-of-code/day4-class-vs-instance.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | 1 | 2019-02-11T15:26:36.000Z | 2019-02-11T15:26:36.000Z | hackerrank/30-days-of-code/day4-class-vs-instance.py | AmrMKayid/KayAlgo | df6e2b5b0f74174d5c0950520f0c47b04212dfaa | [
"MIT"
] | null | null | null | class Person:
def __init__(self, initialAge):
# Add some more code to run some checks on initialAge
self.age = 0
if initialAge > 0:
self.age = initialAge
else:
print('Age is not valid, setting age to 0.')
def amIOld(self):
# Do some computations in here and print out the correct st... | 22 | 85 | 0.605615 |
937119ff6d409251dc6c637780e0dd3bb8b3dd89 | 9,046 | py | Python | homeassistant/components/template/alarm_control_panel.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/template/alarm_control_panel.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/template/alarm_control_panel.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for Template alarm control panels."""
import logging
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
ENTITY_ID_FORMAT,
FORMAT_NUMBER,
PLATFORM_SCHEMA,
AlarmControlPanel,
)
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_... | 31.629371 | 86 | 0.658413 |
937126fe15dc665ec4683996e76fb59b7e6e1ed2 | 1,109 | py | Python | plots/final/plot_adaptation_detailed.py | jokteur/ASMA | 25ac8a0455c680232d56c18d31de62c3188b7153 | [
"MIT"
] | 2 | 2021-11-01T09:13:17.000Z | 2022-03-08T14:34:16.000Z | plots/final/plot_adaptation_detailed.py | jokteur/ASMA | 25ac8a0455c680232d56c18d31de62c3188b7153 | [
"MIT"
] | null | null | null | plots/final/plot_adaptation_detailed.py | jokteur/ASMA | 25ac8a0455c680232d56c18d31de62c3188b7153 | [
"MIT"
] | null | null | null | import numpy as np
import copy
import matplotlib.pyplot as plt
from activity import plot_activity
from kernel import plot_kernel
# Simulation parameters
params = dict(
dt=0.5 * 1e-2,
time_end=17,
Lambda=np.array([12.3, 2.5]),
Gamma=np.array([-8.0, -2.5]),
c=30,
lambda_kappa=50,
Delta=2,
... | 19.45614 | 74 | 0.612263 |
93716f6fd0b82aa42f89d883aa976d96ebcc6712 | 3,104 | py | Python | bootloader/waflib/Tools/gnu_dirs.py | BA7JCM/pyinstaller | 51ff689509391921bdce42848f3a077dcbb40ca0 | [
"Apache-2.0"
] | null | null | null | bootloader/waflib/Tools/gnu_dirs.py | BA7JCM/pyinstaller | 51ff689509391921bdce42848f3a077dcbb40ca0 | [
"Apache-2.0"
] | null | null | null | bootloader/waflib/Tools/gnu_dirs.py | BA7JCM/pyinstaller | 51ff689509391921bdce42848f3a077dcbb40ca0 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os, re
from waflib import Utils, Options, Context
gnuopts = '''
bindir, user commands, ${EXEC_PREFIX}/bin
sbindir, system binaries, ${EXEC_PREFIX}/sbin
libexecdir, program-specific binaries, ... | 40.311688 | 105 | 0.66817 |
9371cf74030728af388268e4c74e1c3ceac92aac | 19,437 | py | Python | copulas/multivariate/tree.py | echo66/Copulas | 5d14678100b15b2534f89d72de9ea9463abd14b1 | [
"MIT"
] | null | null | null | copulas/multivariate/tree.py | echo66/Copulas | 5d14678100b15b2534f89d72de9ea9463abd14b1 | [
"MIT"
] | null | null | null | copulas/multivariate/tree.py | echo66/Copulas | 5d14678100b15b2534f89d72de9ea9463abd14b1 | [
"MIT"
] | null | null | null | import json
import logging
from enum import Enum
import numpy as np
import scipy
from copulas import EPSILON
from copulas.bivariate.base import Bivariate
LOGGER = logging.getLogger(__name__)
class TreeTypes(Enum):
CENTER = 0
DIRECT = 1
REGULAR = 2
class Tree(object):
"""Helper class to instantiat... | 33.512069 | 97 | 0.569069 |
9371d2a20eba744f9a74510bb97d9f9f2ca6e3be | 2,360 | py | Python | scripts/batch_plots.py | Leonardo-H/DR-PG | dc5467ddd73a7b89938aac9d44735b019a3fd7d7 | [
"Apache-2.0"
] | 2 | 2019-11-25T01:56:49.000Z | 2021-05-20T03:22:59.000Z | scripts/batch_plots.py | Leonardo-H/DR-PG | dc5467ddd73a7b89938aac9d44735b019a3fd7d7 | [
"Apache-2.0"
] | null | null | null | scripts/batch_plots.py | Leonardo-H/DR-PG | dc5467ddd73a7b89938aac9d44735b019a3fd7d7 | [
"Apache-2.0"
] | 1 | 2019-11-24T02:30:38.000Z | 2019-11-24T02:30:38.000Z | import os
import argparse
def main(exp, style):
attrs = [
'MeanSumOfRewards',
'MinSumOfRewards',
'MeanRolloutLens',
'std',
'ExplainedVarianceBefore\(value_function_approximator\)',
'ExplainedVarianceAfter\(value_function_approximator\)',
'ExplainedVarianceB... | 29.873418 | 122 | 0.537712 |
9371db2f44d0034b72c591aa11fe074835180374 | 2,036 | py | Python | satella/coding/sequences/choose.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 12 | 2019-12-13T10:17:38.000Z | 2022-01-05T09:01:36.000Z | satella/coding/sequences/choose.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 26 | 2016-04-01T11:55:26.000Z | 2021-12-30T17:03:59.000Z | satella/coding/sequences/choose.py | piotrmaslanka/satella | bf4ba7a21ad2ac93a366442a2b4574dc5568b87e | [
"MIT"
] | 1 | 2021-05-31T08:45:22.000Z | 2021-05-31T08:45:22.000Z | from satella.coding.typing import Iteratable, Predicate, T
def choose_one(filter_fun: Predicate[T], iterable: Iteratable) -> T:
"""
Syntactic sugar for
>>> choose(filter_fun, iterable, check_multiple=True)
This exhausts the iterable.
:param filter_fun: function that returns bool on the single v... | 35.103448 | 93 | 0.68222 |
9371f3fc667ae0eb324a2062c5da24c6c86561af | 844 | py | Python | recordwhat/records/mbbo.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 1 | 2016-06-08T15:14:15.000Z | 2016-06-08T15:14:15.000Z | recordwhat/records/mbbo.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 12 | 2016-02-11T15:01:05.000Z | 2019-09-23T17:28:32.000Z | recordwhat/records/mbbo.py | mrakitin/recordwhat | c68b8fca69836bdba0075726e829325f2c8918a8 | [
"BSD-3-Clause"
] | 4 | 2016-06-08T15:03:07.000Z | 2019-09-23T17:05:38.000Z | from ophyd import (EpicsSignal, EpicsSignalRO)
from .. import (_register_record_type,
FieldComponent as Cpt)
from .mbbi import MbbRecordBase
@_register_record_type('mbbo')
class MbboRecord(MbbRecordBase):
prev_readback_value = Cpt(EpicsSignalRO, '.ORBV')
raw_value = Cpt(EpicsSignal, '.RVAL')... | 32.461538 | 70 | 0.709716 |
937209bde814534637e886ff9d01e8cb8431cdd1 | 77,924 | py | Python | modules/unit_tests/core/tools/hierarchy.py | nursix/DRKCM | 09328289ff721c416494398aa751ff99906327cb | [
"MIT"
] | 3 | 2022-01-26T08:07:54.000Z | 2022-03-21T21:53:52.000Z | modules/unit_tests/core/tools/hierarchy.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | modules/unit_tests/core/tools/hierarchy.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | # Eden Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/core/tools/hierarchy.py
#
import unittest
from lxml import etree
from s3dal import Field, Query, S3DAL
from core import *
from unit_tests import run_suite
# ===========================================... | 37.177481 | 103 | 0.498345 |
93723513b91164890609a79cf1464d420ff8e315 | 8,440 | py | Python | old/nifti_alignment.py | raffienficiaud/brain-data-visualization | edc685e978da5a514686f38106a4cbd274e33f75 | [
"MIT"
] | 6 | 2019-01-05T20:34:29.000Z | 2021-07-31T20:02:52.000Z | old/nifti_alignment.py | raffienficiaud/brain-data-vizualisation | edc685e978da5a514686f38106a4cbd274e33f75 | [
"MIT"
] | null | null | null | old/nifti_alignment.py | raffienficiaud/brain-data-vizualisation | edc685e978da5a514686f38106a4cbd274e33f75 | [
"MIT"
] | 2 | 2021-07-31T20:02:53.000Z | 2022-03-07T18:12:25.000Z | # Running VTK
from examples.nifti_alignment import nifti
#export DYLD_LIBRARY_PATH=/Applications/ParaView-5.4.1.app/Contents/Libraries/:$DYLD_LIBRARY_PATH
#>> python
#import sys
#sys.path.append("/Applications/ParaView-5.4.1.app/Contents/Python")
# easier
# start pvpython
# > /Applications/ParaView-5.4.1.app/Content... | 29.929078 | 138 | 0.724052 |
9372355c9678dc9a3a6cd57158321207e57fecfd | 29,494 | py | Python | config_compare.py | saurabhmishra/config-compare | c92647a82453d8f9e14873d24959c3b0c146f149 | [
"Apache-2.0"
] | 6 | 2016-09-20T22:15:31.000Z | 2019-09-19T03:31:20.000Z | config_compare.py | Symantec/config-compare | c92647a82453d8f9e14873d24959c3b0c146f149 | [
"Apache-2.0"
] | null | null | null | config_compare.py | Symantec/config-compare | c92647a82453d8f9e14873d24959c3b0c146f149 | [
"Apache-2.0"
] | 4 | 2016-12-15T22:34:36.000Z | 2021-02-26T10:22:50.000Z | import argparse
import collections
import copy
import json
import os
import pprint
import re
import sys
import xmltodict
def _chk_label(cmp_root, test_label, conf_file):
"""
Check to see if the label for the current value needs to be created.
:param cmp_root: <dictionary> A dictionary representing the con... | 47.494364 | 151 | 0.575676 |
937241f23bfee5da17257db4ec6eabe3eb8a189b | 27,106 | py | Python | volttron/platform/vip/agent/subsystems/auth.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | null | null | null | volttron/platform/vip/agent/subsystems/auth.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | 4 | 2021-05-28T19:12:54.000Z | 2022-02-18T03:07:40.000Z | volttron/platform/vip/agent/subsystems/auth.py | architpansare/volttron | ea8e7b3c8af9ce08dc736bd8a5c7b513d6b94fe9 | [
"Apache-2.0",
"BSD-2-Clause"
] | 3 | 2021-06-12T19:49:56.000Z | 2022-02-12T20:14:38.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | 38.339463 | 101 | 0.54357 |
93724842f13af3d93d5a68718d857035be58de30 | 4,043 | py | Python | lymph/serializers/base.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 89 | 2015-03-01T11:39:55.000Z | 2022-01-31T22:00:15.000Z | lymph/serializers/base.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 214 | 2015-01-02T23:48:49.000Z | 2020-01-14T10:47:37.000Z | lymph/serializers/base.py | MislavStipetic/lymph | aa36a688380e5665fdea31fda76b4a0cf35b6fc0 | [
"Apache-2.0"
] | 36 | 2015-01-13T13:44:15.000Z | 2021-09-15T17:55:41.000Z | import abc
import datetime
import decimal
import functools
import json
import uuid
import msgpack
import six
import iso8601
from lymph.utils import Undefined
@six.add_metaclass(abc.ABCMeta)
class ExtensionTypeSerializer(object):
@abc.abstractmethod
def serialize(self, obj):
raise NotImplementedError... | 25.427673 | 100 | 0.677715 |
9372e8858add48cf74b04f6fe613f5641b9c9d59 | 3,389 | py | Python | neatsociety/ifnn/__init__.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | 2 | 2018-03-03T16:30:09.000Z | 2022-01-02T17:02:22.000Z | neatsociety/ifnn/__init__.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | null | null | null | neatsociety/ifnn/__init__.py | machinebrains/neat-society | 395c092083aa62ac8ad2a93a9afde659ecbd85fd | [
"BSD-3-Clause"
] | 1 | 2021-09-21T21:53:17.000Z | 2021-09-21T21:53:17.000Z | class IFSynapse(object):
""" A synapse indicates the connection strength between two neurons (or itself) """
def __init__(self, source, dest, weight):
self.__weight = weight
self.__source = source
self.__dest = dest
def advance(self):
"""Advances time in 1 ms."""
if... | 33.22549 | 93 | 0.608439 |
9372eed8217f4258094da315732dfd5988bbd308 | 207 | py | Python | ads/model/common/__init__.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | 20 | 2022-02-22T19:07:09.000Z | 2022-03-16T17:21:42.000Z | ads/model/common/__init__.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | ads/model/common/__init__.py | oracle/accelerated-data-science | d594ed0c8c1365daf4cf9e860daebc760fa9a24b | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*--
# Copyright (c) 2020, 2022 Oracle and its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
| 34.5 | 104 | 0.710145 |
9372fca3cab44800624260fbab75a6b421fe6f34 | 2,849 | py | Python | tests/cupy/admm/test_cbpdnin.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 217 | 2016-06-13T16:41:26.000Z | 2022-03-22T06:31:05.000Z | tests/cupy/admm/test_cbpdnin.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 21 | 2016-06-13T23:28:35.000Z | 2022-02-17T23:20:01.000Z | tests/cupy/admm/test_cbpdnin.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 47 | 2016-12-14T13:08:33.000Z | 2021-12-12T01:59:49.000Z | from __future__ import division
from builtins import object
import pytest
try:
import cupy as cp
try:
cp.cuda.Device(0).compute_capability
except cp.cuda.runtime.CUDARuntimeError:
pytest.skip("GPU device inaccessible", allow_module_level=True)
except ImportError:
pytest.skip("cupy not i... | 24.773913 | 78 | 0.536329 |
9373143f4348f5d8cedd9b68025286156aae67bf | 4,641 | py | Python | metforcings_prep/gridded/metsim_merged_MSWEP-p1deg.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | null | null | null | metforcings_prep/gridded/metsim_merged_MSWEP-p1deg.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | null | null | null | metforcings_prep/gridded/metsim_merged_MSWEP-p1deg.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | 3 | 2020-11-08T16:01:47.000Z | 2021-01-13T17:13:32.000Z | # This script produces merged files containing pr,tasmax,tasmin
# These are input files for Metsim to calculate PET
#
# Peter Uhe
# 2020-01-14
#
# Input files are 0.1 degree resolution
# MSWEP v2-2 precipitation and ERA5 temperature (bias corrected to worldclim)
import os,subprocess,sys,glob
adata = '/export/anthrop... | 37.427419 | 220 | 0.636285 |
9373177039688c7943337e0777f81bcd0a7d95c1 | 1,959 | py | Python | docs/source/conf.py | c1au6i0/pokerpy | 5846ebe323f13e5852c48b18c052b2f3f14a1efe | [
"MIT"
] | null | null | null | docs/source/conf.py | c1au6i0/pokerpy | 5846ebe323f13e5852c48b18c052b2f3f14a1efe | [
"MIT"
] | null | null | null | docs/source/conf.py | c1au6i0/pokerpy | 5846ebe323f13e5852c48b18c052b2f3f14a1efe | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.982143 | 79 | 0.666667 |
93734ca66b250e3295e9842db3016eee95dad64d | 358 | py | Python | Python/ex004_types.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | 1 | 2021-02-16T17:36:53.000Z | 2021-02-16T17:36:53.000Z | Python/ex004_types.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | null | null | null | Python/ex004_types.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | null | null | null | a = input('Digite algo: ')
print('O tipo primitivo desse valor é ',type(a))
print ('Só tem espaços ? ', a.isspace())
print ('É um número? ', a.isnumeric())
print('É alfabético? ', a.isalpha())
print('É alfanumérico? ', a.isalnum())
print ('Está em maiusculas? ', a.isupper())
print('Está em minusculas?', a.islower())
pr... | 35.8 | 48 | 0.659218 |
9373a05c1a1dd3086e9926b23b7e15a294fb5ebc | 2,292 | py | Python | improver/utilities/cli_utilities.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver/utilities/cli_utilities.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver/utilities/cli_utilities.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 41.672727 | 79 | 0.714223 |
9373b8db63315f7435e2afba57160824122eeaea | 6,116 | py | Python | gisele/Steinerman.py | Energy4Growing/gisele_v01 | 833445022ffbbc07885915581822b62bf07ad331 | [
"Apache-2.0"
] | 3 | 2021-09-21T08:13:07.000Z | 2022-03-02T16:18:51.000Z | gisele/Steinerman.py | Energy4Growing/gisele_v01 | 833445022ffbbc07885915581822b62bf07ad331 | [
"Apache-2.0"
] | null | null | null | gisele/Steinerman.py | Energy4Growing/gisele_v01 | 833445022ffbbc07885915581822b62bf07ad331 | [
"Apache-2.0"
] | null | null | null | import networkx as nx
import time
import math
from scipy import sparse
from gisele.functions import *
from gisele.Steiner_tree_code import *
def steiner(geo_df, gdf_cluster_pop, line_bc, resolution, branch_points=None):
'''
:param geo_df:
:param gdf_cluster_pop:
:param line_bc:
:param resolution:... | 38.465409 | 83 | 0.668247 |
9373be1d632db88c60088eaff0208554f8f6ec58 | 1,080 | py | Python | ground_truth/create_custom_image_task/src/ground-truth-postprocess.py | smrmkt/sagemaker-notebooks | b46d08723fff068b94f7ffa4b2ef9d247417eb10 | [
"MIT"
] | 1 | 2019-08-14T00:59:59.000Z | 2019-08-14T00:59:59.000Z | ground_truth/create_custom_image_task/src/ground-truth-postprocess.py | smrmkt/sagemaker-notebooks | b46d08723fff068b94f7ffa4b2ef9d247417eb10 | [
"MIT"
] | null | null | null | ground_truth/create_custom_image_task/src/ground-truth-postprocess.py | smrmkt/sagemaker-notebooks | b46d08723fff068b94f7ffa4b2ef9d247417eb10 | [
"MIT"
] | null | null | null | import json
import boto3
from urlparse import urlparse
def lambda_handler(event, context):
consolidated_labels = []
parsed_url = urlparse(event['payload']['s3Uri']);
s3 = boto3.client('s3')
textFile = s3.get_object(Bucket = parsed_url.netloc, Key = parsed_url.path[1:])
filecont = textFile['Body'].... | 34.83871 | 83 | 0.549074 |
9373cf375b44dbb13ef7cc5ad60fc9e3a3f20ac8 | 206 | py | Python | py/cidoc_crm_types/properties/p71i_is_listed_in.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p71i_is_listed_in.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p71i_is_listed_in.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | from .p67i_is_referred_to_by import P67iIsReferredToBy
from dataclasses import dataclass
@dataclass
class P71iIsListedIn(P67iIsReferredToBy):
URI = "http://erlangen-crm.org/current/P71i_is_listed_in"
| 25.75 | 61 | 0.830097 |
93740f9f6d23c551c1abf0ed7198af90805cf101 | 3,995 | py | Python | setup.py | etano/clisk | 70067eb98568a97d896ee486bae56b49c77bcb11 | [
"MIT"
] | null | null | null | setup.py | etano/clisk | 70067eb98568a97d896ee486bae56b49c77bcb11 | [
"MIT"
] | null | null | null | setup.py | etano/clisk | 70067eb98568a97d896ee486bae56b49c77bcb11 | [
"MIT"
] | null | null | null | """Print ASCII graphs in the terminal.
See:
https://github.com/etano/clisk
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from ... | 34.439655 | 94 | 0.660826 |
937417ebd271817b81309fd198c0a8e3d92290e2 | 593 | py | Python | tree/DiameterofBinaryTree.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | tree/DiameterofBinaryTree.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | tree/DiameterofBinaryTree.py | mengyangbai/leetcode | e7a6906ecc5bce665dec5d0f057b302a64d50f40 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def traverse(self, root):
if not root: return 0
left = self.traverse(root.left)
right = self.traverse(root.right... | 24.708333 | 46 | 0.548061 |
93742ab2af5e62f729d56a6d2190f43b4cfeacdd | 2,027 | py | Python | scripts/build_filename_lexicon.py | mmenietti/python_code | 74df6acf8f950b72f65e27b2ac98854483084b6f | [
"MIT"
] | null | null | null | scripts/build_filename_lexicon.py | mmenietti/python_code | 74df6acf8f950b72f65e27b2ac98854483084b6f | [
"MIT"
] | null | null | null | scripts/build_filename_lexicon.py | mmenietti/python_code | 74df6acf8f950b72f65e27b2ac98854483084b6f | [
"MIT"
] | null | null | null | #------------------------------------------------------------
# Dependencies
#------------------------------------------------------------
import pathlib
# import os
import csv
import argparse
# import collections
# import itertools
import mm.misc_utilities
import mm.text_utilities
#-----------------------------------... | 36.854545 | 116 | 0.600888 |
937448f817b99cb4ecbb933bfafb11dbfb4f9046 | 2,884 | py | Python | widgets/import_manager/import_manager.py | cnralux/qgis-zoa-plugin | f25846ee2d9d563da5e201172c2fb5c220b2952b | [
"MIT"
] | null | null | null | widgets/import_manager/import_manager.py | cnralux/qgis-zoa-plugin | f25846ee2d9d563da5e201172c2fb5c220b2952b | [
"MIT"
] | null | null | null | widgets/import_manager/import_manager.py | cnralux/qgis-zoa-plugin | f25846ee2d9d563da5e201172c2fb5c220b2952b | [
"MIT"
] | null | null | null | '''
Created on 1 mai 2021
@author: CNRA, arxit
'''
from __future__ import absolute_import
from builtins import object
import os
from qgis.core import *
from qgis.gui import *
from qgis.PyQt.QtWidgets import QFileDialog
from qgis.PyQt.QtCore import *
import ZOALuxembourg.main
import ZOALuxembourg.project
from .impo... | 31.692308 | 164 | 0.627601 |
9374621a3a103c2cbb489f8afbbd62ca8e33ca34 | 69,128 | py | Python | epydoc/cli.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | epydoc/cli.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | epydoc/cli.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | # epydoc -- Command line interface
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: cli.py 1807 2008-03-04 02:32:58Z edloper $
"""
Command-line interface for epydoc. Abbreviated Usage::
epydoc [options] NAMES...
NAMES... Th... | 41.543269 | 79 | 0.588329 |
9374cb13799ad24f65d498b735ecaf0a0e44154e | 310 | py | Python | examples/vectorfield.py | maartenbreddels/kaplot | 305026209f8026094d54373e14541f4f039501d5 | [
"MIT"
] | null | null | null | examples/vectorfield.py | maartenbreddels/kaplot | 305026209f8026094d54373e14541f4f039501d5 | [
"MIT"
] | null | null | null | examples/vectorfield.py | maartenbreddels/kaplot | 305026209f8026094d54373e14541f4f039501d5 | [
"MIT"
] | null | null | null | from kaplot import *
import kaplot
#print dir(kaplot.quickgen)
mozaic(type=box)
select(0, 0)
vectorfield("-y", "x", scale=0.5)
select(1, 0)
vectorfield("y", "x", scale=0.5)
select(0, 1)
vectorfield("x**2", "y**2", scale=0.5)
select(1, 1)
vectorfield("x/sqrt(x**2+y**2)", "y/sqrt(x**2+y**2)", scale=0.3)
draw() | 22.142857 | 64 | 0.635484 |
9375779cc981252eeaee556c79f01aa667639819 | 3,980 | py | Python | multistart.py | jmnel/simulated-annealing | 1b50e172eed35f85f7278db1778b88d428ecf5ea | [
"MIT"
] | null | null | null | multistart.py | jmnel/simulated-annealing | 1b50e172eed35f85f7278db1778b88d428ecf5ea | [
"MIT"
] | null | null | null | multistart.py | jmnel/simulated-annealing | 1b50e172eed35f85f7278db1778b88d428ecf5ea | [
"MIT"
] | null | null | null | from typing import Callable, Dict
import numpy as np
import scipy.optimize as optim
from gradient_descent import grad_descent
from zoo import Zoo
def multistart(f: Callable,
jac: Callable,
domain: np.array,
max_iterations: int = 200,
tau: float = 1e-4,
... | 29.701493 | 93 | 0.539447 |
937579d075b13abe23e17b5119b01fcb0c791d30 | 1,797 | py | Python | supervisor/resolution/fixups/store_execute_remove.py | janiversen/supervisor | 890313701c37eb4a14b870b361729491c1ed20aa | [
"Apache-2.0"
] | 597 | 2017-04-27T15:10:08.000Z | 2019-12-18T16:02:57.000Z | supervisor/resolution/fixups/store_execute_remove.py | janiversen/supervisor | 890313701c37eb4a14b870b361729491c1ed20aa | [
"Apache-2.0"
] | 799 | 2017-05-02T00:26:07.000Z | 2019-12-18T21:40:18.000Z | supervisor/resolution/fixups/store_execute_remove.py | janiversen/supervisor | 890313701c37eb4a14b870b361729491c1ed20aa | [
"Apache-2.0"
] | 173 | 2017-04-26T17:03:42.000Z | 2019-12-15T10:41:57.000Z | """Helpers to check and fix issues with free space."""
import logging
from typing import Optional
from ...coresys import CoreSys
from ...exceptions import ResolutionFixupError, StoreError, StoreNotFound
from ..const import ContextType, IssueType, SuggestionType
from .base import FixupBase
_LOGGER: logging.Logger = lo... | 29.95 | 75 | 0.662215 |
93757c40f4c0c0513166de414297f58a85698a59 | 5,999 | py | Python | chapter2/intogen-mutations/develop/workflows/quality/oncodriveclust.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | 1 | 2015-12-22T00:53:18.000Z | 2015-12-22T00:53:18.000Z | chapter2/intogen-mutations/develop/workflows/quality/oncodriveclust.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | null | null | null | chapter2/intogen-mutations/develop/workflows/quality/oncodriveclust.py | chris-zen/phd-thesis | 1eefdff8e7ca1910304e27ae42551dc64496b101 | [
"Unlicense"
] | null | null | null | from wok.task import task
from intogensm import so
from intogensm.config import GlobalConfig, PathsConfig
from intogensm.projects.db import ProjectDb
from intogensm.projects.results import ProjectResults
from intogensm.oncodriveclust import OncodriveClust
@task.foreach()
def oncodriveclust(project):
log = task.logg... | 33.892655 | 102 | 0.757793 |
9375acc3b16d0b81688d18ca1f0cbbe810d472dd | 5,410 | py | Python | maro/simulator/scenarios/abs_business_engine.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | maro/simulator/scenarios/abs_business_engine.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | maro/simulator/scenarios/abs_business_engine.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from pathlib import Path
from abc import ABC, abstractmethod
from typing import Dict, List, Union
from maro.event_buffer import EventBuffer
from maro.backends.frame import FrameBase, SnapshotList
from maro.simulator.utils.common import... | 35.359477 | 194 | 0.639741 |
9375beddf59020e1f632f8b258d28fdac94055a7 | 2,150 | py | Python | IMLearn/utils/utils.py | yuvalarbel/IML.HUJI | 8ef0aa9403c97adc5b79d1ebd6780065cf0af1e7 | [
"MIT"
] | null | null | null | IMLearn/utils/utils.py | yuvalarbel/IML.HUJI | 8ef0aa9403c97adc5b79d1ebd6780065cf0af1e7 | [
"MIT"
] | null | null | null | IMLearn/utils/utils.py | yuvalarbel/IML.HUJI | 8ef0aa9403c97adc5b79d1ebd6780065cf0af1e7 | [
"MIT"
] | null | null | null | from typing import Tuple
import numpy as np
import pandas as pd
def split_train_test(X: pd.DataFrame, y: pd.Series, train_proportion: float = .75) \
-> Tuple[pd.DataFrame, pd.Series, pd.DataFrame, pd.Series]:
"""
Randomly split given sample to a training- and testing sample
Parameters
-------... | 29.861111 | 119 | 0.674884 |
9375d4fc4ac3d901fa59155e8439994a097a5b26 | 4,015 | py | Python | alipay/aop/api/request/AlipayIserviceCcmServicerecordModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayIserviceCcmServicerecordModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayIserviceCcmServicerecordModifyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayIserviceCcmServicerecordModifyModel import AlipayIserviceCcmServicerecordModifyModel
class AlipayIserviceCcmServicerecordModif... | 27.689655 | 148 | 0.648568 |
9375e71be24c6047f74517688eb89b5038751e5d | 3,668 | py | Python | intersight/models/policy_abstract_profile_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/policy_abstract_profile_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/policy_abstract_profile_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PolicyAbstractProfileRef(object):
"""
NOTE: T... | 24.453333 | 77 | 0.5488 |
9375e96d93dd15e63ddf362c0edc5b3452a9e1b3 | 1,048 | gyp | Python | components/url_formatter/url_formatter.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | components/url_formatter/url_formatter.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | components/url_formatter/url_formatter.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2015 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.
{
'targets': [
{
# GN version: //components/url_formatter
'target_name': 'url_formatter',
'type': 'static_library',
'dependenci... | 26.2 | 72 | 0.520038 |
9375ec9505bafa794318e2859921049c544a660c | 7,778 | py | Python | extensions/mapeditor_settings.py | XIThing/esdl-mapeditor | 9f4cd4a58714ea67aeb532e88e88f0435a87dbd5 | [
"Apache-2.0"
] | null | null | null | extensions/mapeditor_settings.py | XIThing/esdl-mapeditor | 9f4cd4a58714ea67aeb532e88e88f0435a87dbd5 | [
"Apache-2.0"
] | null | null | null | extensions/mapeditor_settings.py | XIThing/esdl-mapeditor | 9f4cd4a58714ea67aeb532e88e88f0435a87dbd5 | [
"Apache-2.0"
] | null | null | null | # This work is based on original code developed and copyrighted by TNO 2020.
# Subsequent contributions are licensed to you by the developers of such code and are
# made available to the Project under one or several contributor license agreements.
#
# This work is licensed to you under the Apache License, Version 2... | 36.516432 | 101 | 0.641425 |
9376013175e4e91a521a50a32780d70fb5a2b5af | 5,293 | py | Python | toontown/classicchars/DistributedChipAI.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/classicchars/DistributedChipAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/classicchars/DistributedChipAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | # File: D (Python 2.4)
from otp.ai.AIBaseGlobal import *
from toontown.classicchars.DistributedCCharBaseAI import DistributedCCharBaseAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.task import Task
import random
from toontown.toonbase im... | 31.885542 | 99 | 0.620064 |
93763a0f1611fd323c171c9cd417503999d220e8 | 981 | py | Python | backtracking/0039-combination-sum(预处理的时候将数组倒序).py | ZHUANGHP/LeetCode-Solution-Python | af2b14abb7f50ee061bcd601c8666b32e448cbd8 | [
"Apache-2.0"
] | 1 | 2021-01-10T17:03:21.000Z | 2021-01-10T17:03:21.000Z | backtracking/0039-combination-sum(预处理的时候将数组倒序).py | ZHUANGHP/LeetCode-Solution-Python | af2b14abb7f50ee061bcd601c8666b32e448cbd8 | [
"Apache-2.0"
] | null | null | null | backtracking/0039-combination-sum(预处理的时候将数组倒序).py | ZHUANGHP/LeetCode-Solution-Python | af2b14abb7f50ee061bcd601c8666b32e448cbd8 | [
"Apache-2.0"
] | 1 | 2021-07-25T07:53:14.000Z | 2021-07-25T07:53:14.000Z | from typing import List
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
if len(candidates) == 0:
return []
candidates.sort(reverse=True)
res = []
self.__dfs(candidates, 0, target, [], res)
return res
def __df... | 28.028571 | 84 | 0.571865 |
937654463d5c3d2442e5fc86b85ff535adbb7fca | 3,966 | py | Python | ngraph/frontends/tensorflow/examples/mnist_mlp.py | NervanaSystems/ngraph-python | ac032c83c7152b615a9ad129d54d350f9d6a2986 | [
"Apache-2.0"
] | 18 | 2018-03-19T04:16:49.000Z | 2021-02-08T14:44:58.000Z | ngraph/frontends/tensorflow/examples/mnist_mlp.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 2 | 2019-04-16T06:41:49.000Z | 2019-05-06T14:08:13.000Z | ngraph/frontends/tensorflow/examples/mnist_mlp.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 11 | 2018-06-16T15:59:08.000Z | 2021-03-06T00:45:30.000Z | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... | 39.267327 | 87 | 0.643469 |
93765bf60fdf47586b1e1d00412f2ac811fa9980 | 17,969 | py | Python | autotest/t009_test.py | GWSci/flopy | 5a17b879f46610f96a77e3be5da47965295dd20d | [
"BSD-3-Clause"
] | null | null | null | autotest/t009_test.py | GWSci/flopy | 5a17b879f46610f96a77e3be5da47965295dd20d | [
"BSD-3-Clause"
] | null | null | null | autotest/t009_test.py | GWSci/flopy | 5a17b879f46610f96a77e3be5da47965295dd20d | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'aleaf'
import sys
sys.path.append('/Users/aleaf/Documents/GitHub/flopy3')
import os
import glob
import shutil
import numpy as np
from flopy.utils.recarray_utils import create_empty_recarray
try:
import matplotlib
# if os.getenv('TRAVIS'): # are we running https://travis-ci.org/ automated tests ... | 38.893939 | 92 | 0.55785 |
937685dc9b8f0987b7e4ff2d2ea2c180e857ecf3 | 738 | py | Python | pyram/galaxymodule/mk_gal_params.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | pyram/galaxymodule/mk_gal_params.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | pyram/galaxymodule/mk_gal_params.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z |
cluster = dict(
save=False,
verbose=False,
mstar_min=5e9,
den_lim=1e6,
den_lim2=5e6,
rmin=-1,
Rgal_to_reff=4.0,
method_com=1,
method_cov = "close_member",
follow_bp=None,
unit_conversion='code')
HAGN = dict(
save=False,
verbose=False,
mstar_min=1e10,
den_lim... | 18 | 63 | 0.619241 |
93769028054e95290461a1b292e50702d6a17a0e | 8,707 | py | Python | python/cudf/cudf/utils/utils.py | brycelelbach/cudf | 555b91ae90e7900d2ebcd0d630de8f32dfd375a6 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/utils/utils.py | brycelelbach/cudf | 555b91ae90e7900d2ebcd0d630de8f32dfd375a6 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/utils/utils.py | brycelelbach/cudf | 555b91ae90e7900d2ebcd0d630de8f32dfd375a6 | [
"Apache-2.0"
] | 1 | 2020-09-24T04:31:05.000Z | 2020-09-24T04:31:05.000Z | # Copyright (c) 2020, NVIDIA CORPORATION.
import functools
from collections import OrderedDict
from math import floor, isinf, isnan
import numpy as np
import pandas as pd
from numba import njit
import rmm
import cudf
from cudf.core import column
from cudf.core.buffer import Buffer
from cudf.utils.dtypes import to_cu... | 23.660326 | 76 | 0.601011 |
9376c841988a7eec81d2bb27648e202981cb9122 | 1,188 | py | Python | cinder/api/v3/views/resource_filters.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/api/v3/views/resource_filters.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/api/v3/views/resource_filters.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 33 | 78 | 0.609428 |
9376dfc402da5e95b4f0f4f82de39cd971c5a24a | 2,287 | py | Python | jumpscale/packages/vdc_dashboard/chats/peertube.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 13 | 2020-09-02T09:05:08.000Z | 2022-03-12T02:43:24.000Z | jumpscale/packages/vdc_dashboard/chats/peertube.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 1,998 | 2020-06-15T11:46:10.000Z | 2022-03-24T22:12:41.000Z | jumpscale/packages/vdc_dashboard/chats/peertube.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 8 | 2020-09-29T06:50:35.000Z | 2021-06-14T03:30:52.000Z | from jumpscale.sals.chatflows.chatflows import chatflow_step
from jumpscale.packages.vdc_dashboard.sals.solutions_chatflow import SolutionsChatflowDeploy
class PeertubeDeploy(SolutionsChatflowDeploy):
SOLUTION_TYPE = "peertube"
title = "Peertube"
HELM_REPO_NAME = "marketplace"
steps = [
"init_... | 37.491803 | 175 | 0.662003 |
9376f5b1f8ee7cecc8fca1f7da4f59a6bc2f96b8 | 48 | py | Python | tests/__init__.py | subhrm/torrent-client-cli | 865ea0ba02923b055c3caa938e46db5557883df8 | [
"MIT"
] | null | null | null | tests/__init__.py | subhrm/torrent-client-cli | 865ea0ba02923b055c3caa938e46db5557883df8 | [
"MIT"
] | null | null | null | tests/__init__.py | subhrm/torrent-client-cli | 865ea0ba02923b055c3caa938e46db5557883df8 | [
"MIT"
] | null | null | null | """Unit test package for torrent_client_cli."""
| 24 | 47 | 0.75 |
937710c1e71f4b163f601b5b8560df7b8b14365e | 3,591 | py | Python | appengine/monorail/tracker/issueoriginal.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/tracker/issueoriginal.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/monorail/tracker/issueoriginal.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 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 or at
# https://developers.google.com/open-source/licenses/bsd
"""Servlet to show the original email that caused an issue comment.
The text of the body the e... | 36.272727 | 77 | 0.725703 |
937720724d132dc2e6282fbf9edb6ac172f7d731 | 4,324 | py | Python | tests/h/views/admin/staff_test.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | tests/h/views/admin/staff_test.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:38:24.000Z | 2022-03-02T05:45:01.000Z | tests/h/views/admin/staff_test.py | Manuelinux/kubeh | a549f0d1c09619843290f9b78bce7668ed90853a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import mock
import pytest
from pyramid import httpexceptions
from h.views.admin.staff import staff_add, staff_index, staff_remove
@pytest.mark.usefixtures("routes")
class TestStaffIndex:
def test_when_no_staff(self, pyramid_request)... | 31.562044 | 88 | 0.674838 |
93774a4fb1aafc9dae90b84e5ca2b795b46c3517 | 2,183 | py | Python | invenio_explicit_acls/ext.py | oarepo/invenio-acls | a649b2e71e729e3bcfa44110afeb73358aa6034a | [
"MIT"
] | null | null | null | invenio_explicit_acls/ext.py | oarepo/invenio-acls | a649b2e71e729e3bcfa44110afeb73358aa6034a | [
"MIT"
] | 7 | 2019-05-08T08:35:01.000Z | 2021-06-25T15:21:34.000Z | invenio_explicit_acls/ext.py | oarepo/invenio-explicit-acls | a649b2e71e729e3bcfa44110afeb73358aa6034a | [
"MIT"
] | 2 | 2019-03-31T19:07:30.000Z | 2019-05-06T08:11:45.000Z | #
# Copyright (c) 2019 UCT Prague.
#
# ext.py is part of Invenio Explicit ACLs
# (see https://github.com/oarepo/invenio-explicit-acls).
#
# 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 wi... | 36.383333 | 80 | 0.726065 |
93774f70c2dd8d23ea9d4e0af18d6bc0cb9500ea | 864 | py | Python | examples/app_example.py | sbtinstruments/mitosis | 3a0eb96bdfd51c65b78afcbdcbb2bd770a88f6f5 | [
"MIT"
] | 4 | 2021-07-22T08:20:36.000Z | 2021-08-10T19:59:52.000Z | examples/app_example.py | sbtinstruments/mitosis | 3a0eb96bdfd51c65b78afcbdcbb2bd770a88f6f5 | [
"MIT"
] | null | null | null | examples/app_example.py | sbtinstruments/mitosis | 3a0eb96bdfd51c65b78afcbdcbb2bd770a88f6f5 | [
"MIT"
] | null | null | null | import logging
from contextlib import AsyncExitStack
from pathlib import Path
from anyio import create_task_group, run, sleep, sleep_forever
from mitosis import Flow, MitosisApp
_LOGGER = logging.getLogger(__name__)
async def main():
async with MitosisApp(Path("examples/resources/persistent.json")) as app:
... | 26.181818 | 85 | 0.684028 |
937750134a3b7029634ead9b27bb5929ea6ec7c2 | 5,755 | py | Python | openc2/custom.py | twodayslate/openc2-lycan-python | 57d68bf1bffb79af34be677645049d3c45d690a4 | [
"MIT"
] | 6 | 2018-04-27T14:55:36.000Z | 2022-02-06T16:42:53.000Z | openc2/custom.py | twodayslate/openc2-lycan-python | 57d68bf1bffb79af34be677645049d3c45d690a4 | [
"MIT"
] | 25 | 2018-06-21T17:50:56.000Z | 2020-04-08T15:38:14.000Z | openc2/custom.py | twodayslate/openc2-lycan-python | 57d68bf1bffb79af34be677645049d3c45d690a4 | [
"MIT"
] | 10 | 2018-04-25T15:17:35.000Z | 2021-08-14T09:36:23.000Z | #
# The MIT License (MIT)
#
# Copyright 2019 AT&T Intellectual Property. All other rights reserved.
#
# 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 l... | 34.053254 | 104 | 0.659774 |
937750ea28dadff2e791f1420a3e9529c4ae5fd4 | 5,126 | py | Python | omh_nbi/handlers/onu_activate.py | BroadbandForum/obbaa-vomci | 949ad64e1b0521a892f223b7cf97e4e792b2ea1f | [
"Apache-2.0"
] | null | null | null | omh_nbi/handlers/onu_activate.py | BroadbandForum/obbaa-vomci | 949ad64e1b0521a892f223b7cf97e4e792b2ea1f | [
"Apache-2.0"
] | null | null | null | omh_nbi/handlers/onu_activate.py | BroadbandForum/obbaa-vomci | 949ad64e1b0521a892f223b7cf97e4e792b2ea1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Broadband Forum
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 42.363636 | 107 | 0.671674 |
937770af3ba35087bb09d595150c642ccf9fa80a | 2,380 | py | Python | fairseq/tasks/dual_translation.py | fyabc/BT4MolGen | 05d161ae9a7dbbcc3c95c71417d5e7f92ed0572c | [
"MIT"
] | 3 | 2021-11-01T02:05:20.000Z | 2021-12-09T05:42:17.000Z | fairseq/tasks/dual_translation.py | fyabc/BT4MolGen | 05d161ae9a7dbbcc3c95c71417d5e7f92ed0572c | [
"MIT"
] | null | null | null | fairseq/tasks/dual_translation.py | fyabc/BT4MolGen | 05d161ae9a7dbbcc3c95c71417d5e7f92ed0572c | [
"MIT"
] | 1 | 2022-01-01T18:54:14.000Z | 2022-01-01T18:54:14.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
from .translation import TranslationTask
from . import register_task
@register_task('cycle_back_translation')
class DualTranslation(TranslationTask):
r"""A task for cycle-loop dual translation (back translation).
Forward model f: x -> y
Backward model g: y -> ... | 30.126582 | 115 | 0.612185 |
9377876b7b296c1c8f2e3df10471fd4830211bbc | 5,728 | py | Python | parsl/config.py | vkhodygo/parsl | ce2552caed9d223c3d8a84c16f830abc5f926331 | [
"Apache-2.0"
] | 1 | 2021-01-18T21:36:23.000Z | 2021-01-18T21:36:23.000Z | parsl/config.py | vkhodygo/parsl | ce2552caed9d223c3d8a84c16f830abc5f926331 | [
"Apache-2.0"
] | null | null | null | parsl/config.py | vkhodygo/parsl | ce2552caed9d223c3d8a84c16f830abc5f926331 | [
"Apache-2.0"
] | null | null | null | import logging
import typeguard
from typing import List, Optional
from parsl.utils import RepresentationMixin
from parsl.executors.base import ParslExecutor
from parsl.executors.threads import ThreadPoolExecutor
from parsl.dataflow.error import ConfigurationError
from parsl.monitoring import MonitoringHub
logger = l... | 46.95082 | 146 | 0.663059 |
9377a995ab293c72a9ccb3fc83c404c688d8c08a | 550 | py | Python | tests/test_core.py | AshotVantsyan/longest_slide_down | 33d2ea22901bfde495887968c5674f590776d119 | [
"MIT"
] | null | null | null | tests/test_core.py | AshotVantsyan/longest_slide_down | 33d2ea22901bfde495887968c5674f590776d119 | [
"MIT"
] | null | null | null | tests/test_core.py | AshotVantsyan/longest_slide_down | 33d2ea22901bfde495887968c5674f590776d119 | [
"MIT"
] | null | null | null | #!/usr/bin/env pytest
"""
The test validates core functionality.
"""
import os
import pytest
from helpers import get_pyramid_from_file
from pyramid_slide_down import longest_slide_down
@pytest.mark.parametrize("size,expected", [("minor", 23), ("middle", 1074), ("major", 7273)])
def test_core(size: str, expected: i... | 28.947368 | 93 | 0.736364 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.