hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18c446d9b6c444830ad97a1bd640dfe5bb7d4cc1 | 4,658 | py | Python | turbo_transformers/python/tests/bert_intermediate_test.py | sneaxiy/TurboTransformers | 31cfc3e17706320864244c63a9bab27916ea4e2b | [
"BSD-3-Clause"
] | 1 | 2020-06-07T06:24:41.000Z | 2020-06-07T06:24:41.000Z | turbo_transformers/python/tests/bert_intermediate_test.py | alexshuang/TurboTransformers | 923731429a8c6de6e90ccdb19032f445326cb2b9 | [
"BSD-3-Clause"
] | null | null | null | turbo_transformers/python/tests/bert_intermediate_test.py | alexshuang/TurboTransformers | 923731429a8c6de6e90ccdb19032f445326cb2b9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2020 THL A29 Limited, a Tencent company.
# All rights reserved.
# Licensed under the BSD 3-Clause License (the "License"); you may
# not use this file except in compliance with the License. You may
# obtain a copy of the License at
# https://opensource.org/licenses/BSD-3-Clause
# Unless required by appl... | 39.811966 | 85 | 0.639116 |
7a7e06f1387b2c523c8389bcdca2bbd4ffe095d3 | 1,627 | py | Python | BufferStockModel/figs.py | ThomasHJorgensen/ConsumptionSavingNotebooks | badbdfb1da226d5494026de2adcfec171c7f40ea | [
"MIT"
] | 1 | 2021-11-07T23:37:25.000Z | 2021-11-07T23:37:25.000Z | BufferStockModel/figs.py | bbardoczy/ConsumptionSavingNotebooks | 91811f784ec61fe2f11f8c9e0e172d085574f57c | [
"MIT"
] | null | null | null | BufferStockModel/figs.py | bbardoczy/ConsumptionSavingNotebooks | 91811f784ec61fe2f11f8c9e0e172d085574f57c | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
plt.style.use("seaborn-whitegrid")
prop_cycle = plt.rcParams["axes.prop_cycle"]
colors = prop_cycle.by_key()["color"]
import ipywidgets as widgets
def consumption_function(model,t):
# a. unpack
... | 23.57971 | 70 | 0.609711 |
3dab8a0fc304d9f9b52e0750041cd8ddcb03bfe9 | 3,565 | py | Python | tests/integration_tests/build/test_coverage.py | zlim/firecracker | 03cb9fb3c50861195c2c5429ac18141d9482eadf | [
"Apache-2.0"
] | 1 | 2019-12-16T16:11:23.000Z | 2019-12-16T16:11:23.000Z | tests/integration_tests/build/test_coverage.py | zlim/firecracker | 03cb9fb3c50861195c2c5429ac18141d9482eadf | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/build/test_coverage.py | zlim/firecracker | 03cb9fb3c50861195c2c5429ac18141d9482eadf | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests pertaining to line/branch test coverage for the Firecracker code base.
# TODO
- Put the coverage in `s3://spec.firecracker` and update it automatically.
target should be put in `s3://spec.firecra... | 32.117117 | 79 | 0.670687 |
5e8d6559edc1e0fbc8ac8cf5d687c9701ffc4653 | 75,405 | py | Python | pyocd/tools/pyocd.py | jsiverskog/pyOCD | 8b75633482a2f1856a8ab6af9ebb5c1b2f9d8285 | [
"Apache-2.0"
] | null | null | null | pyocd/tools/pyocd.py | jsiverskog/pyOCD | 8b75633482a2f1856a8ab6af9ebb5c1b2f9d8285 | [
"Apache-2.0"
] | null | null | null | pyocd/tools/pyocd.py | jsiverskog/pyOCD | 8b75633482a2f1856a8ab6af9ebb5c1b2f9d8285 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# pyOCD debugger
# Copyright (c) 2015-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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.or... | 37.968278 | 232 | 0.513335 |
27007008b2d6e8374a4ee6dd93ebbaebfe74c477 | 3,754 | py | Python | server/python/app.py | paypay-ayas/paypay-sample-ecommerce | 04e99105edb4c9180e4fac197e44e3713a7dbd92 | [
"Apache-2.0"
] | null | null | null | server/python/app.py | paypay-ayas/paypay-sample-ecommerce | 04e99105edb4c9180e4fac197e44e3713a7dbd92 | [
"Apache-2.0"
] | null | null | null | server/python/app.py | paypay-ayas/paypay-sample-ecommerce | 04e99105edb4c9180e4fac197e44e3713a7dbd92 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, jsonify
from flask_cors import CORS
import paypayopa
import polling
import uuid
import os
import json
_DEBUG = os.environ.get("_DEBUG", default=True)
API_KEY = os.environ.get("API_KEY")
API_SECRET = os.environ.get("API_SECRET")
FRONTEND_PATH = "http://localhost:8080/orderpayment"
if... | 24.860927 | 119 | 0.581513 |
f43bbe873098b5e144357c129622723850384036 | 1,236 | py | Python | develop/src/db_model.py | SecondDim/crawler-base | 21ba30a3f6a62f2eaee336331abeca04d2a4ed24 | [
"MIT"
] | 11 | 2019-12-21T14:57:17.000Z | 2021-07-15T17:32:10.000Z | develop/src/db_model.py | SecondDim/crawler-base | 21ba30a3f6a62f2eaee336331abeca04d2a4ed24 | [
"MIT"
] | 6 | 2020-01-24T13:26:01.000Z | 2022-02-01T23:05:28.000Z | develop/src/db_model.py | SecondDim/crawler-base | 21ba30a3f6a62f2eaee336331abeca04d2a4ed24 | [
"MIT"
] | 3 | 2020-02-28T06:07:20.000Z | 2021-01-07T09:58:47.000Z | # -*- coding: utf-8 -*-
from datetime import datetime
from pony.orm import *
db_model = Database()
class QueueUrlEttoday(db_model.Entity):
url = Required(str, unique=True)
fetch_state = Required(bool)
fetch_date = Optional(datetime, default=datetime.min)
create_date = Required(datetime, sql_default=... | 27.466667 | 69 | 0.705502 |
694758e86cdf05efb606c1287dcfef55e6c24ec0 | 19,423 | py | Python | pw_transfer/integration_test/cross_language_integration_test.py | Tiggerlaboratoriet/pigweed | 7d7e7ad6223433f45af680f43ab4d75e23ad3257 | [
"Apache-2.0"
] | null | null | null | pw_transfer/integration_test/cross_language_integration_test.py | Tiggerlaboratoriet/pigweed | 7d7e7ad6223433f45af680f43ab4d75e23ad3257 | [
"Apache-2.0"
] | null | null | null | pw_transfer/integration_test/cross_language_integration_test.py | Tiggerlaboratoriet/pigweed | 7d7e7ad6223433f45af680f43ab4d75e23ad3257 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2022 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.351923 | 96 | 0.609278 |
a9689fea606dbed51c1787b785234244caa74978 | 666 | py | Python | setup.py | vojtek/queuing | 8c6f6ab4913c06e84d461b27feea989d3ce3cea6 | [
"MIT"
] | null | null | null | setup.py | vojtek/queuing | 8c6f6ab4913c06e84d461b27feea989d3ce3cea6 | [
"MIT"
] | null | null | null | setup.py | vojtek/queuing | 8c6f6ab4913c06e84d461b27feea989d3ce3cea6 | [
"MIT"
] | null | null | null | import pathlib
from setuptools import setup
HERE = pathlib.Path(__file__).parent
README = (HERE / "README.md").read_text()
setup(name='queuing',
version='0.3.1',
description='Multithreating producent-consumer solution',
long_description=README,
long_description_content_type="text/markdown",
... | 28.956522 | 63 | 0.644144 |
48f8d58bd9a31fdac933d1530a79ae35ec90e37d | 610 | py | Python | September 2020/05-Functions-Advanced/07-Chairs.py | eclipse-ib/Software-University-Professional-Advanced-Module | 636385f9e5521840f680644824d725d074b93c9a | [
"MIT"
] | null | null | null | September 2020/05-Functions-Advanced/07-Chairs.py | eclipse-ib/Software-University-Professional-Advanced-Module | 636385f9e5521840f680644824d725d074b93c9a | [
"MIT"
] | null | null | null | September 2020/05-Functions-Advanced/07-Chairs.py | eclipse-ib/Software-University-Professional-Advanced-Module | 636385f9e5521840f680644824d725d074b93c9a | [
"MIT"
] | null | null | null | #Вариант само с for цикъл:
from itertools import combinations
people = input().split(", ")
chairs = int(input())
combinations = combinations(people, chairs)
for combination in combinations:
print(', '.join(combination))
# #Вариант с функция:
# from itertools import combinations
#
#
# def test(people, chairs):
#... | 24.4 | 102 | 0.644262 |
aa28bcbc13ec546e45e0ae7963ae4a9f4f98652e | 4,188 | py | Python | scripts/semdep_eval.py | Dayitva/Parser-v3 | 45754bb722fabefdb18f67ab4c32a41d24114bca | [
"Apache-2.0"
] | 93 | 2018-08-07T02:54:47.000Z | 2022-02-14T13:47:52.000Z | scripts/semdep_eval.py | Dayitva/Parser-v3 | 45754bb722fabefdb18f67ab4c32a41d24114bca | [
"Apache-2.0"
] | 10 | 2019-01-08T02:37:36.000Z | 2021-01-09T07:45:02.000Z | scripts/semdep_eval.py | Dayitva/Parser-v3 | 45754bb722fabefdb18f67ab4c32a41d24114bca | [
"Apache-2.0"
] | 29 | 2018-07-31T09:08:03.000Z | 2022-03-16T14:50:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2017 Timothy Dozat
#
# 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 ... | 34.04878 | 106 | 0.591691 |
fc7cb9a1304ca3bb447a5c4490996fd15222b2d8 | 1,157 | py | Python | PWEM_functions/K_matrix.py | zhaonat/RCWA | a28fdf90b5b5fc0fedacc8bb44a0a0c2f2a02143 | [
"MIT"
] | 66 | 2019-03-11T11:59:26.000Z | 2022-03-25T05:17:11.000Z | PWEM_functions/K_matrix.py | Ydeh22/Rigorous-Coupled-Wave-Analysis | 15f4300601899d08f57c95863df88280ab6f0d21 | [
"MIT"
] | 5 | 2018-09-23T05:18:15.000Z | 2021-11-07T20:16:40.000Z | PWEM_functions/K_matrix.py | Ydeh22/Rigorous-Coupled-Wave-Analysis | 15f4300601899d08f57c95863df88280ab6f0d21 | [
"MIT"
] | 33 | 2018-09-23T05:16:59.000Z | 2022-03-23T08:37:07.000Z | '''
functions which generate the K matrices along each direction
'''
import numpy as np
from scipy import sparse
def K_matrix_cubic_2D(beta_x, beta_y, a_x, a_y, N_p, N_q):
# K_i = beta_i - pT1i - q T2i - r*T3i
# but here we apply it only for cubic and tegragonal geometries in 2D
'''
:param beta_i:
... | 28.925 | 73 | 0.631806 |
83372a3e86ce6491eb67f08b8deac76303e042fd | 37,531 | py | Python | torch/fx/_symbolic_trace.py | stungkit/pytorch | 0f05e398705bf15406bce79f7ee57d3935ad2abd | [
"Intel"
] | null | null | null | torch/fx/_symbolic_trace.py | stungkit/pytorch | 0f05e398705bf15406bce79f7ee57d3935ad2abd | [
"Intel"
] | 1 | 2022-01-10T18:39:28.000Z | 2022-01-10T19:15:57.000Z | torch/fx/_symbolic_trace.py | stungkit/pytorch | 0f05e398705bf15406bce79f7ee57d3935ad2abd | [
"Intel"
] | 1 | 2022-03-26T14:42:50.000Z | 2022-03-26T14:42:50.000Z | import builtins
import functools
import inspect
import math
import os
from types import CodeType, FunctionType, ModuleType
from typing import Any, Dict, NamedTuple, Optional, Set, Tuple, Type, List, Callable, Union
from itertools import chain
import torch
from torch._C import ScriptObject # type: ignore[attr-defined]
... | 42.360045 | 131 | 0.631611 |
b41c681d9aa3401883fd354651d7125c353d15ec | 11,822 | py | Python | code/switcher.py | CameronSBell/knausj_talon | 3e57e0165257cf07b0e21880d44a91e79cb3ef16 | [
"MIT"
] | 298 | 2020-02-23T03:00:51.000Z | 2022-03-30T02:11:00.000Z | code/switcher.py | CameronSBell/knausj_talon | 3e57e0165257cf07b0e21880d44a91e79cb3ef16 | [
"MIT"
] | 521 | 2020-02-21T18:21:17.000Z | 2022-03-31T16:40:34.000Z | code/switcher.py | CameronSBell/knausj_talon | 3e57e0165257cf07b0e21880d44a91e79cb3ef16 | [
"MIT"
] | 499 | 2020-03-07T05:43:52.000Z | 2022-03-28T12:24:54.000Z | import os
import re
import time
import talon
from talon import Context, Module, app, imgui, ui, fs, actions
from glob import glob
from itertools import islice
from pathlib import Path
import subprocess
# Construct at startup a list of overides for application names (similar to how homophone list is managed)
# ie for... | 31.441489 | 132 | 0.623837 |
dfbe2939f82851b58a94712d5f50a09c716052bb | 5,606 | py | Python | Generative/GENERATESAMPLES/util/utils.py | NREL/GANISP | 3ce6979e26f837d05b8f7cfbe2b949f900b6026b | [
"BSD-3-Clause"
] | 5 | 2021-06-17T18:55:24.000Z | 2022-02-14T15:09:33.000Z | Generative/GENERATESAMPLES/util/utils.py | NREL/GANISP | 3ce6979e26f837d05b8f7cfbe2b949f900b6026b | [
"BSD-3-Clause"
] | null | null | null | Generative/GENERATESAMPLES/util/utils.py | NREL/GANISP | 3ce6979e26f837d05b8f7cfbe2b949f900b6026b | [
"BSD-3-Clause"
] | 1 | 2022-02-23T13:48:06.000Z | 2022-02-23T13:48:06.000Z | import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
def conv_layer_2d(x, filter_shape, stride, trainable=True):
filter_ = tf.get_variable(
name='weight',
shape=filter_shape,
dtype=tf.float32,
initializer=tf.contrib.layers.xavier_initializer(),
trainabl... | 36.402597 | 109 | 0.551374 |
84ec31f0c2ea713b9cbb5d83d7d1a8e405f602c8 | 2,516 | py | Python | sympy/polys/tests/test_rationaltools.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/polys/tests/test_rationaltools.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/polys/tests/test_rationaltools.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | """Tests for tools for manipulation of rational expressions. """
from sympy.polys.rationaltools import together
from sympy import S, symbols, Rational, sin, exp, Eq, Integral, Mul
from sympy.abc import x, y, z
A, B = symbols("A,B", commutative=False)
def test_together():
assert together(0) == 0
assert toge... | 36.463768 | 88 | 0.408585 |
5f597dd265c4df4c66aa4892e961e128c123b8b9 | 4,367 | py | Python | dags/utils/voting/load.py | makerdao-data/airflow-docker-image | 498b8ff83c0e9651c3fd36a91a516ea80f32e8a7 | [
"Apache-2.0"
] | null | null | null | dags/utils/voting/load.py | makerdao-data/airflow-docker-image | 498b8ff83c0e9651c3fd36a91a516ea80f32e8a7 | [
"Apache-2.0"
] | 1 | 2022-03-22T13:57:44.000Z | 2022-03-22T13:57:44.000Z | dags/utils/voting/load.py | makerdao-data/airflow-docker-image | 498b8ff83c0e9651c3fd36a91a516ea80f32e8a7 | [
"Apache-2.0"
] | null | null | null | from decimal import Decimal
from datetime import datetime
from airflow.exceptions import AirflowFailException
import os, sys
sys.path.append('/opt/airflow/')
from dags.connectors.sf import sf
from dags.connectors.sf import clear_stage
from dags.adapters.snowflake.stage import transaction_clear_stage, transaction_write... | 36.697479 | 135 | 0.545455 |
da287915c83c610e1feb1a0cb6ebd97f65c429be | 968 | py | Python | src/doc/common/build_options.py | bopopescu/sagesmc | e8d1d31f6f598dba2d763baa2d2e804338f9e89e | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/doc/common/build_options.py | bopopescu/sagesmc | e8d1d31f6f598dba2d763baa2d2e804338f9e89e | [
"BSL-1.0"
] | null | null | null | src/doc/common/build_options.py | bopopescu/sagesmc | e8d1d31f6f598dba2d763baa2d2e804338f9e89e | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | ###############################################
# Options for building the Sage documentation #
###############################################
import os, re
SAGE_DOC = os.environ['SAGE_DOC']
LANGUAGES = [d for d in os.listdir(SAGE_DOC) if re.match('^[a-z][a-z]$', d)]
SPHINXOPTS = ""
PAPER = ""
OMIT = ["introspect"] ... | 33.37931 | 78 | 0.654959 |
b1b4809be931dfcf5a92828f98447f166c0f3b1f | 1,956 | py | Python | sdk/identity/azure-identity/azure/identity/_credentials/azure_ml.py | jayqi/azure-sdk-for-python | d720e568b7dde29af68fe6a0f57c0dba8dff4b55 | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/identity/azure-identity/azure/identity/_credentials/azure_ml.py | jayqi/azure-sdk-for-python | d720e568b7dde29af68fe6a0f57c0dba8dff4b55 | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/_credentials/azure_ml.py | jayqi/azure-sdk-for-python | d720e568b7dde29af68fe6a0f57c0dba8dff4b55 | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
import os
from typing import TYPE_CHECKING
from azure.core.pipeline.transport import HttpRequest
from .._constants import EnvironmentVariables
from ..... | 32.6 | 104 | 0.681493 |
951fa9ea6aab36f8e200536db53d325a3991a74d | 897 | py | Python | execs/python/cpdbench_zero.py | SimonEismann/TCPDBench | e2e9158e40f38ca92472ead291f0b11fa5c8d1fd | [
"MIT"
] | 67 | 2020-03-17T04:26:16.000Z | 2022-03-29T16:48:33.000Z | execs/python/cpdbench_zero.py | SimonEismann/TCPDBench | e2e9158e40f38ca92472ead291f0b11fa5c8d1fd | [
"MIT"
] | 6 | 2020-05-19T08:59:14.000Z | 2021-10-05T10:40:50.000Z | execs/python/cpdbench_zero.py | SimonEismann/TCPDBench | e2e9158e40f38ca92472ead291f0b11fa5c8d1fd | [
"MIT"
] | 17 | 2020-05-02T21:16:06.000Z | 2022-02-03T18:38:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A method that always returns no change points
Author: G.J.J. van den Burg
Date: 2020-05-07
License: MIT
Copyright: 2020, The Alan Turing Institute
"""
import argparse
import time
from cpdbench_utils import load_dataset, exit_success
def parse_args():
parser =... | 19.5 | 77 | 0.671126 |
807ed6bebda16db2bc98cf42f86d2348edd57bb3 | 528 | py | Python | parsers/kindle_parser.py | mkorneev/my_quotes_bot | cbf1fdc8bb71edeaa4282c29ffadff05ed41e966 | [
"MIT"
] | null | null | null | parsers/kindle_parser.py | mkorneev/my_quotes_bot | cbf1fdc8bb71edeaa4282c29ffadff05ed41e966 | [
"MIT"
] | null | null | null | parsers/kindle_parser.py | mkorneev/my_quotes_bot | cbf1fdc8bb71edeaa4282c29ffadff05ed41e966 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Parser for Kindle clippings file
"""
import codecs
from collections import namedtuple
Quote = namedtuple('Quote', 'text')
def parse(path):
"""
Returns generator which yields Quotes
"""
with codecs.open(path, 'r') as f:
while f.readline():
f.readline()
... | 19.555556 | 70 | 0.545455 |
345a90bab938a43a541ce569d1cbc62ad27a3351 | 16,182 | py | Python | test/functional/p2p_addr_relay.py | wilofice/dahomey | 5cbc2406a27e68bbe30f85a7162b86f4741effab | [
"MIT"
] | 1 | 2022-03-19T13:35:37.000Z | 2022-03-19T13:35:37.000Z | test/functional/p2p_addr_relay.py | wilofice/danxome | 5cbc2406a27e68bbe30f85a7162b86f4741effab | [
"MIT"
] | null | null | null | test/functional/p2p_addr_relay.py | wilofice/danxome | 5cbc2406a27e68bbe30f85a7162b86f4741effab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Danxome Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test addr relay
"""
import random
import time
from test_framework.messages import (
CAddress,
... | 43.972826 | 136 | 0.679953 |
4f108cae5082e44b7199955fbd9665d371aaec3a | 1,779 | py | Python | world/load_busstop.py | homata/geodjango-hands-on | 3ecee17c0f14122a72aacc71f187011f0b112d08 | [
"Apache-2.0"
] | 13 | 2018-12-02T07:40:08.000Z | 2022-03-13T09:04:34.000Z | world/load_busstop.py | homata/geodjango-hands-on | 3ecee17c0f14122a72aacc71f187011f0b112d08 | [
"Apache-2.0"
] | 3 | 2020-06-05T19:24:35.000Z | 2021-06-10T20:58:57.000Z | download/source_code/world/load_busstop.py | homata/geodjango-book | 94842892bb5f4ea053b8366189e89a36bf7505c5 | [
"Apache-2.0"
] | 6 | 2018-06-24T10:07:32.000Z | 2019-08-12T09:46:18.000Z | # -*- coding: utf-8 -*-
import os
from django.contrib.gis.utils import LayerMapping
from world.models import Busstop
# Modelとファイルのカラムのマッピング
mapping = {
'p11_001' : 'P11_001' ,
'p11_002' : 'P11_002',
'p11_003_1' : 'P11_003_1',
'p11_003_2' : 'P11_003_2',
'p11_003_3' : 'P11_003_3',
'p1... | 30.672414 | 99 | 0.602586 |
321c6689615a03961ec061d43a84e329afe8ef44 | 1,252 | py | Python | inferelator/distributed/local_controller.py | meichenfang/inferelator | 47f8ebcc5f303264a75814897c52026b47c57aef | [
"BSD-2-Clause"
] | 1 | 2019-05-13T23:12:48.000Z | 2019-05-13T23:12:48.000Z | inferelator/distributed/local_controller.py | meichenfang/inferelator | 47f8ebcc5f303264a75814897c52026b47c57aef | [
"BSD-2-Clause"
] | null | null | null | inferelator/distributed/local_controller.py | meichenfang/inferelator | 47f8ebcc5f303264a75814897c52026b47c57aef | [
"BSD-2-Clause"
] | null | null | null | """
LocalController just runs everything in a single process
"""
import collections
from inferelator.distributed import AbstractController
from inferelator import utils
from inferelator.utils import Validator as check
class LocalController(AbstractController):
_controller_name = "local"
client = None
... | 23.185185 | 76 | 0.642173 |
57528a66597a164b2379b65dec10ea42d49d1a84 | 2,893 | py | Python | tools/ci/tc/tests/test_taskgraph.py | BasixKOR/wpt | aa27d567c10dcdb2aea6884d5155dfaaa177a800 | [
"BSD-3-Clause"
] | null | null | null | tools/ci/tc/tests/test_taskgraph.py | BasixKOR/wpt | aa27d567c10dcdb2aea6884d5155dfaaa177a800 | [
"BSD-3-Clause"
] | 59 | 2022-01-19T21:35:57.000Z | 2022-03-30T21:35:27.000Z | tools/ci/tc/tests/test_taskgraph.py | BasixKOR/wpt | aa27d567c10dcdb2aea6884d5155dfaaa177a800 | [
"BSD-3-Clause"
] | null | null | null | # mypy: allow-untyped-defs
import pytest
import yaml
from tools.ci.tc import taskgraph
@pytest.mark.parametrize("data, update_data, expected", [
({"a": 1}, {"b": 2}, {"a": 1, "b": 2}),
({"a": 1}, {"a": 2}, {"a": 2}),
({"a": [1]}, {"a": [2]}, {"a": [1, 2]}),
({"a": {"b": 1, "c": 2}}, {"a": {"b": 2, "d... | 19.416107 | 88 | 0.366056 |
2c91e6a881287f23f7a3387269b7cba9f6d7488c | 217 | py | Python | networks/monitoring/nav/manager/container/target/start-cron-services.py | alexanderfefelov/docker-backpack | 33aa9b41451fa54e4573c1fc0557a3b1f8fd37fa | [
"MIT"
] | 13 | 2020-10-23T13:10:49.000Z | 2021-12-07T17:43:39.000Z | networks/monitoring/nav/manager/container/target/start-cron-services.py | alexanderfefelov/docker-backpack | 33aa9b41451fa54e4573c1fc0557a3b1f8fd37fa | [
"MIT"
] | 101 | 2020-08-09T07:01:23.000Z | 2021-06-11T11:59:29.000Z | networks/monitoring/nav/manager/container/target/start-cron-services.py | alexanderfefelov/docker-backpack | 33aa9b41451fa54e4573c1fc0557a3b1f8fd37fa | [
"MIT"
] | 6 | 2020-08-11T09:59:39.000Z | 2021-11-04T15:45:02.000Z | #!/usr/bin/env python3
from nav.startstop import CronService, ServiceRegistry
registry = ServiceRegistry()
for service in registry:
if type(registry[service]) is CronService:
registry[service].start()
| 19.727273 | 54 | 0.741935 |
fa401c88954339276304ae936fc6f58c6bc88be6 | 2,372 | py | Python | malleus/api/domain/protos/timings_pb2.py | joelgerard/malleus | 763850ef270a449829b89a998cdce8febf5020ef | [
"Apache-2.0"
] | null | null | null | malleus/api/domain/protos/timings_pb2.py | joelgerard/malleus | 763850ef270a449829b89a998cdce8febf5020ef | [
"Apache-2.0"
] | 2 | 2021-02-08T20:22:50.000Z | 2021-06-01T22:07:40.000Z | malleus/api/domain/protos/timings_pb2.py | joelgerard/malleus | 763850ef270a449829b89a998cdce8febf5020ef | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: malleus/api/domain/protos/timings.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.protobuf i... | 32.493151 | 231 | 0.778246 |
1b4529efb2fa7e45656a5575865cffb8a1b4f9ab | 8,885 | py | Python | predict.py | BerkayAydin/Coronavirus-Prediction-Tool | 8ef91734a36259cc282dc517be4e28b084878963 | [
"MIT"
] | null | null | null | predict.py | BerkayAydin/Coronavirus-Prediction-Tool | 8ef91734a36259cc282dc517be4e28b084878963 | [
"MIT"
] | 1 | 2020-03-01T12:48:21.000Z | 2020-03-01T12:48:21.000Z | predict.py | BerkayAydin/Coronavirus-Prediction-Tool | 8ef91734a36259cc282dc517be4e28b084878963 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from fbprophet import Prophet
from fbprophet.diagnostics import cross_validation
import plotly.express as px
import os
from datetime import datetime
c_url = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_... | 42.109005 | 154 | 0.556218 |
e1d53892d0091389344910e46313e6b21bffb310 | 7,224 | py | Python | trainer.py | senadkurtisi/pytorch-image-captioning | d7ebf2e6f9bec8bf199b5b0236ffbdfdb5152b46 | [
"MIT"
] | 1 | 2022-02-08T08:58:38.000Z | 2022-02-08T08:58:38.000Z | trainer.py | senadkurtisi/pytorch-image-captioning | d7ebf2e6f9bec8bf199b5b0236ffbdfdb5152b46 | [
"MIT"
] | null | null | null | trainer.py | senadkurtisi/pytorch-image-captioning | d7ebf2e6f9bec8bf199b5b0236ffbdfdb5152b46 | [
"MIT"
] | 1 | 2022-01-10T07:27:15.000Z | 2022-01-10T07:27:15.000Z | import time
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torchvision.models as models
from nltk.translate.bleu_score import corpus_bleu
from dataloader import Flickr8KDataset
from decoder import CaptionDecoder
from utils.decoding_utils import greedy_decoding
fro... | 37.237113 | 111 | 0.650055 |
9d8a4a4e40f1eb2d3f83012f8f1376e81b80e192 | 256 | py | Python | airloft/utils/models.py | Allaye/airloft | deb6274b9eb1de2de79d0b152d67411d1f747afe | [
"FTL"
] | 2 | 2022-03-06T10:34:12.000Z | 2022-03-27T15:41:52.000Z | airloft/utils/models.py | Allaye/airloft | deb6274b9eb1de2de79d0b152d67411d1f747afe | [
"FTL"
] | null | null | null | airloft/utils/models.py | Allaye/airloft | deb6274b9eb1de2de79d0b152d67411d1f747afe | [
"FTL"
] | null | null | null | from django.db import models
class ModelTracker(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
ordering = ('-created_at',)
| 23.272727 | 56 | 0.691406 |
c3067491e8252a49ad8a53461b763f0acdf3468f | 10,575 | py | Python | cert-rotate/cert-rotate.py | WoTTsecurity/google-core-iot | edb835107c1b3005181f438b0f9ba09eb62242f0 | [
"MIT"
] | null | null | null | cert-rotate/cert-rotate.py | WoTTsecurity/google-core-iot | edb835107c1b3005181f438b0f9ba09eb62242f0 | [
"MIT"
] | 2 | 2019-07-11T16:00:57.000Z | 2021-06-03T12:12:11.000Z | cert-rotate/cert-rotate.py | WoTTsecurity/google-core-iot | edb835107c1b3005181f438b0f9ba09eb62242f0 | [
"MIT"
] | 1 | 2019-06-27T16:58:12.000Z | 2019-06-27T16:58:12.000Z | import os
import pytz
import json
import requests
import datetime
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from google.oauth2 import service_account
from googleapiclient import discovery
from googleapiclient.errors import HttpError
# Google IoT core project settings
PROJE... | 33.046875 | 119 | 0.632057 |
ba9a44d335062e59653d90dd20a38fdcd564a054 | 3,951 | py | Python | Tool.py | bachnguyenhuu/RENAT | f747996e1b79284ef70c51b71774098c200abc7f | [
"Apache-2.0"
] | 65 | 2018-01-23T00:25:52.000Z | 2022-02-03T12:02:59.000Z | Tool.py | bachnguyenhuu/RENAT | f747996e1b79284ef70c51b71774098c200abc7f | [
"Apache-2.0"
] | 11 | 2018-01-25T05:29:14.000Z | 2021-01-03T12:07:33.000Z | Tool.py | bachnguyenhuu/RENAT | f747996e1b79284ef70c51b71774098c200abc7f | [
"Apache-2.0"
] | 18 | 2018-01-25T03:09:00.000Z | 2021-12-15T10:41:15.000Z | # -*- coding: utf-8 -*-
# Copyright 2017-2020 NTT Communications
#
# 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... | 36.925234 | 118 | 0.667679 |
0656f50d5c6544e7da6cc25335a827bfd5294e46 | 623 | py | Python | Homeworks/scripts/data_visualization.py | LetteraUnica/DSSC_DL_2021 | 97d83a59d33cfc1a6dcb20abb4209d7ee7fb6e63 | [
"MIT"
] | null | null | null | Homeworks/scripts/data_visualization.py | LetteraUnica/DSSC_DL_2021 | 97d83a59d33cfc1a6dcb20abb4209d7ee7fb6e63 | [
"MIT"
] | null | null | null | Homeworks/scripts/data_visualization.py | LetteraUnica/DSSC_DL_2021 | 97d83a59d33cfc1a6dcb20abb4209d7ee7fb6e63 | [
"MIT"
] | null | null | null | import pylab as pl
def plot_train_test(train_losses: list, test_losses: list):
"""
Plots the training and test loss in two separate graphs
"""
import seaborn as sns
sns.set_theme()
epochs = list(range(1, len(train_losses)+1))
fig, axes = pl.subplots(1, 2, figsize=(12,4))
axes[0].plot(e... | 36.647059 | 74 | 0.688604 |
7d23109baf68f4be9d12aa307957addfdc4b4913 | 4,088 | py | Python | cw/aero_file/linear_nd_interpolation_coefficient_model.py | aarondewindt/cw | 6be9770da0f0fc34ea47d7ab83e6929c4823e98a | [
"MIT"
] | 1 | 2021-10-06T07:20:43.000Z | 2021-10-06T07:20:43.000Z | cw/aero_file/linear_nd_interpolation_coefficient_model.py | aarondewindt/cw | 6be9770da0f0fc34ea47d7ab83e6929c4823e98a | [
"MIT"
] | 3 | 2019-02-18T13:49:39.000Z | 2020-12-28T04:13:27.000Z | cw/aero_file/linear_nd_interpolation_coefficient_model.py | aarondewindt/cw | 6be9770da0f0fc34ea47d7ab83e6929c4823e98a | [
"MIT"
] | null | null | null | from cw.aero_file.coefficient_model_base import CoefficientModelBase
from cw.cached import cached
import scipy.interpolate as interpolate
import numpy as np
class LinearNDInterpolationCoefficientModel(CoefficientModelBase):
"""
Aerodynamic coefficient model based on scipy's
:class:`scipy.interpolate.Linea... | 40.88 | 104 | 0.666341 |
a0d98f7752778e342678a5073034ca6ba00ee9e0 | 8,143 | py | Python | 135.py | Jamal135/135Project | 0176ff10b1a8e57bdb2ca7a45ed963f3ca2ea332 | [
"MIT"
] | 3 | 2021-06-07T15:04:10.000Z | 2021-11-17T16:37:48.000Z | 135.py | Jamal135/135Project | 0176ff10b1a8e57bdb2ca7a45ed963f3ca2ea332 | [
"MIT"
] | 4 | 2021-11-04T02:36:55.000Z | 2021-12-06T13:39:49.000Z | 135.py | Jamal135/135Project | 0176ff10b1a8e57bdb2ca7a45ed963f3ca2ea332 | [
"MIT"
] | 1 | 2021-11-04T14:10:22.000Z | 2021-11-04T14:10:22.000Z | # python 135.py
import validation
from functions.encryption._147cipher_ import encrypt_147, decrypt_147
from functions.encryption._135cipher_ import encrypt_135, decrypt_135
from functions.encryption._101cipher_ import encrypt_101, decrypt_101
from functions.datatools._basetool_ import base_convert
from functions.datat... | 34.214286 | 90 | 0.671865 |
5742166b5af6d1ee4fddb42db877a9ce76b05fc0 | 5,007 | py | Python | airflow/providers/amazon/aws/operators/sagemaker_transform.py | wileeam/airflow | f46be8152a4d89c57db4ca46f5b3339e4876b723 | [
"Apache-2.0"
] | 1 | 2020-02-17T17:40:14.000Z | 2020-02-17T17:40:14.000Z | airflow/providers/amazon/aws/operators/sagemaker_transform.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 2 | 2021-05-12T12:41:51.000Z | 2021-09-29T17:47:43.000Z | airflow/providers/amazon/aws/operators/sagemaker_transform.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | null | null | null | #
# 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... | 40.056 | 101 | 0.668664 |
2381aab98f1dfd526eff5eaf3b9dca2bdf602761 | 34,015 | py | Python | turfpy/transformation.py | omanges/turfpy | eda665bb014a8371c42f655f626d6c6b6bf18c65 | [
"MIT"
] | 82 | 2020-03-21T13:29:02.000Z | 2022-03-31T11:36:26.000Z | turfpy/transformation.py | devick/turfpy | eda665bb014a8371c42f655f626d6c6b6bf18c65 | [
"MIT"
] | 51 | 2020-03-21T14:53:46.000Z | 2022-02-25T07:44:37.000Z | turfpy/transformation.py | devick/turfpy | eda665bb014a8371c42f655f626d6c6b6bf18c65 | [
"MIT"
] | 22 | 2020-03-21T13:49:12.000Z | 2022-03-18T05:15:37.000Z | """
This module implements some of the spatial analysis techniques and processes used to
understand the patterns and relationships of geographic features.
This is mainly inspired by turf.js.
link: http://turfjs.org/
"""
import copy
import itertools
import math
from math import floor, sqrt
from typing import List, Optio... | 31.849251 | 90 | 0.609731 |
eb25c193c1d9d6adfae383eeb4b768722e5e7892 | 685 | py | Python | pluto/data/traffic/storage/collections/equity_metadata.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/data/traffic/storage/collections/equity_metadata.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/data/traffic/storage/collections/equity_metadata.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | from pluto.data.traffic.storage.database.mongo_utils import get_collection
_META_DATA = get_collection('AvailableTickers')
_TICKERS = get_collection('Tickers')
'''keeps track of what to download and maintain... and the symbols in general...'''
class MetaData(object):
def __init__(self):
self._observers = []
def ... | 24.464286 | 83 | 0.732847 |
91a95719089a488be6e23bc09b470e3c69d1df79 | 2,849 | py | Python | pymoo/optimize.py | AIasd/pymoo | 08705ca866367d9fab675c30ffe585c837df9654 | [
"Apache-2.0"
] | 11 | 2018-05-22T17:38:02.000Z | 2022-02-28T03:34:33.000Z | pymoo/optimize.py | AIasd/pymoo | 08705ca866367d9fab675c30ffe585c837df9654 | [
"Apache-2.0"
] | 15 | 2022-01-03T19:36:36.000Z | 2022-03-30T03:57:58.000Z | pymoo/optimize.py | AIasd/pymoo | 08705ca866367d9fab675c30ffe585c837df9654 | [
"Apache-2.0"
] | 3 | 2021-11-22T08:01:47.000Z | 2022-03-11T08:53:58.000Z | import copy
from pymoo.factory import get_termination
from pymoo.model.termination import Termination
from pymoo.util.termination.default import MultiObjectiveDefaultTermination, SingleObjectiveDefaultTermination
def minimize(problem,
algorithm,
termination=None,
**kwargs):
... | 34.743902 | 111 | 0.710425 |
f61ac3aaf04f777d94d5a5c1e19344f17f9296a5 | 1,337 | py | Python | rosshow/viewers/nav_msgs/OccupancyGridViewer.py | dheera/rosstorm | 463f6065c481ed1dfae2dc5c9b66a00356eb6fe9 | [
"BSD-3-Clause"
] | 868 | 2017-07-14T08:37:50.000Z | 2022-03-27T15:30:22.000Z | rosshow/viewers/nav_msgs/OccupancyGridViewer.py | dheera/rosstorm | 463f6065c481ed1dfae2dc5c9b66a00356eb6fe9 | [
"BSD-3-Clause"
] | 19 | 2017-07-14T12:02:19.000Z | 2022-01-24T16:50:22.000Z | rosshow/viewers/nav_msgs/OccupancyGridViewer.py | dheera/rosstorm | 463f6065c481ed1dfae2dc5c9b66a00356eb6fe9 | [
"BSD-3-Clause"
] | 70 | 2017-07-14T22:26:20.000Z | 2022-03-22T07:13:12.000Z | import numpy as np
import time
import PIL.Image
import rosshow.termgraphics as termgraphics
from rosshow.viewers.generic.GenericImageViewer import GenericImageViewer
class OccupancyGridViewer(GenericImageViewer):
def __init__(self, canvas, title = ""):
def msg_decoder(msg):
"""
Dec... | 37.138889 | 127 | 0.623785 |
cdbae39c891c0f744c3d055b2a74237a5bc2dfc8 | 2,459 | py | Python | scripts/visualisations/compare_auc.py | pirakd/DeepProp | e43f6e12220da38a3bda51918bd75bb7c48dec31 | [
"MIT"
] | null | null | null | scripts/visualisations/compare_auc.py | pirakd/DeepProp | e43f6e12220da38a3bda51918bd75bb7c48dec31 | [
"MIT"
] | null | null | null | scripts/visualisations/compare_auc.py | pirakd/DeepProp | e43f6e12220da38a3bda51918bd75bb7c48dec31 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from os import path, makedirs
from utils import get_root_path, get_time
import json
from cycler import cycler
import seaborn
root_path = get_root_path()
output_folder = 'output'
output_file_path = path.join(get_root_path(), output_folder, path.basename(__file__).split... | 46.396226 | 202 | 0.649044 |
4dc4bb5177bd0a8ce48a9749a454b6b009f3bdaf | 16,307 | py | Python | sentry_sdk/serializer.py | annu-ps31/sentry-python | 3966b4a9744bfcb8c53dcca1b615bbadf4935aec | [
"BSD-2-Clause"
] | 1,213 | 2018-06-19T00:51:01.000Z | 2022-03-31T06:37:16.000Z | sentry_sdk/serializer.py | annu-ps31/sentry-python | 3966b4a9744bfcb8c53dcca1b615bbadf4935aec | [
"BSD-2-Clause"
] | 1,020 | 2018-07-16T12:50:36.000Z | 2022-03-31T20:42:49.000Z | sentry_sdk/serializer.py | annu-ps31/sentry-python | 3966b4a9744bfcb8c53dcca1b615bbadf4935aec | [
"BSD-2-Clause"
] | 340 | 2018-07-16T12:47:27.000Z | 2022-03-22T10:13:21.000Z | import sys
import math
from datetime import datetime
from sentry_sdk.utils import (
AnnotatedValue,
capture_internal_exception,
disable_capture_event,
format_timestamp,
json_dumps,
safe_repr,
strip_string,
)
import sentry_sdk.utils
from sentry_sdk._compat import text_type, PY2, string_ty... | 35.144397 | 90 | 0.579935 |
e9e8ef7ff914b562b0a3541a1fb075f6241b7aea | 13,814 | py | Python | examples/ex1-london/ex1-london.py | hidekb/PyRossGeo | 0d245a547add212f27be00bf234235cbd1db65f9 | [
"MIT"
] | 12 | 2020-05-12T09:18:48.000Z | 2020-10-23T13:29:24.000Z | examples/ex1-london/ex1-london.py | hidekb/PyRossGeo | 0d245a547add212f27be00bf234235cbd1db65f9 | [
"MIT"
] | null | null | null | examples/ex1-london/ex1-london.py | hidekb/PyRossGeo | 0d245a547add212f27be00bf234235cbd1db65f9 | [
"MIT"
] | 5 | 2020-05-15T15:53:08.000Z | 2020-07-20T23:31:38.000Z | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# +
# %%capture
# Compile and import local pyrossgeo mo... | 26.927875 | 217 | 0.617417 |
42f36a2ff8cb08238011480c34325960099f25a7 | 1,239 | py | Python | tests/conftest.py | thekashifmalik/dynaconf | 2cb4ad53e9dff7ed2582a48ec975fa86780ab911 | [
"MIT"
] | null | null | null | tests/conftest.py | thekashifmalik/dynaconf | 2cb4ad53e9dff7ed2582a48ec975fa86780ab911 | [
"MIT"
] | null | null | null | tests/conftest.py | thekashifmalik/dynaconf | 2cb4ad53e9dff7ed2582a48ec975fa86780ab911 | [
"MIT"
] | null | null | null | # coding: utf-8
import os
import pytest
from dynaconf.base import LazySettings
@pytest.fixture(scope='module')
def settings():
"""Settings fixture with some defaults"""
mode = 'TRAVIS' if os.environ.get('TRAVIS') else 'TEST'
loaders = ['dynaconf.loaders.env_loader']
os.environ['DYNA%s_HOSTNAME' % mod... | 30.975 | 75 | 0.546408 |
79dc41de90e500800353b6c12a5e9fe392da8184 | 598 | py | Python | rtl/tests/icebreaker-top/tests.py | andars/4ft4 | 9417585b62b77f0bda72091bcc064eb2b8b623a8 | [
"MIT"
] | null | null | null | rtl/tests/icebreaker-top/tests.py | andars/4ft4 | 9417585b62b77f0bda72091bcc064eb2b8b623a8 | [
"MIT"
] | null | null | null | rtl/tests/icebreaker-top/tests.py | andars/4ft4 | 9417585b62b77f0bda72091bcc064eb2b8b623a8 | [
"MIT"
] | null | null | null | import cocotb
from cocotb.clock import Clock
from cocotb.triggers import ClockCycles
@cocotb.test()
async def test_icebreaker_top(dut):
# start a 12 MHz clock
clock = Clock(dut.clock, round(1e3/100), units="ns")
cocotb.start_soon(clock.start())
# reset
dut.reset.value = 1
await ClockCycles(dut... | 24.916667 | 56 | 0.682274 |
0a1e7a9d481c669f585cdff7a6a7697df5befedb | 2,010 | py | Python | pigLatin.py | valentinsoare/currentlyLearningPythonProjectsBased | 740acdecec1de2ac827eb46cc72a060bb0bdf954 | [
"MIT"
] | 1 | 2021-08-17T02:27:18.000Z | 2021-08-17T02:27:18.000Z | pigLatin.py | valentinsoare/currentlyLearningPythonProjectsBased | 740acdecec1de2ac827eb46cc72a060bb0bdf954 | [
"MIT"
] | null | null | null | pigLatin.py | valentinsoare/currentlyLearningPythonProjectsBased | 740acdecec1de2ac827eb46cc72a060bb0bdf954 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import re
def check_if_punctuation(given_word):
checking = re.search(r'(([a-z]+)(\W))', given_word)
if checking:
punctuation_checking = 1
return punctuation_checking, checking.group(1), checking.group(2), checking.group(3)
else:
punctuation_checking = 0
... | 26.103896 | 94 | 0.669652 |
d7bbafbd905d7099cafc9f37751a06f98b857486 | 4,625 | py | Python | examples/nlp/language_modeling/megatron_gpt_eval.py | Jorjeous/NeMo | cafc21ee6a0c7781fb08e9821c327b1ece1f83e3 | [
"Apache-2.0"
] | null | null | null | examples/nlp/language_modeling/megatron_gpt_eval.py | Jorjeous/NeMo | cafc21ee6a0c7781fb08e9821c327b1ece1f83e3 | [
"Apache-2.0"
] | null | null | null | examples/nlp/language_modeling/megatron_gpt_eval.py | Jorjeous/NeMo | cafc21ee6a0c7781fb08e9821c327b1ece1f83e3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.706349 | 118 | 0.678054 |
166cf6654f03b1821f66e00e419f15fb6b261535 | 2,718 | py | Python | keras_cv/layers/preprocessing/solarization_test.py | kartik4949/keras-cv | 4c300f564d8ec99cd1351c445e1803ee6664915a | [
"Apache-2.0"
] | null | null | null | keras_cv/layers/preprocessing/solarization_test.py | kartik4949/keras-cv | 4c300f564d8ec99cd1351c445e1803ee6664915a | [
"Apache-2.0"
] | null | null | null | keras_cv/layers/preprocessing/solarization_test.py | kartik4949/keras-cv | 4c300f564d8ec99cd1351c445e1803ee6664915a | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The KerasCV Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 33.146341 | 88 | 0.633186 |
4b3ea336f2fa847fc2da5799030a9f017450f04b | 1,561 | py | Python | jogging-lawrence/src/graphics.py | alanxoc3/stupid-games | 674a884eb428be5b6da47d0a41946929da79ae99 | [
"MIT"
] | 1 | 2020-08-11T10:53:15.000Z | 2020-08-11T10:53:15.000Z | jogging-lawrence/src/graphics.py | alanxoc3/stupid-games | 674a884eb428be5b6da47d0a41946929da79ae99 | [
"MIT"
] | null | null | null | jogging-lawrence/src/graphics.py | alanxoc3/stupid-games | 674a884eb428be5b6da47d0a41946929da79ae99 | [
"MIT"
] | 1 | 2020-08-11T10:53:16.000Z | 2020-08-11T10:53:16.000Z | import pygame
images = {}
_width = None
_height = None
_screen = None
_backBuf = None
_entities = []
_map = None
def reset():
del _entities[:]
# adds entity to entities - which holds what needs to be drawn
# each entity needs sprite_sheet, frame, weight
# , and FRAMES (ann array of x and y coods representing the p... | 24.390625 | 90 | 0.72902 |
7891dfbf0df8f05e4d1c3bc3b09e53b60c6795a2 | 9,688 | py | Python | nmt.py | rjhd2/sotc_graphics | e9d2b259fb09d6a7bc9262d33de25b1a113fb9b1 | [
"BSD-3-Clause"
] | null | null | null | nmt.py | rjhd2/sotc_graphics | e9d2b259fb09d6a7bc9262d33de25b1a113fb9b1 | [
"BSD-3-Clause"
] | null | null | null | nmt.py | rjhd2/sotc_graphics | e9d2b259fb09d6a7bc9262d33de25b1a113fb9b1 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T05:15:03.000Z | 2020-10-01T05:15:03.000Z | #!/usr/bin/env python
#************************************************************************
#
# Plot figures and output numbers for NMAT section.
# For BAMS SotC 2020
#
#************************************************************************
# SVN Info
# $Rev:: 24 ... | 43.25 | 257 | 0.55192 |
357334ed6468e7fc640e411ea0100b94c80aeeda | 44 | py | Python | python/cendalytics/tfidf/core/bp/__init__.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/tfidf/core/bp/__init__.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/tfidf/core/bp/__init__.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | from .vectorspace_api import VectorSpaceAPI
| 22 | 43 | 0.886364 |
8b0ad63bf9a718768b183ff428443ee080443c18 | 1,408 | py | Python | .cmake-format.py | devjgm/google-cloud-cpp-common | f7b259caa09a8662847ca8463c3c28e8d285a403 | [
"Apache-2.0"
] | 29 | 2019-05-03T15:03:48.000Z | 2021-06-04T06:15:55.000Z | .cmake-format.py | devjgm/google-cloud-cpp-common | f7b259caa09a8662847ca8463c3c28e8d285a403 | [
"Apache-2.0"
] | 1,199 | 2019-05-03T13:05:54.000Z | 2020-06-01T18:58:26.000Z | .cmake-format.py | devjgm/google-cloud-cpp-common | f7b259caa09a8662847ca8463c3c28e8d285a403 | [
"Apache-2.0"
] | 18 | 2019-05-02T20:53:06.000Z | 2021-10-07T21:29:36.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 29.333333 | 74 | 0.564631 |
d78dfd269d93137ff4b88b94a7bb7eca2cdb32d6 | 891 | py | Python | onnx_test/mcrec_onnx_model_test.py | chencsgit/luoxi_models | ea9e69dfb81b29f41ed92c75faacf81114c69a2f | [
"Apache-2.0"
] | 58 | 2022-03-28T06:16:51.000Z | 2022-03-31T07:36:35.000Z | onnx_test/mcrec_onnx_model_test.py | chencsgit/luoxi_models | ea9e69dfb81b29f41ed92c75faacf81114c69a2f | [
"Apache-2.0"
] | null | null | null | onnx_test/mcrec_onnx_model_test.py | chencsgit/luoxi_models | ea9e69dfb81b29f41ed92c75faacf81114c69a2f | [
"Apache-2.0"
] | 4 | 2022-03-28T06:23:25.000Z | 2022-03-30T13:45:07.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 The Luoxi Team.
# All rights reserved.
# This source code is licensed under the Apache 2.0 license
# found in the LICENSE file in the root directory.
import torch
def mock_orec_data():
num_samples = 2
mock_data = {}
hist_seq = [[int(e) for e in "44,172,602,602,163... | 33 | 166 | 0.645342 |
3081776d96a269eaa1f1ba604645c78aa9cc936e | 32,698 | py | Python | tests/i18n/test_extraction.py | neon-jungle/django | d8f00e1918ce4df76920f3d79bc8d805fa69e29e | [
"BSD-3-Clause"
] | 1 | 2021-04-11T08:16:02.000Z | 2021-04-11T08:16:02.000Z | tests/i18n/test_extraction.py | neon-jungle/django | d8f00e1918ce4df76920f3d79bc8d805fa69e29e | [
"BSD-3-Clause"
] | null | null | null | tests/i18n/test_extraction.py | neon-jungle/django | d8f00e1918ce4df76920f3d79bc8d805fa69e29e | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import shutil
import sys
import time
from unittest import SkipTest, skipUnless
import warnings
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_lin... | 45.795518 | 194 | 0.650865 |
d9a5d0eb2ea303f0395d02c234272502da218b47 | 6,391 | py | Python | excessive.py | stephenkorankye/Basic-Hotel-System | 4c3156c2a77f0aefdc347fc2e8255b2c5fd5a8ed | [
"MIT"
] | null | null | null | excessive.py | stephenkorankye/Basic-Hotel-System | 4c3156c2a77f0aefdc347fc2e8255b2c5fd5a8ed | [
"MIT"
] | null | null | null | excessive.py | stephenkorankye/Basic-Hotel-System | 4c3156c2a77f0aefdc347fc2e8255b2c5fd5a8ed | [
"MIT"
] | null | null | null |
# STEPHEN KORANKYE
import os
from subprocess import call
import sys
try:
from Tkinter import *
except ImportError:
from tkinter import *
try:
import ttk
py3 = False
except ImportError:
import tkinter.ttk as ttk
py3 = True
def click_checkinn():
call(["python", "checkin_gui_and_program.p... | 39.695652 | 80 | 0.664372 |
22354b20f7b7f1dd7d25420b2c6de338a528d3f9 | 759 | py | Python | virtualapp/migrations/0005_attendance.py | Halar1312/Virtual-School | 3dced5f196f4283c0840fa81f35abe85e1f55efd | [
"MIT"
] | null | null | null | virtualapp/migrations/0005_attendance.py | Halar1312/Virtual-School | 3dced5f196f4283c0840fa81f35abe85e1f55efd | [
"MIT"
] | null | null | null | virtualapp/migrations/0005_attendance.py | Halar1312/Virtual-School | 3dced5f196f4283c0840fa81f35abe85e1f55efd | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-25 20:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('virtualapp', '0004_registeredstudents'),
]
operations = [
migrations.CreateModel(
name='Attendance',
fields=[
... | 28.111111 | 86 | 0.544137 |
056cc74b1c088bd4b92caaa4e7e0f0ba390f10ef | 4,153 | py | Python | channels/auth.py | milos-u/channels | a393253b0544bc2a6fd480dd9c53ed433a2fa103 | [
"BSD-3-Clause"
] | null | null | null | channels/auth.py | milos-u/channels | a393253b0544bc2a6fd480dd9c53ed433a2fa103 | [
"BSD-3-Clause"
] | null | null | null | channels/auth.py | milos-u/channels | a393253b0544bc2a6fd480dd9c53ed433a2fa103 | [
"BSD-3-Clause"
] | null | null | null | import functools
from django.contrib import auth
from .sessions import channel_and_http_session, channel_session, http_session
def transfer_user(from_session, to_session):
"""
Transfers user from HTTP session to channel session.
"""
if auth.BACKEND_SESSION_KEY in from_session and \
auth.SESSI... | 39.552381 | 96 | 0.684084 |
460c7a9883fe11394528aa6a59a1f67ae9375f44 | 59,795 | py | Python | qtgui/widgets/image.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | 2 | 2019-09-01T01:38:59.000Z | 2020-02-13T19:25:51.000Z | qtgui/widgets/image.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | null | null | null | qtgui/widgets/image.py | CogSciUOS/DeepLearningToolbox | bf07578b9486d8c48e25df357bc4b9963b513b46 | [
"MIT"
] | null | null | null | """QWidgets for displaying images.
There are two Qt classes associated with images: `QPixmap` and
`QImage`. The `QPixmap` is an off-screen representation that
can be used as a paint device. A `QPixmap` cannot be manipulated
outside a GUI thread, while a `QImage` has no such restrictions.
If you plan to draw the sam... | 35.634684 | 135 | 0.570365 |
359ee0738ef4b8d1d83535433cfcf294a7a50732 | 16,453 | py | Python | src/primaires/scripting/test.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/scripting/test.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/scripting/test.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | 36.807606 | 79 | 0.617334 |
58d6c5a49ebf4dff7c49afac63ca0f8e5135b01b | 39,974 | py | Python | conans/client/conan_api.py | JosiahOne/conan | 4e64c29e7d878230829560b9b51e9e192fc0b8b6 | [
"MIT"
] | null | null | null | conans/client/conan_api.py | JosiahOne/conan | 4e64c29e7d878230829560b9b51e9e192fc0b8b6 | [
"MIT"
] | null | null | null | conans/client/conan_api.py | JosiahOne/conan | 4e64c29e7d878230829560b9b51e9e192fc0b8b6 | [
"MIT"
] | null | null | null | import os
import sys
import requests
import conans
from conans import __version__ as client_version, tools
from conans.client.cmd.create import create
from conans.client.recorder.action_recorder import ActionRecorder
from conans.client.client_cache import ClientCache
from conans.client.conf import MIN_SERVER_COMPATIB... | 45.219457 | 119 | 0.654425 |
a1b6ee05d946436eda86426425afb7968a9938df | 12,445 | py | Python | sdk/python/pulumi_azure_native/attestation/attestation_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/attestation/attestation_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/attestation/attestation_provider.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 43.062284 | 450 | 0.656087 |
72b12bccea449e89acbba1b4e58c9da67c4421e3 | 10,444 | py | Python | book_api/tests/test_views_books.py | musflood/zonar-book-api | 97e8ef4b52b03ac70285acc942f0ca5b775f2061 | [
"MIT"
] | null | null | null | book_api/tests/test_views_books.py | musflood/zonar-book-api | 97e8ef4b52b03ac70285acc942f0ca5b775f2061 | [
"MIT"
] | null | null | null | book_api/tests/test_views_books.py | musflood/zonar-book-api | 97e8ef4b52b03ac70285acc942f0ca5b775f2061 | [
"MIT"
] | null | null | null | """Unit tests for the Book view functions."""
import pytest
from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden
from book_api.models.book import Book
from book_api.tests.conftest import FAKE
from book_api.views.books import (
_create_book, _delete_book, _list_books, _update_book, validate_user)
def... | 32.234568 | 105 | 0.662581 |
8c6c9dc735641b1bbbac95e1be04188dc9e45f66 | 407 | py | Python | powerdns/migrations/0033_auto_20161114_1442.py | mike-johnson-jr/django-powerdns-dnssec | c96973ad1d619e03299fb9f26eb43064a584711b | [
"BSD-2-Clause"
] | 32 | 2015-06-12T12:26:40.000Z | 2021-11-11T13:43:29.000Z | powerdns/migrations/0033_auto_20161114_1442.py | mike-johnson-jr/django-powerdns-dnssec | c96973ad1d619e03299fb9f26eb43064a584711b | [
"BSD-2-Clause"
] | 160 | 2015-07-09T11:53:51.000Z | 2019-10-17T05:21:30.000Z | powerdns/migrations/0033_auto_20161114_1442.py | mike-johnson-jr/django-powerdns-dnssec | c96973ad1d619e03299fb9f26eb43064a584711b | [
"BSD-2-Clause"
] | 20 | 2015-06-29T12:32:47.000Z | 2019-11-21T16:53:28.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('powerdns', '0032_auto_20161102_2006'),
]
operations = [
migrations.AlterUniqueTogether(
name='domainowner',
... | 21.421053 | 73 | 0.621622 |
ed186ba769f906f86bd6ebfce4517354492b40e3 | 3,271 | py | Python | ner/arguments.py | ROBINADC/BiGRU-CRF-with-Attention-for-NER | b9e037ebd6e1d56500ffb60c6030013982c17ded | [
"MIT"
] | 27 | 2020-10-04T07:59:25.000Z | 2022-03-31T03:35:35.000Z | ner/arguments.py | janerjzou/BiGRU-CRF-with-Attention-for-NER | b9e037ebd6e1d56500ffb60c6030013982c17ded | [
"MIT"
] | 6 | 2020-12-28T02:47:58.000Z | 2021-11-06T03:47:22.000Z | ner/arguments.py | janerjzou/BiGRU-CRF-with-Attention-for-NER | b9e037ebd6e1d56500ffb60c6030013982c17ded | [
"MIT"
] | 12 | 2020-06-28T15:48:17.000Z | 2022-03-20T19:40:58.000Z | # -*- coding: utf-8 -*-
"""
Arguments
Created on 2020/5/13
"""
__author__ = "Yihang Wu"
class Arguments:
"""
General settings of arguments
"""
# Device
device = 'cuda'
# Path
raw_data_dir = '../data/raw'
raw_data_train = raw_data_dir + '/train.csv'
raw_data_val = raw_data_dir ... | 22.558621 | 80 | 0.633445 |
83a23b6d8b6a05fa1e050f8453dfdc1ebc141c1b | 14,585 | py | Python | qcfractal/storage_sockets/db_queries.py | alongd/QCFractal | f40dd1a9efa0e0fa44746e8db6dba28967ac0202 | [
"BSD-3-Clause"
] | null | null | null | qcfractal/storage_sockets/db_queries.py | alongd/QCFractal | f40dd1a9efa0e0fa44746e8db6dba28967ac0202 | [
"BSD-3-Clause"
] | null | null | null | qcfractal/storage_sockets/db_queries.py | alongd/QCFractal | f40dd1a9efa0e0fa44746e8db6dba28967ac0202 | [
"BSD-3-Clause"
] | null | null | null | from typing import List, Optional, Set, Union
from sqlalchemy import Integer, inspect
from sqlalchemy.sql import bindparam, text
from qcfractal.interface.models import Molecule, ResultRecord
from qcfractal.storage_sockets.models import MoleculeORM, ResultORM
QUERY_CLASSES = set()
class QueryBase:
# The name/a... | 33.299087 | 117 | 0.610559 |
84d32e4cd18888f42a82bbdc3ccd4915db53aea0 | 12,969 | py | Python | sbadmin/settings/__init__.py | Nels885/csd_dashboard | aa5a3b970c50a2a93af722f962bd87c3728f233c | [
"MIT"
] | null | null | null | sbadmin/settings/__init__.py | Nels885/csd_dashboard | aa5a3b970c50a2a93af722f962bd87c3728f233c | [
"MIT"
] | null | null | null | sbadmin/settings/__init__.py | Nels885/csd_dashboard | aa5a3b970c50a2a93af722f962bd87c3728f233c | [
"MIT"
] | null | null | null | """
Django settings for sbadmin project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
impo... | 33.861619 | 120 | 0.633819 |
baa6cea7cd3ac0959f35b5f7066948029f9c4690 | 3,859 | py | Python | tests/unit_tests/data_steward/cdr_cleaner/cleaning_rules/rdr_observation_source_concept_id_suppression_test.py | dcampbell-vumc/curation | 327296b12cc0864cf32636be03b2b020447bd012 | [
"MIT"
] | null | null | null | tests/unit_tests/data_steward/cdr_cleaner/cleaning_rules/rdr_observation_source_concept_id_suppression_test.py | dcampbell-vumc/curation | 327296b12cc0864cf32636be03b2b020447bd012 | [
"MIT"
] | null | null | null | tests/unit_tests/data_steward/cdr_cleaner/cleaning_rules/rdr_observation_source_concept_id_suppression_test.py | dcampbell-vumc/curation | 327296b12cc0864cf32636be03b2b020447bd012 | [
"MIT"
] | null | null | null | """
Unit Test for the rdr_observation_source_concept_id_suppression module.
Remove three irrelevant observation_source_concept_ids from the RDR dataset.
Original Issue: DC-529
The intent is to remove PPI records from the observation table in the RDR
export where observation_source_concept_id in (43530490, 43528818,... | 37.466019 | 176 | 0.59575 |
e2a92e719df8029b372df6274fb8d2f188e11586 | 2,534 | py | Python | python/setup.py | ishine/lid_kaldi | 0f9d61dff2ee04df656fb0ace10dc9f614cfa05d | [
"Apache-2.0"
] | 24 | 2021-04-03T11:09:18.000Z | 2022-02-23T15:31:29.000Z | python/setup.py | gooran/lid_kaldi | bd7456c472b9ceb824cc784bcd010d5c6d060934 | [
"Apache-2.0"
] | 3 | 2021-05-15T12:37:04.000Z | 2022-03-31T17:45:20.000Z | python/setup.py | gooran/lid_kaldi | bd7456c472b9ceb824cc784bcd010d5c6d060934 | [
"Apache-2.0"
] | 6 | 2021-04-29T06:27:34.000Z | 2021-08-30T08:49:37.000Z | import os
import sys
import setuptools
import shutil
import glob
import platform
# Figure out environment for cross-compile
lid_source = os.getenv("LID_SOURCE", os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
system = os.environ.get('LID_PLATFORM', platform.system())
architecture = os.environ.get('LID_... | 35.194444 | 100 | 0.635754 |
3b5c09eafaec405af26501c11f072b375b00bad2 | 3,193 | py | Python | 02-multi-armed-bandits/plots.py | nikibobi/rl-an-introduction | b1aeb8263f38af6a3f5ea4663f8e40b574037e73 | [
"MIT"
] | null | null | null | 02-multi-armed-bandits/plots.py | nikibobi/rl-an-introduction | b1aeb8263f38af6a3f5ea4663f8e40b574037e73 | [
"MIT"
] | null | null | null | 02-multi-armed-bandits/plots.py | nikibobi/rl-an-introduction | b1aeb8263f38af6a3f5ea4663f8e40b574037e73 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import seaborn as sns
from scipy.stats import norm
def generate_normal(num=100, e=0.01):
return norm.ppf(np.linspace(e, 1 - e, num=num, dtype=np.float))
normal = generate_normal()
def plot_bandits(means):
n = len(means)
... | 34.706522 | 99 | 0.66176 |
01753677e3f3ce3d54c9bf70559665cec382b481 | 17,046 | py | Python | rmgpy/cantherm/qchem.py | keceli/RMG-Py | 17c7870195a4feb6e8bf8974292f9bcdca1a1d9d | [
"MIT"
] | 1 | 2017-12-18T18:43:22.000Z | 2017-12-18T18:43:22.000Z | rmgpy/cantherm/qchem.py | keceli/RMG-Py | 17c7870195a4feb6e8bf8974292f9bcdca1a1d9d | [
"MIT"
] | null | null | null | rmgpy/cantherm/qchem.py | keceli/RMG-Py | 17c7870195a4feb6e8bf8974292f9bcdca1a1d9d | [
"MIT"
] | 1 | 2021-08-14T13:47:18.000Z | 2021-08-14T13:47:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free ... | 41.474453 | 127 | 0.503461 |
ab60ebb9e77b2e6317b142abedd7e0287623e22d | 841 | py | Python | ch2/package/ch2_pkg_py/ch2_pkg_py/pkg2go.py | homalozoa/ros2_for_beginners_code | 0515621d9cb53cc0c0e2380cf9a52e68ce975e76 | [
"Apache-2.0"
] | null | null | null | ch2/package/ch2_pkg_py/ch2_pkg_py/pkg2go.py | homalozoa/ros2_for_beginners_code | 0515621d9cb53cc0c0e2380cf9a52e68ce975e76 | [
"Apache-2.0"
] | null | null | null | ch2/package/ch2_pkg_py/ch2_pkg_py/pkg2go.py | homalozoa/ros2_for_beginners_code | 0515621d9cb53cc0c0e2380cf9a52e68ce975e76 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 Homalozoa
#
# 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... | 26.28125 | 74 | 0.712247 |
491e7618a61185fd306819de93d7d793b63a8075 | 53 | py | Python | main/courses/exams/forms.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | 2 | 2015-10-31T23:12:52.000Z | 2021-01-19T11:03:00.000Z | main/courses/exams/forms.py | sunu/class2go | 653b1edd01d390ad387dd788e0fc2d89445fbcab | [
"Apache-2.0"
] | null | null | null | main/courses/exams/forms.py | sunu/class2go | 653b1edd01d390ad387dd788e0fc2d89445fbcab | [
"Apache-2.0"
] | null | null | null | from django import forms
from c2g.models import Exam | 26.5 | 27 | 0.830189 |
8631867f80552746e0f3a68b35253c1d6ec7fd96 | 15,731 | py | Python | tests/test_queryparser.py | psyhomb/alerta | 299f0b92ff67149190d1c781c4d203dbcc8a81b6 | [
"Apache-2.0"
] | null | null | null | tests/test_queryparser.py | psyhomb/alerta | 299f0b92ff67149190d1c781c4d203dbcc8a81b6 | [
"Apache-2.0"
] | 60 | 2020-07-27T07:00:45.000Z | 2022-03-21T18:02:18.000Z | tests/test_queryparser.py | psyhomb/alerta | 299f0b92ff67149190d1c781c4d203dbcc8a81b6 | [
"Apache-2.0"
] | 1 | 2020-11-24T03:16:49.000Z | 2020-11-24T03:16:49.000Z | import unittest
def skip_postgres():
try:
import psycopg2 # noqa
except ImportError:
return True
return False
class PostgresQueryTestCase(unittest.TestCase):
def setUp(self):
if skip_postgres():
self.skipTest('psycopg2 import failed')
from alerta.databa... | 37.189125 | 180 | 0.531435 |
4a46b749347c3bda65438d24af05f82fe48fd8a8 | 4,763 | py | Python | graphene_sqlalchemy/fields.py | dubbl/graphene-sqlalchemy | e362e3fc4993d7e95873044bb4d00185b1d3dd8b | [
"MIT"
] | null | null | null | graphene_sqlalchemy/fields.py | dubbl/graphene-sqlalchemy | e362e3fc4993d7e95873044bb4d00185b1d3dd8b | [
"MIT"
] | null | null | null | graphene_sqlalchemy/fields.py | dubbl/graphene-sqlalchemy | e362e3fc4993d7e95873044bb4d00185b1d3dd8b | [
"MIT"
] | null | null | null | import logging
from functools import partial
from promise import Promise, is_thenable
from sqlalchemy.orm.query import Query
from graphene.relay import Connection, ConnectionField
from graphene.relay.connection import PageInfo
from graphql_relay.connection.arrayconnection import connection_from_list_slice
from .util... | 35.281481 | 102 | 0.675625 |
40694776e21d4a165a405b603a2f7d200527a3da | 3,721 | py | Python | core/systemcomponent.py | bahadley/dtest-controller | 905621d76bd0613f69a233ccba86cce8efb3179c | [
"MIT"
] | null | null | null | core/systemcomponent.py | bahadley/dtest-controller | 905621d76bd0613f69a233ccba86cce8efb3179c | [
"MIT"
] | null | null | null | core/systemcomponent.py | bahadley/dtest-controller | 905621d76bd0613f69a233ccba86cce8efb3179c | [
"MIT"
] | null | null | null | """
systemcomponent.py: Contains the SystemComponent class.
Each SystemUnderTest has one or more SystemComponent instances. These
instances may correspond to running virtual machine instances, in the
case Open Stack compute, or to a vSwitch instance or veth pair in the
case of the Linux networking stack. The 'ta... | 43.776471 | 78 | 0.615426 |
5d5feaa5dffc17cff6330b1f0cf5476c3c24c5e7 | 2,168 | py | Python | backoffice/transactions/migrations/0001_initial.py | AlejandroUPC/pythonmicroservices | 9d42bd6dfd9847ad4a8e6029e808de927292c251 | [
"MIT"
] | null | null | null | backoffice/transactions/migrations/0001_initial.py | AlejandroUPC/pythonmicroservices | 9d42bd6dfd9847ad4a8e6029e808de927292c251 | [
"MIT"
] | null | null | null | backoffice/transactions/migrations/0001_initial.py | AlejandroUPC/pythonmicroservices | 9d42bd6dfd9847ad4a8e6029e808de927292c251 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-23 08:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Customer',
fields=[
... | 41.692308 | 124 | 0.579336 |
c147aefe1528699440c016b4c39cdd3077e9bf3d | 9,166 | py | Python | src/sentry/utils/pytest/sentry.py | skeptycal/sentry | b802f4a5e8ceb98390cf3ec03af4a73a7083c817 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/utils/pytest/sentry.py | skeptycal/sentry | b802f4a5e8ceb98390cf3ec03af4a73a7083c817 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/utils/pytest/sentry.py | skeptycal/sentry | b802f4a5e8ceb98390cf3ec03af4a73a7083c817 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import pytest
import mock
import os
from django.conf import settings
from sentry_sdk import Hub
TEST_ROOT = os.path.normpath(
os.path.join(
os.path.dirname(__file__),
os.pardir,
os.pardir,
os.pardir,
os.pardir,
'tests'))
de... | 33.452555 | 91 | 0.669976 |
e41d19a9b87a6a6490e516e0a901ba98755bc522 | 190 | py | Python | sui/ml/__init__.py | AdrianLeonLhy/sui | 06e0636e98e862a0fa95d97cfd56b1f0ef51b299 | [
"MIT"
] | null | null | null | sui/ml/__init__.py | AdrianLeonLhy/sui | 06e0636e98e862a0fa95d97cfd56b1f0ef51b299 | [
"MIT"
] | null | null | null | sui/ml/__init__.py | AdrianLeonLhy/sui | 06e0636e98e862a0fa95d97cfd56b1f0ef51b299 | [
"MIT"
] | null | null | null | """sui.ml
Machine learning algorithm implementations
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from .mf import FunkSVD, BiasSVD, SVDpp, BPR, ALS
| 31.666667 | 82 | 0.810526 |
3cceb4a5a0c1d6e976e2929ea7a837914bd0778a | 9,080 | py | Python | functionaltests/api/v1/test_assembly.py | devdattakulkarni/test-solum | 4e9ddb82d217116aa2c30a6f2581080cbdfae325 | [
"Apache-2.0"
] | null | null | null | functionaltests/api/v1/test_assembly.py | devdattakulkarni/test-solum | 4e9ddb82d217116aa2c30a6f2581080cbdfae325 | [
"Apache-2.0"
] | null | null | null | functionaltests/api/v1/test_assembly.py | devdattakulkarni/test-solum | 4e9ddb82d217116aa2c30a6f2581080cbdfae325 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2013 - Noorul Islam K M
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 42.037037 | 79 | 0.601322 |
a5d20fc343d4be628da04796e7bca793e5964391 | 272 | py | Python | tests/artificial/transf_Quantization/trend_MovingAverage/cycle_5/ar_/test_artificial_1024_Quantization_MovingAverage_5__20.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Quantization/trend_MovingAverage/cycle_5/ar_/test_artificial_1024_Quantization_MovingAverage_5__20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Quantization/trend_MovingAverage/cycle_5/ar_/test_artificial_1024_Quantization_MovingAverage_5__20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 5, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 0); | 38.857143 | 172 | 0.738971 |
be9539a7f5bd4efaae9503c59a7aa6046578e273 | 316 | py | Python | packages/pyright-internal/src/tests/samples/super3.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 4,391 | 2019-05-07T01:18:57.000Z | 2022-03-31T20:45:44.000Z | packages/pyright-internal/src/tests/samples/super3.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 2,740 | 2019-05-07T03:29:30.000Z | 2022-03-31T12:57:46.000Z | packages/pyright-internal/src/tests/samples/super3.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 455 | 2019-05-07T12:55:14.000Z | 2022-03-31T17:09:15.000Z | # This sample tests the case where super() is used for a class
# whose base classes are of unknown types.
from some_module import ClassUnknown # type: ignore
class Class1(ClassUnknown):
def __init__(self, x: int):
# This should not generate an error.
super(Class1, self).__init__(x, 1, 2, 3)
| 28.727273 | 62 | 0.696203 |
74589c02a6af4bcb2d4d177c2d54ed3bc8812ae0 | 10,048 | py | Python | lib/googlecloudsdk/third_party/apis/oslogin/v1/oslogin_v1_messages.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/oslogin/v1/oslogin_v1_messages.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/googlecloudsdk/third_party/apis/oslogin/v1/oslogin_v1_messages.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | """Generated message classes for oslogin version v1.
You can use OS Login to manage access to your VM instances using IAM roles.
For more information, read [OS Login](/compute/docs/oslogin/).
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.protorpclite import messages as _m... | 34.410959 | 89 | 0.741242 |
e7788bca798881af7070f98c8951744a173186c3 | 8,693 | py | Python | tests/layerGrad/layerGrad-sd.py | simonlegrand/pysit | 1fb1a80839ceebef12a8d71aa9c295b65b08bac4 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T13:19:16.000Z | 2022-01-12T13:19:16.000Z | tests/layerGrad/layerGrad-sd.py | simonlegrand/pysit | 1fb1a80839ceebef12a8d71aa9c295b65b08bac4 | [
"BSD-3-Clause"
] | null | null | null | tests/layerGrad/layerGrad-sd.py | simonlegrand/pysit | 1fb1a80839ceebef12a8d71aa9c295b65b08bac4 | [
"BSD-3-Clause"
] | null | null | null | # Std import block
import time
import pickle
import numpy as np
import copy
import sys
import scipy.io as sio
from pysit import *
from pysit.gallery import layered_gradient_medium
from pysit.util.io import *
from pysit.util.parallel import *
from mpi4py import MPI
if __name__ == '__main__':
ExpDir = '.'
co... | 39.334842 | 104 | 0.510986 |
784a2cf880de0139031f5e39ce81a4b5c05eb9cd | 4,195 | py | Python | nipyapi/nifi/models/dimensions_dto.py | Paul-Verardi/nipyapi | 7a709611d9cf30e4ce8943db4d4dd617f2f7c81c | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/dimensions_dto.py | Paul-Verardi/nipyapi | 7a709611d9cf30e4ce8943db4d4dd617f2f7c81c | [
"Apache-2.0"
] | 1 | 2018-11-13T21:01:33.000Z | 2018-11-13T21:01:33.000Z | nipyapi/nifi/models/dimensions_dto.py | Paul-Verardi/nipyapi | 7a709611d9cf30e4ce8943db4d4dd617f2f7c81c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 27.24026 | 479 | 0.538975 |
ac9f038ba79ad80c448f788278ad0a2a076bc08c | 170 | py | Python | setup.py | er-knight/photo-magic | 4b122c76785c718df0aceb5833e2ade475595fc6 | [
"MIT"
] | 1 | 2021-11-14T18:34:26.000Z | 2021-11-14T18:34:26.000Z | setup.py | er-knight/photo-magic | 4b122c76785c718df0aceb5833e2ade475595fc6 | [
"MIT"
] | null | null | null | setup.py | er-knight/photo-magic | 4b122c76785c718df0aceb5833e2ade475595fc6 | [
"MIT"
] | null | null | null | from setuptools import setup
from Cython.Build import cythonize
setup(
ext_modules=cythonize("lfsr.py",
compiler_directives={"language_level" : "3"}
),
) | 21.25 | 52 | 0.705882 |
1348168df3b64ab99c73bfbc440167f99e45f1cc | 7,974 | py | Python | unsupervised_learning/clustering/agglomerative_clustering.py | cesar0205/machine_learning_algorithms | 7cd7c7295e2fb7357123cd81cb3e43c485930d74 | [
"Apache-2.0"
] | null | null | null | unsupervised_learning/clustering/agglomerative_clustering.py | cesar0205/machine_learning_algorithms | 7cd7c7295e2fb7357123cd81cb3e43c485930d74 | [
"Apache-2.0"
] | null | null | null | unsupervised_learning/clustering/agglomerative_clustering.py | cesar0205/machine_learning_algorithms | 7cd7c7295e2fb7357123cd81cb3e43c485930d74 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.cluster.hierarchy import dendrogram as scipy_dendrogram
from itertools import combinations
from scipy.spatial.distance import euclidean
import copy
'''
Abstract class that different linkeage implementations will use to link two clusters.
'''
class Abstr... | 32.283401 | 121 | 0.625031 |
cfacd883d333bfa3b28161034faa34ff506f3ad1 | 506 | py | Python | spotify_controller.py | koshini/spotify-gesture-controller | e4d0481848604754b9ef639d1cbb22a498e9b862 | [
"MIT"
] | null | null | null | spotify_controller.py | koshini/spotify-gesture-controller | e4d0481848604754b9ef639d1cbb22a498e9b862 | [
"MIT"
] | null | null | null | spotify_controller.py | koshini/spotify-gesture-controller | e4d0481848604754b9ef639d1cbb22a498e9b862 | [
"MIT"
] | null | null | null | import spotipy
class SpotifyController():
def __init__(self, TOKEN, DEVICEID):
self.sp = spotipy.Spotify(auth=TOKEN)
self.device_id = DEVICEID
def pause(self):
self.sp.pause_playback(device_id=self.device_id)
def play(self):
self.sp.start_playback(device_id=self... | 26.631579 | 58 | 0.667984 |
46a6404d7efef9e75de5556d300c1c4c8cedfdf2 | 6,556 | py | Python | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/xops/ip.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 46 | 2017-05-15T11:15:08.000Z | 2018-07-02T03:32:52.000Z | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/xops/ip.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | null | null | null | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/xops/ip.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 24 | 2017-05-17T03:26:17.000Z | 2018-07-09T07:00:50.000Z |
from __future__ import division
from math import floor
def get_cidr_from_subnet(subnet):
if (not validate_ipv4(subnet)):
raise ValueError, 'Subnet must be valid.'
subnetsplit = subnet.split('.')
cidr = 0
for oct in subnetsplit:
cidr = (cidr + list(bin(int(oct))).count('1'))
... | 36.422222 | 136 | 0.540879 |
38aaa296fe8220d96167c8ffa5fb484d86235a2f | 506 | py | Python | zsolozsma/migrations/0029_auto_20210313_1334.py | molnarm/liturgia.tv | 3c78de6dcec65262ae9e272188dbda92f71a7c15 | [
"MIT"
] | 4 | 2020-05-04T10:52:35.000Z | 2020-12-03T22:01:09.000Z | zsolozsma/migrations/0029_auto_20210313_1334.py | molnarm/liturgia.tv | 3c78de6dcec65262ae9e272188dbda92f71a7c15 | [
"MIT"
] | 27 | 2021-02-18T19:41:24.000Z | 2021-11-23T05:01:00.000Z | zsolozsma/migrations/0029_auto_20210313_1334.py | molnarm/zsolozsma | a260af574b38687cc5955bbbf76caabc779f09c4 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-13 12:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zsolozsma', '0028_liturgy_duration'),
]
operations = [
migrations.AlterField(
model_name='liturgy',
na... | 26.631579 | 150 | 0.618577 |
c25a4db48e24da067398f7f9b54ed006f3009d7e | 2,660 | py | Python | python/opscore/RO/ParseMsg/GetKeyword.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | python/opscore/RO/ParseMsg/GetKeyword.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | 1 | 2021-08-17T21:08:14.000Z | 2021-08-17T21:08:14.000Z | python/opscore/RO/ParseMsg/GetKeyword.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
History:
2004-05-18 ROwen Modified test code to use astr instead of str
and adict instead of dict.
2015-09-24 ROwen Replace "== None" with "is None" to modernize the code.
2015-11-03 ROwen Replace "!= None" with "is not None" to modernize the code.
"""
from __fut... | 32.048193 | 86 | 0.546617 |
685462452ed9294af2ee01a2766262371a62de07 | 935 | py | Python | saleor/discount/migrations/0008_auto_20180223_1018.py | 3d510/saleor-easyship | e094141bd217f62168c77965a1844426c592a6ef | [
"BSD-3-Clause"
] | null | null | null | saleor/discount/migrations/0008_auto_20180223_1018.py | 3d510/saleor-easyship | e094141bd217f62168c77965a1844426c592a6ef | [
"BSD-3-Clause"
] | null | null | null | saleor/discount/migrations/0008_auto_20180223_1018.py | 3d510/saleor-easyship | e094141bd217f62168c77965a1844426c592a6ef | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-23 16:18
from django.db import migrations, models
import django_prices.models
class Migration(migrations.Migration):
dependencies = [
('discount', '0007_auto_20180108_0814'),
]
operations = [
migrations.AlterField(
model_name='sale',
... | 31.166667 | 122 | 0.592513 |
d8fb310a7fc557644874762a8d8e31c72e4a1137 | 8,317 | py | Python | libcloud/test/compute/test_cloudsigma_v1_0.py | atsaki/libcloud | ae85479e835494e196e2f6e79aae9a475603d8ac | [
"Apache-2.0"
] | 3 | 2015-09-11T15:42:16.000Z | 2021-05-12T01:10:05.000Z | libcloud/test/compute/test_cloudsigma_v1_0.py | atsaki/libcloud | ae85479e835494e196e2f6e79aae9a475603d8ac | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | libcloud/test/compute/test_cloudsigma_v1_0.py | atsaki/libcloud | ae85479e835494e196e2f6e79aae9a475603d8ac | [
"Apache-2.0"
] | 3 | 2016-02-08T23:38:18.000Z | 2019-11-05T00:31:34.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 37.129464 | 76 | 0.668991 |
eeb3976bfcd57bcee65f02876ecd8ab7215ba2cc | 14,541 | py | Python | reagent/evaluation/weighted_sequential_doubly_robust_estimator.py | mcx/ReAgent | 57b58a8b3a6b74bb87a197b73a6cd108ddad895e | [
"BSD-3-Clause"
] | null | null | null | reagent/evaluation/weighted_sequential_doubly_robust_estimator.py | mcx/ReAgent | 57b58a8b3a6b74bb87a197b73a6cd108ddad895e | [
"BSD-3-Clause"
] | null | null | null | reagent/evaluation/weighted_sequential_doubly_robust_estimator.py | mcx/ReAgent | 57b58a8b3a6b74bb87a197b73a6cd108ddad895e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import itertools
import logging
import numpy as np
import scipy as sp
import torch
from reagent.evaluation.cpe import CpeEstimate
from reagent.evaluation.evaluation_data_page import EvaluationDataPage
logger = logging.get... | 37.573643 | 106 | 0.610412 |
551006ca2bcf147dcfcfcfa4177442de9f5f357b | 2,874 | py | Python | salt/modules/elasticsearch.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | 3 | 2016-09-03T06:26:42.000Z | 2019-06-30T13:04:53.000Z | salt/modules/elasticsearch.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | salt/modules/elasticsearch.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
Connection module for Elasticsearch
:depends: elasticsearch
'''
from __future__ import absolute_import
# Import Python libs
import logging
log = logging.getLogger(__name__)
# Import third party libs
try:
import elasticsearch
logging.getLogger('elasticsearch').setLevel(logging.CRI... | 26.611111 | 138 | 0.671886 |
9c6456e10c623a53995ea512cc51c8fec87d7c6f | 2,690 | py | Python | a4/utils.py | KIONLEE/cs224n | 63054e187fb40d65af058673fe7aa2f22433da6e | [
"MIT"
] | null | null | null | a4/utils.py | KIONLEE/cs224n | 63054e187fb40d65af058673fe7aa2f22433da6e | [
"MIT"
] | null | null | null | a4/utils.py | KIONLEE/cs224n | 63054e187fb40d65af058673fe7aa2f22433da6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
CS224N 2019-20: Homework 4
nmt.py: NMT Model
Pencheng Yin <pcyin@cs.cmu.edu>
Sahil Chopra <schopra8@stanford.edu>
Vera Lin <veralin@stanford.edu>
"""
import math
from typing import List
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional... | 30.568182 | 100 | 0.649442 |
8e6e00acfce057ced702c737508c93c7efae612d | 1,773 | py | Python | 3-semanticui-upload-image/app.py | rhcproc/tornado | de044044bfc33be535f9cba1c372f6b648d9472d | [
"MIT"
] | null | null | null | 3-semanticui-upload-image/app.py | rhcproc/tornado | de044044bfc33be535f9cba1c372f6b648d9472d | [
"MIT"
] | null | null | null | 3-semanticui-upload-image/app.py | rhcproc/tornado | de044044bfc33be535f9cba1c372f6b648d9472d | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
import tornado.web
import tornado.httpserver
import tornado.ioloop
import os.path
from tornado.options import define, options
define("port", default=3000, help="run on the given port", type=int)
def get_picture_list():
import os
path = os.path.dirname( os.path.abspath( __file__ ))
... | 30.568966 | 91 | 0.634518 |
9c1bbeb9a84e935024bdf99bd990a80b6730609c | 5,809 | py | Python | mistralclient/commands/v2/environments.py | lostmap/python-mistralclient | f77c1d23fb68b24d7406647b489f3f960026c46b | [
"Apache-2.0"
] | null | null | null | mistralclient/commands/v2/environments.py | lostmap/python-mistralclient | f77c1d23fb68b24d7406647b489f3f960026c46b | [
"Apache-2.0"
] | null | null | null | mistralclient/commands/v2/environments.py | lostmap/python-mistralclient | f77c1d23fb68b24d7406647b489f3f960026c46b | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 - StackStorm, 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 ... | 30.098446 | 78 | 0.613531 |
48de5fa4626aa3a425fb0281fa232ffa828ea6ce | 88 | py | Python | basepy/exceptions.py | pyflow/insightpy | d80f11277a7903f0ca679ceae1def0037ca2d920 | [
"MIT"
] | 3 | 2020-02-01T04:27:50.000Z | 2020-04-28T13:50:10.000Z | basepy/exceptions.py | pyflow/insightpy | d80f11277a7903f0ca679ceae1def0037ca2d920 | [
"MIT"
] | null | null | null | basepy/exceptions.py | pyflow/insightpy | d80f11277a7903f0ca679ceae1def0037ca2d920 | [
"MIT"
] | 1 | 2020-03-02T03:55:05.000Z | 2020-03-02T03:55:05.000Z |
class ConnectionError(Exception):
"""Failed to connect to the broker."""
pass
| 14.666667 | 42 | 0.670455 |
b4740d9c37c98a3bc3c018c209c14282cc80e50a | 3,215 | py | Python | src/api/cgi/yahoofinances/search/index.py | etinaude/9spokes | ed548aec08e659445a8b2dea1be910e73dc2e326 | [
"MIT"
] | 2 | 2020-09-08T04:45:25.000Z | 2020-09-28T04:23:15.000Z | src/api/cgi/yahoofinances/search/index.py | natisha99/9spokes | 5252aea920761339e5af3154acb5d84664803cf8 | [
"MIT"
] | 5 | 2020-07-14T13:03:47.000Z | 2022-02-27T10:00:11.000Z | src/api/cgi/yahoofinances/search/index.py | etinaude/9spokes | ed548aec08e659445a8b2dea1be910e73dc2e326 | [
"MIT"
] | 1 | 2020-09-08T04:46:54.000Z | 2020-09-08T04:46:54.000Z | #!/usr/bin/pypy3
#!/usr/bin/python3
import cgi
import mysql.connector
from datetime import datetime, timedelta
from threading import Thread
from urllib.request import Request, urlopen
import json
def commit(company_name, results, cursor, cnx):
sql1 = "DELETE FROM yahoofinancessearch WHERE company_name='{}';".forma... | 33.489583 | 102 | 0.596579 |
31975e8aeb381a043250eae7c443773c89c9c5b6 | 3,643 | py | Python | scripts/get_dates.py | senseconcordia/NFBugsExtended | 60058ccbd64107018a92ede73056d08ecbdaaed2 | [
"MIT"
] | 2 | 2021-05-23T07:21:28.000Z | 2021-05-26T03:44:17.000Z | scripts/get_dates.py | senseconcordia/NFBugsExtended | 60058ccbd64107018a92ede73056d08ecbdaaed2 | [
"MIT"
] | null | null | null | scripts/get_dates.py | senseconcordia/NFBugsExtended | 60058ccbd64107018a92ede73056d08ecbdaaed2 | [
"MIT"
] | null | null | null | # import csv
# bug_fixing_hash = ''
# bug_inducing_hash = ''
# with open('cassandra.csv') as csvfile:
# commits = csv.DictReader(csvfile, delimiter=',')
# for commit in commits:
# if any(issue in commit['commit_message'] for issue in perf_tags):
# perf_fix_commits.append(commit['commit_ha... | 32.526786 | 92 | 0.645896 |
3daf27cd148bceeb965db4cbf0f5a77ae7f36736 | 1,403 | py | Python | xm06_LinkList_InPlaceReversalOfALinkedList/IPRAL_02_Reverse_a_linklist.py | RagnorLixiaomeng/grokkingTheCoding | a46aea3e5895f6dbe23aa008e3f635d2d758a714 | [
"Apache-2.0"
] | null | null | null | xm06_LinkList_InPlaceReversalOfALinkedList/IPRAL_02_Reverse_a_linklist.py | RagnorLixiaomeng/grokkingTheCoding | a46aea3e5895f6dbe23aa008e3f635d2d758a714 | [
"Apache-2.0"
] | null | null | null | xm06_LinkList_InPlaceReversalOfALinkedList/IPRAL_02_Reverse_a_linklist.py | RagnorLixiaomeng/grokkingTheCoding | a46aea3e5895f6dbe23aa008e3f635d2d758a714 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021/5/27 10:28 PM
# @Author: lixiaomeng_someday
# @Email : 131xxxx119@163.com
# @File : IPRAL_02_Reverse_a_linklist.py
"""
story:
Given the head of a Singly LinkedList, reverse the LinkedList.
Write a function to return the new head of the reversed LinkedList.
analysis:
... | 26.980769 | 75 | 0.693514 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.