hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c6eccfdb298372c43ab31d736f39af58a37263c | 1,745 | py | Python | sdk/automation/azure-mgmt-automation/tests/test_cli_mgmt_automation.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/automation/azure-mgmt-automation/tests/test_cli_mgmt_automation.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/automation/azure-mgmt-automation/tests/test_cli_mgmt_automation.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | 30.086207 | 118 | 0.637822 |
1c6ed0ea115b9928e476e4b60bac4d064a35991f | 8,456 | py | Python | backend/sales/views.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/sales/views.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/sales/views.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | from rest_framework import generics
from rest_framework import mixins
from django.http import Http404, HttpResponseBadRequest, HttpResponse, JsonResponse
from django.db.models import Sum
import json
from article.helpers import ArticleDictParsers
from crm.helpers import CRMDictParsers
from money.serializers import Mone... | 42.28 | 117 | 0.68815 |
1c6ed5f946ce04367591806862ede0315b3af1f5 | 76,706 | py | Python | backend/config_app/config_decider_ensemble/config_app_routes.py | co-demos/apiviz-backend | 8a86b92dce728e81c1c935427b890da590edd720 | [
"MIT"
] | 1 | 2019-12-17T22:31:00.000Z | 2019-12-17T22:31:00.000Z | backend/config_app/config_decider_ensemble/config_app_routes.py | co-demos/apiviz-backend | 8a86b92dce728e81c1c935427b890da590edd720 | [
"MIT"
] | 10 | 2019-05-28T19:57:28.000Z | 2021-06-01T23:46:00.000Z | backend/config_app/config_decider_ensemble/config_app_routes.py | co-demos/apiviz-backend | 8a86b92dce728e81c1c935427b890da590edd720 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from . import version, uuid_models
### ROUTES / PAGES
default_routes_config = [
### - - - - - - - - - - - - - - - - - - - ###
### CONFIG DECIDER ENSEMBLE
### - - - - - - - - - - - - - - - - - - - ###
### - - - - - - - - - - - - - - - - - ###
### PAGES : HOME --> NEED AT L... | 43.533485 | 307 | 0.433525 |
1c6f1ac098431de72f632fcdf5a38044684070d4 | 105,084 | py | Python | src/borg/archive.py | CyberFlameGO/borg | cf4a1abb87014acd38ada22a807382393513a5d9 | [
"BSD-3-Clause"
] | null | null | null | src/borg/archive.py | CyberFlameGO/borg | cf4a1abb87014acd38ada22a807382393513a5d9 | [
"BSD-3-Clause"
] | null | null | null | src/borg/archive.py | CyberFlameGO/borg | cf4a1abb87014acd38ada22a807382393513a5d9 | [
"BSD-3-Clause"
] | null | null | null | import json
import os
import socket
import stat
import sys
import time
from collections import OrderedDict
from contextlib import contextmanager
from datetime import datetime, timezone, timedelta
from functools import partial
from getpass import getuser
from io import BytesIO
from itertools import groupby, zip_longest
... | 46.190769 | 148 | 0.590823 |
1c6f4d3ff1a9b7a61c8a6690cbe63c10c1c0c398 | 19,204 | py | Python | qgrad/qgrad_qutip.py | quantshah/qgrad | db13e8463de49a8df1bf59524bc1b0a875405ee9 | [
"BSD-3-Clause"
] | 37 | 2020-07-10T14:06:21.000Z | 2022-03-29T01:40:48.000Z | qgrad/qgrad_qutip.py | quantshah/qgrad | db13e8463de49a8df1bf59524bc1b0a875405ee9 | [
"BSD-3-Clause"
] | 65 | 2020-06-11T16:24:29.000Z | 2021-07-16T12:41:47.000Z | qgrad/qgrad_qutip.py | quantshah/qgrad | db13e8463de49a8df1bf59524bc1b0a875405ee9 | [
"BSD-3-Clause"
] | 10 | 2020-06-09T06:13:39.000Z | 2021-07-02T11:52:37.000Z | """
Implementation of some common quantum mechanics functions that work with JAX
"""
from jax.ops import index, index_update
import jax.numpy as jnp
from jax.random import PRNGKey, uniform
import numpy as np
from scipy.linalg import expm, sqrtm
from numpy.linalg import matrix_power
def fidelity(a, b):
"""Computes... | 30.924316 | 108 | 0.580035 |
1c6f54e338901a6c5d5c867db76d41d277cc88a6 | 5,698 | py | Python | komics/polish.py | FreBio/komics | 3af2d968f7864d5f3767983b236660f268f8d0c0 | [
"OLDAP-2.2.1"
] | 2 | 2021-10-04T14:10:32.000Z | 2021-11-10T11:59:39.000Z | komics/polish.py | FreBio/komics | 3af2d968f7864d5f3767983b236660f268f8d0c0 | [
"OLDAP-2.2.1"
] | 2 | 2021-10-20T11:21:22.000Z | 2022-03-29T13:47:28.000Z | komics/polish.py | FreBio/komics | 3af2d968f7864d5f3767983b236660f268f8d0c0 | [
"OLDAP-2.2.1"
] | 1 | 2020-06-11T10:05:32.000Z | 2020-06-11T10:05:32.000Z | import re
import os
import sys
import subprocess
from collections import defaultdict
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
class Error (Exception): pass
class Polisher:
def __init__(self,
out,
fasta,
minidentity,
csb1mer,
... | 38.5 | 159 | 0.569849 |
1c6f6e848d487bca313bca790ba8af148d946bf4 | 106,690 | py | Python | src/olympia/addons/tests/test_views.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-07-27T11:22:17.000Z | 2020-07-27T11:22:17.000Z | src/olympia/addons/tests/test_views.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | src/olympia/addons/tests/test_views.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from unittest import mock
from django.test.utils import override_settings
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode, urlunquote
import pytest
from elasticsearch import Elasticsearch
from unittest.mock import patc... | 41.384794 | 79 | 0.617752 |
1c6f742ff7bb6409fa5b1d806e2433034d2aa878 | 1,096 | py | Python | distillation/build_student.py | fengxiaoshuai/CNN_model_optimizer | 4c48420989ffe31a4075d36a5133fee0d999466a | [
"Apache-2.0"
] | null | null | null | distillation/build_student.py | fengxiaoshuai/CNN_model_optimizer | 4c48420989ffe31a4075d36a5133fee0d999466a | [
"Apache-2.0"
] | 1 | 2021-01-05T10:41:24.000Z | 2021-01-05T10:41:24.000Z | distillation/build_student.py | fengxiaoshuai/CNN_model_optimizer | 4c48420989ffe31a4075d36a5133fee0d999466a | [
"Apache-2.0"
] | 1 | 2020-08-07T02:56:20.000Z | 2020-08-07T02:56:20.000Z | import tensorflow as tf
import numpy as np
with tf.variable_scope("student"):
input_label = tf.placeholder(dtype=tf.float32, shape=[10, 10], name="label")
input_image = tf.placeholder(dtype=tf.float32, shape=[10, 224, 224, 3], name="input")
conv1 = tf.layers.conv2d(inputs=input_image, filters=64, kernel_s... | 40.592593 | 96 | 0.681569 |
1c6f90911abaca5c39f4c650dc25390d4d28f324 | 288 | py | Python | test/make_a_wiki.py | funkyeah/tiddlyweb | 2346e6c05aa03ae9c8f2687d9ef9e46103267a8e | [
"BSD-3-Clause"
] | 1 | 2016-05-09T15:26:17.000Z | 2016-05-09T15:26:17.000Z | test/make_a_wiki.py | funkyeah/tiddlyweb | 2346e6c05aa03ae9c8f2687d9ef9e46103267a8e | [
"BSD-3-Clause"
] | null | null | null | test/make_a_wiki.py | funkyeah/tiddlyweb | 2346e6c05aa03ae9c8f2687d9ef9e46103267a8e | [
"BSD-3-Clause"
] | null | null | null |
import sys
sys.path.append('.')
from tiddlyweb.model.recipe import Recipe
from tiddlyweb.serializer import Serializer
from fixtures import recipe_list
recipe = Recipe(name='testrecipe')
recipe.set_recipe(recipe_list)
ser = Serializer('wiki')
ser.object = recipe
print ser.to_string()
| 19.2 | 43 | 0.791667 |
1c6fde406b542177c274a0d3f36d0593fb457198 | 2,483 | py | Python | scripts/plot_slices.py | gemini3d/pygemini | 4fbc15f3aa17c85de44d6f86ad37dc930644c8d1 | [
"Apache-2.0"
] | 4 | 2020-12-08T15:59:31.000Z | 2021-09-22T02:49:11.000Z | example/plot_slices.py | gemini3d/PyGemini | ef5be10eb6b25814e40698b05c684dbe65b9fbd9 | [
"Apache-2.0"
] | 8 | 2021-02-11T19:32:41.000Z | 2022-03-13T19:55:29.000Z | example/plot_slices.py | gemini3d/PyGemini | ef5be10eb6b25814e40698b05c684dbe65b9fbd9 | [
"Apache-2.0"
] | 1 | 2021-07-19T23:31:47.000Z | 2021-07-19T23:31:47.000Z | #!/usr/bin/env python3
"""
NOTE: this is made for very basic plots. The axes quantities are notional and not scaled.
"""
from pathlib import Path
import argparse
from matplotlib.pyplot import figure, show, close
import gemini3d.plot.slices as slices
import gemini3d.find as find
import gemini3d.read as read
if __na... | 28.872093 | 89 | 0.501007 |
1c6ff3fec3ae57f1515efc319163782e44e1d66a | 2,208 | py | Python | glimix_core/cov/_linear.py | Horta/limix-inference | 1ba102fc544f8d307412d361b574da9d4c166f8e | [
"MIT"
] | 7 | 2019-06-10T12:27:25.000Z | 2021-07-23T16:36:04.000Z | glimix_core/cov/_linear.py | Horta/limix-inference | 1ba102fc544f8d307412d361b574da9d4c166f8e | [
"MIT"
] | 12 | 2017-05-28T10:59:31.000Z | 2021-05-17T20:11:00.000Z | glimix_core/cov/_linear.py | Horta/limix-inference | 1ba102fc544f8d307412d361b574da9d4c166f8e | [
"MIT"
] | 5 | 2017-08-27T20:13:45.000Z | 2022-02-14T06:33:14.000Z | from numpy import exp, log
from optimix import Function, Scalar
from .._util import format_function
class LinearCov(Function):
"""
Linear covariance function, K = s⋅XXᵀ.
The mathematical representation is s⋅XXᵀ, for a n×r matrix X provided by the user
and a scaling parameter s.
Example
----... | 21.230769 | 85 | 0.506793 |
1c7001e25d56dae37476f14185c1710ba6996b8b | 7,403 | py | Python | ingestion/src/metadata/ingestion/source/database/bigquery.py | codingwithabhi/OpenMetadata | 196b023643cbb8cd3be11294c7b40aa9aaf8e88b | [
"Apache-2.0"
] | null | null | null | ingestion/src/metadata/ingestion/source/database/bigquery.py | codingwithabhi/OpenMetadata | 196b023643cbb8cd3be11294c7b40aa9aaf8e88b | [
"Apache-2.0"
] | null | null | null | ingestion/src/metadata/ingestion/source/database/bigquery.py | codingwithabhi/OpenMetadata | 196b023643cbb8cd3be11294c7b40aa9aaf8e88b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... | 37.201005 | 101 | 0.640686 |
1c701248f620551562c202a666c0a174f7ca85c3 | 221 | py | Python | modulo 4/potencia.py | antonio343/clase | fda04a606246695aa5d93c8b2b5e2890a16d5973 | [
"MIT"
] | null | null | null | modulo 4/potencia.py | antonio343/clase | fda04a606246695aa5d93c8b2b5e2890a16d5973 | [
"MIT"
] | null | null | null | modulo 4/potencia.py | antonio343/clase | fda04a606246695aa5d93c8b2b5e2890a16d5973 | [
"MIT"
] | null | null | null | def potencia(base,exponente):
if exponente <0:
return 1/potencia(base,-exponente)
if exponente ==0:
return 1
else:
return base*potencia(base,exponente-1)
print( potencia(5,3)) | 20.090909 | 46 | 0.606335 |
1c70130ea65acb4754bb62330304ae2dd0de45a6 | 8,156 | py | Python | fabric_cf/actor/core/apis/abc_kernel_reservation.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | null | null | null | fabric_cf/actor/core/apis/abc_kernel_reservation.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | 67 | 2020-12-21T15:39:49.000Z | 2022-02-27T17:55:00.000Z | fabric_cf/actor/core/apis/abc_kernel_reservation.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# 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 ... | 27.277592 | 87 | 0.644679 |
1c703d19430e56574632e85698c57a7c0491ccd4 | 52,780 | py | Python | vnpy/app/cta_strategy_pro/template_spread.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 1 | 2020-03-28T10:09:49.000Z | 2020-03-28T10:09:49.000Z | vnpy/app/cta_strategy_pro/template_spread.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | null | null | null | vnpy/app/cta_strategy_pro/template_spread.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 1 | 2020-04-03T10:43:31.000Z | 2020-04-03T10:43:31.000Z | # 套利模板
# 华富资产 @ 李来佳
import os
import traceback
from copy import copy
from vnpy.trader.utility import append_data
from .template import (
CtaPosition,
CtaGridTrade,
CtaGrid,
CtaTemplate,
Direction,
datetime,
Offset,
OrderType,
OrderData,
TradeData,
Status,
StopOrder
)
c... | 43.983333 | 112 | 0.538518 |
1c703da59eaa26b26d988d6b2cf36fee45a6562c | 14,019 | py | Python | tests/app/service/test_send_one_off_notification.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | tests/app/service/test_send_one_off_notification.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | tests/app/service/test_send_one_off_notification.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | import uuid
from unittest.mock import Mock
import pytest
from notifications_utils import SMS_CHAR_COUNT_LIMIT
from notifications_utils.recipients import InvalidPhoneError
from app.dao.service_safelist_dao import dao_add_and_commit_safelisted_contacts
from app.models import (
EMAIL_TYPE,
KEY_TYPE_NORMAL,
L... | 33.780723 | 124 | 0.717526 |
1c7051f0909f6b75e1adf2b016e9cb3826fb41d5 | 1,766 | py | Python | ansiblemetrics/playbook/num_fact_modules.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | 1 | 2020-04-24T16:09:14.000Z | 2020-04-24T16:09:14.000Z | ansiblemetrics/playbook/num_fact_modules.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | ansiblemetrics/playbook/num_fact_modules.py | radon-h2020/AnsibleMetrics | 8a8e27d9b54fc1578d00526c8663184a2e686cb2 | [
"Apache-2.0"
] | null | null | null | from ansiblemetrics.ansible_modules import FACT_MODULES_LIST
from ansiblemetrics.ansible_metric import AnsibleMetric
class NumFactModules(AnsibleMetric):
""" This class measures the number of fact modules in a playbook.
Fact modules are modules that do not alter state but rather return data.
Knowing the ... | 30.982456 | 117 | 0.60419 |
1c7056b29aa9216f03932fbd740c0468b7731925 | 2,363 | py | Python | scattertext/ScatterChartData.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | 1 | 2019-12-23T13:25:21.000Z | 2019-12-23T13:25:21.000Z | scattertext/ScatterChartData.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | null | null | null | scattertext/ScatterChartData.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | 1 | 2020-01-08T00:25:31.000Z | 2020-01-08T00:25:31.000Z | import numpy as np
from scattertext.termranking import AbsoluteFrequencyRanker
class ScatterChartData(object):
def __init__(self,
minimum_term_frequency=3,
minimum_not_category_term_frequency=0,
jitter=None,
seed=0,
pmi_threshold_coefficient=3,
... | 39.383333 | 98 | 0.735083 |
1c706601406e5eff6dda3d25b069db5bac5e15bc | 697 | py | Python | alipay/aop/api/response/AlipaySecurityDataInnerouterTestQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipaySecurityDataInnerouterTestQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipaySecurityDataInnerouterTestQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipaySecurityDataInnerouterTestQueryResponse(AlipayResponse):
def __init__(self):
super(AlipaySecurityDataInnerouterTestQueryResponse, self).__init__()
self._one = N... | 26.807692 | 118 | 0.707317 |
1c70a82c76b580eabdba4e9e83effccdc5e92bec | 1,451 | py | Python | examples.py | andychase/pipeless | 0b976a5a82197c8747312a0ce7c37b3eea4959b2 | [
"MIT"
] | 36 | 2015-05-20T16:14:53.000Z | 2021-03-22T09:38:35.000Z | examples.py | andychase/pipeless | 0b976a5a82197c8747312a0ce7c37b3eea4959b2 | [
"MIT"
] | 1 | 2015-06-02T09:05:27.000Z | 2016-04-20T15:45:23.000Z | examples.py | andychase/pipeless | 0b976a5a82197c8747312a0ce7c37b3eea4959b2 | [
"MIT"
] | 5 | 2015-07-10T23:19:19.000Z | 2019-04-02T12:53:54.000Z | """ Pipeless / examples.py. MIT licensed.
Basic functionality
>>> from pipeless import pipeline
>>> function, run, _ = pipeline(lambda item, e: None)
>>> @function
... def up_one(_): return _+1
>>> list(run([0, 1, 3]))
[1, 2, 4]
>>> @function
... def twofer(_):
... yield _
... yield _
>>> list(run([0, 1, 3]))
... | 21.984848 | 76 | 0.594762 |
1c70fcba8372bd6e2cde1fad47ed74a59e3a1ee3 | 1,030 | py | Python | sdks/python/test/test_ReleaseWithDistributionGroup.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_ReleaseWithDistributionGroup.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_ReleaseWithDistributionGroup.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 25.75 | 115 | 0.747573 |
1c711a561865ea6309f1b049e97cef809b20c03e | 4,645 | py | Python | datastructures/rangeQuery/basics_range_query.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | 10 | 2020-09-21T22:23:09.000Z | 2022-01-25T16:58:44.000Z | datastructures/rangeQuery/basics_range_query.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | datastructures/rangeQuery/basics_range_query.py | hariharanragothaman/pymaster | b3d033b4d5c75c69f587c94d9d12cd4a349a6a69 | [
"Apache-2.0"
] | null | null | null | """
The whole idea of rangeQueries is to get min(l, r) | max(l, r) | sum(l, r)
"""
arr = [1, 3, 8, 4, 6, 1, 3, 4]
def get_sum(arr, l, r):
total = 0
for i in range(l, r + 1):
total += arr[i]
return total
# Naive way of getting the sum
result = get_sum(arr, 3, 6)
print("Full parsing::The sum bet... | 26.542857 | 103 | 0.55845 |
1c713dca367999a6aa8c9381ae4b3cf300e67f36 | 1,858 | py | Python | test/runtime/operators_test/elementwise_add_test.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | test/runtime/operators_test/elementwise_add_test.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | test/runtime/operators_test/elementwise_add_test.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | import numpy as np
from test.util import generate_kernel_test_case, wrap_template
from webdnn.graph.graph import Graph
from webdnn.graph.order import OrderNHWC, OrderNCHW, OrderC
from webdnn.graph.variable import Variable
@wrap_template
def template(shape=(2, 3, 4, 5), x1_order=OrderNHWC, x2_order=OrderNHWC, y_order... | 29.03125 | 91 | 0.64747 |
1c716cda583e0b621545ddecac2e82afeae73b35 | 56,733 | py | Python | tests/test_io.py | abigailbishop/pyrex | 10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5 | [
"MIT"
] | 6 | 2018-06-19T16:01:35.000Z | 2020-05-21T20:02:53.000Z | tests/test_io.py | bhokansonfasig/pyrex | 8b2abc954f2cf4945424042f33847b783c72dcfa | [
"MIT"
] | 4 | 2018-01-19T14:52:33.000Z | 2021-09-02T17:20:07.000Z | tests/test_io.py | abigailbishop/pyrex | 10ba2e9f4c8820f4fcf5f00bd866927dacb0b2b5 | [
"MIT"
] | 5 | 2018-01-19T14:49:16.000Z | 2021-01-21T12:34:59.000Z | """File containing tests of pyrex io module"""
import pytest
from pyrex.io import HDF5Base, HDF5Reader, HDF5Writer, EventIterator, File, H5PY_V2_STRINGS
from pyrex.signals import Signal
from pyrex.antenna import Antenna
from pyrex.particle import Particle, Event
from pyrex.ray_tracing import RayTracer
import h5py
im... | 49.290182 | 109 | 0.593288 |
1c718145d39bdb477c08c45f27167b3ed98d986a | 17,875 | py | Python | NavPython/IronPython/Lib/tempfile.py | jstammers/EDMSuite | 2841c0edef32a496855ca41deaa0f710b017ae2f | [
"MIT"
] | 76 | 2015-12-20T16:56:37.000Z | 2021-12-13T09:40:48.000Z | NavPython/IronPython/Lib/tempfile.py | jstammers/EDMSuite | 2841c0edef32a496855ca41deaa0f710b017ae2f | [
"MIT"
] | 20 | 2015-04-20T12:09:12.000Z | 2022-03-12T01:25:04.000Z | NavPython/IronPython/Lib/tempfile.py | jstammers/EDMSuite | 2841c0edef32a496855ca41deaa0f710b017ae2f | [
"MIT"
] | 101 | 2016-05-20T16:04:12.000Z | 2022-01-31T01:01:08.000Z | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | 29.448105 | 78 | 0.623944 |
1c7191d63558874dda3e4ad953f3f939f5bdefea | 1,041 | py | Python | otp/level/LocatorEntity.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | otp/level/LocatorEntity.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | otp/level/LocatorEntity.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from otp.level import Entity, BasicEntities
from pandac.PandaModules import NodePath
from direct.directnotify import DirectNotifyGlobal
class LocatorEntity(Entity.Entity, NodePath):
notify = DirectNotifyGlobal.directNotify.newCategory('LocatorEntity')
def __init__(self, level, entId):
node = hidden.at... | 31.545455 | 85 | 0.644573 |
1c71e1c6d6e21ad17b6be87266f9d9a6c845620f | 2,331 | py | Python | blog/forms.py | WillieIlus/jobscorner | ed3734468ea0e88a306a1d29bc876562e940f4fb | [
"bzip2-1.0.6"
] | 2 | 2020-04-12T13:18:35.000Z | 2021-04-02T04:18:17.000Z | blog/forms.py | WillieIlus/jobscorner | ed3734468ea0e88a306a1d29bc876562e940f4fb | [
"bzip2-1.0.6"
] | 3 | 2020-02-11T23:58:53.000Z | 2020-09-06T18:46:17.000Z | blog/forms.py | WillieIlus/jobscorner | ed3734468ea0e88a306a1d29bc876562e940f4fb | [
"bzip2-1.0.6"
] | 1 | 2020-08-17T08:29:41.000Z | 2020-08-17T08:29:41.000Z | from builtins import super
from crispy_forms.bootstrap import InlineRadios
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Column, Layout, Row, Submit
from django import forms
from django.forms import ModelForm
from pagedown.widgets import PagedownWidget
from blog.models import STATUS_CHOIC... | 38.213115 | 113 | 0.612613 |
1c7207dd29699155018e8a73e520190271bf7f27 | 48 | py | Python | nn_analysis/acts/__init__.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | nn_analysis/acts/__init__.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | nn_analysis/acts/__init__.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | from .acts import Acts
from . import core, utils | 24 | 25 | 0.770833 |
1c72090066d6b012d8f935fa5d6e494554ca158a | 7,394 | py | Python | descriptor-packages/vnfd/videoServer_vnfd/charms/ansible-charm/lib/charms/sshproxy.py | beckrian/mano | a03088ab9a35fe4ab65a30587a6f0e0d72491434 | [
"Apache-2.0"
] | 1 | 2019-05-01T08:40:09.000Z | 2019-05-01T08:40:09.000Z | descriptor-packages/vnfd/videoServer_vnfd/charms/ansible-charm/lib/charms/sshproxy.py | beckrian/mano | a03088ab9a35fe4ab65a30587a6f0e0d72491434 | [
"Apache-2.0"
] | null | null | null | descriptor-packages/vnfd/videoServer_vnfd/charms/ansible-charm/lib/charms/sshproxy.py | beckrian/mano | a03088ab9a35fe4ab65a30587a6f0e0d72491434 | [
"Apache-2.0"
] | 5 | 2018-05-25T18:08:15.000Z | 2020-01-03T14:15:46.000Z | """Module to help with executing commands over SSH."""
##
# Copyright 2016 Canonical Ltd.
# 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.... | 34.073733 | 79 | 0.600081 |
1c7239984315f290a6b8b32b37ca6df5e944dfe4 | 11,723 | py | Python | BayesPSD/lightcurve.py | rsnemmen/BayesPSD | 2285a1c7d1511b6e51e5fafc57c1c779613d86e4 | [
"BSD-2-Clause"
] | 9 | 2017-09-23T20:47:44.000Z | 2021-03-27T03:10:16.000Z | BayesPSD/lightcurve.py | rsnemmen/BayesPSD | 2285a1c7d1511b6e51e5fafc57c1c779613d86e4 | [
"BSD-2-Clause"
] | 2 | 2016-07-18T20:38:11.000Z | 2018-03-28T03:35:43.000Z | BayesPSD/lightcurve.py | rsnemmen/BayesPSD | 2285a1c7d1511b6e51e5fafc57c1c779613d86e4 | [
"BSD-2-Clause"
] | 7 | 2015-05-01T14:36:42.000Z | 2020-12-10T16:30:22.000Z | #!/usr/bin/env python
#####################
#
# Class definition for the light curve class.
# Used to create light curves out of photon counting data
# or to save existing light curves in a class that's easy to use.
#
#
import matplotlib.pyplot as plt
import numpy
import math
import numpy as np
import scipy.optimiz... | 38.185668 | 123 | 0.554551 |
1c723a891f680f3c9bef907da5085cf7f8c8a562 | 135 | py | Python | pulotu/tests/test_functional.py | blurks/pulotu | 621460f3d4dbe05367ed4814b95d192df348cb72 | [
"Apache-2.0"
] | null | null | null | pulotu/tests/test_functional.py | blurks/pulotu | 621460f3d4dbe05367ed4814b95d192df348cb72 | [
"Apache-2.0"
] | 1 | 2021-11-19T16:50:11.000Z | 2021-11-19T16:55:17.000Z | pulotu/tests/test_functional.py | blurks/pulotu | 621460f3d4dbe05367ed4814b95d192df348cb72 | [
"Apache-2.0"
] | 1 | 2021-11-22T13:28:14.000Z | 2021-11-22T13:28:14.000Z | def test_home(app):
app.get_html('/', status=200)
app.get_html('/about', status=200)
app.get_html('/glossary', status=200)
| 27 | 41 | 0.651852 |
1c723eb6527cd27757dc277e49ba13d41e0feb8e | 7,872 | py | Python | mlrun/frameworks/onnx/model_handler.py | dinal/mlrun | 712ccdd2c706af3988791e1562e7a7a2fd113660 | [
"Apache-2.0"
] | null | null | null | mlrun/frameworks/onnx/model_handler.py | dinal/mlrun | 712ccdd2c706af3988791e1562e7a7a2fd113660 | [
"Apache-2.0"
] | null | null | null | mlrun/frameworks/onnx/model_handler.py | dinal/mlrun | 712ccdd2c706af3988791e1562e7a7a2fd113660 | [
"Apache-2.0"
] | null | null | null | import os
from typing import Any, Dict, List, Union
import onnx
import onnxoptimizer
import mlrun
from mlrun.artifacts import Artifact
from mlrun.frameworks._common import ModelHandler
class ONNXModelHandler(ModelHandler):
"""
Class for handling an ONNX model, enabling loading and saving it during runs.
... | 39.164179 | 120 | 0.624238 |
1c724cb1fa0061faf4452ed03f12be047949bbb9 | 18,909 | py | Python | CHECK_METADATA_FORMAT/apply_metadata_check.py | spacetelescope/MAST_HLSP | 48c1df2e6bef3e03f6eefe9f52808b345e1587b4 | [
"MIT"
] | 1 | 2017-10-16T15:30:08.000Z | 2017-10-16T15:30:08.000Z | CHECK_METADATA_FORMAT/apply_metadata_check.py | spacetelescope/MAST_HLSP | 48c1df2e6bef3e03f6eefe9f52808b345e1587b4 | [
"MIT"
] | 18 | 2018-05-11T16:07:48.000Z | 2018-11-19T19:45:40.000Z | CHECK_METADATA_FORMAT/apply_metadata_check.py | spacetelescope/MAST_HLSP | 48c1df2e6bef3e03f6eefe9f52808b345e1587b4 | [
"MIT"
] | 1 | 2017-10-03T19:38:59.000Z | 2017-10-03T19:38:59.000Z | """
.. module:: apply_metadata_check
:synopsis: Applies the check of header keywords and values given a standard.
().. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
import logging
import os
from astropy.io import fits
import numpy
import sys
from get_filetypes_keys import get_filetypes_keys
sys.path.a... | 41.558242 | 85 | 0.521762 |
1c726906c9df3f2d3658160fa383071d4bb4fe14 | 679 | py | Python | LintCode/chapter 12/38. Search a 2D Matrix II/.ipynb_checkpoints/solution-checkpoint.py | vincent507cpu/Comprehensive-Algorithm-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | 4 | 2020-06-26T00:45:53.000Z | 2021-04-19T12:23:32.000Z | LintCode/chapter 12/38. Search a 2D Matrix II/solution.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | LintCode/chapter 12/38. Search a 2D Matrix II/solution.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | class Solution:
"""
@param matrix: A list of lists of integers
@param target: An integer you want to search in matrix
@return: An integer indicate the total occurrence of target in the given matrix
"""
def searchMatrix(self, matrix, target):
# write your code here
m, n = len(matr... | 28.291667 | 83 | 0.446244 |
1c726d820708f76faeb4dc1ded4814f120350e86 | 5,021 | py | Python | ooni/templates/scapyt.py | irl/ooni-probe | c21861c28ca6bd667715872d099006fab87222fd | [
"BSD-2-Clause"
] | null | null | null | ooni/templates/scapyt.py | irl/ooni-probe | c21861c28ca6bd667715872d099006fab87222fd | [
"BSD-2-Clause"
] | null | null | null | ooni/templates/scapyt.py | irl/ooni-probe | c21861c28ca6bd667715872d099006fab87222fd | [
"BSD-2-Clause"
] | null | null | null | from base64 import b64encode
from ooni.nettest import NetTestCase
from ooni.utils import log
from ooni.settings import config
from ooni.utils.net import hasRawSocketPermission
from ooni.utils.txscapy import ScapySender, ScapyFactory
def _representPacket(packet):
return {
"raw_packet": {
'data... | 31.578616 | 85 | 0.594503 |
1c726de4bf9910adbf925f5830c91224af896533 | 3,051 | py | Python | texturizer/sentiment.py | john-hawkins/Text_Feature_Generator | 201b9255d20c5e4fa3400a0b007b9e3fca62aee5 | [
"MIT"
] | 3 | 2020-09-03T09:09:51.000Z | 2021-05-25T11:19:37.000Z | texturizer/sentiment.py | john-hawkins/Text_Feature_Generator | 201b9255d20c5e4fa3400a0b007b9e3fca62aee5 | [
"MIT"
] | null | null | null | texturizer/sentiment.py | john-hawkins/Text_Feature_Generator | 201b9255d20c5e4fa3400a0b007b9e3fca62aee5 | [
"MIT"
] | 1 | 2020-08-24T07:40:02.000Z | 2020-08-24T07:40:02.000Z | # -*- coding: utf-8 -*-
from textblob import TextBlob
import numpy as np
import re
from .process import load_word_pattern
"""
texturizer.sentiment: Sentiment feature flags
We use multiple sets of words lists for different sentiment features
Hu and Liu
This is a large list of postive and negative ... | 33.163043 | 117 | 0.600131 |
1c7273a2511857b67672b4a2c0c5cdb1110262e5 | 4,347 | py | Python | py/gpinfer.py | shilad/geo-provenance | 12781c6c8f875f6a85e8b8e71ce37d20fa5eeeb7 | [
"Apache-2.0"
] | 6 | 2015-03-30T02:09:03.000Z | 2019-08-03T23:19:58.000Z | py/gpinfer.py | shilad/geo-provenance | 12781c6c8f875f6a85e8b8e71ce37d20fa5eeeb7 | [
"Apache-2.0"
] | 1 | 2015-06-24T13:46:19.000Z | 2015-06-24T13:46:19.000Z | py/gpinfer.py | shilad/geo-provenance | 12781c6c8f875f6a85e8b8e71ce37d20fa5eeeb7 | [
"Apache-2.0"
] | 2 | 2016-04-17T08:55:09.000Z | 2022-02-16T20:16:57.000Z | #!/usr/bin/python -O
import collections
import math
from gputils import *
from country import read_countries
# from geoip import GeoIPFeature
from milgov import MilGovFeature
from pagelang import PagelangsFeature
from whois import FreetextWhoisFeature, ParsedWhoisFeature
from wikidata import WikidataFeature
from tld ... | 29.97931 | 103 | 0.551645 |
1c728140272618168bafb295ac086198b3be3c23 | 2,103 | py | Python | chhotu/miscdata/models.py | roshan007/chhout.web.backend | a952a53d908fb0c648b8b7279130166c2054f502 | [
"MIT"
] | null | null | null | chhotu/miscdata/models.py | roshan007/chhout.web.backend | a952a53d908fb0c648b8b7279130166c2054f502 | [
"MIT"
] | null | null | null | chhotu/miscdata/models.py | roshan007/chhout.web.backend | a952a53d908fb0c648b8b7279130166c2054f502 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from accounts.models import Profile
from products.models import Product
from .managers import FeedbackManager, ProductFeedbackManager, ProductOrderTrackManager
class Feedback(models.Model):
... | 30.926471 | 87 | 0.700903 |
1c7281d89bdeb928cae802960fc0d878547004ba | 3,432 | py | Python | docusign_rooms/models/field_data_for_update.py | docusign/docusign-rooms-python-client | eb8cfd0e487a87bc43d54bfa9de784eb170a40d3 | [
"MIT"
] | 2 | 2020-11-11T01:38:45.000Z | 2021-11-14T17:00:43.000Z | docusign_rooms/models/field_data_for_update.py | docusign/docusign-rooms-python-client | eb8cfd0e487a87bc43d54bfa9de784eb170a40d3 | [
"MIT"
] | null | null | null | docusign_rooms/models/field_data_for_update.py | docusign/docusign-rooms-python-client | eb8cfd0e487a87bc43d54bfa9de784eb170a40d3 | [
"MIT"
] | 1 | 2021-11-14T17:00:32.000Z | 2021-11-14T17:00:32.000Z | # coding: utf-8
"""
DocuSign Rooms API - v2
An API for an integrator to access the features of DocuSign Rooms # noqa: E501
OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import... | 27.902439 | 83 | 0.568182 |
1c729ea6844f17725dcf84b3d5e7c00dc283a041 | 6,685 | py | Python | bonneville/modules/sysbench.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/modules/sysbench.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | null | null | null | bonneville/modules/sysbench.py | lowsodium/bonneville | 02a016380b56345594f20ee007c62e7e92821a8b | [
"Apache-2.0"
] | 3 | 2020-05-10T02:08:44.000Z | 2020-11-06T11:01:57.000Z | # -*- coding: utf-8 -*-
'''
The 'sysbench' module is used to analyse the
performance of the minions, right from the master!
It measures various system parameters such as
CPU, Memory, FileI/O, Threads and Mutex.
'''
import re
import bonneville.utils
def __virtual__():
'''
loads the module, if only sysbench is... | 26.955645 | 78 | 0.625879 |
1c729f8ca9b5d60bcf0b55675ebede4c63e51f65 | 5,685 | py | Python | apis/manager.py | didi/MEEP | eb668fe598e40d244f204363d360babbe1fe0dc2 | [
"Apache-2.0"
] | 17 | 2020-09-09T02:32:14.000Z | 2021-10-01T09:46:40.000Z | apis/manager.py | didi/MEEP | eb668fe598e40d244f204363d360babbe1fe0dc2 | [
"Apache-2.0"
] | 2 | 2020-12-02T09:10:03.000Z | 2020-12-02T20:31:05.000Z | apis/manager.py | didi/MEEP | eb668fe598e40d244f204363d360babbe1fe0dc2 | [
"Apache-2.0"
] | 3 | 2020-10-10T09:14:43.000Z | 2022-01-18T02:36:31.000Z | import copy
import os
from apis.utils import add_full_names
class VariableManager():
'''Manages:
- saved variable state for when agent refreshes
- interface including counter for logger
'''
def __init__(self, socket_emit_fn, logger, initial_variables,
get_destination, con... | 41.195652 | 99 | 0.614952 |
1c72a2bc858aff0c9a72940bc1d61212a4dd6ac2 | 12,043 | py | Python | tempest/services/baremetal/v1/json/baremetal_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/baremetal/v1/json/baremetal_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/baremetal/v1/json/baremetal_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 32.200535 | 78 | 0.599518 |
1c72a506f33de2b8142cf3dc6629886fdc86ff00 | 2,984 | py | Python | src/models/gcs_script.py | IUS-CS/s22-project-breakneck | 80d462e375256a44d83d16a187b423c32b0496d4 | [
"MIT"
] | null | null | null | src/models/gcs_script.py | IUS-CS/s22-project-breakneck | 80d462e375256a44d83d16a187b423c32b0496d4 | [
"MIT"
] | 2 | 2022-03-08T21:32:31.000Z | 2022-03-28T05:37:36.000Z | src/models/gcs_script.py | IUS-CS/s22-project-breakneck | 80d462e375256a44d83d16a187b423c32b0496d4 | [
"MIT"
] | null | null | null | from fileinput import filename
import os
import sys
import glob
from google.cloud import storage
from pathlib import Path
### Script for uploading and downloading models from google cloud storage
BUCKET_NAME='project_fake_image_bucket'
storage_client = storage.Client.create_anonymous_client()
bucket = storage_client... | 30.141414 | 134 | 0.563673 |
1c72b3a8bd50bdf86f0338c1d7ce47852a5057f2 | 8,971 | py | Python | syncmanagerapi/syncmanagerapi/git/model.py | Frie-man/syncmanager | f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6 | [
"MIT"
] | null | null | null | syncmanagerapi/syncmanagerapi/git/model.py | Frie-man/syncmanager | f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6 | [
"MIT"
] | null | null | null | syncmanagerapi/syncmanagerapi/git/model.py | Frie-man/syncmanager | f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6 | [
"MIT"
] | null | null | null | from datetime import datetime
import os.path as osp
import uuid
from ..database import db, ma
from .git import GitRepoFs
from ..model import User, ClientEnv, ClientEnvSchema
from ..error import DataInconsistencyException
from marshmallow import fields
class GitRepo(db.Model):
__tablename__ = "git_repos"
id =... | 44.631841 | 117 | 0.660127 |
1c730c6a262194fbd555f2fc268ead0d4a84493b | 1,503 | py | Python | datawinners/search/tests/test_index_utils.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | datawinners/search/tests/test_index_utils.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | datawinners/search/tests/test_index_utils.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | import unittest
from mock import Mock, patch
from datawinners.search.index_utils import subject_dict
from mangrove.datastore.database import DatabaseManager
from mangrove.datastore.entity import Entity
from mangrove.form_model.form_model import EntityFormModel
class TestIndexUtils(unittest.TestCase):
def test_s... | 45.545455 | 113 | 0.635396 |
1c73141585f45614d08a5accdd6c0e250776a48c | 17,720 | py | Python | tests/rptminigameshub/main_test.py | ThisALV/RpT-Minigames-Hub | 1c7d0c780376588e88ae9e9af3224ec55fc66e4b | [
"MIT"
] | null | null | null | tests/rptminigameshub/main_test.py | ThisALV/RpT-Minigames-Hub | 1c7d0c780376588e88ae9e9af3224ec55fc66e4b | [
"MIT"
] | null | null | null | tests/rptminigameshub/main_test.py | ThisALV/RpT-Minigames-Hub | 1c7d0c780376588e88ae9e9af3224ec55fc66e4b | [
"MIT"
] | null | null | null | from rptminigameshub.__main__ import *
import rptminigameshub.__main__
import rptminigameshub.checkout
import rptminigameshub.network
import asyncio
import pytest
import pathlib
import json.encoder
class TestMain:
"""Unit tests for program entry point."""
@pytest.fixture
@pytest.mark.asyncio
def rese... | 55.548589 | 171 | 0.70254 |
1c7319f811e0bfcca18b7e2b6a022355268d8430 | 1,734 | py | Python | 0x08-python-more_classes/7-rectangle.py | flourishcodes/holbertonschool-higher_level_programming | 6fda5cca4ed960d7f3d40c26292ad55e1e7d3065 | [
"MIT"
] | null | null | null | 0x08-python-more_classes/7-rectangle.py | flourishcodes/holbertonschool-higher_level_programming | 6fda5cca4ed960d7f3d40c26292ad55e1e7d3065 | [
"MIT"
] | null | null | null | 0x08-python-more_classes/7-rectangle.py | flourishcodes/holbertonschool-higher_level_programming | 6fda5cca4ed960d7f3d40c26292ad55e1e7d3065 | [
"MIT"
] | 4 | 2018-05-01T05:04:15.000Z | 2020-04-28T22:22:54.000Z | #!/usr/bin/python3
'''7-rectangle: Python Funtion that defines Rectangle type'''
class Rectangle:
'''Defines the Rectangle type'''
number_of_instances = 0
print_symbol = "#"
def __init__(self, width=0, height=0):
self.width = width
self.height = height
Rectangle.number_of_ins... | 26.272727 | 67 | 0.56113 |
1c733440dd8b7285edf4c7b5a64f3e2746bb69fb | 1,832 | py | Python | histomicsui/models/case.py | DigitalSlideArchive/HistomicsUI | 838b2a6c7f92bb5cb9a05f4a9577c5f05564f146 | [
"Apache-2.0"
] | 17 | 2020-06-17T06:03:10.000Z | 2022-03-16T15:44:52.000Z | histomicsui/models/case.py | DigitalSlideArchive/HistomicsUI | 838b2a6c7f92bb5cb9a05f4a9577c5f05564f146 | [
"Apache-2.0"
] | 67 | 2020-02-27T20:17:04.000Z | 2022-03-31T15:36:32.000Z | histomicsui/models/case.py | DigitalSlideArchive/HistomicsUI | 838b2a6c7f92bb5cb9a05f4a9577c5f05564f146 | [
"Apache-2.0"
] | 9 | 2020-02-11T19:35:23.000Z | 2021-11-04T02:22:15.000Z | from girder.models.folder import Folder
from girder.models.model_base import ValidationException
from .cohort import Cohort
from .meta import TCGAModel
class Case(TCGAModel, Folder):
TCGAType = 'case'
TCGAIndices = [
'tcga.label'
]
def validate(self, doc, **kwargs):
if doc.get('pare... | 29.548387 | 70 | 0.549672 |
1c73456c9bfbfd2027e61100c51b0f7f28889df0 | 2,546 | py | Python | minesweeper/minesweeper.py | grantbow/kata-python-minesweeper | dd7128f5cdd8e8903b217c29ae2b9e55b0e490d1 | [
"Apache-2.0"
] | null | null | null | minesweeper/minesweeper.py | grantbow/kata-python-minesweeper | dd7128f5cdd8e8903b217c29ae2b9e55b0e490d1 | [
"Apache-2.0"
] | null | null | null | minesweeper/minesweeper.py | grantbow/kata-python-minesweeper | dd7128f5cdd8e8903b217c29ae2b9e55b0e490d1 | [
"Apache-2.0"
] | 1 | 2022-03-10T06:07:44.000Z | 2022-03-10T06:07:44.000Z | import re
def process_grid( filename ):
""" input: a file containing
grid size on the first line: #x#
bomb locations on subsequent lines: #,#
returns: string of grid, space separated locations
X is a bomb
# is adjacent bombs
"""
with open(filename, 'r... | 26.8 | 63 | 0.386881 |
1c73477dfb5c58b2306fdd1e1e2ffd542eb6076a | 4,579 | py | Python | fancyflags/_argument_parsers_test.py | alimuldal/fancyflags | 0ec5468b084830d7a5a11b0d187d81fb4dbab77b | [
"Apache-2.0"
] | 22 | 2021-02-05T09:15:06.000Z | 2021-12-31T09:46:01.000Z | fancyflags/_argument_parsers_test.py | alimuldal/fancyflags | 0ec5468b084830d7a5a11b0d187d81fb4dbab77b | [
"Apache-2.0"
] | 2 | 2021-09-15T18:27:30.000Z | 2021-11-27T15:34:21.000Z | fancyflags/_argument_parsers_test.py | alimuldal/fancyflags | 0ec5468b084830d7a5a11b0d187d81fb4dbab77b | [
"Apache-2.0"
] | 4 | 2021-02-14T03:54:31.000Z | 2021-12-09T23:17:20.000Z | # Copyright 2021 DeepMind Technologies Limited.
#
# 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 agre... | 32.707143 | 80 | 0.605372 |
1c7363eecb65a292f4c707319a19aba5e3b70094 | 8,291 | py | Python | export_csv/views.py | narenchoudhary/django-export-csv | 60cb0e1886267dbb53d7c22277d6adc5f2fa32f2 | [
"BSD-3-Clause"
] | 6 | 2016-11-27T15:50:11.000Z | 2022-01-20T10:21:49.000Z | export_csv/views.py | narenchoudhary/django-export-csv | 60cb0e1886267dbb53d7c22277d6adc5f2fa32f2 | [
"BSD-3-Clause"
] | 1 | 2019-04-23T14:19:58.000Z | 2019-04-23T14:29:38.000Z | export_csv/views.py | narenchoudhary/django-export-csv | 60cb0e1886267dbb53d7c22277d6adc5f2fa32f2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import csv
from django.http import HttpResponse
from django.utils.encoding import force_str, force_text
from django.utils.translation import ugettext_lazy as _
from django.views.generic import View
from .exceptions import NoModelFoundException
class ExportCSV(View):
"""G... | 34.690377 | 79 | 0.590882 |
1c7379c59ae950b50259baf4e44b08cf7e30157b | 453 | py | Python | deepracing_py/vjoy_playground.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 11 | 2020-06-29T15:21:37.000Z | 2021-04-12T00:42:26.000Z | deepracing_py/vjoy_playground.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | null | null | null | deepracing_py/vjoy_playground.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 4 | 2019-01-23T23:36:57.000Z | 2021-07-02T00:18:37.000Z | import py_f1_interface
import argparse
parser = argparse.ArgumentParser(description="Set steering ratio")
parser.add_argument("angle", type=float, help="Steering value [-1,1]")
parser.add_argument("throttle", type=float, help="Steering value [-1,1]")
parser.add_argument("brake", type=float, help="Steering value [-1,1]"... | 50.333333 | 73 | 0.779249 |
1c73875e3e892f61836e1b26476ca6b5cd8280bf | 183 | py | Python | Rannan_configs/splunk_apps_indexes/apps_configs.tgz_fixed/splunk_app_db_connect/bin/dbx_migrate_connections.py | mhassan2/datafabric_splunk | b4a1ba77ad7e1ab84d22cb40da6ff12e6bf16d1e | [
"Apache-2.0"
] | 14 | 2017-12-21T00:17:04.000Z | 2020-07-15T19:00:31.000Z | Rannan_configs/splunk_apps_indexes/apps_configs.tgz_fixed/splunk_app_db_connect/bin/dbx_migrate_connections.py | mhassan2/datafabric_splunk | b4a1ba77ad7e1ab84d22cb40da6ff12e6bf16d1e | [
"Apache-2.0"
] | null | null | null | Rannan_configs/splunk_apps_indexes/apps_configs.tgz_fixed/splunk_app_db_connect/bin/dbx_migrate_connections.py | mhassan2/datafabric_splunk | b4a1ba77ad7e1ab84d22cb40da6ff12e6bf16d1e | [
"Apache-2.0"
] | 5 | 2018-01-18T17:34:48.000Z | 2019-03-27T09:32:05.000Z | from dbx2.migration.migrate import migrate
ENDPOINT = 'configs/conf-database'
if __name__ == '__main__':
migrate('Database Connections', ENDPOINT, ['identity', 'connection'])
| 20.333333 | 73 | 0.73224 |
1c73946ecd2ef31fca14c26ba68855af39f79ac5 | 3,292 | py | Python | machine_learning/logistic_regression.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | machine_learning/logistic_regression.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | machine_learning/logistic_regression.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | 1 | 2020-06-26T09:46:17.000Z | 2020-06-26T09:46:17.000Z | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... | 30.766355 | 141 | 0.659174 |
1c73aad1c3220e0ae9586a984b5a4a0bd0aaf7af | 236 | py | Python | utils/__init__.py | wofmanaf/Group-CAM | d52a2ceb4b44201c8b5bd5ed27867eba9ff482e5 | [
"Apache-2.0"
] | 68 | 2021-03-26T23:14:35.000Z | 2022-03-24T04:29:35.000Z | utils/__init__.py | wofmanaf/Group-CAM | d52a2ceb4b44201c8b5bd5ed27867eba9ff482e5 | [
"Apache-2.0"
] | 9 | 2021-04-12T02:34:32.000Z | 2022-03-19T02:48:25.000Z | utils/__init__.py | wofmanaf/Group-CAM | d52a2ceb4b44201c8b5bd5ed27867eba9ff482e5 | [
"Apache-2.0"
] | 21 | 2021-03-26T03:58:40.000Z | 2022-03-22T08:28:50.000Z | from .imagenet import *
from .misc import *
from .target_layer import TargetLayer
from .cluster import group_sum
_EXCLUDE = {"torch", "torchvision"}
__all__ = [k for k in globals().keys() if k not in _EXCLUDE and not k.startswith("_")] | 33.714286 | 86 | 0.737288 |
1c73f88c9cf71163bff1da47c7471e2aa3fd99b4 | 56,499 | py | Python | python/mxnet/test_utils.py | qingzhouzhen/densetnet | 823db6b8a5656460861f281fcad14b0588655f43 | [
"Apache-2.0"
] | null | null | null | python/mxnet/test_utils.py | qingzhouzhen/densetnet | 823db6b8a5656460861f281fcad14b0588655f43 | [
"Apache-2.0"
] | null | null | null | python/mxnet/test_utils.py | qingzhouzhen/densetnet | 823db6b8a5656460861f281fcad14b0588655f43 | [
"Apache-2.0"
] | 1 | 2019-07-15T01:48:44.000Z | 2019-07-15T01:48:44.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... | 38.356415 | 100 | 0.605621 |
1c74178e603142607bfef80295ded12b961ef3d2 | 2,306 | py | Python | custom_components/hahm/lock.py | Lemocin/custom_homematic | 1b6bc2da270bcbb58b52806c50f4d7dbdcff4e37 | [
"MIT"
] | 45 | 2021-07-28T07:37:52.000Z | 2022-03-31T11:05:53.000Z | custom_components/hahm/lock.py | Lemocin/custom_homematic | 1b6bc2da270bcbb58b52806c50f4d7dbdcff4e37 | [
"MIT"
] | 14 | 2021-11-24T09:26:21.000Z | 2022-03-20T16:17:57.000Z | custom_components/hahm/lock.py | Lemocin/custom_homematic | 1b6bc2da270bcbb58b52806c50f4d7dbdcff4e37 | [
"MIT"
] | 12 | 2021-10-10T06:15:17.000Z | 2022-03-30T08:36:12.000Z | """binary_sensor for Homematic(IP) Local."""
from __future__ import annotations
import logging
from typing import Any
from hahomematic.const import HmPlatform
from hahomematic.devices.lock import BaseLock
from homeassistant.components.lock import SUPPORT_OPEN, LockEntity
from homeassistant.config_entries import Conf... | 30.342105 | 87 | 0.711622 |
1c741eb67d73192f6ddf8e74972bc74031da8383 | 2,677 | py | Python | examples/soc/bios/bios_example.py | asaioe99/luna_JP | 276c9d86d2c964c7c4be149d721156d869c9489b | [
"BSD-3-Clause"
] | 1 | 2021-02-25T01:43:12.000Z | 2021-02-25T01:43:12.000Z | examples/soc/bios/bios_example.py | kbeckmann/luna | befb33620d1c4267607a45f331b84bc196c7a8bf | [
"BSD-3-Clause"
] | null | null | null | examples/soc/bios/bios_example.py | kbeckmann/luna | befb33620d1c4267607a45f331b84bc196c7a8bf | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This file is part of LUNA.
#
from nmigen import Elaboratable, Module, Cat
from nmigen.hdl.rec import Record
from lambdasoc.periph import Peripheral
from lambdasoc.periph.serial import AsyncSerialPeripheral
from lambdasoc.periph.timer ... | 29.097826 | 90 | 0.598058 |
1c74404aaa6473b7e0aa8cc8cbedd8cd5267aa4c | 11,471 | py | Python | ft/onto/base_ontology.py | jrxk/forte | bb88412a23efa8b4b22f636c1e8073c18fab8c18 | [
"Apache-2.0"
] | null | null | null | ft/onto/base_ontology.py | jrxk/forte | bb88412a23efa8b4b22f636c1e8073c18fab8c18 | [
"Apache-2.0"
] | null | null | null | ft/onto/base_ontology.py | jrxk/forte | bb88412a23efa8b4b22f636c1e8073c18fab8c18 | [
"Apache-2.0"
] | null | null | null | # ***automatically_generated***
# ***source json:forte/ontology_specs/base_ontology.json***
# flake8: noqa
# mypy: ignore-errors
# pylint: skip-file
"""
Automatically generated ontology base_ontology. Do not change manually.
"""
from dataclasses import dataclass
from forte.data.data_pack import DataPack
from forte.dat... | 28.749373 | 158 | 0.665156 |
1c74caa28de95116d21180ab5bc38ae6356d40b8 | 2,399 | py | Python | alipay/aop/api/domain/AlipayUserApplepayProvisioningbundleEffectModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayUserApplepayProvisioningbundleEffectModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayUserApplepayProvisioningbundleEffectModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayUserApplepayProvisioningbundleEffectModel(object):
def __init__(self):
self._event_type = None
self._provisioning_bundle_identifier = None
self._reference_identifier... | 33.788732 | 111 | 0.675698 |
1c74cd29ac1130d5246c2dbaac4e3559c4da415e | 386 | py | Python | src/cyborgbackup/celery.py | ikkemaniac/cyborgbackup | b11139fa9632f745a3c288787c51fbf814b961fa | [
"BSD-3-Clause"
] | 69 | 2019-11-30T06:47:06.000Z | 2022-02-03T22:00:37.000Z | src/cyborgbackup/celery.py | ikkemaniac/cyborgbackup | b11139fa9632f745a3c288787c51fbf814b961fa | [
"BSD-3-Clause"
] | 46 | 2019-11-23T20:37:26.000Z | 2021-11-20T15:50:44.000Z | src/cyborgbackup/celery.py | ikkemaniac/cyborgbackup | b11139fa9632f745a3c288787c51fbf814b961fa | [
"BSD-3-Clause"
] | 21 | 2019-12-07T08:18:53.000Z | 2021-12-22T01:02:05.000Z | from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cyborgbackup.settings')
app = Celery('cyborgbackup')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)
def d... | 21.444444 | 72 | 0.779793 |
1c74e8b4114ae85c3cee9d5b257225ce0dcf82e3 | 10,529 | py | Python | Tensorflow-tutorials/Not-Safe-For-Work-Detection/model.py | AathmanT/cv-tricks.com | 7367c42d3e2d398b31ebf1b058bdbb5dc2a56253 | [
"MIT"
] | 326 | 2017-04-01T13:00:31.000Z | 2019-11-08T06:45:00.000Z | Tensorflow-tutorials/Not-Safe-For-Work-Detection/model.py | AathmanT/cv-tricks.com | 7367c42d3e2d398b31ebf1b058bdbb5dc2a56253 | [
"MIT"
] | 22 | 2017-04-15T12:30:30.000Z | 2019-11-24T19:52:47.000Z | Tensorflow-tutorials/Not-Safe-For-Work-Detection/model.py | AathmanT/cv-tricks.com | 7367c42d3e2d398b31ebf1b058bdbb5dc2a56253 | [
"MIT"
] | 506 | 2017-03-30T11:38:46.000Z | 2019-11-18T19:18:04.000Z | import math
import numpy as np
import tensorflow as tf
from enum import Enum, unique
@unique
class InputType(Enum):
TENSOR = 1
BASE64_JPEG = 2
class OpenNsfwModel:
"""Tensorflow implementation of Yahoo's Open NSFW Model
Original implementation:
https://github.com/yahoo/open_nsfw
Weights ha... | 41.290196 | 107 | 0.554089 |
1c74f6bff71ef83a23706b7fcd9451ab4ea00b6c | 14,315 | py | Python | octoprint_octopod/alerts.py | gdombiak/OctoPrint-OctoPod | 58a09b559a4279326492e9b415a434c2b5c5c1bd | [
"Apache-2.0"
] | 52 | 2019-05-28T03:41:20.000Z | 2022-01-29T00:32:57.000Z | octoprint_octopod/alerts.py | gdombiak/OctoPrint-OctoPod | 58a09b559a4279326492e9b415a434c2b5c5c1bd | [
"Apache-2.0"
] | 111 | 2019-05-28T14:50:01.000Z | 2022-03-21T22:12:05.000Z | octoprint_octopod/alerts.py | gdombiak/OctoPrint-OctoPod | 58a09b559a4279326492e9b415a434c2b5c5c1bd | [
"Apache-2.0"
] | 11 | 2019-07-20T15:36:21.000Z | 2021-12-30T16:53:56.000Z | # coding=utf-8
import json
import requests
class Alerts:
# Flag to indicate if we should use APNS for development or production
_use_dev = False
def __init__(self, logger):
self._logger = logger
self._languages = {
'en': {
"Print complete": 'Print complete',
"Print progress": "Progress {}%",
... | 43.911043 | 111 | 0.694866 |
1c7505d1068f120f257c820fdff5d75d0a4f0d95 | 3,581 | py | Python | tests/app/forms/validation/test_number_validator.py | ons-eq-team/eq-questionnaire-runner | 8d029097faa2b9d53d9621064243620db60c62c7 | [
"MIT"
] | null | null | null | tests/app/forms/validation/test_number_validator.py | ons-eq-team/eq-questionnaire-runner | 8d029097faa2b9d53d9621064243620db60c62c7 | [
"MIT"
] | null | null | null | tests/app/forms/validation/test_number_validator.py | ons-eq-team/eq-questionnaire-runner | 8d029097faa2b9d53d9621064243620db60c62c7 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import Mock, patch
from wtforms.validators import StopValidation, ValidationError
from app.forms.error_messages import error_messages
from app.forms.validators import NumberCheck, DecimalPlaces
# pylint: disable=no-member
@patch("app.jinja_filters.flask_babel.get_locale", Mock(retu... | 28.879032 | 78 | 0.647584 |
1c752a63c6b376efc964ded886c3bfebc0a534ad | 14,308 | py | Python | scripts/display_resjson.py | rakshithShetty/captionGAN | 3a1d33923aee05ea46d2556f59cb892132a1e5c2 | [
"MIT"
] | 66 | 2017-12-04T05:23:29.000Z | 2022-03-16T02:43:23.000Z | scripts/display_resjson.py | Jevin754/captionGAN | b9d1331e7a64ed20e152a749eaa1f086c0be556d | [
"MIT"
] | 5 | 2018-02-28T06:25:53.000Z | 2021-11-07T16:38:03.000Z | scripts/display_resjson.py | Jevin754/captionGAN | b9d1331e7a64ed20e152a749eaa1f086c0be556d | [
"MIT"
] | 17 | 2017-11-16T01:45:15.000Z | 2022-02-06T08:09:08.000Z | import os
#os.chdir('../')
import os.path as osp
import sys
from collections import OrderedDict
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
this_dir = osp.dirname(__file__)
# Add caffe to PYTHONPATH
main_path = osp.join(this_dir, '..')
add_path(main_path)
import numpy as np
imp... | 40.191011 | 188 | 0.608191 |
1c752b5ae58bf78b11390035fe377c5b0721ceb2 | 916 | py | Python | nova/api/openstack/compute/legacy_v2/contrib/extended_services.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/api/openstack/compute/legacy_v2/contrib/extended_services.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 9 | 2015-05-20T11:20:17.000Z | 2017-07-27T08:21:33.000Z | nova/api/openstack/compute/legacy_v2/contrib/extended_services.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 13 | 2015-05-05T09:34:04.000Z | 2017-11-08T02:03:46.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 38.166667 | 78 | 0.712882 |
1c7541ea5154774db95fdb3205ea799ed36c39b0 | 4,004 | py | Python | alipay/aop/api/request/AlipayCommerceTransportEtcTripSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayCommerceTransportEtcTripSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayCommerceTransportEtcTripSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceTransportEtcTripSyncModel import AlipayCommerceTransportEtcTripSyncModel
class AlipayCommerceTransportEtcTripSyncReque... | 27.613793 | 148 | 0.647353 |
1c755266c3967766fa518fd83de80b5b1bd75646 | 841 | py | Python | huginn/configuration.py | pmatigakis/flightsim | a35fec1df844eec05c7ab97a7c70c750e43a9f08 | [
"BSD-3-Clause"
] | 13 | 2015-11-14T03:57:42.000Z | 2021-04-19T18:12:30.000Z | huginn/configuration.py | pmatigakis/flightsim | a35fec1df844eec05c7ab97a7c70c750e43a9f08 | [
"BSD-3-Clause"
] | null | null | null | huginn/configuration.py | pmatigakis/flightsim | a35fec1df844eec05c7ab97a7c70c750e43a9f08 | [
"BSD-3-Clause"
] | 7 | 2016-08-30T10:44:00.000Z | 2019-11-23T10:24:24.000Z | """
The huginn.configuration module contains the default configuration values
"""
import pkg_resources
# interface settings
SIMULATOR_CONTROL_PORT = 10500
WEB_SERVER_PORT = 8090
SENSORS_PORT = 10300
CONTROLS_PORT = 10301
FDM_CLIENT_ADDRESS = "127.0.0.1"
FDM_CLIENT_PORT = 10302
FDM_CLIENT_DT = 0.1
TELEMETRY_PORT = 10... | 19.55814 | 73 | 0.75981 |
1c7553b0ef7dd3029c504e49dccbbbce4b2adbf5 | 2,663 | py | Python | {{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/main.py | triaxtec/fastapi-serverless-cookiecutter | fe5ca7ebb0fbe47ee55adbe93431b02862e62544 | [
"MIT"
] | 15 | 2020-05-09T16:34:29.000Z | 2021-06-05T14:26:34.000Z | {{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/main.py | triaxtec/fastapi-serverless-cookiecutter | fe5ca7ebb0fbe47ee55adbe93431b02862e62544 | [
"MIT"
] | null | null | null | {{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/main.py | triaxtec/fastapi-serverless-cookiecutter | fe5ca7ebb0fbe47ee55adbe93431b02862e62544 | [
"MIT"
] | 1 | 2020-08-13T18:40:55.000Z | 2020-08-13T18:40:55.000Z | import re
from importlib.metadata import version
from typing import Awaitable, Callable
from fastapi import FastAPI
from fastapi.middleware.gzip import GZipMiddleware
from fastapi.routing import APIRoute
from secure import SecureHeaders
from semantic_version import Version
from starlette.middleware.cors import CORSMid... | 35.039474 | 116 | 0.754037 |
1c7577673bda1ce683d72c7639136caae47f249d | 3,230 | py | Python | autobias/experiments/mnist/train_models_batch.py | chrisc36/autobias | df1120d46adccf024c8dc59f86dd95f2c710fb52 | [
"Apache-2.0"
] | 3 | 2020-12-27T11:42:14.000Z | 2021-04-12T14:19:39.000Z | autobias/experiments/mnist/train_models_batch.py | chrisc36/autobias | df1120d46adccf024c8dc59f86dd95f2c710fb52 | [
"Apache-2.0"
] | 1 | 2020-12-28T01:36:46.000Z | 2020-12-28T01:36:46.000Z | autobias/experiments/mnist/train_models_batch.py | chrisc36/autobias | df1120d46adccf024c8dc59f86dd95f2c710fb52 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import warnings
from os import environ
from os.path import join, basename
from typing import Iterable
from autobias.training import train_utils
from autobias.training.evaluate import run_evaluation
from autobias.utils.process_par import Processor, process_par
warnings.simplefilter(actio... | 36.292135 | 100 | 0.679257 |
1c7596f637203bfe2df0fdf5480d72cdf6fae72c | 1,858 | py | Python | rbac/common/proposal/proposal_confirm.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | null | null | null | rbac/common/proposal/proposal_confirm.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | null | null | null | rbac/common/proposal/proposal_confirm.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | 1 | 2018-12-07T10:55:08.000Z | 2018-12-07T10:55:08.000Z | # Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | 40.391304 | 82 | 0.707212 |
1c75c563700a6ff01552a169198bb9cd056c9203 | 9,689 | py | Python | chapter3/resnet_gpu/train.py | hu-qi/mindspore-21-days-tutorials | a9d3a024a0b17e48ae758de66195923b14f8ea6c | [
"Apache-2.0"
] | 1 | 2021-01-10T08:29:45.000Z | 2021-01-10T08:29:45.000Z | resnet_gpu/train.py | leonwanghui/ms-resnet50-mushroom | a37190721597d93d225b63145c747bcfe6705fd2 | [
"Apache-2.0"
] | null | null | null | resnet_gpu/train.py | leonwanghui/ms-resnet50-mushroom | a37190721597d93d225b63145c747bcfe6705fd2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 49.433673 | 125 | 0.667355 |
1c75dbaa6f87b75fa9762cc1cfa4fde266061fe8 | 484 | py | Python | myPacket.py | misterlihao/network-programming-project | f2213ff92a60bce2849116819326ec04ee67f0cf | [
"MIT"
] | null | null | null | myPacket.py | misterlihao/network-programming-project | f2213ff92a60bce2849116819326ec04ee67f0cf | [
"MIT"
] | 1 | 2015-05-14T13:29:40.000Z | 2015-05-14T13:29:40.000Z | myPacket.py | misterlihao/network-programming-project | f2213ff92a60bce2849116819326ec04ee67f0cf | [
"MIT"
] | null | null | null | import struct
packet_len_pack_pattern = 'Q'
sizeBytes = 8
def sendPacket(sock, bstr):
sock.send(struct.pack(packet_len_pack_pattern, len(bstr)))
sock.sendall(bstr)
def recvPacket(sock):
packet_len_bstr = recvBytes(sock, sizeBytes)
packet_len = struct.unpack(packet_len_pack_pattern, packet_len_bstr)[0]
bstr = re... | 21.043478 | 72 | 0.737603 |
1c75eb7e18c8c6d602bf19d902e65bea9d92b421 | 32,416 | py | Python | tests/test_vtapi3_files.py | drobotun/virustotalapi3 | 7d9e278dc58fa9702ddf8c62de09c852a7316148 | [
"MIT"
] | 8 | 2020-01-10T00:19:06.000Z | 2022-01-12T18:13:27.000Z | tests/test_vtapi3_files.py | drobotun/virustotalapi3 | 7d9e278dc58fa9702ddf8c62de09c852a7316148 | [
"MIT"
] | 2 | 2020-02-07T22:01:55.000Z | 2020-02-11T19:52:48.000Z | tests/test_vtapi3_files.py | drobotun/virustotalapi3 | 7d9e278dc58fa9702ddf8c62de09c852a7316148 | [
"MIT"
] | 3 | 2020-01-10T00:19:18.000Z | 2020-12-08T17:13:41.000Z | """
VirusTotalAPIFiles class testing module.
Author: Evgeny Drobotun (c) 2020
License: MIT (https://github.com/drobotun/virustotalapi3/blob/master/LICENSE)
"""
import unittest
import errno
from unittest import mock
import requests
from vtapi3 import VirusTotalAPIFiles, VirusTotalAPIError
def raise_file_not... | 42.708827 | 112 | 0.709927 |
1c75f33453c485287a2bc3022cef1500361d535d | 540 | py | Python | examples/clocker.py | msabramo/diesel | a1ed7ed0358d0fec8592e23aafc3b7ec167ab649 | [
"BSD-3-Clause"
] | 224 | 2015-01-03T06:33:05.000Z | 2021-11-22T03:19:02.000Z | examples/clocker.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 12 | 2015-01-01T03:35:15.000Z | 2021-05-22T23:37:28.000Z | examples/clocker.py | dowski/diesel | d9824e467805caf40e0ba21b88a27db38e64c352 | [
"BSD-3-Clause"
] | 37 | 2015-01-04T01:47:55.000Z | 2022-03-03T02:04:15.000Z | import os
from diesel import Loop, fork, Application, sleep
from diesel.util.stats import CPUStats
def not_always_busy_worker():
with CPUStats() as stats:
for _ in xrange(12):
for i in xrange(10000000): # do some work to forward cpu seconds
pass
sleep(0.1) # give up ... | 25.714286 | 76 | 0.666667 |
1c760c985e90208c370b6db1670de00beff08def | 521 | py | Python | CADMium/partition/partition_energy.py | wasserman-group/CADMium | 0d0e16f8965e0a3acfea9ea6ba5dd0d51f1bdc55 | [
"BSD-3-Clause"
] | null | null | null | CADMium/partition/partition_energy.py | wasserman-group/CADMium | 0d0e16f8965e0a3acfea9ea6ba5dd0d51f1bdc55 | [
"BSD-3-Clause"
] | 1 | 2021-05-12T17:24:27.000Z | 2021-05-12T17:24:27.000Z | CADMium/partition/partition_energy.py | wasserman-group/CADMium | 0d0e16f8965e0a3acfea9ea6ba5dd0d51f1bdc55 | [
"BSD-3-Clause"
] | 2 | 2020-10-07T20:48:56.000Z | 2021-04-22T19:06:18.000Z | """
partition_energy.py
"""
def partition_energy(self):
"""
Calculates the partiton energy
"""
if not self.optPartition.isolated:
#Calculate components of the partition energy
self.ep_nuclear() #Potential energy
self.ep_kinetic() #Kinetic energy
self.ep_hxc() #Hxc ... | 22.652174 | 65 | 0.581574 |
1c762a1ad874d64a50afec93afd22de86c0e4090 | 501 | py | Python | tests/test_helper_funcs.py | UCSBarchlab/PyLSE | 571ec250a0b09033041fc8da7497a2f986f19de2 | [
"BSD-3-Clause"
] | null | null | null | tests/test_helper_funcs.py | UCSBarchlab/PyLSE | 571ec250a0b09033041fc8da7497a2f986f19de2 | [
"BSD-3-Clause"
] | null | null | null | tests/test_helper_funcs.py | UCSBarchlab/PyLSE | 571ec250a0b09033041fc8da7497a2f986f19de2 | [
"BSD-3-Clause"
] | 1 | 2021-06-08T19:25:16.000Z | 2021-06-08T19:25:16.000Z | from pylse.simulation import Simulation
import unittest
from pylse import working_circuit, inspect, inp, Simulation
class TestHelpers(unittest.TestCase):
def setUp(self):
working_circuit().reset()
def test_inspect_adds_visible_event(self):
in0 = inp(delay=1.2)
inspect(in0, 'in0')
... | 21.782609 | 59 | 0.632735 |
1c7643ba6be0f8e99132db2ebbc8ccb48a6d7db5 | 60,571 | py | Python | premise/electricity.py | kais-siala/rmnd-lca | db00e65e520b59e7e85268cbefb5fef593139715 | [
"BSD-3-Clause"
] | null | null | null | premise/electricity.py | kais-siala/rmnd-lca | db00e65e520b59e7e85268cbefb5fef593139715 | [
"BSD-3-Clause"
] | null | null | null | premise/electricity.py | kais-siala/rmnd-lca | db00e65e520b59e7e85268cbefb5fef593139715 | [
"BSD-3-Clause"
] | null | null | null | import os
from . import DATA_DIR
from .activity_maps import InventorySet
from .geomap import Geomap
from wurst import searching as ws
import csv
import numpy as np
import uuid
import wurst
from .utils import get_lower_heating_values
from datetime import date
PRODUCTION_PER_TECH = (
DATA_DIR / "electricity" / "elec... | 41.801932 | 129 | 0.435638 |
1c764a9d7101f2504129edd5f0db47eda70598e7 | 9,548 | py | Python | proxy/common/pki.py | GDGSNF/proxy.py | 3ee2824217286df3c108beadf3185eee35c28b49 | [
"BSD-3-Clause"
] | null | null | null | proxy/common/pki.py | GDGSNF/proxy.py | 3ee2824217286df3c108beadf3185eee35c28b49 | [
"BSD-3-Clause"
] | null | null | null | proxy/common/pki.py | GDGSNF/proxy.py | 3ee2824217286df3c108beadf3185eee35c28b49 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | 29.198777 | 88 | 0.613846 |
1c7661ab6aebc9ed2ccfba3a3aead4f9a7c3bf89 | 10,892 | py | Python | vector_cv_tools/datasets/kinetics.py | VectorInstitute/vector_cv_tools | 37d5b4c41a83f15554994bf7d19d8d274282ee61 | [
"MIT"
] | 6 | 2021-06-10T03:10:34.000Z | 2021-07-14T19:27:01.000Z | vector_cv_tools/datasets/kinetics.py | VectorInstitute/vector_cv_tools | 37d5b4c41a83f15554994bf7d19d8d274282ee61 | [
"MIT"
] | null | null | null | vector_cv_tools/datasets/kinetics.py | VectorInstitute/vector_cv_tools | 37d5b4c41a83f15554994bf7d19d8d274282ee61 | [
"MIT"
] | 1 | 2021-11-28T20:03:50.000Z | 2021-11-28T20:03:50.000Z | import torch
import numpy as np
import pickle
import os, sys
from pathlib import Path
import json
import logging
import hashlib
import tqdm
import cv2
from ..utils import video_reader
def flatten_entries(ordered_pairs, data_path, class_filter):
if class_filter is not None:
class_filter = set(class_filter... | 37.047619 | 114 | 0.587128 |
1c76a71cea7ba132387f9d61bd2fcbed61b6a2d6 | 5,399 | py | Python | appengine/findit/gae_libs/model/versioned_model.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/findit/gae_libs/model/versioned_model.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/findit/gae_libs/model/versioned_model.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides a model to support versioned entities in datastore.
Idea: use a root model entity to keep track of the most recent version of a
versioned entity,... | 33.74375 | 80 | 0.691424 |
1c76a9998773e21fc651bd1db2c010f6d3583cd9 | 1,117 | py | Python | src/osducli/commands/list/records.py | equinor/osdu-cli | 579922556925ea7ad759a6230498378cf724b445 | [
"MIT"
] | 3 | 2021-08-19T05:59:39.000Z | 2021-11-10T08:02:58.000Z | src/osducli/commands/list/records.py | equinor/osdu-cli | 579922556925ea7ad759a6230498378cf724b445 | [
"MIT"
] | 2 | 2021-09-13T11:10:15.000Z | 2021-11-25T13:21:54.000Z | src/osducli/commands/list/records.py | equinor/osdu-cli | 579922556925ea7ad759a6230498378cf724b445 | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) Equinor ASA. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
"""Custom cl... | 31.027778 | 96 | 0.625783 |
1c76dc2dd43f773b5f6265abe296c42c73bdff7c | 597 | py | Python | rgislackbot/dispatcher/dispatchconfig.py | raginggeek/RGISlackBot | 9fddf78b37f494eb6605da890a28f41427f37f03 | [
"MIT"
] | null | null | null | rgislackbot/dispatcher/dispatchconfig.py | raginggeek/RGISlackBot | 9fddf78b37f494eb6605da890a28f41427f37f03 | [
"MIT"
] | 11 | 2019-03-08T01:38:40.000Z | 2019-03-15T16:21:59.000Z | rgislackbot/dispatcher/dispatchconfig.py | raginggeek/RGISlackBot | 9fddf78b37f494eb6605da890a28f41427f37f03 | [
"MIT"
] | null | null | null | class DispatchConfig:
def __init__(self, raw_config):
self.registered_commands = {}
for package in raw_config["handlers"]:
for command in package["commands"]:
self.registered_commands[command] = {
"class": package["class"],
"fullpat... | 37.3125 | 99 | 0.572864 |
1c770f9b89c97c16026da6a6fcddbf8bc84bf374 | 16,565 | py | Python | tests/test_writers.py | anton-shakh-qg/spoonbill | b54d48f053009d2d6dd8c6a023348af2d54188fe | [
"BSD-3-Clause"
] | null | null | null | tests/test_writers.py | anton-shakh-qg/spoonbill | b54d48f053009d2d6dd8c6a023348af2d54188fe | [
"BSD-3-Clause"
] | null | null | null | tests/test_writers.py | anton-shakh-qg/spoonbill | b54d48f053009d2d6dd8c6a023348af2d54188fe | [
"BSD-3-Clause"
] | null | null | null | import csv
from pathlib import Path
from unittest.mock import call, patch
import openpyxl
from spoonbill import FileAnalyzer, FileFlattener
from spoonbill.flatten import Flattener, FlattenOptions
from spoonbill.writers.csv import CSVWriter
from spoonbill.writers.xlsx import XlsxWriter
from .conftest import releases_... | 36.247265 | 117 | 0.601207 |
1c771a2a916b3052eb56428128afeba699e2d5d4 | 1,620 | py | Python | utils/morse_code_encodings.py | lebyanelm/mf_code | 88b5d28224d6fc29d0b26a3011d046f30bdcedc8 | [
"Apache-2.0"
] | null | null | null | utils/morse_code_encodings.py | lebyanelm/mf_code | 88b5d28224d6fc29d0b26a3011d046f30bdcedc8 | [
"Apache-2.0"
] | null | null | null | utils/morse_code_encodings.py | lebyanelm/mf_code | 88b5d28224d6fc29d0b26a3011d046f30bdcedc8 | [
"Apache-2.0"
] | null | null | null | """
HELPER METHODS AND VARIABLES TO HELP WITH SUB-OPERATIONS
"""
# ENCODING OF THE MORSE CODE LANGUAGE, IN (HEIGHT, WIDTH, BINARY)
MORSE_CODE_ENCODING = {
'A' : ( 1, 0 ),
'B' : ( 0, 1, 1, 1 ),
'C' : ( 0, 1, 0, 1 ),
'D' : ( 0, 1, 1 ),
'E' : ( 1 ),
'F' : ( 1, 1, 0, 1 ),
'G' : ( 0, 0, 1 ),
... | 26.129032 | 65 | 0.239506 |
1c7767f1007c35f9f05e99a01427cbd19d228ba7 | 4,775 | py | Python | dp_conceptual_search/ons/search/client/abstract_search_engine.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | 3 | 2018-05-10T16:49:27.000Z | 2022-03-29T15:23:04.000Z | dp_conceptual_search/ons/search/client/abstract_search_engine.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | 2 | 2018-09-20T06:37:27.000Z | 2018-11-12T12:05:08.000Z | dp_conceptual_search/ons/search/client/abstract_search_engine.py | flaxandteal/dp-conceptual-search | 16c6383a61ba5b7069337c2626a0dc243bfe9d35 | [
"MIT"
] | 3 | 2018-06-25T10:48:43.000Z | 2021-04-11T08:01:27.000Z | import abc
import logging as logger
from typing import List
from dp_conceptual_search.search.query_helper import match_by_uri
from dp_conceptual_search.search.client.search_client import SearchClient
from dp_conceptual_search.ons.search.sort_fields import query_sort
from dp_conceptual_search.ons.search import Content... | 31.006494 | 120 | 0.615079 |
1c77692d93e009b064fc099d1da27bec46ae03dc | 27,475 | py | Python | sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import ba... | 44.101124 | 119 | 0.628426 |
1c777019f07b2fb81642000eeef3b1693a904aa6 | 1,085 | py | Python | test/test_proof.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | test/test_proof.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | test/test_proof.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | """Integration tests for the pyWriter project.
Test the conversion of the proofread-manuscript.
For further information see https://github.com/peter88213/PyWriter
Published under the MIT License (https://opensource.org/licenses/mit-license.php)
"""
from pywriter.html.html_proof import HtmlProof
from pywriter.... | 26.463415 | 82 | 0.684793 |
1c778d484a93b10955436ddbed7453971a9e09a9 | 732 | py | Python | 01-scanner/main.py | wgslr/agh-compilation-theory | 8cc91ba006fd0e9eea392c195245f0ae21933486 | [
"MIT"
] | null | null | null | 01-scanner/main.py | wgslr/agh-compilation-theory | 8cc91ba006fd0e9eea392c195245f0ae21933486 | [
"MIT"
] | null | null | null | 01-scanner/main.py | wgslr/agh-compilation-theory | 8cc91ba006fd0e9eea392c195245f0ae21933486 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import sys
import ply.lex as lex
import scanner # scanner.py is a file you create, (it is not an external library)
if __name__ == '__main__':
try:
filename = sys.argv[1] if len(sys.argv) > 1 else "example.txt"
file = open(filename, "r")
except IOError:
print("C... | 25.241379 | 82 | 0.584699 |
1c778edab441327821d3055a7dbafaccfc940b58 | 14,471 | py | Python | entries/ray/ai01.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | 1 | 2017-10-20T14:24:06.000Z | 2017-10-20T14:24:06.000Z | entries/ray/ai01.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | null | null | null | entries/ray/ai01.py | sadakatsu/SpeedClueContest | f670e4e594b35e4a5111492dde31414429865ade | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import itertools
from speedclue.playerproxy import Player, main
from speedclue.cards import CARDS
from speedclue.protocol import BufMessager
# import crash_on_ipy
class Card:
def __init__(self, name, type):
self.name = name
self.possible_owners = []
self.owner = Non... | 35.730864 | 90 | 0.553175 |
1c779379caaf581ef0380a4cd8c50d35c7329478 | 4,352 | py | Python | sdk/streamanalytics/azure-mgmt-streamanalytics/azure/mgmt/streamanalytics/aio/operations/_subscriptions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/streamanalytics/azure-mgmt-streamanalytics/azure/mgmt/streamanalytics/aio/operations/_subscriptions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/streamanalytics/azure-mgmt-streamanalytics/azure/mgmt/streamanalytics/aio/operations/_subscriptions_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.333333 | 149 | 0.70864 |
1c7812f7a66b06ad5a82b0f738705c738f0792cb | 3,547 | py | Python | Carte.py | Darrao/Carte | dfdf4ac80ad66848a7affb0ce4ba59d0ee187ed4 | [
"Apache-2.0"
] | null | null | null | Carte.py | Darrao/Carte | dfdf4ac80ad66848a7affb0ce4ba59d0ee187ed4 | [
"Apache-2.0"
] | null | null | null | Carte.py | Darrao/Carte | dfdf4ac80ad66848a7affb0ce4ba59d0ee187ed4 | [
"Apache-2.0"
] | null | null | null | class Carte:
"""Une classe carte rudimentaire définie par \n
- sa valeur : 1 à 10, Valet, Dame, Roi\n
- sa couleur : Carreau, Coeur, Pique, Trèfle\n
- sa figure (le nom du fichier image correspondant)"""
__valeur = 0
__couleur = 0
__figure = ""
def __init__(se... | 33.149533 | 86 | 0.546941 |
1c787e0ee347b6d6a6b34992b63dc7805e3a0e53 | 731 | py | Python | tests/conftest.py | i008/zeroml | 849258d34606698aba44c5f0028254025755e8ff | [
"MIT"
] | null | null | null | tests/conftest.py | i008/zeroml | 849258d34606698aba44c5f0028254025755e8ff | [
"MIT"
] | null | null | null | tests/conftest.py | i008/zeroml | 849258d34606698aba44c5f0028254025755e8ff | [
"MIT"
] | null | null | null | import uuid
from pathlib import Path
import numpy as np
import pandas as pd
import PIL.Image
import pytest
@pytest.fixture
def random_pil_image() -> PIL.Image:
image = PIL.Image.fromarray(np.random.randn(224, 224, 3).astype("uint8"))
return image
@pytest.fixture
def create_image_test_dataframe(tmp_path) ->... | 24.366667 | 93 | 0.670315 |
1c789a7079593291c2c8002595f408fd1b78ab5b | 1,459 | py | Python | examples/AdsPixelSharedAgenciesEdge.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | null | null | null | examples/AdsPixelSharedAgenciesEdge.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | null | null | null | examples/AdsPixelSharedAgenciesEdge.py | pasha-r/facebook-python-ads-sdk | 76feadd77baed839516b53297628e7a254c8c3c0 | [
"CNRI-Python"
] | 1 | 2018-09-24T14:04:48.000Z | 2018-09-24T14:04:48.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 38.394737 | 76 | 0.784099 |
1c789e49678551ab9684432c569f34537d72cce6 | 11,681 | py | Python | axolotl/algorithms/tuners/tunable_base.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | axolotl/algorithms/tuners/tunable_base.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | axolotl/algorithms/tuners/tunable_base.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | import logging
import multiprocessing
import os
import uuid
import copy
from typing import Tuple
import re
import numpy as np
from d3m.metadata import hyperparams
from d3m.metadata.base import ArgumentType
from d3m.metadata.pipeline import Pipeline
from kerastuner.engine import trial as trial_module
from axolotl im... | 45.100386 | 139 | 0.629141 |
1c78bacc690a078d99dd2201077add383a3435db | 1,242 | py | Python | app/models.py | Muturi403/News | 7e8f0159a52e628bb048fa4718d5bf6c0e0e5998 | [
"MIT"
] | null | null | null | app/models.py | Muturi403/News | 7e8f0159a52e628bb048fa4718d5bf6c0e0e5998 | [
"MIT"
] | null | null | null | app/models.py | Muturi403/News | 7e8f0159a52e628bb048fa4718d5bf6c0e0e5998 | [
"MIT"
] | 1 | 2022-01-31T06:57:11.000Z | 2022-01-31T06:57:11.000Z | class Source:
'''
Sources class to define the news source objects
'''
def __init__(self, id, name, description, url, category):
self.id = id
self.name = name
self.description = description
self.url = url
self.category = category
class Article:
'''
... | 27 | 82 | 0.60789 |
1c78c894635bdf42a9002f414b6c6013260ca505 | 232 | py | Python | request.py | learnisearning/heart-disease-project | 5a4cd2c828c42495bd18394ad403e98f4c4d072a | [
"MIT"
] | null | null | null | request.py | learnisearning/heart-disease-project | 5a4cd2c828c42495bd18394ad403e98f4c4d072a | [
"MIT"
] | null | null | null | request.py | learnisearning/heart-disease-project | 5a4cd2c828c42495bd18394ad403e98f4c4d072a | [
"MIT"
] | null | null | null | import requests
url = 'http://localhost:5000/predict_api'
r = requests.post(url,json={'age':1, 'sex':1, 'cp':1,'trestbps':1,'chol':1,'fbs':1,'restecg':1,'thalach':1,'exang':1,'oldpeak':1,'slope':1,'ca':1,'thal':3})
print(r.json()) | 38.666667 | 156 | 0.637931 |
1c78e3694283fba7e6dcc6811a22122d28be5a26 | 6,625 | py | Python | pyhanko/pdf_utils/images.py | ooguz/pyHanko | f1490d9ecaa74ce600e464a27807290d486acc6f | [
"MIT"
] | null | null | null | pyhanko/pdf_utils/images.py | ooguz/pyHanko | f1490d9ecaa74ce600e464a27807290d486acc6f | [
"MIT"
] | null | null | null | pyhanko/pdf_utils/images.py | ooguz/pyHanko | f1490d9ecaa74ce600e464a27807290d486acc6f | [
"MIT"
] | 1 | 2021-04-08T05:11:03.000Z | 2021-04-08T05:11:03.000Z | """Utilities for embedding bitmap image data into PDF files.
The image data handling is done by
`Pillow <https://github.com/python-pillow/Pillow>`_.
.. note::
Note that also here we only support a subset of what the PDF standard
provides for. Most RGB and grayscale images (with or without transparency)
th... | 35.61828 | 80 | 0.635472 |
1c78faf397c15256c91f5adad92ac03df6d1f68b | 6,753 | py | Python | lottery/runner.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | 9 | 2021-03-30T20:43:26.000Z | 2021-12-28T06:25:17.000Z | lottery/runner.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | null | null | null | lottery/runner.py | xhchrn/open_lth | 6b3d04a12a2f868ce851bd09b330ea57957c1de6 | [
"MIT"
] | 2 | 2021-03-31T01:19:48.000Z | 2021-08-02T13:41:32.000Z | # 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.
import argparse
from foundations import paths
from cli import shared_args
from dataclasses import dataclass
from foundations.runner import Run... | 48.582734 | 140 | 0.684733 |
1c793a5a528fbbc792af3d2e7b5f2388b00cffb1 | 3,129 | py | Python | prefpanels/CachePanel.py | notatallshaw/Grail-0.6 | 2b850a4a3dcfcb6cb4cf891f2c2f9ee0509c7b43 | [
"CNRI-Jython"
] | null | null | null | prefpanels/CachePanel.py | notatallshaw/Grail-0.6 | 2b850a4a3dcfcb6cb4cf891f2c2f9ee0509c7b43 | [
"CNRI-Jython"
] | null | null | null | prefpanels/CachePanel.py | notatallshaw/Grail-0.6 | 2b850a4a3dcfcb6cb4cf891f2c2f9ee0509c7b43 | [
"CNRI-Jython"
] | null | null | null | """Grail cache preferences panel."""
__version__ = "$Revision: 1.14 $"
# Base class for the panel:
import PrefsPanels
from tkinter import *
import tk_tools
class CachePanel(PrefsPanels.Framework):
"""Miscellaneous preferences relating to the browser, startup, and
other behaviors that don't fit in specific ... | 31.606061 | 77 | 0.537552 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.