hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f760b9a3cfd18b60dccdd61b83d7c18d606694ef | 3,459 | py | Python | human_eval/coverage/preprocess_kb_triples_part2.py | anudeep23/CS7634-FinalProject-COMET2020 | ef86531719a9016f2597516d84dbcf010fb8699c | [
"Apache-2.0"
] | 94 | 2021-02-16T07:55:54.000Z | 2022-03-19T14:58:45.000Z | human_eval/coverage/preprocess_kb_triples_part2.py | anudeep23/CS7634-FinalProject-COMET2020 | ef86531719a9016f2597516d84dbcf010fb8699c | [
"Apache-2.0"
] | 12 | 2021-02-20T04:45:27.000Z | 2022-03-10T18:26:35.000Z | human_eval/coverage/preprocess_kb_triples_part2.py | anudeep23/CS7634-FinalProject-COMET2020 | ef86531719a9016f2597516d84dbcf010fb8699c | [
"Apache-2.0"
] | 23 | 2021-02-17T07:31:15.000Z | 2022-03-30T22:15:06.000Z | from nltk import pos_tag, word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import csv
import argparse
import os
exact2tokenized = {}
tokenized2pos = {}
pos2content = {}
def main():
print('\n#######################')
print('Preprocess Part 2')
print('################... | 25.433824 | 135 | 0.598728 | from nltk import pos_tag, word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
import csv
import argparse
import os
exact2tokenized = {}
tokenized2pos = {}
pos2content = {}
def main():
print('\n#######################')
print('Preprocess Part 2')
print('################... | true | true |
f760b9e10e6cf6084d780ce3072e75daadaabc1d | 2,118 | py | Python | aliyun-python-sdk-cloudapi/aliyunsdkcloudapi/request/v20160714/DescribePurchasedApisRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cloudapi/aliyunsdkcloudapi/request/v20160714/DescribePurchasedApisRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cloudapi/aliyunsdkcloudapi/request/v20160714/DescribePurchasedApisRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.090909 | 92 | 0.75543 |
from aliyunsdkcore.request import RpcRequest
class DescribePurchasedApisRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'CloudAPI', '2016-07-14', 'DescribePurchasedApis','apigateway')
def get_StageName(self):
return self.get_query_params().get('StageName')
def set_StageName(self,Stage... | true | true |
f760ba9ab4e75453ad907b0de38dd5f6944e6048 | 382 | py | Python | maxipago/__init__.py | tfedatto/sdk-python | ee253415dd73b0a73ea27c69527a88ac34856518 | [
"MIT"
] | null | null | null | maxipago/__init__.py | tfedatto/sdk-python | ee253415dd73b0a73ea27c69527a88ac34856518 | [
"MIT"
] | null | null | null | maxipago/__init__.py | tfedatto/sdk-python | ee253415dd73b0a73ea27c69527a88ac34856518 | [
"MIT"
] | 4 | 2018-07-09T12:56:09.000Z | 2019-10-21T21:00:42.000Z | """maxiPago python integration"""
# :copyright: (c) 2013 by Stored (www.stored.com.br).
# :license: BSD, see LICENSE for more details.
VERSION = (1, 2, 0)
__version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:])
__author__ = 'Stored'
__contact__ = 'contato@stored.com.br'
__docformat__ = 'restructuredtex... | 27.285714 | 69 | 0.698953 |
VERSION = (1, 2, 0)
__version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:])
__author__ = 'Stored'
__contact__ = 'contato@stored.com.br'
__docformat__ = 'restructuredtext'
__license__ = 'MIT'
from maxipago.client import Maxipago
| true | true |
f760bb847589ce0cc907894d87fb59fb8a74487d | 186 | py | Python | demopy/tools.py | omars-lab/demo-py | 08d656968ee330e607b100e58727b4503a5cde33 | [
"MIT"
] | null | null | null | demopy/tools.py | omars-lab/demo-py | 08d656968ee330e607b100e58727b4503a5cde33 | [
"MIT"
] | null | null | null | demopy/tools.py | omars-lab/demo-py | 08d656968ee330e607b100e58727b4503a5cde33 | [
"MIT"
] | null | null | null | import re
def clean_multiline_str(s: str):
return re.sub(
# |||||| <- Clear comments too.
r"^\s*('.*)?",
"",
s.strip(),
flags=re.M
) | 18.6 | 43 | 0.413978 | import re
def clean_multiline_str(s: str):
return re.sub(
r"^\s*('.*)?",
"",
s.strip(),
flags=re.M
) | true | true |
f760bbbe21330dc5b4085441924d5615a6505dbb | 23,377 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_load_balancers_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 ... | 48.905858 | 195 | 0.665569 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f760bbd86e15d9fab0e0f5de7b60d29356697fc8 | 442 | py | Python | alipay/aop/api/response/AlipayOpenSmsgDataSetResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayOpenSmsgDataSetResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayOpenSmsgDataSetResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenSmsgDataSetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenSmsgDataSetResponse, self).__init__()
def parse_response_content(self, ... | 27.625 | 102 | 0.776018 | import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenSmsgDataSetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenSmsgDataSetResponse, self).__init__()
def parse_response_content(self, response_content):
response = super(Al... | true | true |
f760bc01769dc6437438a9672b50c5b8686a387f | 2,535 | py | Python | bibtex-abbrev.py | traktofon/journal-abbrev | 7dd8213893d3e5e1ec4cdf4c62840ace2b02f023 | [
"MIT"
] | null | null | null | bibtex-abbrev.py | traktofon/journal-abbrev | 7dd8213893d3e5e1ec4cdf4c62840ace2b02f023 | [
"MIT"
] | null | null | null | bibtex-abbrev.py | traktofon/journal-abbrev | 7dd8213893d3e5e1ec4cdf4c62840ace2b02f023 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import bibtexparser as bp
import argparse
import re
def fix_journal(j):
"Attempt to canonicalize the journal name."
j = j.lower()
j = j.replace("," , "" )
j = j.replace("\&", "and")
j = re.sub(" *the *", " ", j).strip()
return j
def fix_abbrev(a):
"Encode the ab... | 27.258065 | 82 | 0.614596 |
import bibtexparser as bp
import argparse
import re
def fix_journal(j):
j = j.lower()
j = j.replace("," , "" )
j = j.replace("\&", "and")
j = re.sub(" *the *", " ", j).strip()
return j
def fix_abbrev(a):
a = a.replace("&", "\&")
return a
def parse_abbrev(fnam):
with open(fnam) a... | true | true |
f760bc054bd5f150860f37d77b34982950a4b284 | 4,552 | py | Python | tests/unit/the_census/persistence/persistence_test.py | drawjk705/us-stats | a8116fb27dfa46fa837fdca26eab0d5ddd4ac384 | [
"MIT"
] | null | null | null | tests/unit/the_census/persistence/persistence_test.py | drawjk705/us-stats | a8116fb27dfa46fa837fdca26eab0d5ddd4ac384 | [
"MIT"
] | 54 | 2021-01-26T20:37:12.000Z | 2021-08-23T19:41:45.000Z | tests/unit/the_census/persistence/persistence_test.py | drawjk705/us-stats | a8116fb27dfa46fa837fdca26eab0d5ddd4ac384 | [
"MIT"
] | null | null | null | from typing import Any, cast
from unittest.mock import MagicMock, Mock
import pandas
import pytest
from callee import String
from pytest_mock.plugin import MockerFixture
from tests.service_test_fixtures import ServiceTestFixture
from tests.utils import shuffled_cases
from the_census._config import Config
from the_cen... | 30.550336 | 79 | 0.671793 | from typing import Any, cast
from unittest.mock import MagicMock, Mock
import pandas
import pytest
from callee import String
from pytest_mock.plugin import MockerFixture
from tests.service_test_fixtures import ServiceTestFixture
from tests.utils import shuffled_cases
from the_census._config import Config
from the_cen... | true | true |
f760bc0c2b5874afac5c2e512420d8d81930e5ad | 2,944 | py | Python | neat_eo/tools/dataset.py | hzitoun/neat-EO | c54408806b74315ed5cffe33e2a542373c03f7e4 | [
"MIT"
] | 4 | 2020-03-30T12:13:18.000Z | 2021-08-04T15:08:57.000Z | neat_eo/tools/dataset.py | ruptivespatial/neat-EO | 3519f1b2a5b4eb6b1b8ec38bce0e722efb61a94b | [
"MIT"
] | null | null | null | neat_eo/tools/dataset.py | ruptivespatial/neat-EO | 3519f1b2a5b4eb6b1b8ec38bce0e722efb61a94b | [
"MIT"
] | 2 | 2021-07-10T04:52:53.000Z | 2021-08-10T12:11:15.000Z | import os
import sys
import torch
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from neat_eo.core import load_config, check_classes, check_channels
from neat_eo.tiles import tiles_from_dir, tile_label_from_file, tiles_from_csv
def add_parser(subparser, formatter_class):
parser ... | 40.328767 | 120 | 0.699728 | import os
import sys
import torch
import numpy as np
from tqdm import tqdm
from torch.utils.data import DataLoader
from neat_eo.core import load_config, check_classes, check_channels
from neat_eo.tiles import tiles_from_dir, tile_label_from_file, tiles_from_csv
def add_parser(subparser, formatter_class):
parser ... | true | true |
f760bd92d95eb67dc287c9d720e0ecbd4b2cbe79 | 826 | py | Python | src/games/game.py | Michael-Beukman/NEATNoveltyPCG | 2441d80eb0f6dd288a00ebb56c432963cefc879d | [
"MIT"
] | 5 | 2022-01-26T23:19:46.000Z | 2022-02-10T20:24:19.000Z | src/games/game.py | Michael-Beukman/NEATNoveltyPCG | 2441d80eb0f6dd288a00ebb56c432963cefc879d | [
"MIT"
] | null | null | null | src/games/game.py | Michael-Beukman/NEATNoveltyPCG | 2441d80eb0f6dd288a00ebb56c432963cefc879d | [
"MIT"
] | null | null | null | from typing import Tuple
import numpy as np
from games.level import Level
class Game:
"""
A game can be played (by a human/agent/etc).
It requires a level and has some rules.
"""
def __init__(self, level: Level):
self.level = level
self.current_pos = np.array([0, 0])
def... | 29.5 | 93 | 0.577482 | from typing import Tuple
import numpy as np
from games.level import Level
class Game:
def __init__(self, level: Level):
self.level = level
self.current_pos = np.array([0, 0])
def step(self, action: int) -> Tuple[bool, float]:
raise NotImplementedError()
def reset(self, level: Level)... | true | true |
f760be4078a6b5c984b7235cdd5cd9dc2e2e2eaa | 967 | py | Python | jesse/indicators/sinwma.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-03-25T09:25:49.000Z | 2021-03-25T09:25:49.000Z | jesse/indicators/sinwma.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | null | null | null | jesse/indicators/sinwma.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-09-28T16:23:40.000Z | 2021-09-28T16:23:40.000Z | from typing import Union
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from jesse.helpers import get_candle_source, slice_candles, same_length
def sinwma(candles: np.ndarray, period: int = 14, source_type: str = "close", sequential: bool = False) -> Union[
float, np.ndarray]:
""... | 32.233333 | 113 | 0.693899 | from typing import Union
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from jesse.helpers import get_candle_source, slice_candles, same_length
def sinwma(candles: np.ndarray, period: int = 14, source_type: str = "close", sequential: bool = False) -> Union[
float, np.ndarray]:
ca... | true | true |
f760becacb7ad81bf22a6db60ab364531224e375 | 3,406 | py | Python | scripts/paper_big_table.py | v-m/ChangePropagation | b967608c94bd1b319be87938487209e711798c5b | [
"MIT"
] | 2 | 2015-08-11T17:19:51.000Z | 2015-11-12T20:15:57.000Z | scripts/paper_big_table.py | v-m/ChangePropagation | b967608c94bd1b319be87938487209e711798c5b | [
"MIT"
] | 2 | 2016-08-11T14:17:15.000Z | 2016-08-11T14:20:24.000Z | scripts/paper_big_table.py | v-m/PropagationAnalysis | b967608c94bd1b319be87938487209e711798c5b | [
"MIT"
] | 3 | 2017-01-29T08:35:08.000Z | 2020-12-31T14:31:46.000Z | #!/bin/python
#Generate one document showing precision/recall/fscores in a latex table.
#Pass as arguments CSV files generated using 'pminer-global-perf' command with -c ";" option.
#Can take as many files as required but ensure that there are only five graphs to avoid bugs (indeed, this script is made to handle 5 gra... | 27.467742 | 142 | 0.507046 |
import sys
import utils
import cmath
display = [-1,2,14,15,11,12,13]
cols = ["PDG", "CG", "CHA-CG", "F-CHA-CG"]
if len(sys.argv) < 2:
print("Please specify a csv file as parameter.")
sys.exit(1)
items = utils.parseGlobalCsvFiles(sys.argv[1:], type="med")
header = open(".templates/page2.tex", "r")
for l ... | true | true |
f760bf08684808d1cc590146a60996cfa833f75b | 765 | py | Python | notebooks/71.0-BDP-pdiff.py | zeou1/maggot_models | 4e1b518c2981ab1ca9607099c3813e8429d94ca4 | [
"BSD-3-Clause"
] | null | null | null | notebooks/71.0-BDP-pdiff.py | zeou1/maggot_models | 4e1b518c2981ab1ca9607099c3813e8429d94ca4 | [
"BSD-3-Clause"
] | null | null | null | notebooks/71.0-BDP-pdiff.py | zeou1/maggot_models | 4e1b518c2981ab1ca9607099c3813e8429d94ca4 | [
"BSD-3-Clause"
] | null | null | null | #%%
from src.data import load_metagraph
import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
mg = load_metagraph("G", "2020-01-21")
is_pdiff = np.where(mg["is_pdiff"])[0]
mg = mg.reindex(is_pdiff)
degree_df = mg.calculate_degrees()
plt.figure()
melt_degree = pd.melt(
degre... | 24.677419 | 70 | 0.69281 | from src.data import load_metagraph
import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
mg = load_metagraph("G", "2020-01-21")
is_pdiff = np.where(mg["is_pdiff"])[0]
mg = mg.reindex(is_pdiff)
degree_df = mg.calculate_degrees()
plt.figure()
melt_degree = pd.melt(
degree_df... | true | true |
f760bf87f988f188de49f3bd674aba4a09e07dba | 149 | py | Python | ex15.py | wellingtonn96/Revisao_LP2 | 6cd23606633b07db5a984666b12b2dc2193e799d | [
"Apache-2.0"
] | null | null | null | ex15.py | wellingtonn96/Revisao_LP2 | 6cd23606633b07db5a984666b12b2dc2193e799d | [
"Apache-2.0"
] | null | null | null | ex15.py | wellingtonn96/Revisao_LP2 | 6cd23606633b07db5a984666b12b2dc2193e799d | [
"Apache-2.0"
] | null | null | null | cargos = {'ana' : 'vendedora',
'pedro': 'taxista',
'paulo' : 'garçom' }
for n in cargos:
print('%s : %s' % (n, cargos[n]))
| 18.625 | 37 | 0.456376 | cargos = {'ana' : 'vendedora',
'pedro': 'taxista',
'paulo' : 'garçom' }
for n in cargos:
print('%s : %s' % (n, cargos[n]))
| true | true |
f760c218e50b9c6a0ae0262311f284f08a5ff5d8 | 3,488 | py | Python | cgi-bin/tools/shapes.py | quartzcms/Learning-Bot | 2ca01ce3bfe724f82681b86d79570c3665bc0541 | [
"MIT"
] | 2 | 2019-03-17T02:51:44.000Z | 2019-11-24T02:44:09.000Z | cgi-bin/tools/shapes.py | quartzcms/Learning-Bot | 2ca01ce3bfe724f82681b86d79570c3665bc0541 | [
"MIT"
] | null | null | null | cgi-bin/tools/shapes.py | quartzcms/Learning-Bot | 2ca01ce3bfe724f82681b86d79570c3665bc0541 | [
"MIT"
] | null | null | null | import sys
import cgi
import os
class Shapes():
def __init__(self, form, output):
self.form = form
self.output = output
def ovale(self, grid, size, pointsWH):
x = (size[0] // 5)
for i, array in enumerate(grid):
spacing_height = round(((pointsWH[1][1] - pointsWH[1][0]) / 2) - (size[1] / 2))
bottom_si... | 41.035294 | 86 | 0.608658 | import sys
import cgi
import os
class Shapes():
def __init__(self, form, output):
self.form = form
self.output = output
def ovale(self, grid, size, pointsWH):
x = (size[0] // 5)
for i, array in enumerate(grid):
spacing_height = round(((pointsWH[1][1] - pointsWH[1][0]) / 2) - (size[1] / 2))
bottom_si... | true | true |
f760c248cef152eddf1cae181f58b1f6744a4854 | 1,865 | py | Python | danceschool/faq/cms_plugins.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 1 | 2019-02-04T02:11:32.000Z | 2019-02-04T02:11:32.000Z | danceschool/faq/cms_plugins.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 2 | 2019-03-26T22:37:49.000Z | 2019-12-02T15:39:35.000Z | danceschool/faq/cms_plugins.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 1 | 2019-03-19T22:49:01.000Z | 2019-03-19T22:49:01.000Z | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from django.utils.translation import ugettext_lazy as _
from .models import FAQSinglePluginModel, FAQCategoryPluginModel, FAQ
class FAQTOCPlugin(CMSPluginBase):
model = CMSPlu... | 27.426471 | 77 | 0.66756 | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from django.utils.translation import ugettext_lazy as _
from .models import FAQSinglePluginModel, FAQCategoryPluginModel, FAQ
class FAQTOCPlugin(CMSPluginBase):
model = CMSPlu... | true | true |
f760c2847d7b3434f88f4d2b8e0332f96c109290 | 18,756 | py | Python | chaingreen/util/keychain.py | todortron/chaingreen-test | 9054bfd79812ebd7fb3a3d341c03dbadea990fd0 | [
"Apache-2.0"
] | null | null | null | chaingreen/util/keychain.py | todortron/chaingreen-test | 9054bfd79812ebd7fb3a3d341c03dbadea990fd0 | [
"Apache-2.0"
] | null | null | null | chaingreen/util/keychain.py | todortron/chaingreen-test | 9054bfd79812ebd7fb3a3d341c03dbadea990fd0 | [
"Apache-2.0"
] | null | null | null | import colorama
import pkg_resources
import sys
import unicodedata
from bitstring import BitArray # pyright: reportMissingImports=false
from blspy import AugSchemeMPL, G1Element, PrivateKey # pyright: reportMissingImports=false
from chaingreen.util.hash import std_hash
from chaingreen.util.keyring_wrapper import Key... | 36.490272 | 117 | 0.639262 | import colorama
import pkg_resources
import sys
import unicodedata
from bitstring import BitArray from blspy import AugSchemeMPL, G1Element, PrivateKey from chaingreen.util.hash import std_hash
from chaingreen.util.keyring_wrapper import KeyringWrapper
from getpass import getpass
from hashlib import pbkdf2_hmac
from... | true | true |
f760c309ca1a7cddef9a9c029158923f72b1bf53 | 89,138 | py | Python | cinder/tests/unit/volume/drivers/hpe/test_nimble.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/hpe/test_nimble.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/hpe/test_nimble.py | arunvinodqmco/cinder | 62cb72c6890e458427ba0601646b186b7b36dc01 | [
"Apache-2.0"
] | 1 | 2022-03-28T10:49:13.000Z | 2022-03-28T10:49:13.000Z | # Nimble Storage, Inc. (c) 2013-2014
# 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 requi... | 44.040514 | 79 | 0.605858 |
import sys
from unittest import mock
from oslo_utils import uuidutils
from six.moves import http_client
from cinder import context
from cinder import exception
from cinder.objects import fields
from cinder.objects import volume as obj_volume
from cinder.objects import volume_type
from cinder.tests.unit import fake_... | true | true |
f760c394e43d7aa848a9a72a68b27a7d3b18466f | 1,379 | py | Python | national_weather_service.py | ali-ramadhan/wxConch | 1106ce17d25f96a038ca784029261faafd7cfaf9 | [
"MIT"
] | 1 | 2019-03-09T01:10:59.000Z | 2019-03-09T01:10:59.000Z | national_weather_service.py | ali-ramadhan/weather-prediction-model-consensus | 1106ce17d25f96a038ca784029261faafd7cfaf9 | [
"MIT"
] | 1 | 2019-08-19T12:26:06.000Z | 2019-08-19T12:26:06.000Z | national_weather_service.py | ali-ramadhan/weather-prediction-model-consensus | 1106ce17d25f96a038ca784029261faafd7cfaf9 | [
"MIT"
] | null | null | null | import json
import requests
import logging.config
from dateutil.parser import parse
logging.config.fileConfig("logging.ini", disable_existing_loggers=False)
logger = logging.getLogger(__name__)
def nws_temp_time_series(lat, lon):
api_url = "https://api.weather.gov/points/" + str(lat) + "," + str(lon)
respons... | 29.340426 | 90 | 0.661349 | import json
import requests
import logging.config
from dateutil.parser import parse
logging.config.fileConfig("logging.ini", disable_existing_loggers=False)
logger = logging.getLogger(__name__)
def nws_temp_time_series(lat, lon):
api_url = "https://api.weather.gov/points/" + str(lat) + "," + str(lon)
respons... | true | true |
f760c4a15ae9c407de8fa50d5a959786d6069dc4 | 3,935 | py | Python | jupyter_cadquery/utils.py | roipoussiere/jupyter-cadquery | 7ed5ff2ba484ea6cb96f5ea999a88484dfb6b1c1 | [
"Apache-2.0"
] | null | null | null | jupyter_cadquery/utils.py | roipoussiere/jupyter-cadquery | 7ed5ff2ba484ea6cb96f5ea999a88484dfb6b1c1 | [
"Apache-2.0"
] | null | null | null | jupyter_cadquery/utils.py | roipoussiere/jupyter-cadquery | 7ed5ff2ba484ea6cb96f5ea999a88484dfb6b1c1 | [
"Apache-2.0"
] | null | null | null | import json
import math
import numpy as np
import time
import warnings
from webcolors import name_to_rgb, hex_to_rgb, rgb_to_hex
import ipywidgets as widgets
class Color:
def __init__(self, color=None):
if color is None:
self.r = self.g = self.b = 160
elif isinstance(color, Color):
... | 26.952055 | 116 | 0.574841 | import json
import math
import numpy as np
import time
import warnings
from webcolors import name_to_rgb, hex_to_rgb, rgb_to_hex
import ipywidgets as widgets
class Color:
def __init__(self, color=None):
if color is None:
self.r = self.g = self.b = 160
elif isinstance(color, Color):
... | true | true |
f760c59cd0ecf095a53bcfc3f9f3b09fed41c5d4 | 2,905 | py | Python | examples/glat/glat/glat_length_search.py | godweiyang/ParaGen | 9665d1244ea38a41fc06b4e0a7f6411985e2221f | [
"Apache-2.0"
] | null | null | null | examples/glat/glat/glat_length_search.py | godweiyang/ParaGen | 9665d1244ea38a41fc06b4e0a7f6411985e2221f | [
"Apache-2.0"
] | null | null | null | examples/glat/glat/glat_length_search.py | godweiyang/ParaGen | 9665d1244ea38a41fc06b4e0a7f6411985e2221f | [
"Apache-2.0"
] | null | null | null | import torch
from torch import Tensor
from typing import Callable, Tuple
from paragen.utils.ops import local_seed
from paragen.modules.utils import create_padding_mask_from_length
from paragen.modules.search.abstract_search import AbstractSearch
"""
Args: window_size L
input: length [B], encoder_out [S * B * D], enco... | 39.794521 | 91 | 0.623064 | import torch
from torch import Tensor
from typing import Callable, Tuple
from paragen.utils.ops import local_seed
from paragen.modules.utils import create_padding_mask_from_length
from paragen.modules.search.abstract_search import AbstractSearch
class GLATLengthSearcher(AbstractSearch):
def __init__(self,
... | true | true |
f760c637999779c5731e267a4cc37d17588ef892 | 1,934 | py | Python | Surveys/__init__.py | EleutherAI/adaptive-hit | eafd085674466d5dd910a988e921a581c98c4f1f | [
"MIT"
] | null | null | null | Surveys/__init__.py | EleutherAI/adaptive-hit | eafd085674466d5dd910a988e921a581c98c4f1f | [
"MIT"
] | null | null | null | Surveys/__init__.py | EleutherAI/adaptive-hit | eafd085674466d5dd910a988e921a581c98c4f1f | [
"MIT"
] | null | null | null | from __future__ import annotations
from dataclasses import dataclass
from abc import abstractmethod
import sys
from typing import Dict, Tuple, Iterable, List
from typeguard import typechecked
from Data import DataPipelineOutput
_SURVEYPIPELINE = Dict[str, any] = {}
def register_surveypipeline(name):
"""Decora... | 21.488889 | 74 | 0.698552 | from __future__ import annotations
from dataclasses import dataclass
from abc import abstractmethod
import sys
from typing import Dict, Tuple, Iterable, List
from typeguard import typechecked
from Data import DataPipelineOutput
_SURVEYPIPELINE = Dict[str, any] = {}
def register_surveypipeline(name):
def regi... | true | true |
f760c6e07d9c5e48a3e8282efb3edf9f42ea1f7c | 38,371 | py | Python | Pyext/test/py_u_test_add.py | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | null | null | null | Pyext/test/py_u_test_add.py | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | null | null | null | Pyext/test/py_u_test_add.py | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | null | null | null | #////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
# Name :
# Author : Avi
# Revision : $Revision: #10 $
#
# Copyright 2009- ECMWF.
# This software is licensed under the terms of the Apache Licence version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE... | 53.967651 | 168 | 0.559772 | from ecflow import Alias, AttrType, Autocancel, CheckPt, ChildCmdType, Client, Clock, Cron, DState, Date, Day, Days, \
Defs, Ecf, Event, Expression, Family, FamilyVec, File, Flag, FlagType, FlagTypeVec, InLimit, \
JobCreationCtrl, Label, Late, Limit, Meter, Node, NodeContainer, NodeV... | true | true |
f760c78bdb466b8d81dc27308001e9362e2203ec | 745 | py | Python | breakouts/adc344x/software/test/ls_dump.py | loxodes/Vector-Network-Analyzer | f0848f4c1c00c2dfc3c841fe7eea3b7f7243ecbf | [
"MIT"
] | 173 | 2016-04-22T06:15:30.000Z | 2022-03-07T07:52:37.000Z | breakouts/adc344x/software/test/ls_dump.py | loxodes/Vector-Network-Analyzer | f0848f4c1c00c2dfc3c841fe7eea3b7f7243ecbf | [
"MIT"
] | null | null | null | breakouts/adc344x/software/test/ls_dump.py | loxodes/Vector-Network-Analyzer | f0848f4c1c00c2dfc3c841fe7eea3b7f7243ecbf | [
"MIT"
] | 38 | 2016-05-31T03:21:00.000Z | 2022-01-17T18:27:29.000Z | from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
wb = RemoteClient()
wb.open()
analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_subsampler(1) ## increase this to "skip" cycles, e.g. subsample
analyzer.confi... | 32.391304 | 86 | 0.809396 | from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
wb = RemoteClient()
wb.open()
analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_subsampler(1) analyzer.configure_group(0)
analyzer.add_rising_edge_trigger("s... | true | true |
f760cb8dbbdd5f672e616f246c24e6941b341ac8 | 1,940 | py | Python | maintenancemode/middleware.py | matthiask/django-maintenancemode | 6069edbb36fa5959c427a0fe78ad1fabc92de2ea | [
"BSD-3-Clause"
] | null | null | null | maintenancemode/middleware.py | matthiask/django-maintenancemode | 6069edbb36fa5959c427a0fe78ad1fabc92de2ea | [
"BSD-3-Clause"
] | null | null | null | maintenancemode/middleware.py | matthiask/django-maintenancemode | 6069edbb36fa5959c427a0fe78ad1fabc92de2ea | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import re
from django.conf import urls
from django.urls import get_resolver
from django.utils.deprecation import MiddlewareMixin
from . import utils as maintenance
from .conf import settings
urls.handler503 = "maintenancemode.views.temporary_unavailable"
urls.__all__.append("handler503")
IG... | 32.881356 | 80 | 0.675773 |
import re
from django.conf import urls
from django.urls import get_resolver
from django.utils.deprecation import MiddlewareMixin
from . import utils as maintenance
from .conf import settings
urls.handler503 = "maintenancemode.views.temporary_unavailable"
urls.__all__.append("handler503")
IGNORE_URLS = tuple([re.co... | true | true |
f760cc691bb851e84eed51a5d980db2d3e5d099c | 312 | py | Python | jp.atcoder/abc123/abc123_c/8663624.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc123/abc123_c/8663624.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc123/abc123_c/8663624.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
from math import ceil
def main():
n, *capacity = map(int, sys.stdin.read().split())
max_peop = n
time = 0
for c in capacity:
time += ceil(max_peop / c)
if max_peop > c:
max_peop = c
print(time)
if __name__ == "__main__":
main()
| 17.333333 | 54 | 0.519231 | import sys
from math import ceil
def main():
n, *capacity = map(int, sys.stdin.read().split())
max_peop = n
time = 0
for c in capacity:
time += ceil(max_peop / c)
if max_peop > c:
max_peop = c
print(time)
if __name__ == "__main__":
main()
| true | true |
f760cd6df2aa3ab80ee0aa3bf9cec7fbd4284ae8 | 14,908 | py | Python | examples/speech_recognition/w2l_decoder.py | jefflai108/fairseq | fd3f3e7712a7084b9219e45e7b3dc843c69797ba | [
"MIT"
] | 4 | 2021-09-06T06:40:41.000Z | 2022-02-14T09:59:37.000Z | examples/speech_recognition/w2l_decoder.py | jefflai108/fairseq | fd3f3e7712a7084b9219e45e7b3dc843c69797ba | [
"MIT"
] | null | null | null | examples/speech_recognition/w2l_decoder.py | jefflai108/fairseq | fd3f3e7712a7084b9219e45e7b3dc843c69797ba | [
"MIT"
] | 1 | 2021-07-12T12:34:47.000Z | 2021-07-12T12:34:47.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Wav2letter decoders.
"""
import gc
import itertools as it
import os.path as osp
import warnings
from collections ... | 34.192661 | 164 | 0.569962 |
import gc
import itertools as it
import os.path as osp
import warnings
from collections import deque, namedtuple
import numpy as np
import torch
from examples.speech_recognition.data.replabels import unpack_replabels
from fairseq import tasks
from fairseq.utils import apply_to_sample
try:
from wav2letter.comm... | true | true |
f760cd754822e6c117f6f18b47329bbd5af54f18 | 407 | py | Python | setup.py | ethanmiller/tablesnap | c1573247a21fdcdaa422d795ea31c821c4180e28 | [
"BSD-3-Clause"
] | null | null | null | setup.py | ethanmiller/tablesnap | c1573247a21fdcdaa422d795ea31c821c4180e28 | [
"BSD-3-Clause"
] | null | null | null | setup.py | ethanmiller/tablesnap | c1573247a21fdcdaa422d795ea31c821c4180e28 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
setup(
name='tablesnap',
version='0.7.2',
author='Jeremy Grosser',
author_email='jeremy@synack.me',
url='https://github.com/JeremyGrosser/tablesnap',
scripts=[
'tablesnap',
'tableslurp',
'tablechop'
],
install_requires=[
'pyin... | 19.380952 | 53 | 0.555283 | from setuptools import setup
setup(
name='tablesnap',
version='0.7.2',
author='Jeremy Grosser',
author_email='jeremy@synack.me',
url='https://github.com/JeremyGrosser/tablesnap',
scripts=[
'tablesnap',
'tableslurp',
'tablechop'
],
install_requires=[
'pyin... | true | true |
f760cdc66d6c7c3dc13a9a197032815bfaa67eb4 | 10,661 | py | Python | tensorflow_datasets/object_detection/kitti.py | abhinavsp0730/datasets | 3c69b42456fb947a7af7086a3310b972bd1ae3fb | [
"Apache-2.0"
] | 1 | 2019-04-02T02:12:17.000Z | 2019-04-02T02:12:17.000Z | tensorflow_datasets/object_detection/kitti.py | abhinavsp0730/datasets | 3c69b42456fb947a7af7086a3310b972bd1ae3fb | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/object_detection/kitti.py | abhinavsp0730/datasets | 3c69b42456fb947a7af7086a3310b972bd1ae3fb | [
"Apache-2.0"
] | 3 | 2019-12-06T01:05:46.000Z | 2019-12-07T16:53:21.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 34.390323 | 82 | 0.660445 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import os
import numpy as np
import tensorflow.compat.v2 as tf
import tensorflow_datasets.public_api as tfds
_CITATION = """\
@inproceedings{Geiger2012CVPR,
author = {Andreas ... | true | true |
f760cde45b1e678ae11b5bb66c7575d226d75fab | 2,972 | py | Python | cla_backend/apps/cla_provider/management/commands/test_for_call_bunching.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 3 | 2019-10-02T15:31:03.000Z | 2022-01-13T10:15:53.000Z | cla_backend/apps/cla_provider/management/commands/test_for_call_bunching.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 206 | 2015-01-02T16:50:11.000Z | 2022-02-16T20:16:05.000Z | cla_backend/apps/cla_provider/management/commands/test_for_call_bunching.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 6 | 2015-03-23T23:08:42.000Z | 2022-02-15T17:04:44.000Z | # coding=utf-8
from __future__ import unicode_literals
from collections import OrderedDict
import datetime
from django.core.management.base import BaseCommand
from django.contrib.admin.models import LogEntry
from django.contrib.contenttypes.models import ContentType
from legalaid.models import Case
class Command(Bas... | 33.772727 | 118 | 0.599933 | from __future__ import unicode_literals
from collections import OrderedDict
import datetime
from django.core.management.base import BaseCommand
from django.contrib.admin.models import LogEntry
from django.contrib.contenttypes.models import ContentType
from legalaid.models import Case
class Command(BaseCommand):
... | true | true |
f760d220ae07b1d3ce2a8b1299759a116eebeb8b | 1,701 | py | Python | 7c numbersArray.py | spoonsandhangers/Term2_Python | 380464b353fac39ea357f779d720f553abb39dca | [
"CC0-1.0"
] | null | null | null | 7c numbersArray.py | spoonsandhangers/Term2_Python | 380464b353fac39ea357f779d720f553abb39dca | [
"CC0-1.0"
] | null | null | null | 7c numbersArray.py | spoonsandhangers/Term2_Python | 380464b353fac39ea357f779d720f553abb39dca | [
"CC0-1.0"
] | null | null | null | """
Suggested new question wording
Use subroutines where appropriate
Create an empty list and assign it to a global variable called numbersArray
Ask the user to input a number
cast this input to an integer
Add this integer to the next available index in the array
Add a try except block around the integer cast
set a boo... | 36.191489 | 80 | 0.75485 |
numbersArray = []
flag = False
for i in range(5):
flag = False
while flag != True:
try:
userNum = int(input("Enter an integer to add to my list: "))
flag = True
except ValueError:
# it just makes sure.
print("The value you have entered is not an integer")
flag = False
#Once th... | true | true |
f760d324b859684fd317f6a4da91338e9d77083a | 6,751 | py | Python | pymt/component/model.py | csdms/pymt | 188222d7858cd3e8eb15564e56d9b7f0cb43cae5 | [
"MIT"
] | 38 | 2017-06-30T17:10:53.000Z | 2022-01-05T07:38:03.000Z | pymt/component/model.py | csdms/pymt | 188222d7858cd3e8eb15564e56d9b7f0cb43cae5 | [
"MIT"
] | 96 | 2017-04-04T18:52:41.000Z | 2021-11-01T21:30:48.000Z | pymt/component/model.py | csdms/pymt | 188222d7858cd3e8eb15564e56d9b7f0cb43cae5 | [
"MIT"
] | 15 | 2017-05-23T15:40:16.000Z | 2021-06-14T21:30:28.000Z | import os
import six
import yaml
from .component import Component
def get_exchange_item_mapping(items):
"""Construct a mapping for exchange items.
Parameters
----------
items : iterable
List of exchange item names or (*dest*, *src*) tuples.
Returns
-------
items : list
... | 27.555102 | 86 | 0.545845 | import os
import six
import yaml
from .component import Component
def get_exchange_item_mapping(items):
mapping = []
for item in items:
if isinstance(item, six.string_types):
item_map = (item, item)
else:
try:
item_map = (item["destination"], item["sou... | true | true |
f760d3966904f29b060cd4e8992beb6bcb9acb19 | 72,348 | py | Python | protos/gen/python/protos/public/monitoring/Alert_pb2.py | benshaw/modeldb | 5ed5765a3d1842970489dee2fd8630848cbb3baa | [
"Apache-2.0"
] | 624 | 2020-01-18T21:10:12.000Z | 2022-03-23T12:11:06.000Z | protos/gen/python/protos/public/monitoring/Alert_pb2.py | benshaw/modeldb | 5ed5765a3d1842970489dee2fd8630848cbb3baa | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | protos/gen/python/protos/public/monitoring/Alert_pb2.py | benshaw/modeldb | 5ed5765a3d1842970489dee2fd8630848cbb3baa | [
"Apache-2.0"
] | 118 | 2019-04-12T16:01:21.000Z | 2022-03-05T16:29:41.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: monitoring/Alert.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as ... | 45.2175 | 8,307 | 0.770125 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.api import annotations_pb2 as google_dot_api_do... | true | true |
f760d48b49b691b989f462d80ce71eb10c563dba | 5,700 | py | Python | django/utils/decorators.py | Haakenlid/tassen | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 16 | 2017-03-21T03:53:37.000Z | 2021-08-14T06:28:02.000Z | django/utils/decorators.py | universitas/universitas.no | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 104 | 2017-03-25T00:12:46.000Z | 2021-03-09T22:40:58.000Z | django/utils/decorators.py | Haakenlid/tassen | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 6 | 2017-03-21T03:53:40.000Z | 2020-06-07T14:15:38.000Z | # forked from https://github.com/peterbe/django-cache-memoize
from functools import wraps
import hashlib
import inspect
import logging
import time
from django.core.cache import cache
from django.utils.encoding import force_bytes, force_text
logger = logging.getLogger('apps')
def timeit(fn):
@wraps(fn)
def t... | 32.20339 | 76 | 0.584737 | from functools import wraps
import hashlib
import inspect
import logging
import time
from django.core.cache import cache
from django.utils.encoding import force_bytes, force_text
logger = logging.getLogger('apps')
def timeit(fn):
@wraps(fn)
def timeit_wrapper(*args, **kwargs):
t0 = time.time()
... | true | true |
f760d490e60e9988d1559ef77a7728e5c75250bf | 11,000 | py | Python | app/account/views.py | ArianePinche/pyrrha | db5e20faff6c972360609394bc58f6318797c478 | [
"MIT"
] | null | null | null | app/account/views.py | ArianePinche/pyrrha | db5e20faff6c972360609394bc58f6318797c478 | [
"MIT"
] | null | null | null | app/account/views.py | ArianePinche/pyrrha | db5e20faff6c972360609394bc58f6318797c478 | [
"MIT"
] | null | null | null | from flask import (
Blueprint,
flash,
redirect,
render_template,
request,
url_for, current_app)
from flask_login import (
current_user,
login_required,
login_user,
logout_user,
)
from app import db
from app.account.forms import (
ChangeEmailForm,
ChangePasswordForm,
... | 38.062284 | 95 | 0.650909 | from flask import (
Blueprint,
flash,
redirect,
render_template,
request,
url_for, current_app)
from flask_login import (
current_user,
login_required,
login_user,
logout_user,
)
from app import db
from app.account.forms import (
ChangeEmailForm,
ChangePasswordForm,
... | true | true |
f760d4fbc2bd8f05df4e204f6765a33043b198b5 | 1,503 | py | Python | day4-2.py | SayWhat1/adventofcode2016 | ecf4661ecc29c374cb99a09508c28615b98c6b06 | [
"MIT"
] | null | null | null | day4-2.py | SayWhat1/adventofcode2016 | ecf4661ecc29c374cb99a09508c28615b98c6b06 | [
"MIT"
] | null | null | null | day4-2.py | SayWhat1/adventofcode2016 | ecf4661ecc29c374cb99a09508c28615b98c6b06 | [
"MIT"
] | null | null | null | """Module to find real rooms in data and sum their sector IDs."""
def main():
"""Run the main function."""
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in dataList:
data = line.strip("\n").split('-')
... | 27.327273 | 73 | 0.539587 |
def main():
with open('data/day4data.txt', 'r') as f:
dataList = f.readlines()
realRoomList = []
roomNames = []
sum = 0
for line in dataList:
data = line.strip("\n").split('-')
name = '-'.join(data[:-1])
id, checkSum = data[-1].strip(']').split('[')
nameC... | true | true |
f760d6b930c8251a1829fbc97632ef4a88d52f92 | 4,563 | py | Python | clients/python/lakefs_client/api/health_check_api.py | NNstorm/lakeFS | 8d8c179cb442290a7ca5020dcf7e95e41301bcf8 | [
"Apache-2.0"
] | 1 | 2021-09-09T16:21:14.000Z | 2021-09-09T16:21:14.000Z | clients/python/lakefs_client/api/health_check_api.py | NNstorm/lakeFS | 8d8c179cb442290a7ca5020dcf7e95e41301bcf8 | [
"Apache-2.0"
] | null | null | null | clients/python/lakefs_client/api/health_check_api.py | NNstorm/lakeFS | 8d8c179cb442290a7ca5020dcf7e95e41301bcf8 | [
"Apache-2.0"
] | null | null | null | """
lakeFS API
lakeFS HTTP API # noqa: E501
The version of the OpenAPI document: 0.1.0
Contact: services@treeverse.io
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint
from lak... | 32.361702 | 88 | 0.501425 |
import re import sys
from lakefs_client.api_client import ApiClient, Endpoint as _Endpoint
from lakefs_client.model_utils import ( check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
class HealthCheckApi(object):
def __init... | true | true |
f760d6d11bbb59b7a8dc03d0c8d4b75a1c56df2f | 2,528 | py | Python | lib/galaxy/webapps/galaxy/api/genomes.py | sneumann/galaxy | f6011bab5b8adbabae4986a45849bb9158ffc8bb | [
"CC-BY-3.0"
] | 1 | 2021-02-05T13:19:58.000Z | 2021-02-05T13:19:58.000Z | lib/galaxy/webapps/galaxy/api/genomes.py | sneumann/galaxy | f6011bab5b8adbabae4986a45849bb9158ffc8bb | [
"CC-BY-3.0"
] | 4 | 2021-02-08T20:28:34.000Z | 2022-03-02T02:52:55.000Z | lib/galaxy/webapps/galaxy/api/genomes.py | sneumann/galaxy | f6011bab5b8adbabae4986a45849bb9158ffc8bb | [
"CC-BY-3.0"
] | 1 | 2018-05-30T07:38:54.000Z | 2018-05-30T07:38:54.000Z | from galaxy import web
from galaxy.web.base.controller import BaseAPIController
from galaxy.web.framework.helpers import is_true
def get_id(base, format):
if format:
return "%s.%s" % (base, format)
else:
return base
class GenomesController(BaseAPIController):
"""
RESTful controller f... | 32.410256 | 97 | 0.620253 | from galaxy import web
from galaxy.web.base.controller import BaseAPIController
from galaxy.web.framework.helpers import is_true
def get_id(base, format):
if format:
return "%s.%s" % (base, format)
else:
return base
class GenomesController(BaseAPIController):
@web.legacy_expose_api_anon... | true | true |
f760d77771c5419f69008964312d3811d59b54aa | 10,407 | py | Python | ginga/util/io_rgb.py | mfwofford/ginga | e1b4d04e32b49229fd1345f8a909bc614140cafd | [
"BSD-3-Clause"
] | 1 | 2019-04-11T02:22:48.000Z | 2019-04-11T02:22:48.000Z | ginga/util/io_rgb.py | mfwofford/ginga | e1b4d04e32b49229fd1345f8a909bc614140cafd | [
"BSD-3-Clause"
] | null | null | null | ginga/util/io_rgb.py | mfwofford/ginga | e1b4d04e32b49229fd1345f8a909bc614140cafd | [
"BSD-3-Clause"
] | null | null | null | #
# io_rgb.py -- RGB image file handling.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
import time
import mimetypes
from io import BytesIO
import numpy as np
from ginga.BaseImage import Header, ImageError
from ginga.util import iohelper, rg... | 30.699115 | 95 | 0.570097 | import sys
import time
import mimetypes
from io import BytesIO
import numpy as np
from ginga.BaseImage import Header, ImageError
from ginga.util import iohelper, rgb_cms
try:
import cv2
have_opencv = True
except ImportError:
have_opencv = False
try:
import PIL.Image as PILimage
from PIL.... | true | true |
f760d83e87d58d520ff89f351a8ca3737ff52537 | 18,478 | py | Python | aries-test-harness/features/steps/0036-issue-credential.py | esune/aries-agent-test-harness | b79cac7f2b612f39a263baf0b4311d643e253edd | [
"Apache-2.0"
] | 1 | 2021-05-06T13:46:13.000Z | 2021-05-06T13:46:13.000Z | aries-test-harness/features/steps/0036-issue-credential.py | morrieinmaas/aries-agent-test-harness | 4e9bf6f42d7a9925990198ec4c4d6ebbffa661df | [
"Apache-2.0"
] | null | null | null | aries-test-harness/features/steps/0036-issue-credential.py | morrieinmaas/aries-agent-test-harness | 4e9bf6f42d7a9925990198ec4c4d6ebbffa661df | [
"Apache-2.0"
] | null | null | null | from behave import *
import json
from agent_backchannel_client import agent_backchannel_GET, agent_backchannel_POST, expected_agent_state
from agent_test_utils import format_cred_proposal_by_aip_version
from time import sleep
import time
# This step is defined in another feature file
# Given "Acme" and "Bob" have an e... | 47.994805 | 226 | 0.707165 | from behave import *
import json
from agent_backchannel_client import agent_backchannel_GET, agent_backchannel_POST, expected_agent_state
from agent_test_utils import format_cred_proposal_by_aip_version
from time import sleep
import time
SCHEMA_TEMPLATE = {
"schema_name": "test_schema.",
"schema_version": "1... | true | true |
f760d8bde33eeffc79649b95d1fb9c027d3dba3b | 75 | py | Python | app/config/dev.py | charlesashby/marketvault-front-end | 758cf8ba1d8486f45eac093ded78a15fc82df3dc | [
"MIT"
] | null | null | null | app/config/dev.py | charlesashby/marketvault-front-end | 758cf8ba1d8486f45eac093ded78a15fc82df3dc | [
"MIT"
] | null | null | null | app/config/dev.py | charlesashby/marketvault-front-end | 758cf8ba1d8486f45eac093ded78a15fc82df3dc | [
"MIT"
] | null | null | null | MYSQL_HOST = "db-dev-marketvault.c3aprxswdrnw.us-east-2.rds.amazonaws.com"
| 37.5 | 74 | 0.8 | MYSQL_HOST = "db-dev-marketvault.c3aprxswdrnw.us-east-2.rds.amazonaws.com"
| true | true |
f760d9c3db5e148d538e403e35338c88be0d8792 | 2,906 | py | Python | src/ics/alarm.py | aureooms-contrib/ics-py | 27279885334eebd337be620e0c247c059d6a4e87 | [
"Apache-2.0"
] | 312 | 2015-01-06T08:25:54.000Z | 2021-02-02T20:36:47.000Z | src/ics/alarm.py | aureooms-contrib/ics-py | 27279885334eebd337be620e0c247c059d6a4e87 | [
"Apache-2.0"
] | 200 | 2015-01-17T16:48:40.000Z | 2021-01-31T08:20:13.000Z | src/ics/alarm.py | aureooms-contrib/ics-py | 27279885334eebd337be620e0c247c059d6a4e87 | [
"Apache-2.0"
] | 99 | 2015-01-18T01:09:50.000Z | 2021-01-04T22:45:37.000Z | import attr
from abc import ABCMeta, abstractmethod
from attr.converters import optional as c_optional
from attr.validators import instance_of, optional as v_optional
from datetime import datetime, timedelta
from typing import List, Union, Type
from ics.attendee import Attendee
from ics.component import Component
from... | 24.627119 | 119 | 0.669649 | import attr
from abc import ABCMeta, abstractmethod
from attr.converters import optional as c_optional
from attr.validators import instance_of, optional as v_optional
from datetime import datetime, timedelta
from typing import List, Union, Type
from ics.attendee import Attendee
from ics.component import Component
from... | true | true |
f760dbad109e10036a3184cf69ec0fe03318e2ae | 4,533 | py | Python | bin/SVM_ROC.py | liguowang/epage | 2ce60ddbcd23f06dc4d635681e8e52b66ba519f9 | [
"MIT"
] | null | null | null | bin/SVM_ROC.py | liguowang/epage | 2ce60ddbcd23f06dc4d635681e8e52b66ba519f9 | [
"MIT"
] | null | null | null | bin/SVM_ROC.py | liguowang/epage | 2ce60ddbcd23f06dc4d635681e8e52b66ba519f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 16 09:29:30 2019
@author: m102324
Description
-----------
Plot Receiver operating characteristic (ROC) curves using K-fold cross-validation.
Format
-------
* 1st-column : sample ID (string)
* 2nd-column : binary label (intger, must be 0 or 1)
* 3rd... | 40.473214 | 390 | 0.683212 |
import sys
from optparse import OptionParser
from pacmodule.svm import plot_cvROC
__author__ = "Liguo Wang"
__copyright__ = "Copyleft"
__credits__ = []
__license__ = "GPL"
__version__="1.0.0"
__maintainer__ = "Liguo Wang"
__email__ = "wang.liguo@mayo.edu"
__status__ = "Development"
def pick_colors(n):
my_colors = ... | true | true |
f760dc0cf68d80c03516178552e811e5f64bfe27 | 4,745 | py | Python | LowCrawler/mysite/mysite/settings.py | hanbox/mysite-master | 70872768148ce9ce86c93b8bdd5640e16e1e21e7 | [
"MIT"
] | 2 | 2017-02-24T15:36:29.000Z | 2017-12-30T15:59:34.000Z | LowCrawler/mysite/mysite/settings.py | HanBox2016/mysite-master | 70872768148ce9ce86c93b8bdd5640e16e1e21e7 | [
"MIT"
] | null | null | null | LowCrawler/mysite/mysite/settings.py | HanBox2016/mysite-master | 70872768148ce9ce86c93b8bdd5640e16e1e21e7 | [
"MIT"
] | null | null | null | #encoding:utf-8
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
""... | 25.10582 | 72 | 0.689779 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '-!5wvn!m9#x9lsllr06ry+9@vk9qt+_!et41=ev)obp)0yl2=k'
DEBUG = True
ALLOWED_HOSTS = [
# '.example.com', # Allow domain and subdomains
# '.example.com.', # Also allow FQDN and subdomains
'127.0.0.1',
'.fo... | true | true |
f760dd65c1cfc6bf8942a85ef58d97d085382a1a | 844 | py | Python | scripts/internal/generate_manifest.py | zed/psutil | 8fc5ed1b20c9c9fab75164aae1984698a46974dc | [
"BSD-3-Clause"
] | null | null | null | scripts/internal/generate_manifest.py | zed/psutil | 8fc5ed1b20c9c9fab75164aae1984698a46974dc | [
"BSD-3-Clause"
] | null | null | null | scripts/internal/generate_manifest.py | zed/psutil | 8fc5ed1b20c9c9fab75164aae1984698a46974dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Generate MANIFEST.in file.
"""
import os
import subprocess
SKIP_EXTS = ('.png', '.jpg', '.jpeg')
SKIP_FILES = ('.cirrus.yml',... | 22.810811 | 72 | 0.625592 |
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
SKIP_EXTS = ('.png', '.jpg', '.jpeg')
SKIP_FILES = ('.cirrus.yml', '.travis.yml', 'appveyor.yml')
SKIP_PREFIXES = ('.ci/', '.github/', 'scripts/internal/')
def sh(cmd):
return sub... | true | true |
f760dee1b2e57116f9db5a9a9bfe9d43e7619b59 | 8,115 | py | Python | dionysus/games/ridethebus/cog.py | ethanharstad/dionysus | 31d9595a0a26bb2d68673c636755b8c3dd6f80f9 | [
"MIT"
] | 1 | 2021-06-22T06:22:42.000Z | 2021-06-22T06:22:42.000Z | dionysus/games/ridethebus/cog.py | ethanharstad/dionysus | 31d9595a0a26bb2d68673c636755b8c3dd6f80f9 | [
"MIT"
] | 12 | 2021-05-20T22:03:45.000Z | 2021-06-09T05:12:14.000Z | dionysus/games/ridethebus/cog.py | ethanharstad/dionysus | 31d9595a0a26bb2d68673c636755b8c3dd6f80f9 | [
"MIT"
] | null | null | null | import logging
from typing import Dict, List, Iterable
import asyncio
import discord
from discord.ext import commands
import emoji
from .game import RideTheBus, GameState
from .result import Result
from utils import playingcards
logger = logging.getLogger(__name__)
COLOR = 0xFFFF00
ROUND_RULES = {
GameState.RE... | 36.066667 | 156 | 0.605422 | import logging
from typing import Dict, List, Iterable
import asyncio
import discord
from discord.ext import commands
import emoji
from .game import RideTheBus, GameState
from .result import Result
from utils import playingcards
logger = logging.getLogger(__name__)
COLOR = 0xFFFF00
ROUND_RULES = {
GameState.RE... | true | true |
f760dee94a965760254b80c022d4bdf5aba60851 | 26,602 | py | Python | test/test_menu_config.py | stivesso/aws-ec2rescue-linux | 63fb350ba65d3d67c25c0ecc367793adef6cebbd | [
"Apache-2.0"
] | 178 | 2017-07-18T18:58:36.000Z | 2022-03-31T03:12:52.000Z | test/test_menu_config.py | stivesso/aws-ec2rescue-linux | 63fb350ba65d3d67c25c0ecc367793adef6cebbd | [
"Apache-2.0"
] | 45 | 2017-07-18T23:19:06.000Z | 2021-11-30T17:31:51.000Z | test/test_menu_config.py | stivesso/aws-ec2rescue-linux | 63fb350ba65d3d67c25c0ecc367793adef6cebbd | [
"Apache-2.0"
] | 72 | 2017-07-18T18:57:59.000Z | 2022-03-29T06:14:06.000Z | # Copyright 2016-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#
# or in the "license" f... | 43.89769 | 120 | 0.637734 |
import curses
import mock
import os
import sys
import unittest
import ec2rlcore.menu
import ec2rlcore.menu_config
import ec2rlcore.menu_item
import ec2rlcore.module
import ec2rlcore.moduledir
class TestMenuConfig(unittest.TestCase):
_callp = sys.argv[0]
if not os.path.isabs(_callp):
_callp = os.pat... | true | true |
f760def25dfd735ace2364b58d92f461b8e71126 | 3,571 | py | Python | cirqprojectq/xmon_rules_040.py | HQSquantumsimulations/CirqProjectQ | 3329dcbd9382a57be00359d95291d694653cdd81 | [
"Apache-2.0"
] | 6 | 2019-03-28T09:34:57.000Z | 2021-12-16T04:31:29.000Z | cirqprojectq/xmon_rules_040.py | HQSquantumsimulations/CirqProjectQ | 3329dcbd9382a57be00359d95291d694653cdd81 | [
"Apache-2.0"
] | 1 | 2018-11-19T13:45:00.000Z | 2018-11-19T13:45:00.000Z | cirqprojectq/xmon_rules_040.py | HeisenbergQS/CirqProjectQ | 3329dcbd9382a57be00359d95291d694653cdd81 | [
"Apache-2.0"
] | 2 | 2019-01-18T02:44:50.000Z | 2021-12-16T04:33:25.000Z | # Copyright 2018 Heisenberg Quantum Simulations
# -*- coding: utf-8 -*-
#
# 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... | 38.397849 | 116 | 0.684682 | import cirq
version = [int(cirq.__version__[0]), int(cirq.__version__[2])]
assert(version[0] > 0 or version[1] >= 4)
import cmath
from projectq.meta import get_control_count
from . import xmon_gates
from ._rules_pq_to_cirq import Ruleset_pq_to_cirq as Ruleset
from ._rules_pq_to_cirq import Rule_pq_to_cirq as Rule
from ... | true | true |
f760df1e2b3b711f027382d4fdbba608146778b2 | 2,627 | py | Python | test/test_edit_contact.py | jekaterinak/python_training | 5fc48bdd6abcb47a18042096a1f8b73c105fa379 | [
"Apache-2.0"
] | null | null | null | test/test_edit_contact.py | jekaterinak/python_training | 5fc48bdd6abcb47a18042096a1f8b73c105fa379 | [
"Apache-2.0"
] | null | null | null | test/test_edit_contact.py | jekaterinak/python_training | 5fc48bdd6abcb47a18042096a1f8b73c105fa379 | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
import random
def test_edit_some_contact_via_main_view_lastname(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.add(Contact(firstname="faname", lastname="lname", address="address", homephone="1",
mobilephone="2", ... | 53.612245 | 112 | 0.64941 | from model.contact import Contact
import random
def test_edit_some_contact_via_main_view_lastname(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.add(Contact(firstname="faname", lastname="lname", address="address", homephone="1",
mobilephone="2", ... | true | true |
f760e086ceca5de0e1a9afbc254373f37d276b1f | 1,132 | py | Python | day_08/day_08.py | niccolomarcon/AoC_2020 | 1afe7453f7ad8c789a3f804c29159c0bb62a7499 | [
"MIT"
] | null | null | null | day_08/day_08.py | niccolomarcon/AoC_2020 | 1afe7453f7ad8c789a3f804c29159c0bb62a7499 | [
"MIT"
] | null | null | null | day_08/day_08.py | niccolomarcon/AoC_2020 | 1afe7453f7ad8c789a3f804c29159c0bb62a7499 | [
"MIT"
] | null | null | null | def do(action, value, acc, i):
if action == 'acc':
acc += value
elif action == 'jmp':
i += value - 1
elif action == 'nop':
pass
return acc, i
def run(instrs):
visited, acc, i = set(), 0, 0
while i < len(instrs):
if i in visited:
break
else:
... | 28.3 | 97 | 0.510601 | def do(action, value, acc, i):
if action == 'acc':
acc += value
elif action == 'jmp':
i += value - 1
elif action == 'nop':
pass
return acc, i
def run(instrs):
visited, acc, i = set(), 0, 0
while i < len(instrs):
if i in visited:
break
else:
... | true | true |
f760e0bc26886a4463350c405b4337f55844083f | 969 | py | Python | module2-sql-for-analysis/insert_titanic.py | mherbert93/DS-Unit-3-Sprint-2-SQL-and-Databases | c322a132ca53ab7fad04da3bd8b3c7f982d8ce65 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/insert_titanic.py | mherbert93/DS-Unit-3-Sprint-2-SQL-and-Databases | c322a132ca53ab7fad04da3bd8b3c7f982d8ce65 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/insert_titanic.py | mherbert93/DS-Unit-3-Sprint-2-SQL-and-Databases | c322a132ca53ab7fad04da3bd8b3c7f982d8ce65 | [
"MIT"
] | null | null | null | import psycopg2
import sqlite3
import os
from dotenv import load_dotenv
import pandas as pd
from sqlalchemy import create_engine
load_dotenv()
DB_NAME = os.getenv("DB_NAME")
DB_USER = os.getenv("DB_USER")
DB_PW = os.getenv("DB_PW")
DB_HOST = os.getenv("DB_HOST")
DB_URL = os.getenv("DB_URL")
df = pd.read_csv('titanic... | 22.022727 | 65 | 0.738906 | import psycopg2
import sqlite3
import os
from dotenv import load_dotenv
import pandas as pd
from sqlalchemy import create_engine
load_dotenv()
DB_NAME = os.getenv("DB_NAME")
DB_USER = os.getenv("DB_USER")
DB_PW = os.getenv("DB_PW")
DB_HOST = os.getenv("DB_HOST")
DB_URL = os.getenv("DB_URL")
df = pd.read_csv('titanic... | true | true |
f760e13ad0e2bff07afc23e244db337b538224e3 | 1,674 | py | Python | rtxp/core/signer.py | johansten/rtxp-py | 47380dca6f9f4b53b90aa297df3f773c44ad4423 | [
"BSD-3-Clause"
] | 1 | 2015-06-18T07:02:02.000Z | 2015-06-18T07:02:02.000Z | rtxp/core/signer.py | johansten/rtxp-py | 47380dca6f9f4b53b90aa297df3f773c44ad4423 | [
"BSD-3-Clause"
] | null | null | null | rtxp/core/signer.py | johansten/rtxp-py | 47380dca6f9f4b53b90aa297df3f773c44ad4423 | [
"BSD-3-Clause"
] | null | null | null |
import os
from rtxp.core import dsa
from rtxp.core import hashes
from rtxp.core import utils
_HASH_TX_SIGN = 'STX\0'
_HASH_TX_SIGN_TESTNET = 'stx\0'
def _get_signing_hash(blob, test=False):
prefix = _HASH_TX_SIGN_TESTNET if test else _HASH_TX_SIGN
return hashes.sha512half(prefix + blob)
def _sign_blob(blob, r... | 27 | 67 | 0.765233 |
import os
from rtxp.core import dsa
from rtxp.core import hashes
from rtxp.core import utils
_HASH_TX_SIGN = 'STX\0'
_HASH_TX_SIGN_TESTNET = 'stx\0'
def _get_signing_hash(blob, test=False):
prefix = _HASH_TX_SIGN_TESTNET if test else _HASH_TX_SIGN
return hashes.sha512half(prefix + blob)
def _sign_blob(blob, r... | true | true |
f760e1861bf81a44d22c80545dfadf6260e2484d | 718 | py | Python | date_time/date_range.py | jumploop/collection_python | f66f18dc5ae50fce95679e0f4aee5e28b2543432 | [
"MIT"
] | null | null | null | date_time/date_range.py | jumploop/collection_python | f66f18dc5ae50fce95679e0f4aee5e28b2543432 | [
"MIT"
] | null | null | null | date_time/date_range.py | jumploop/collection_python | f66f18dc5ae50fce95679e0f4aee5e28b2543432 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime, date, timedelta
import calendar
def get_month_range(start_date=None):
if start_date is None:
start_date = date.today().replace(day=1)
_, days_in_month = calendar.monthrange(start_date.year, start_date.month)
end_date = st... | 26.592593 | 77 | 0.682451 | from datetime import datetime, date, timedelta
import calendar
def get_month_range(start_date=None):
if start_date is None:
start_date = date.today().replace(day=1)
_, days_in_month = calendar.monthrange(start_date.year, start_date.month)
end_date = start_date + timedelta(days=days_in_month)
r... | true | true |
f760e26d25f1fa8f278b7af74e88ed15159f8e74 | 1,689 | py | Python | app/database/hit.py | yooli23/MTurk | 80c5541dbc23deafaefd824abf549cdc2521bf67 | [
"MIT"
] | null | null | null | app/database/hit.py | yooli23/MTurk | 80c5541dbc23deafaefd824abf549cdc2521bf67 | [
"MIT"
] | null | null | null | app/database/hit.py | yooli23/MTurk | 80c5541dbc23deafaefd824abf549cdc2521bf67 | [
"MIT"
] | null | null | null | import json
from database.database import Database, Inspector
class HIT:
def __init__(self, task_id=None, hit_id=None):
super().__init__()
if task_id is not None:
self.task_id = task_id
self.inspector = Inspector(task_id)
self.__dict__.update(self.info)
... | 27.688525 | 117 | 0.53582 | import json
from database.database import Database, Inspector
class HIT:
def __init__(self, task_id=None, hit_id=None):
super().__init__()
if task_id is not None:
self.task_id = task_id
self.inspector = Inspector(task_id)
self.__dict__.update(self.info)
... | true | true |
f760e32c9249f77d128eeb1506aea5c276ff8202 | 2,091 | py | Python | setup.py | kevinhu/avro_gen | 5996896f19d4bceb07450ddd0ccf2bdc38fbda82 | [
"Apache-2.0"
] | null | null | null | setup.py | kevinhu/avro_gen | 5996896f19d4bceb07450ddd0ccf2bdc38fbda82 | [
"Apache-2.0"
] | null | null | null | setup.py | kevinhu/avro_gen | 5996896f19d4bceb07450ddd0ccf2bdc38fbda82 | [
"Apache-2.0"
] | null | null | null | """
A setuptools-based setup module.
See:
https://github.com/hsheth2/avro_gen
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
if path.exists(path.join(here, 'README.md')):
with... | 31.681818 | 77 | 0.635103 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
if path.exists(path.join(here, 'README.md')):
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
else:
long_description = ''
se... | true | true |
f760e34282c06f906e38e95350b7e92c3fffa8ed | 11,235 | py | Python | networkapi/api_network/tests/test_facade.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 73 | 2015-04-13T17:56:11.000Z | 2022-03-24T06:13:07.000Z | networkapi/api_network/tests/test_facade.py | leopoldomauricio/GloboNetworkAPI | 3b5b2e336d9eb53b2c113977bfe466b23a50aa29 | [
"Apache-2.0"
] | 99 | 2015-04-03T01:04:46.000Z | 2021-10-03T23:24:48.000Z | networkapi/api_network/tests/test_facade.py | shildenbrand/GloboNetworkAPI | 515d5e961456cee657c08c275faa1b69b7452719 | [
"Apache-2.0"
] | 64 | 2015-08-05T21:26:29.000Z | 2022-03-22T01:06:28.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import unittest
from mock import MagicMock
from mock import patch
from networkapi.ambiente.models import Ambiente
from networkapi.api_network.exceptions import IncorrectRedundantGatewayRegistryExcept... | 44.94 | 104 | 0.717045 | from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import unittest
from mock import MagicMock
from mock import patch
from networkapi.ambiente.models import Ambiente
from networkapi.api_network.exceptions import IncorrectRedundantGatewayRegistryException
from networkapi.api_... | true | true |
f760e4c5f344dfd8738b284976ac9ec0fcde4e99 | 3,283 | py | Python | lib/django-1.2/django/db/models/expressions.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.2/django/db/models/expressions.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.2/django/db/models/expressions.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from datetime import datetime
from django.utils import tree
from django.utils.copycompat import deepcopy
class ExpressionNode(tree.Node):
"""
Base class for all query expressions.
"""
# Arithmetic connectors
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%%' # This is a quoted % o... | 28.798246 | 76 | 0.620774 | from datetime import datetime
from django.utils import tree
from django.utils.copycompat import deepcopy
class ExpressionNode(tree.Node):
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%%'
AND = '&'
OR = '|'
def __init__(self, children=None, c... | true | true |
f760e55eeb81d899c5be0fa96c76d6802adc2e5d | 1,433 | py | Python | cpx_accel_logger.py | caternuson/Express_Logger | a97252a5f49dda7ad5c57f9e521410aad793be46 | [
"MIT"
] | null | null | null | cpx_accel_logger.py | caternuson/Express_Logger | a97252a5f49dda7ad5c57f9e521410aad793be46 | [
"MIT"
] | null | null | null | cpx_accel_logger.py | caternuson/Express_Logger | a97252a5f49dda7ad5c57f9e521410aad793be46 | [
"MIT"
] | null | null | null |
# Circuit Playground Express Acceleration Logger
#
# Author: Carter Nelson
# MIT License (https://opensource.org/licenses/MIT)
import time
from adafruit_circuitplayground.express import cpx
TOTAL_TIME = 10 # seconds
COLORS = {
'RED' : ( 80, 0, 0),
'GREEN' : ( 0, 80, 0),
'BLUE' : ( 0, ... | 29.854167 | 80 | 0.575715 |
import time
from adafruit_circuitplayground.express import cpx
TOTAL_TIME = 10 COLORS = {
'RED' : ( 80, 0, 0),
'GREEN' : ( 0, 80, 0),
'BLUE' : ( 0, 0, 80),
'BLACK' : ( 0, 0, 0),
}
count = 0
try:
cpx.pixels.fill(COLORS['BLUE'])
while not cpx.button_a and not c... | false | true |
f760e5d66a5e8453e5ebe441fc2241eeadeec51e | 1,378 | py | Python | test/test_story_api.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | null | null | null | test/test_story_api.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | 1 | 2018-09-05T08:51:24.000Z | 2018-09-06T14:56:30.000Z | test/test_story_api.py | Pluxbox/radiomanager-python-client | a25450c079110fb12d8e5b00f8b96c2619ed6172 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
RadioManager
RadioManager # noqa: E501
OpenAPI spec version: 2.0
Contact: support@pluxbox.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import radiomanager_sdk
from radiomanager_sdk.api.stor... | 19.685714 | 74 | 0.625544 |
from __future__ import absolute_import
import unittest
import radiomanager_sdk
from radiomanager_sdk.api.story_api import StoryApi from radiomanager_sdk.rest import ApiException
class TestStoryApi(unittest.TestCase):
def setUp(self):
self.api = radiomanager_sdk.api.story_api.StoryApi()
def te... | true | true |
f760e659d9e5f8b6525c0647ebc7fb5c152e67e2 | 7,837 | py | Python | contrib/bitrpc/bitrpc.py | vertcoin/Eyeglass | c9b94236fe31ed541a0bcfd67cfe381a26ff0b4f | [
"MIT"
] | 5 | 2017-08-30T16:24:06.000Z | 2022-01-30T07:56:15.000Z | contrib/bitrpc/bitrpc.py | vertcoin/Eyeglass | c9b94236fe31ed541a0bcfd67cfe381a26ff0b4f | [
"MIT"
] | 2 | 2017-11-25T02:26:30.000Z | 2019-03-22T10:57:34.000Z | contrib/bitrpc/bitrpc.py | vertcoin/Eyeglass | c9b94236fe31ed541a0bcfd67cfe381a26ff0b4f | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:5888")
else:
access = Ser... | 24.113846 | 79 | 0.66824 | from jsonrpc import ServiceProxy
import sys
import string
rpcuser = ""
rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:5888")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:5888")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":
try:
path = raw_input("Enter dest... | false | true |
f760e672e6cc367256e57122049155a324341577 | 2,213 | py | Python | tests/galaxy_crawler/models/v1/base.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | 2 | 2019-12-24T10:45:37.000Z | 2022-03-04T00:47:14.000Z | tests/galaxy_crawler/models/v1/base.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | 2 | 2019-10-31T17:42:36.000Z | 2020-03-24T18:20:41.000Z | tests/galaxy_crawler/models/v1/base.py | pddg/galaxy_crawler | cc0634dfca7d81ee49e5370ff0bf83cca92ec4ac | [
"Apache-2.0"
] | null | null | null | from sqlalchemy.orm.session import sessionmaker, Session
from galaxy_crawler.models import v1 as model
from galaxy_crawler.models import engine
def create_session(e) -> 'Session':
return sessionmaker(bind=e)()
class ModelTestBase(object):
def setup_method(self):
self.engine = engine.get_in_memory_... | 25.732558 | 95 | 0.585178 | from sqlalchemy.orm.session import sessionmaker, Session
from galaxy_crawler.models import v1 as model
from galaxy_crawler.models import engine
def create_session(e) -> 'Session':
return sessionmaker(bind=e)()
class ModelTestBase(object):
def setup_method(self):
self.engine = engine.get_in_memory_... | true | true |
f760e728f524c73f10fda646dd5add3e2e043b49 | 133 | py | Python | staging/dnsup/dea_dnsup/__init__.py | zidingz/odc-tools | 2c624b054d03f7d3d1ef378fdd007ed90b46a59a | [
"Apache-2.0"
] | 29 | 2019-09-18T10:21:07.000Z | 2022-03-10T07:46:57.000Z | staging/dnsup/dea_dnsup/__init__.py | zidingz/odc-tools | 2c624b054d03f7d3d1ef378fdd007ed90b46a59a | [
"Apache-2.0"
] | 259 | 2019-12-11T03:19:01.000Z | 2022-03-31T22:46:11.000Z | staging/dnsup/dea_dnsup/__init__.py | zidingz/odc-tools | 2c624b054d03f7d3d1ef378fdd007ed90b46a59a | [
"Apache-2.0"
] | 18 | 2020-01-22T14:50:27.000Z | 2022-03-01T14:48:12.000Z | from ._version import __version__
import sys
from odc.aws.dns import cli as dns_cli
def cli():
sys.exit(dns_cli(sys.argv[1:]))
| 16.625 | 38 | 0.729323 | from ._version import __version__
import sys
from odc.aws.dns import cli as dns_cli
def cli():
sys.exit(dns_cli(sys.argv[1:]))
| true | true |
f760e753df8e3498204adf086683531f44f0ad25 | 1,039 | py | Python | setup.py | Slimakoi/Amino.py | 56ef11394b40e9abe873cb537777247d2cc89551 | [
"MIT"
] | 113 | 2020-01-06T11:53:42.000Z | 2022-03-29T12:40:22.000Z | setup.py | aminobot22/Amino.py | 56ef11394b40e9abe873cb537777247d2cc89551 | [
"MIT"
] | 34 | 2020-11-07T10:31:42.000Z | 2022-03-18T21:23:37.000Z | setup.py | aminobot22/Amino.py | 56ef11394b40e9abe873cb537777247d2cc89551 | [
"MIT"
] | 110 | 2020-02-24T10:55:22.000Z | 2022-03-22T09:58:46.000Z | from setuptools import setup, find_packages
with open("README.md", "r") as stream:
long_description = stream.read()
setup(
name = 'Amino.py',
version = '2.0.3',
url = 'https://github.com/Slimakoi/Amino.py',
download_url = 'https://github.com/Slimakoi/Amino.py/tarball/master',
license = 'MIT',
... | 23.613636 | 73 | 0.553417 | from setuptools import setup, find_packages
with open("README.md", "r") as stream:
long_description = stream.read()
setup(
name = 'Amino.py',
version = '2.0.3',
url = 'https://github.com/Slimakoi/Amino.py',
download_url = 'https://github.com/Slimakoi/Amino.py/tarball/master',
license = 'MIT',
... | true | true |
f760e788f5055b18747a60e8f5cd2de782997c94 | 679 | py | Python | setup.py | tcvdijk/mini-ipe | ef6ad9d9dd0534bf8ee03d8dc49d3eb321e4d7a5 | [
"MIT"
] | null | null | null | setup.py | tcvdijk/mini-ipe | ef6ad9d9dd0534bf8ee03d8dc49d3eb321e4d7a5 | [
"MIT"
] | null | null | null | setup.py | tcvdijk/mini-ipe | ef6ad9d9dd0534bf8ee03d8dc49d3eb321e4d7a5 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="miniipe",
version="0.4.0",
author="Thomas van Dijk",
author_email="tvdmaps@gmail.com",
description="An easy, no-dependencies package for writing IPE files from Python.",
long_descripti... | 29.521739 | 86 | 0.665685 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="miniipe",
version="0.4.0",
author="Thomas van Dijk",
author_email="tvdmaps@gmail.com",
description="An easy, no-dependencies package for writing IPE files from Python.",
long_descripti... | true | true |
f760e79b5eec4ab9c6611995ae9d2322208dcb05 | 6,476 | py | Python | piret/maps/star.py | bos-lab/piret | 23ecdf80331d72612bb2f48ab3207117673c373d | [
"BSD-3-Clause"
] | 2 | 2017-05-04T05:25:43.000Z | 2017-08-02T19:20:53.000Z | piret/maps/star.py | bos-lab/piret | 23ecdf80331d72612bb2f48ab3207117673c373d | [
"BSD-3-Clause"
] | 7 | 2018-01-24T16:39:47.000Z | 2018-04-11T16:49:42.000Z | piret/maps/star.py | bos-lab/piret | 23ecdf80331d72612bb2f48ab3207117673c373d | [
"BSD-3-Clause"
] | 4 | 2019-01-03T05:40:02.000Z | 2021-12-06T22:41:13.000Z | #! /usr/bin/env python
"""Luigi Tasks to perform various RNA seq functions, from Mapping to Counting.
Mapping is done using hisat2 and counting is done using featurecounts
and stringtie
"""
import os
import luigi
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.abspath(os.path.joi... | 38.547619 | 93 | 0.581532 |
import os
import luigi
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.abspath(os.path.join(dir_path, '..'))
sys.path.append(lib_path)
from luigi.contrib.external_program import ExternalProgramTask
from luigi import ExternalTask
from luigi import LocalTarget
from luigi import Para... | true | true |
f760e946349d702d3a84feebb9786d84e01de226 | 308 | py | Python | sql.py | Jual6332/FlaskWebpage | 1c16ac41837ab3b0153bcdcaf890bc5f7c11a33f | [
"MIT"
] | null | null | null | sql.py | Jual6332/FlaskWebpage | 1c16ac41837ab3b0153bcdcaf890bc5f7c11a33f | [
"MIT"
] | null | null | null | sql.py | Jual6332/FlaskWebpage | 1c16ac41837ab3b0153bcdcaf890bc5f7c11a33f | [
"MIT"
] | null | null | null | import sqlite3
with sqlite3.connect("sample.db") as connection:
c = connection.cursor()
c.execute("DROP TABLE posts")
c.execute("CREATE TABLE posts(title TEXT, description TEXT)")
c.execute('INSERT INTO posts VALUES("Good", "I\'m good.")')
c.execute('INSERT INTO posts VALUES("Well", "I\'m well.")')
| 30.8 | 62 | 0.701299 | import sqlite3
with sqlite3.connect("sample.db") as connection:
c = connection.cursor()
c.execute("DROP TABLE posts")
c.execute("CREATE TABLE posts(title TEXT, description TEXT)")
c.execute('INSERT INTO posts VALUES("Good", "I\'m good.")')
c.execute('INSERT INTO posts VALUES("Well", "I\'m well.")')
| true | true |
f760e9e89a0b80264eba824743198f5edb27a3f4 | 13,587 | py | Python | development/release-notes/GitClient.py | digitalbuddha/androidx | 03a8f7cfffc74435a23aeae0084ed2f3b84728fd | [
"Apache-2.0"
] | 1 | 2020-09-06T20:07:54.000Z | 2020-09-06T20:07:54.000Z | development/release-notes/GitClient.py | digitalbuddha/androidx | 03a8f7cfffc74435a23aeae0084ed2f3b84728fd | [
"Apache-2.0"
] | null | null | null | development/release-notes/GitClient.py | digitalbuddha/androidx | 03a8f7cfffc74435a23aeae0084ed2f3b84728fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#
# Copyright (C) 2020 The Android Open Source Project
#
# 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 requir... | 38.82 | 148 | 0.728122 |
import os, sys
from enum import Enum
import subprocess
from ReleaseNoteMarkdown import *
GIT_LOG_CMD_PREFIX = "git log --name-only"
def print_e(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def removePrefix(text, prefix):
if text.startswith(prefix): return text[len(prefix):]
return text
class GitCli... | true | true |
f760eaf7809a1fb40ff2482ed41b92ccb340a3bd | 547 | py | Python | astropy/utils/tests/test_gzip.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/utils/tests/test_gzip.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/utils/tests/test_gzip.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
from ...tests.helper import pytest
from ..compat import gzip
pytestmark = pytest.mark.skipif(str("sys.version_info < (3,0)"))
def t... | 24.863636 | 66 | 0.678245 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
from ...tests.helper import pytest
from ..compat import gzip
pytestmark = pytest.mark.skipif(str("sys.version_info < (3,0)"))
def test_gzip(tmpdir):
fd = gzip.GzipFile(str(tmpdir.join("test.g... | true | true |
f760ebab34e2bf7579c19a77001c66f31ac17b5e | 2,177 | py | Python | elasticdl/python/tests/model_helper_test.py | sorrycc/elasticdl | 01439e0bf7bba6ebfffe265916fd41370a59c29d | [
"MIT"
] | 2 | 2021-07-07T16:31:50.000Z | 2021-11-08T09:23:01.000Z | elasticdl/python/tests/model_helper_test.py | sorrycc/elasticdl | 01439e0bf7bba6ebfffe265916fd41370a59c29d | [
"MIT"
] | null | null | null | elasticdl/python/tests/model_helper_test.py | sorrycc/elasticdl | 01439e0bf7bba6ebfffe265916fd41370a59c29d | [
"MIT"
] | 1 | 2021-08-18T18:14:38.000Z | 2021-08-18T18:14:38.000Z | import os
import unittest
from elasticdl.python.common.model_helper import (
_get_spec_value,
get_model_spec,
get_module_file_path,
)
_model_zoo_path = os.path.dirname(os.path.realpath(__file__))
class ModelHelperTest(unittest.TestCase):
def test_get_model_spec(self):
(
model,
... | 29.026667 | 78 | 0.59853 | import os
import unittest
from elasticdl.python.common.model_helper import (
_get_spec_value,
get_model_spec,
get_module_file_path,
)
_model_zoo_path = os.path.dirname(os.path.realpath(__file__))
class ModelHelperTest(unittest.TestCase):
def test_get_model_spec(self):
(
model,
... | true | true |
f760ebaf1c9f4bdff34dec76b7a9bfb5ba5af706 | 4,311 | py | Python | src/scheduler/scheduler/application/CreateExecution/CreateExecutionCommandHandler.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | 1 | 2020-12-18T21:37:28.000Z | 2020-12-18T21:37:28.000Z | src/scheduler/scheduler/application/CreateExecution/CreateExecutionCommandHandler.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | null | null | null | src/scheduler/scheduler/application/CreateExecution/CreateExecutionCommandHandler.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | 1 | 2020-12-18T21:37:31.000Z | 2020-12-18T21:37:31.000Z | from datetime import datetime
from injector import inject
from pdip.configuration.models.database import DatabaseConfig
from pdip.cqrs import ICommandHandler
from pdip.data import RepositoryProvider
from pdip.exceptions import OperationalException
from pdip.logging.loggers.database import SqlLogger
from scheduler.appl... | 51.321429 | 117 | 0.724658 | from datetime import datetime
from injector import inject
from pdip.configuration.models.database import DatabaseConfig
from pdip.cqrs import ICommandHandler
from pdip.data import RepositoryProvider
from pdip.exceptions import OperationalException
from pdip.logging.loggers.database import SqlLogger
from scheduler.appl... | true | true |
f760ec2f3df8f12e8547391353b69f8113d3c547 | 4,862 | py | Python | Backtest/main/Simul/TestStrat.py | simonydbutt/b2a | 0bf4a6de8547d73ace22967780442deeaff2d5c6 | [
"MIT"
] | 2 | 2018-07-01T03:36:24.000Z | 2020-02-13T17:22:46.000Z | Backtest/main/Simul/TestStrat.py | simonydbutt/b2a | 0bf4a6de8547d73ace22967780442deeaff2d5c6 | [
"MIT"
] | null | null | null | Backtest/main/Simul/TestStrat.py | simonydbutt/b2a | 0bf4a6de8547d73ace22967780442deeaff2d5c6 | [
"MIT"
] | null | null | null | from Backtest.main.Exit.Exit import Exit
from Backtest.main.Utils.TimeUtil import TimeUtil
from Backtest.main.Visual.StratVisual import StratVisual
from Backtest.main.Utils.AssetBrackets import AssetBrackets
from Backtest.main.Entrance.Enter import Enter
import numpy as np
class TestStrat:
def __init__(self, Entr... | 35.75 | 88 | 0.450638 | from Backtest.main.Exit.Exit import Exit
from Backtest.main.Utils.TimeUtil import TimeUtil
from Backtest.main.Visual.StratVisual import StratVisual
from Backtest.main.Utils.AssetBrackets import AssetBrackets
from Backtest.main.Entrance.Enter import Enter
import numpy as np
class TestStrat:
def __init__(self, Entr... | true | true |
f760ed47e3fcdfdf1db5990aa6f9e0ce5631970e | 68 | py | Python | CLOUD4.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | CLOUD4.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | CLOUD4.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | print(1)
n = int(input())
if(n==2):
print(3)
else:
print(2)
| 9.714286 | 16 | 0.514706 | print(1)
n = int(input())
if(n==2):
print(3)
else:
print(2)
| true | true |
f760ee47efe6f22606da8fce2e1a7320f63c239b | 545 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractTkocreationsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractTkocreationsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractTkocreationsCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractTkocreationsCom(item):
'''
Parser for 'tkocreations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loite... | 24.772727 | 104 | 0.631193 |
def extractTkocreationsCom(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', 'oel'),
]
for ta... | true | true |
f760ee5692a36d610cb15ce208936be12e731190 | 352 | py | Python | Gena/map_set_center.py | liuxb555/earthengine-py-examples | cff5d154b15a17d6a241e3c003b7fc9a2c5903f3 | [
"MIT"
] | 75 | 2020-06-09T14:40:11.000Z | 2022-03-07T08:38:10.000Z | Gena/map_set_center.py | gentaprekazi/earthengine-py-examples | 76ae8e071a71b343f5e464077afa5b0ed2f9314c | [
"MIT"
] | 1 | 2022-03-15T02:23:45.000Z | 2022-03-15T02:23:45.000Z | Gena/map_set_center.py | gentaprekazi/earthengine-py-examples | 76ae8e071a71b343f5e464077afa5b0ed2f9314c | [
"MIT"
] | 35 | 2020-06-12T23:23:48.000Z | 2021-11-15T17:34:50.000Z | import ee
import geemap
# Create a map centered at (lat, lon).
Map = geemap.Map(center=[40, -100], zoom=4)
# Add some data to the Map
dem = ee.Image("JAXA/ALOS/AW3D30_V1_1").select('MED')
Map.addLayer(dem, {'min': 0, 'max': 5000, 'palette': ['000000', 'ffffff'] }, 'DEM', True)
# TEST Map.setCenter
Map.setCenter(0, 2... | 22 | 89 | 0.65625 | import ee
import geemap
Map = geemap.Map(center=[40, -100], zoom=4)
dem = ee.Image("JAXA/ALOS/AW3D30_V1_1").select('MED')
Map.addLayer(dem, {'min': 0, 'max': 5000, 'palette': ['000000', 'ffffff'] }, 'DEM', True)
Map.setCenter(0, 28, 2.5)
Map
| true | true |
f760eee86951d6b8a6b1fd5c47cefa5a4c8cfdb1 | 1,175 | py | Python | test/test_modify_group.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | test/test_modify_group.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | test/test_modify_group.py | MrSedek/-dev | 12eed868cd706a7e598e92a7f0e06c8fdd9aca29 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
from random import randrange
"""
def test_modify_group_name(app):
if app.group.count() == 0:
app.group.create(Group(name='test'))
old_groups = app.group.get_group_list()
index = randrange(len(old_groups))
group = Group(name='New rename group')
group.id = old_gro... | 30.921053 | 93 | 0.673191 | from model.group import Group
from random import randrange
| true | true |
f760efc71063ef24d4d0339f8bf118ae55924eea | 3,588 | py | Python | gem/evaluation/evaluate_link_prediction.py | vishalbelsare/GEM | ea1cb5f9f28c0d2f49646442ccfd2b6ea7b6cab8 | [
"BSD-3-Clause"
] | 1,223 | 2017-05-09T06:50:42.000Z | 2022-03-31T12:06:34.000Z | gem/evaluation/evaluate_link_prediction.py | vishalbelsare/GEM | ea1cb5f9f28c0d2f49646442ccfd2b6ea7b6cab8 | [
"BSD-3-Clause"
] | 92 | 2017-05-26T09:59:03.000Z | 2022-01-03T15:56:26.000Z | gem/evaluation/evaluate_link_prediction.py | vishalbelsare/GEM | ea1cb5f9f28c0d2f49646442ccfd2b6ea7b6cab8 | [
"BSD-3-Clause"
] | 385 | 2017-05-10T03:36:54.000Z | 2022-03-29T06:56:13.000Z | try: import cPickle as pickle
except: import pickle
from gem.evaluation import metrics
from gem.utils import evaluation_util, graph_util
import numpy as np
import networkx as nx
import sys
sys.path.insert(0, './')
from gem.utils import embed_util
def evaluateStaticLinkPrediction(digraph, graph_embedding,
... | 34.171429 | 115 | 0.604236 | try: import cPickle as pickle
except: import pickle
from gem.evaluation import metrics
from gem.utils import evaluation_util, graph_util
import numpy as np
import networkx as nx
import sys
sys.path.insert(0, './')
from gem.utils import embed_util
def evaluateStaticLinkPrediction(digraph, graph_embedding,
... | true | true |
f760f1423873c6fcdcd40161cb4335438bad7ad0 | 122 | py | Python | yc104/207.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc104/207.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc104/207.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | A, B = map(int, input().split())
for i in range(A, B + 1):
if i % 3 == 0 or str(i).count('3') != 0:
print(i)
| 20.333333 | 44 | 0.459016 | A, B = map(int, input().split())
for i in range(A, B + 1):
if i % 3 == 0 or str(i).count('3') != 0:
print(i)
| true | true |
f760f211069c4a2673d7c7dbaae1eaa21f72efcf | 2,871 | py | Python | venv/lib/python3.7/site-packages/tweepy/errors.py | hamesjan/SurfForecastBot | 83429cdbe0d569b75478f5318a7db84d993bdcb4 | [
"MIT"
] | 1 | 2022-01-24T10:17:38.000Z | 2022-01-24T10:17:38.000Z | venv/lib/python3.7/site-packages/tweepy/errors.py | hamesjan/SurfForecastBot | 83429cdbe0d569b75478f5318a7db84d993bdcb4 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/tweepy/errors.py | hamesjan/SurfForecastBot | 83429cdbe0d569b75478f5318a7db84d993bdcb4 | [
"MIT"
] | 1 | 2022-03-23T19:59:45.000Z | 2022-03-23T19:59:45.000Z | # Tweepy
# Copyright 2009-2022 Joshua Roesslein
# See LICENSE for details.
import requests
class TweepyException(Exception):
"""Base exception for Tweepy
.. versionadded:: 4.0
"""
pass
class HTTPException(TweepyException):
"""HTTPException()
Exception raised when an HTTP request fails
... | 22.968 | 75 | 0.588645 |
import requests
class TweepyException(Exception):
pass
class HTTPException(TweepyException):
def __init__(self, response):
self.response = response
self.api_errors = []
self.api_codes = []
self.api_messages = []
try:
response_json = response.json()
... | true | true |
f760f2e06ad97b8fc221f1cff0a0436600c2fa78 | 16,282 | py | Python | pycherwell/models/search_results_request.py | greenpau/pycherwell | 2a25446d5cf86d69e6158067faf27ce250aba966 | [
"Apache-2.0"
] | 2 | 2020-04-09T16:41:25.000Z | 2020-08-25T21:07:53.000Z | pycherwell/models/search_results_request.py | greenpau/pycherwell | 2a25446d5cf86d69e6158067faf27ce250aba966 | [
"Apache-2.0"
] | 15 | 2020-02-12T14:57:30.000Z | 2020-11-27T23:34:15.000Z | pycherwell/models/search_results_request.py | greenpau/pycherwell | 2a25446d5cf86d69e6158067faf27ce250aba966 | [
"Apache-2.0"
] | 2 | 2020-02-12T14:57:38.000Z | 2021-07-30T11:32:28.000Z | # coding: utf-8
"""
Cherwell REST API
Unofficial Python Cherwell REST API library. # noqa: E501
The version of the OpenAPI document: 9.3.2
Contact: See AUTHORS.
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from pycherwell.configuration imp... | 28.868794 | 392 | 0.619518 |
import pprint
import re
import six
from pycherwell.configuration import Configuration
class SearchResultsRequest(object):
openapi_types = {
'association': 'str',
'bus_ob_id': 'str',
'custom_grid_def_id': 'str',
'date_time_formatting': 'str',
'field_id': 'str',
... | true | true |
f760f71b9beb5c4860fa02fb612223c21ec4bf53 | 7,000 | py | Python | MetaScreener/external_sw/mgltools/MGLToolsPckgs/AutoFill/Recipe.py | bio-hpc/metascreener | 6900497629f601c4b6c0c37da26de58ffa221988 | [
"Apache-2.0"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | MetaScreener/external_sw/mgltools/MGLToolsPckgs/AutoFill/Recipe.py | bio-hpc/metascreener | 6900497629f601c4b6c0c37da26de58ffa221988 | [
"Apache-2.0"
] | null | null | null | MetaScreener/external_sw/mgltools/MGLToolsPckgs/AutoFill/Recipe.py | bio-hpc/metascreener | 6900497629f601c4b6c0c37da26de58ffa221988 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
############################################################################
#
# autoPACK Authors: Graham T. Johnson, Mostafa Al-Alusi, Ludovic Autin,
# and Michel Sanner
# Based on COFFEE Script developed by Graham Johnson between 2005 and 2010
# with assistance from Mostafa Al-Alusi i... | 40.697674 | 90 | 0.575857 |
from .Ingredient import Ingredient
import weakref
from random import random, seed
class Recipe:
def __init__(self):
self.ingredients = []
self.activeIngredients = []
self.organelle = None
self.exclude = []
self.number=0
def delIngredient(self... | true | true |
f760f7363f4fa97d7ce71ae380634e5b7db871a0 | 105,148 | py | Python | lib/galaxy/tools/parameters/basic.py | igorhollaender/sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 2 | 2018-10-14T16:42:39.000Z | 2018-10-14T16:42:41.000Z | lib/galaxy/tools/parameters/basic.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/tools/parameters/basic.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | null | null | null | """
Basic tool parameters.
"""
import logging
import re
import os
import os.path
from six import string_types
from xml.etree.ElementTree import XML
from galaxy import util
from galaxy.web import form_builder
from galaxy.util import string_as_bool, sanitize_param, unicodify
from galaxy.util.expressions import Expressi... | 43.884808 | 181 | 0.605309 | """
Basic tool parameters.
"""
import logging
import re
import os
import os.path
from six import string_types
from xml.etree.ElementTree import XML
from galaxy import util
from galaxy.web import form_builder
from galaxy.util import string_as_bool, sanitize_param, unicodify
from galaxy.util.expressions import Expressi... | false | true |
f760f7f366e0188e28e256222f02e87454728158 | 457 | py | Python | task1/utils.py | SN4KEBYTE/fundamentals_of_cryptography | 49c1ab3f9b743eb9ce6454dce8560ab33dc8434b | [
"MIT"
] | null | null | null | task1/utils.py | SN4KEBYTE/fundamentals_of_cryptography | 49c1ab3f9b743eb9ce6454dce8560ab33dc8434b | [
"MIT"
] | null | null | null | task1/utils.py | SN4KEBYTE/fundamentals_of_cryptography | 49c1ab3f9b743eb9ce6454dce8560ab33dc8434b | [
"MIT"
] | null | null | null | from typing import List
from task1.const import ALPHABET, SYLLABLE_LEN
def swap(s: str, i: int, j: int) -> str:
str_list = list(s)
str_list[i], str_list[j] = str_list[j], str_list[i]
return ''.join(str_list)
def preprocess(text: str) -> str:
return ''.join(ch for ch in text.lower() if ch in ALPHAB... | 24.052632 | 80 | 0.669584 | from typing import List
from task1.const import ALPHABET, SYLLABLE_LEN
def swap(s: str, i: int, j: int) -> str:
str_list = list(s)
str_list[i], str_list[j] = str_list[j], str_list[i]
return ''.join(str_list)
def preprocess(text: str) -> str:
return ''.join(ch for ch in text.lower() if ch in ALPHAB... | true | true |
f760fb704f168118c315c72f94b289cfdfba5dc8 | 5,464 | py | Python | Program_python/Guibill/GuiBill_run.py | pection-zz/MNfurniture | f7ee4940a9a177bd5e83ffd320fefc1c8a496f4d | [
"MIT"
] | null | null | null | Program_python/Guibill/GuiBill_run.py | pection-zz/MNfurniture | f7ee4940a9a177bd5e83ffd320fefc1c8a496f4d | [
"MIT"
] | null | null | null | Program_python/Guibill/GuiBill_run.py | pection-zz/MNfurniture | f7ee4940a9a177bd5e83ffd320fefc1c8a496f4d | [
"MIT"
] | 1 | 2020-11-24T18:12:59.000Z | 2020-11-24T18:12:59.000Z | import PySimpleGUI as sg
import cv2
from creategui import changedicttolist, CreateTablegui, Data_template
from resizefill import resize, xyaxis
from PIL import ImageFont, ImageDraw, Image
import tldextract
import subprocess
import platform
import argparse
import yaml
import imutils
import datetime
config_vals = ""
wit... | 40.474074 | 144 | 0.606332 | import PySimpleGUI as sg
import cv2
from creategui import changedicttolist, CreateTablegui, Data_template
from resizefill import resize, xyaxis
from PIL import ImageFont, ImageDraw, Image
import tldextract
import subprocess
import platform
import argparse
import yaml
import imutils
import datetime
config_vals = ""
wit... | true | true |
f760fbae35276246fbe49a7737b56b32998e106f | 452 | py | Python | day7a.py | lukesdm/aoc-2021 | 8891eebdc8e24d75bc2eb1e1ef7655e9498e97f1 | [
"Unlicense"
] | null | null | null | day7a.py | lukesdm/aoc-2021 | 8891eebdc8e24d75bc2eb1e1ef7655e9498e97f1 | [
"Unlicense"
] | null | null | null | day7a.py | lukesdm/aoc-2021 | 8891eebdc8e24d75bc2eb1e1ef7655e9498e97f1 | [
"Unlicense"
] | null | null | null | import math
def totalDist(crabs, pos):
total = 0
for crab in crabs:
total += abs(crab - pos)
return total
input = None
filename = "day7-input.txt" # "day7-sample.txt"
with open(filename) as reader:
input = reader.read()
crabs = list(map(int, input.strip().split(",")))
cmin, cmax = min(crabs)... | 20.545455 | 49 | 0.64823 | import math
def totalDist(crabs, pos):
total = 0
for crab in crabs:
total += abs(crab - pos)
return total
input = None
filename = "day7-input.txt" with open(filename) as reader:
input = reader.read()
crabs = list(map(int, input.strip().split(",")))
cmin, cmax = min(crabs), max(crabs)
fuelMi... | true | true |
f760fbd3d789e0d141f0a3147e216729b5e25034 | 2,355 | py | Python | conftest.py | yulgul/ui_moodle_tests | bac8c09a45638dbe1ca8b8fd8af4a701d0ee4660 | [
"Apache-2.0"
] | null | null | null | conftest.py | yulgul/ui_moodle_tests | bac8c09a45638dbe1ca8b8fd8af4a701d0ee4660 | [
"Apache-2.0"
] | null | null | null | conftest.py | yulgul/ui_moodle_tests | bac8c09a45638dbe1ca8b8fd8af4a701d0ee4660 | [
"Apache-2.0"
] | null | null | null | import logging
import allure
import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from models.auth import AuthData
from pages.app import Application
logger = logging.getLogger("moodle")
@pytest.fixture(scope="s... | 26.460674 | 74 | 0.623779 | import logging
import allure
import pytest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from models.auth import AuthData
from pages.app import Application
logger = logging.getLogger("moodle")
@pytest.fixture(scope="s... | true | true |
f760fcd302d371665d0f7ed29425c138cfd79a26 | 2,107 | py | Python | util/generate_quadrature_macros.py | Andlon/crest | f79bf5a68f3eb86f5e3422881678bc6f9011730a | [
"MIT"
] | null | null | null | util/generate_quadrature_macros.py | Andlon/crest | f79bf5a68f3eb86f5e3422881678bc6f9011730a | [
"MIT"
] | 5 | 2017-01-24T10:45:27.000Z | 2017-01-27T16:21:37.000Z | util/generate_quadrature_macros.py | Andlon/crest | f79bf5a68f3eb86f5e3422881678bc6f9011730a | [
"MIT"
] | null | null | null | # Utility script to generate macros from
# the triangle quadrature rules retrieved from the appendix of
# F.D. Witherden, , P.E. Vincent, "On the identification of symmetric quadrature rules for finite element methods"
# Department of Aeronautics, Imperial College London, SW7 2AZ, United Kingdom
import sys
from pathli... | 27.363636 | 132 | 0.602278 |
import sys
from pathlib import PurePath
import re
def align_numeric_string(s, width):
if s[0] == '-':
return s.ljust(width)
else:
return " " + s.ljust(width - 1)
pattern = """
MAKE_QUADRATURE_RULE(STRENGTH, NUM,
({ X }),
({ Y }),
({ W })
)
"""
def make_macro(strength, num, ... | true | true |
f760fcf244f437a813a5a4d4e6acbc1dee47753c | 3,946 | py | Python | stellar_sdk/operation/manage_sell_offer.py | Shaptic/py-stellar-base | f5fa47f4d96f215889d99249fb25c7be002f5cf3 | [
"Apache-2.0"
] | null | null | null | stellar_sdk/operation/manage_sell_offer.py | Shaptic/py-stellar-base | f5fa47f4d96f215889d99249fb25c7be002f5cf3 | [
"Apache-2.0"
] | 27 | 2022-01-12T10:55:38.000Z | 2022-03-28T01:38:24.000Z | stellar_sdk/operation/manage_sell_offer.py | Shaptic/py-stellar-base | f5fa47f4d96f215889d99249fb25c7be002f5cf3 | [
"Apache-2.0"
] | 2 | 2021-12-02T12:42:03.000Z | 2021-12-07T20:53:10.000Z | from decimal import Decimal
from typing import Optional, Union
from .. import xdr as stellar_xdr
from ..asset import Asset
from ..muxed_account import MuxedAccount
from ..price import Price
from ..type_checked import type_checked
from ..utils import raise_if_not_valid_amount
from .operation import Operation
__all__ =... | 36.878505 | 132 | 0.674607 | from decimal import Decimal
from typing import Optional, Union
from .. import xdr as stellar_xdr
from ..asset import Asset
from ..muxed_account import MuxedAccount
from ..price import Price
from ..type_checked import type_checked
from ..utils import raise_if_not_valid_amount
from .operation import Operation
__all__ =... | true | true |
f760fea132fbb78cd8da795ab5fbfa38ea1d2295 | 7,143 | py | Python | netbox/dcim/models/power.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | 2 | 2021-06-02T03:00:05.000Z | 2021-07-30T18:52:32.000Z | netbox/dcim/models/power.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | null | null | null | netbox/dcim/models/power.py | esljaz/netbox | e7f64334c06748b4b85c54d881f5e2b03b9463b5 | [
"Apache-2.0"
] | 1 | 2020-09-16T11:31:25.000Z | 2020-09-16T11:31:25.000Z | from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.urls import reverse
from taggit.managers import TaggableManager
from dcim.choices import *
f... | 30.012605 | 109 | 0.643287 | from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.urls import reverse
from taggit.managers import TaggableManager
from dcim.choices import *
f... | true | true |
f760fffd85e908239fd6171370adc4cb3427927a | 2,588 | py | Python | gibbon/fem/_score_point.py | Huxx0804/gibbon_lib | b1f4e565f336f6ce7399f6e5e8e10392d5712dea | [
"MIT"
] | null | null | null | gibbon/fem/_score_point.py | Huxx0804/gibbon_lib | b1f4e565f336f6ce7399f6e5e8e10392d5712dea | [
"MIT"
] | null | null | null | gibbon/fem/_score_point.py | Huxx0804/gibbon_lib | b1f4e565f336f6ce7399f6e5e8e10392d5712dea | [
"MIT"
] | 1 | 2021-10-20T06:14:08.000Z | 2021-10-20T06:14:08.000Z | import uuid
import numpy as np
from shapely.geometry import Point, LineString
from ._finite_cell import FiniteCell
class ScorePoint:
def __init__(
self,
coords: list,
value: float = 1,
influence_range: float = 2000
):
self.uuid = str(uuid.uuid4())
self.value = v... | 28.43956 | 67 | 0.671561 | import uuid
import numpy as np
from shapely.geometry import Point, LineString
from ._finite_cell import FiniteCell
class ScorePoint:
def __init__(
self,
coords: list,
value: float = 1,
influence_range: float = 2000
):
self.uuid = str(uuid.uuid4())
self.value = v... | true | true |
f76100b23c42f624edc8c9ec47a75bf6b2982ecd | 5,049 | py | Python | cloudkittyclient/common/base.py | sreenathmenon/cloudkittyclient-0.5.1d13 | 316de1186f4345e4a249f58eb15d6a2d02a931d3 | [
"Apache-2.0"
] | null | null | null | cloudkittyclient/common/base.py | sreenathmenon/cloudkittyclient-0.5.1d13 | 316de1186f4345e4a249f58eb15d6a2d02a931d3 | [
"Apache-2.0"
] | null | null | null | cloudkittyclient/common/base.py | sreenathmenon/cloudkittyclient-0.5.1d13 | 316de1186f4345e4a249f58eb15d6a2d02a931d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# Copyright 2015 Objectif Libre
# 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/license... | 28.851429 | 79 | 0.617152 |
import copy
from six.moves.urllib import parse
from cloudkittyclient import exc
from cloudkittyclient.i18n import _
from cloudkittyclient.openstack.common.apiclient import base
def getid(obj):
try:
return obj.id
except AttributeError:
return obj
class Manager(object):
resource_class ... | true | true |
f76102479db2700705c9c90c065137db2e03f278 | 1,569 | py | Python | bigml/tests/test_21_projects.py | javinp/python | bdec1e206ed028990503ed4bebcbc7023d3ff606 | [
"Apache-2.0"
] | null | null | null | bigml/tests/test_21_projects.py | javinp/python | bdec1e206ed028990503ed4bebcbc7023d3ff606 | [
"Apache-2.0"
] | null | null | null | bigml/tests/test_21_projects.py | javinp/python | bdec1e206ed028990503ed4bebcbc7023d3ff606 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2015 BigML
#
# 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... | 30.764706 | 75 | 0.670491 |
""" Testing projects REST api calls
"""
from world import world, setup_module, teardown_module
import create_project_steps as create
import delete_project_steps as delete
class Test_projects(object):
def setup(self):
"""
Debug information
"""
print "\n-------------------\nT... | false | true |
f761029a623b7455779cdd89d071df88d82a184f | 2,302 | py | Python | src/bin/shipyard_airflow/shipyard_airflow/dags/relabel_nodes.py | openvdro/airship-shipyard | bae15294c534cf321f5c7ca37592dfa74c4ad7c2 | [
"Apache-2.0"
] | 12 | 2018-05-18T18:59:23.000Z | 2019-05-10T12:31:44.000Z | src/bin/shipyard_airflow/shipyard_airflow/dags/relabel_nodes.py | openvdro/airship-shipyard | bae15294c534cf321f5c7ca37592dfa74c4ad7c2 | [
"Apache-2.0"
] | 4 | 2021-07-28T14:36:57.000Z | 2022-03-22T16:39:23.000Z | src/bin/shipyard_airflow/shipyard_airflow/dags/relabel_nodes.py | openvdro/airship-shipyard | bae15294c534cf321f5c7ca37592dfa74c4ad7c2 | [
"Apache-2.0"
] | 9 | 2018-05-18T16:42:41.000Z | 2019-04-18T20:12:14.000Z | # Copyright 2018 AT&T Intellectual Property. All other 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... | 34.358209 | 77 | 0.765856 | from datetime import timedelta
import airflow
from airflow import DAG
try:
from common_step_factory import CommonStepFactory
except ImportError:
from shipyard_airflow.dags.common_step_factory import CommonStepFactory
PARENT_DAG_NAME = 'relabel_nodes'
default_args = {
'owner': 'airflow',
'depends_on... | true | true |
f76102ee9fd463b59a7fd78952a4e374c33654b7 | 9,026 | py | Python | selfdrive/controls/lib/driver_monitor.py | jordanmkoncz/openpilot | 7502daf28ff6f217de67f5bc1139eac79a4fa6a6 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/driver_monitor.py | jordanmkoncz/openpilot | 7502daf28ff6f217de67f5bc1139eac79a4fa6a6 | [
"MIT"
] | null | null | null | selfdrive/controls/lib/driver_monitor.py | jordanmkoncz/openpilot | 7502daf28ff6f217de67f5bc1139eac79a4fa6a6 | [
"MIT"
] | null | null | null | import numpy as np
from common.realtime import DT_CTRL, DT_DMON
from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET
from common.filter_simple import FirstOrderFilter
from common.stat_live import RunningStatFilter
_AWARENESS_TIME = 100. # 1.6 minutes limit without user touching steering whe... | 42.777251 | 161 | 0.749501 | import numpy as np
from common.realtime import DT_CTRL, DT_DMON
from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET
from common.filter_simple import FirstOrderFilter
from common.stat_live import RunningStatFilter
_AWARENESS_TIME = 100. _AWARENESS_PRE_TIME_TILL_TERMINAL = 25. _AWARENESS_PR... | true | true |
f7610324861f244c5194d357c599b0bc0238d1a5 | 14,715 | py | Python | contrib/profiler/profiler.py | wutb15/pai | 649200b70fac69e9f33bdd10b50995761eeb8bbe | [
"MIT"
] | 1 | 2020-01-03T08:13:14.000Z | 2020-01-03T08:13:14.000Z | contrib/profiler/profiler.py | wutb15/pai | 649200b70fac69e9f33bdd10b50995761eeb8bbe | [
"MIT"
] | null | null | null | contrib/profiler/profiler.py | wutb15/pai | 649200b70fac69e9f33bdd10b50995761eeb8bbe | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to ... | 41.450704 | 120 | 0.64791 |
import pynvml as nv
import numpy as np
import glob
import csv
import os
import time
import argparse
from utils import Sample
from utils import Adviser
from utils import print_process
from utils import SlideWindows
from utils import GPU_INFO_OFFSET
from utils import INFO_NUM_PER_GPU
from utils import GPU_MEM_OFFSET
... | true | true |
f761034020a789cb53efee28075efc3af207a34b | 1,840 | py | Python | ops/tc_reordering.py | kiyoon/TDN | 2015c13994324b200cbe560de1ec663676900917 | [
"Apache-2.0"
] | null | null | null | ops/tc_reordering.py | kiyoon/TDN | 2015c13994324b200cbe560de1ec663676900917 | [
"Apache-2.0"
] | null | null | null | ops/tc_reordering.py | kiyoon/TDN | 2015c13994324b200cbe560de1ec663676900917 | [
"Apache-2.0"
] | null | null | null | def TC_idx(T):
"""
Returns TC Reordering indices.
When channels are ordered like (1R 1G 1B 2R 2G 2B 3R 3G 3B 4R ...),
Returns indices to make it (1R 2R 3R 2G 3G 4G 3B 4B 5B 4R 5R 6R ...).
"""
assert T >= 3
idx_3frame = [0, 3, 6, 4, 7, 10, 8, 11, 14] # (1R 2R 3R) (2G 3G 4G) (3B 4B 5B)
rep... | 32.280702 | 106 | 0.59837 | def TC_idx(T):
assert T >= 3
idx_3frame = [0, 3, 6, 4, 7, 10, 8, 11, 14] repeat = T//3 + (T%3>0) idx = []
for i in range(repeat):
idx.extend(map(lambda x: x+9*i, idx_3frame))
idx = idx[:T*3] def frame_limit(x):
while x >= T*3:
x -= 3
return x
idx = li... | true | true |
f7610420f3cae75b3b9d0169cdf9f686ba220b80 | 4,769 | py | Python | neural-navigation-with-lstm/MARCO/plastk/examples/gngsom.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | 14 | 2016-04-03T19:25:13.000Z | 2022-01-05T07:03:07.000Z | neural-navigation-with-lstm/MARCO/plastk/examples/gngsom.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | null | null | null | neural-navigation-with-lstm/MARCO/plastk/examples/gngsom.py | ronaldahmed/SLAM-for-ugv | 52e3241b8b737a0cfe5682c0aa87ec8c27d6a33d | [
"MIT"
] | 5 | 2018-06-21T12:58:58.000Z | 2020-02-15T05:33:39.000Z | """
GNG vs SOM comparison example for PLASTK.
This script shows how to:
- Train PLASTK vector quantizers (SOM and GNG)
- Set default parameters
- Create a simple agent and environment.
- Run an interaction between the agent and the environment
with a GUI.
$Id: gngsom.py,v 1.3 2006/02/17 19:40:09 jp Exp $
... | 29.257669 | 79 | 0.662403 |
from plastk import *
from plastk.vq.som import SOM,SOM2DDisplay
from plastk.vq.gng import EquilibriumGNG, GNG2DDisplay
import pdb
SOM.xdim = 10
SOM.ydim = 10
SOM.dim = 2
EquilibriumGNG.dim = 2
EquilibriumGNG.rmin = 0
EquilibriumGNG.rmax = 100
EquilibriumGNG.error_threshold = 0.002
EquilibriumGNG.lambda_ = 200... | true | true |
f7610617ef50dc44da6170d8ccfe655cb524d545 | 2,724 | py | Python | pyzoo/zoo/examples/anomalydetection/anomaly_detection.py | abdolence/analytics-zoo | 364856abcbe9aff7f7b6cf9b9f8648d51e07ca64 | [
"Apache-2.0"
] | 1 | 2019-04-10T07:16:17.000Z | 2019-04-10T07:16:17.000Z | pyzoo/zoo/examples/anomalydetection/anomaly_detection.py | abdolence/analytics-zoo | 364856abcbe9aff7f7b6cf9b9f8648d51e07ca64 | [
"Apache-2.0"
] | 3 | 2018-10-19T08:30:38.000Z | 2018-10-19T08:32:12.000Z | pyzoo/zoo/examples/anomalydetection/anomaly_detection.py | abdolence/analytics-zoo | 364856abcbe9aff7f7b6cf9b9f8648d51e07ca64 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 42.5625 | 99 | 0.694934 |
from zoo.common.nncontext import init_nncontext
from zoo.models.anomalydetection import AnomalyDetector
import pandas as pd
from pyspark.sql import SQLContext
from pyspark import sql
from optparse import OptionParser
import sys
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("--input_dir"... | true | true |
f761069de6ed21372fce7deb724e15a580ce92bf | 1,763 | py | Python | lispat_app/lispat/bin/rst2odt_prepstyles.py | ZugNZwang/LISPAT | 16f49197a5e598b224374094a22f28989c31302c | [
"MIT"
] | null | null | null | lispat_app/lispat/bin/rst2odt_prepstyles.py | ZugNZwang/LISPAT | 16f49197a5e598b224374094a22f28989c31302c | [
"MIT"
] | 2 | 2021-03-31T19:17:42.000Z | 2021-12-13T20:09:27.000Z | lispat_app/lispat/bin/rst2odt_prepstyles.py | ericholguin/LISPAT | 16f49197a5e598b224374094a22f28989c31302c | [
"MIT"
] | null | null | null | #!/Users/joshuabrummet/workspace/senior-design/LISPAT/lispat_app/lispat/bin/python3
# $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Fix a word-processor-generated styles.odt for odtwriter us... | 25.926471 | 83 | 0.646058 |
from lxml import etree
import sys
import zipfile
from tempfile import mkstemp
import shutil
import os
NAMESPACES = {
"style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
"fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
}
def prepstyle(filename):
zin = zipfile.ZipFile(fil... | true | true |
f7610762d6450042acbe9c28f894b2ebf66f699d | 11,996 | py | Python | rsmatic.py | peitur/colag | 7ffefaa1a622a12718e94439f77b6e47db7c4452 | [
"MIT"
] | 1 | 2019-09-02T18:28:07.000Z | 2019-09-02T18:28:07.000Z | rsmatic.py | peitur/colag | 7ffefaa1a622a12718e94439f77b6e47db7c4452 | [
"MIT"
] | 5 | 2019-01-05T12:51:37.000Z | 2021-11-12T10:53:13.000Z | rsmatic.py | peitur/colag | 7ffefaa1a622a12718e94439f77b6e47db7c4452 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys,re,os,re, datetime
import subprocess, shlex
# import requests
import json
import hashlib
import getopt
from datetime import datetime
from pprint import pprint
from pathlib import Path
################################################################################
## Hashing large f... | 30.917526 | 112 | 0.47149 |
import sys,re,os,re, datetime
import subprocess, shlex
import json
import hashlib
import getopt
from datetime import datetime
from pprint import pprint
from pathlib import Path
def file_hash( filename, chksum="sha256" ):
BLOCKSIZE = 65536
if chksum == "sha1":
hasher = hashlib.sha1()
elif chksum ... | true | true |
f76107b415ed5842a6276ecbcad06436e6118eb1 | 1,121 | py | Python | application/utils/auth.py | MilitaryCheese/Cryptojacking-Attack-Detection-System | 9a04b3e3ad03e8d4f4e41cbd6b158674f3fd4c0e | [
"MIT"
] | 1 | 2021-07-15T08:10:20.000Z | 2021-07-15T08:10:20.000Z | application/utils/auth.py | MilitaryCheese/Cryptojacking-Attack-Detection-System | 9a04b3e3ad03e8d4f4e41cbd6b158674f3fd4c0e | [
"MIT"
] | null | null | null | application/utils/auth.py | MilitaryCheese/Cryptojacking-Attack-Detection-System | 9a04b3e3ad03e8d4f4e41cbd6b158674f3fd4c0e | [
"MIT"
] | null | null | null | from functools import wraps
from flask import request, g, jsonify
from itsdangerous import (
TimedJSONWebSignatureSerializer as Serializer,
SignatureExpired,
BadSignature,
)
from index import app
TWO_WEEKS = 1209600
def generate_token(user, expiration=TWO_WEEKS):
s = Serializer(app.config["SECRET_KEY... | 24.911111 | 82 | 0.634255 | from functools import wraps
from flask import request, g, jsonify
from itsdangerous import (
TimedJSONWebSignatureSerializer as Serializer,
SignatureExpired,
BadSignature,
)
from index import app
TWO_WEEKS = 1209600
def generate_token(user, expiration=TWO_WEEKS):
s = Serializer(app.config["SECRET_KEY... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.