hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3a373e469546b3ab9cba2a722ab7dc51df112fb2 | 7,167 | py | Python | src/ops/sklearn_ops.py | pybokeh/dagster-examples | 459cfbe00585f1d123e49058685c74149efb867d | [
"MIT"
] | null | null | null | src/ops/sklearn_ops.py | pybokeh/dagster-examples | 459cfbe00585f1d123e49058685c74149efb867d | [
"MIT"
] | null | null | null | src/ops/sklearn_ops.py | pybokeh/dagster-examples | 459cfbe00585f1d123e49058685c74149efb867d | [
"MIT"
] | null | null | null | from dagster import op, In, Out, Output, String
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import SGDClassifier
import numpy as np
import pandas as pd
import scip... | 29.134146 | 98 | 0.610297 |
f06ab4aba44d268a0a0dc31f95fe18a717006bfe | 40 | py | Python | test/1.py | hopingpeople/test | 5b672c44e9b69275d45c59ab5e40b04b8e4fe105 | [
"MIT"
] | null | null | null | test/1.py | hopingpeople/test | 5b672c44e9b69275d45c59ab5e40b04b8e4fe105 | [
"MIT"
] | null | null | null | test/1.py | hopingpeople/test | 5b672c44e9b69275d45c59ab5e40b04b8e4fe105 | [
"MIT"
] | null | null | null | a = 1
b = 2
def sum():
return a+b
| 5.714286 | 14 | 0.45 |
fae6ce1c0a9f34f9eeb48cef4b1536a78e6a44d2 | 1,696 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/virtual_machine_agent_instance_view_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.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 ... | 42.4 | 115 | 0.664505 |
e84c66c0bdd05e5a00e446840fc4e50e173527c6 | 37,335 | py | Python | Lib/unittest/test/testmock/testasync.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 2,441 | 2020-07-31T06:45:53.000Z | 2022-03-30T15:56:49.000Z | Lib/unittest/test/testmock/testasync.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 238 | 2020-10-21T04:54:00.000Z | 2022-03-31T21:49:03.000Z | Lib/unittest/test/testmock/testasync.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 93 | 2020-08-09T12:00:17.000Z | 2022-03-25T07:57:24.000Z | import asyncio
import inspect
import re
import unittest
from unittest.mock import (ANY, call, AsyncMock, patch, MagicMock, Mock,
create_autospec, sentinel, _CallList)
def tearDownModule():
asyncio.set_event_loop_policy(None)
class AsyncClass:
def __init__(self):
pass
... | 35.693117 | 84 | 0.648078 |
d8d59c0ac46f2ab2bc9dd825cf7819b4f192a62d | 9,842 | py | Python | Examples/Python/models/customer_create.py | Duett-AS/DuettAPI | ffd2f6060d6cfcc62e18a1c3b00ba1db58d5d289 | [
"MIT"
] | 4 | 2021-11-25T10:25:02.000Z | 2021-12-01T09:37:55.000Z | Examples/Python/models/customer_create.py | Duett-AS/DuettAPI | ffd2f6060d6cfcc62e18a1c3b00ba1db58d5d289 | [
"MIT"
] | null | null | null | Examples/Python/models/customer_create.py | Duett-AS/DuettAPI | ffd2f6060d6cfcc62e18a1c3b00ba1db58d5d289 | [
"MIT"
] | 2 | 2021-11-26T11:23:26.000Z | 2021-12-09T10:44:34.000Z | # coding: utf-8
"""
OpenApi
##  _How to take the Duett api in use_ To be able to use the API, you must have an interaction key and a client key. Eksample curl: ```swift curl -X 'GET' \\ 'https://api.duett.no/articl... | 33.25 | 970 | 0.625787 |
b7f984436e21305aa509bcada6d51ec1ae4531d0 | 763 | py | Python | lesson1/exercise2_1.py | mfeindt0705/ansiblenetmf | 8e1935e030c8adf621b8a7b5866f7ebc65420f09 | [
"Apache-2.0"
] | null | null | null | lesson1/exercise2_1.py | mfeindt0705/ansiblenetmf | 8e1935e030c8adf621b8a7b5866f7ebc65420f09 | [
"Apache-2.0"
] | 5 | 2020-02-26T20:13:55.000Z | 2021-12-13T19:56:22.000Z | lesson1/exercise2_1.py | mfeindt0705/ansiblenetmf | 8e1935e030c8adf621b8a7b5866f7ebc65420f09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
define base functions for yaml file
read-file and write_file
"""
# !/usr/bin/env python3
"""
def basic functions for yaml processing
"""
import yaml
from pprint import pprint
def read_yaml(filename):
"""
yaml file processing
function has filename as input and returns the file d... | 20.078947 | 78 | 0.68152 |
de7416d92ccdf00fa437ba1a1fba0498623ed6ec | 16,422 | py | Python | backend/main.py | johnr0/LanguageRule | f97d0a0c560e8feffe4e4aa9eb88eeacccc3e11a | [
"MIT"
] | null | null | null | backend/main.py | johnr0/LanguageRule | f97d0a0c560e8feffe4e4aa9eb88eeacccc3e11a | [
"MIT"
] | null | null | null | backend/main.py | johnr0/LanguageRule | f97d0a0c560e8feffe4e4aa9eb88eeacccc3e11a | [
"MIT"
] | null | null | null | from sanic import Sanic
from sanic.response import json, file, text
from nltk.corpus import wordnet as wn
import numpy as np
import stanfordnlp
import nltk
from nltk.stem import WordNetLemmatizer
from empath import Empath
import json as js
from .db import db_connect, init_db
from .random_code import get_random_code
c... | 33.175758 | 114 | 0.6635 |
87be6b625896e405fac4d799b160f7f509ba6ce8 | 31,600 | py | Python | apps/life_sci/python/dgllife/utils/featurizers.py | shyustc/dgl | bdf1bb52e6cb7514e57d648bcba8ed660c11ca9c | [
"Apache-2.0"
] | 1 | 2020-04-10T04:22:01.000Z | 2020-04-10T04:22:01.000Z | apps/life_sci/python/dgllife/utils/featurizers.py | shyustc/dgl | bdf1bb52e6cb7514e57d648bcba8ed660c11ca9c | [
"Apache-2.0"
] | null | null | null | apps/life_sci/python/dgllife/utils/featurizers.py | shyustc/dgl | bdf1bb52e6cb7514e57d648bcba8ed660c11ca9c | [
"Apache-2.0"
] | null | null | null | """Node and edge featurization for molecular graphs."""
import dgl.backend as F
import itertools
import numpy as np
from collections import defaultdict
from rdkit import Chem
__all__ = ['one_hot_encoding',
'atom_type_one_hot',
'atomic_number_one_hot',
'atomic_number',
'atom... | 33.228181 | 106 | 0.609051 |
8fd5390ed2abaa6fd89508263c284fcd63395ca6 | 41,707 | py | Python | var/spack/repos/builtin/packages/py-tensorflow/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | var/spack/repos/builtin/packages/py-tensorflow/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/py-tensorflow/package.py | hainest/spack | c592e17d49118f253b552ef6165745ded8ac0ea5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
import tempfile
class PyTensorflow(Package, CudaPackage):
"""TensorFlow is an Open Source Software Librar... | 51.745658 | 147 | 0.61968 |
81e1e20ce65e2894ad2e497fa414faf67a68f00c | 14,103 | py | Python | tests/analyses/reaching_definitions/test_dep_graph.py | mikenawrocki/angr | 57f5593e902f5ad58709bc8f4ce7859134300ffb | [
"BSD-2-Clause"
] | 6,132 | 2015-08-06T23:24:47.000Z | 2022-03-31T21:49:34.000Z | tests/analyses/reaching_definitions/test_dep_graph.py | mikenawrocki/angr | 57f5593e902f5ad58709bc8f4ce7859134300ffb | [
"BSD-2-Clause"
] | 2,272 | 2015-08-10T08:40:07.000Z | 2022-03-31T23:46:44.000Z | tests/analyses/reaching_definitions/test_dep_graph.py | mikenawrocki/angr | 57f5593e902f5ad58709bc8f4ce7859134300ffb | [
"BSD-2-Clause"
] | 1,155 | 2015-08-06T23:37:39.000Z | 2022-03-31T05:54:11.000Z | # pylint: disable=no-self-use
from random import randrange
from unittest import mock, TestCase
import networkx
import claripy
from angr.code_location import CodeLocation
from angr.knowledge_plugins.key_definitions.atoms import Atom, MemoryLocation, Register
from angr.knowledge_plugins.key_definitions.definition impor... | 33.739234 | 150 | 0.647735 |
96e125ec5aa02313a1615a9630dae1a661e5c4fd | 2,339 | py | Python | srgan_pytorch/utils/transform.py | nisargshah1999/SRGAN-PyTorch | 093fba8ee4e571d71ac9644350bdd03a1a547765 | [
"Apache-2.0"
] | 2 | 2021-08-22T06:27:48.000Z | 2021-08-22T06:36:43.000Z | srgan_pytorch/utils/transform.py | ekstra26/SRGAN-PyTorch | 3cc4c034362070ba1e02549acca2088572fd7ec2 | [
"Apache-2.0"
] | null | null | null | srgan_pytorch/utils/transform.py | ekstra26/SRGAN-PyTorch | 3cc4c034362070ba1e02549acca2088572fd7ec2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Dakewe Biotech Corporation. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 30.376623 | 91 | 0.68106 |
90ce6b7b58ee0c317f2b5cda64d37a1a3c153449 | 9,068 | py | Python | mail/api.py | mitodl/odl-video-service | 9a292c88aa475f2ce720a93a769f7b46bcd8fa62 | [
"BSD-3-Clause"
] | 3 | 2017-08-19T02:00:28.000Z | 2022-01-11T20:53:37.000Z | mail/api.py | mitodl/odl-video-service | 9a292c88aa475f2ce720a93a769f7b46bcd8fa62 | [
"BSD-3-Clause"
] | 915 | 2017-04-18T15:46:40.000Z | 2022-03-23T17:47:03.000Z | mail/api.py | mitodl/odl-video-service | 9a292c88aa475f2ce720a93a769f7b46bcd8fa62 | [
"BSD-3-Clause"
] | null | null | null | """
Provides functions for sending and retrieving data about in-app email
"""
import json
import re
from urllib.parse import urljoin
import requests
from bs4 import BeautifulSoup
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string... | 34.090226 | 111 | 0.615792 |
9fb7b4d0cad67db2d2d4b56e43d8837b8160cdb0 | 68,302 | py | Python | python/paddle/fluid/layers/control_flow.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/control_flow.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/control_flow.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 34.759288 | 106 | 0.589763 |
d3fdeec8165e84bf7a43059c3c5c541ee72ccb58 | 68,892 | py | Python | lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py | mrosanes/taurus_deb | 119bf27193af0bbaaececf054eefb78beb6f117a | [
"CC-BY-3.0"
] | null | null | null | lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py | mrosanes/taurus_deb | 119bf27193af0bbaaececf054eefb78beb6f117a | [
"CC-BY-3.0"
] | null | null | null | lib/taurus/qt/qtgui/taurusgui/appsettingswizard.py | mrosanes/taurus_deb | 119bf27193af0bbaaececf054eefb78beb6f117a | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... | 41.007143 | 149 | 0.631321 |
0711b5ccedf98d759098fcf4ca4eadbc4df04e09 | 4,869 | py | Python | measures/validation/accuracy.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 3 | 2019-03-18T03:22:06.000Z | 2021-04-06T07:53:51.000Z | measures/validation/accuracy.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | null | null | null | measures/validation/accuracy.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 2 | 2020-10-05T08:22:25.000Z | 2020-10-05T08:24:02.000Z | #!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, February 2017
from classification.validation import knn... | 33.57931 | 150 | 0.681454 |
c289200558db6ebbacced9ff2a6427b372f8cdb6 | 498 | py | Python | calendertest.py | Soonyeon-Kim/TheShadowTree_in_Seoul | 3de33c7c9b4ce85b5fe927423b2356f2d34f1e33 | [
"Unlicense"
] | 1 | 2019-07-08T07:11:58.000Z | 2019-07-08T07:11:58.000Z | calendertest.py | Soonyeon-Kim/TheShadowTree_in_Seoul | 3de33c7c9b4ce85b5fe927423b2356f2d34f1e33 | [
"Unlicense"
] | null | null | null | calendertest.py | Soonyeon-Kim/TheShadowTree_in_Seoul | 3de33c7c9b4ce85b5fe927423b2356f2d34f1e33 | [
"Unlicense"
] | null | null | null | from datetime import date, timedelta
def date_cal(start_date, end_date):
d1 = date(int(start_date.split('-')[0]),int(start_date.split('-')[1]),int(start_date.split('-')[2]))
d2 = date(int(end_date.split('-')[0]),int(end_date.split('-')[1]),int(end_date.split('-')[2]))
delta = d2 - d1
dateli... | 27.666667 | 105 | 0.554217 |
40b769d8ab499e8451b5f892c5a33fccc467d18c | 15,384 | py | Python | env/Lib/site-packages/colorzero/tables.py | Nitinsd96/Air-Pollution-Monitoring-System | 4870223ce7b40b4ea465620a4c3d39cf617c6eff | [
"MIT"
] | 10 | 2018-10-16T15:53:09.000Z | 2020-08-19T06:06:23.000Z | env/Lib/site-packages/colorzero/tables.py | Nitinsd96/Air-Pollution-Monitoring-System | 4870223ce7b40b4ea465620a4c3d39cf617c6eff | [
"MIT"
] | 23 | 2018-10-13T16:00:43.000Z | 2019-04-27T19:08:58.000Z | env/Lib/site-packages/colorzero/tables.py | Nitinsd96/Air-Pollution-Monitoring-System | 4870223ce7b40b4ea465620a4c3d39cf617c6eff | [
"MIT"
] | 2 | 2018-11-04T17:55:53.000Z | 2018-11-18T17:33:27.000Z | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# The colorzero color library
# Copyright (c) 2016-2018 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sourc... | 31.654321 | 79 | 0.436882 |
0afb7609845a8aa4c47e7e7ac28415afba56b4a1 | 555 | py | Python | examples/cnn_specs.py | edessa/RLKit | de257a56b7d3d1990f66c6156a127d2038940f47 | [
"MIT"
] | null | null | null | examples/cnn_specs.py | edessa/RLKit | de257a56b7d3d1990f66c6156a127d2038940f47 | [
"MIT"
] | null | null | null | examples/cnn_specs.py | edessa/RLKit | de257a56b7d3d1990f66c6156a127d2038940f47 | [
"MIT"
] | null | null | null |
"""
padding is for image size (104, 80)
(obtained by downsample=2, crop_last_row=True)
"""
cnn_specs = dict()
# Too slow, ~150 seconds training per epoch
# Used on 84x84 size images
spec = dict(
kernel_sizes=[5,3,3,3,3],
strides=[3,1,1,2,1],
paddings=[0,1,1,1,1],
hidden_sizes=[64,64],
n_channels=... | 19.137931 | 46 | 0.618018 |
92d787e99b8532361b94928245d8a65521b3b100 | 972 | py | Python | isi_sdk_8_2_1/test/test_job_statistics_job_node_cpu.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_1/test/test_job_statistics_job_node_cpu.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_1/test/test_job_statistics_job_node_cpu.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 8
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_1
from i... | 23.707317 | 106 | 0.726337 |
de7bfe38580a3c5ddb60cc0cbabe4897095738e3 | 1,514 | py | Python | tests/2d_gaussian.py | DimitriMisiak/mcmc-red | caae0ce39d082e578176a5078a9184980b0851c3 | [
"MIT"
] | null | null | null | tests/2d_gaussian.py | DimitriMisiak/mcmc-red | caae0ce39d082e578176a5078a9184980b0851c3 | [
"MIT"
] | null | null | null | tests/2d_gaussian.py | DimitriMisiak/mcmc-red | caae0ce39d082e578176a5078a9184980b0851c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Handy MCMC scripts.
Test for the different fit method (mcmc, ptmcmc, minimizer).
Author:
Dimitri Misiak (misiak@ipnl.in2p3.fr)
"""
import numpy as np
import matplotlib.pyplot as plt
import sys
import scipy.signal as sgl
from os import path
import scipy.optimize ... | 24.031746 | 83 | 0.64531 |
b07e8827a295ac6401ec38dd567dd15bdf4fe7a6 | 64,385 | py | Python | pytorch/pytorchcv/models/common.py | sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | [
"MIT"
] | 1 | 2020-12-04T11:58:50.000Z | 2020-12-04T11:58:50.000Z | pytorch/pytorchcv/models/common.py | sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | [
"MIT"
] | null | null | null | pytorch/pytorchcv/models/common.py | sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | [
"MIT"
] | null | null | null | """
Common routines for models in PyTorch.
"""
__all__ = ['round_channels', 'Identity', 'Swish', 'HSigmoid', 'HSwish', 'get_activation_layer', 'SelectableDense',
'DenseBlock', 'ConvBlock1d', 'conv1x1', 'conv3x3', 'depthwise_conv3x3', 'ConvBlock', 'conv1x1_block',
'conv3x3_block', 'conv7x7_blo... | 31.468719 | 130 | 0.577262 |
92b83c2702b1993bd3da2408e821dd3a7aad14c4 | 2,807 | py | Python | mybot/lebowski/actions.py | osboo/sharegood | 76cca0fa8a65256d6694de66929dca9f21ebdbf9 | [
"MIT"
] | null | null | null | mybot/lebowski/actions.py | osboo/sharegood | 76cca0fa8a65256d6694de66929dca9f21ebdbf9 | [
"MIT"
] | 22 | 2021-08-08T15:33:50.000Z | 2021-09-24T01:12:54.000Z | mybot/lebowski/actions.py | osboo/sharegood | 76cca0fa8a65256d6694de66929dca9f21ebdbf9 | [
"MIT"
] | null | null | null | import logging
from azure.storage.table import TableService
from lebowski.azure_connections import AKVConnector
from lebowski.db import DBHelper
from lebowski.enums import CCY, Tables
from lebowski.external_api import get_eur_rates, get_gas_quotes
from lebowski.stat import convert_spendings_to_eur, get_total_mileage,... | 35.0875 | 114 | 0.694336 |
305af257e6d6ffba6ff0ed6653fa408f2830507f | 4,451 | py | Python | dynaconf/vendor_src/ruamel/yaml/scalarint.py | sephiartlist/dynaconf | 9c5f60b289c1f0fa3f899f1962a8fe5712c74eab | [
"MIT"
] | 2,293 | 2015-08-14T22:39:31.000Z | 2022-03-31T12:44:49.000Z | dynaconf/vendor_src/ruamel/yaml/scalarint.py | sephiartlist/dynaconf | 9c5f60b289c1f0fa3f899f1962a8fe5712c74eab | [
"MIT"
] | 676 | 2015-08-20T19:29:56.000Z | 2022-03-31T13:45:51.000Z | dynaconf/vendor_src/ruamel/yaml/scalarint.py | sephiartlist/dynaconf | 9c5f60b289c1f0fa3f899f1962a8fe5712c74eab | [
"MIT"
] | 255 | 2015-12-02T21:16:33.000Z | 2022-03-20T22:03:46.000Z | # coding: utf-8
from __future__ import print_function, absolute_import, division, unicode_literals
from .compat import no_limit_int # NOQA
from .anchor import Anchor
if False: # MYPY
from typing import Text, Any, Dict, List # NOQA
__all__ = ['ScalarInt', 'BinaryInt', 'OctalInt', 'HexInt', 'HexCapsInt', 'Deci... | 33.977099 | 95 | 0.601887 |
9f0fea9c716565cd883bbca9fbb3b0d1e0a72301 | 1,123 | py | Python | setup.py | liorcohen5/replay-monitor | 086ec57ccdd446b56da92fb4e735186e9e639f15 | [
"MIT"
] | null | null | null | setup.py | liorcohen5/replay-monitor | 086ec57ccdd446b56da92fb4e735186e9e639f15 | [
"MIT"
] | null | null | null | setup.py | liorcohen5/replay-monitor | 086ec57ccdd446b56da92fb4e735186e9e639f15 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="replay-monitor", # Replace with your own username
version="0.0.5",
author="Leor Cohen",
author_email="liorcohen5@gmail.com",
description="A tool for easy data exploration... | 40.107143 | 108 | 0.682992 |
7c4a7567c47a098a5987f328ba3ed4ed5a6f2bb5 | 2,685 | py | Python | tests/random_expression.py | Dobatymo/quepy | d56a5ae1310ef7c3e6e292a03a84ef922f192788 | [
"BSD-3-Clause"
] | null | null | null | tests/random_expression.py | Dobatymo/quepy | d56a5ae1310ef7c3e6e292a03a84ef922f192788 | [
"BSD-3-Clause"
] | null | null | null | tests/random_expression.py | Dobatymo/quepy | d56a5ae1310ef7c3e6e292a03a84ef922f192788 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
from builtins import chr
from future.utils import python_2_unicode_compatible
import random
from quepy.expression import Expression
def get_random_unichar():
# returns only encodable unicode chars
while True:
... | 28.56383 | 76 | 0.565736 |
a71189bbc184432881e09cba8270d1a57eece967 | 1,536 | py | Python | exp/python_c3_class_mro/python_c3_mro_anler_run.py | nicolasessisbreton/fython | 988f5a94cee8b16b0000501a22239195c73424a1 | [
"Apache-2.0"
] | 41 | 2016-01-21T05:14:45.000Z | 2021-11-24T20:37:21.000Z | exp/python_c3_class_mro/python_c3_mro_anler_run.py | nicolasessisbreton/fython | 988f5a94cee8b16b0000501a22239195c73424a1 | [
"Apache-2.0"
] | 5 | 2016-01-21T05:36:37.000Z | 2016-08-22T19:26:51.000Z | exp/python_c3_class_mro/python_c3_mro_anler_run.py | nicolasessisbreton/fython | 988f5a94cee8b16b0000501a22239195c73424a1 | [
"Apache-2.0"
] | 3 | 2016-01-23T04:03:44.000Z | 2016-08-21T15:58:38.000Z | import itertools
cls = 'd'
mro_lists = [ ['d', 'c'], ['c', 'b'], ['b', 'a'], ['a', 'o'] ]
# Make a copy so we don't change existing content
mro_lists = [list(mro_list[:]) for mro_list in mro_lists]
print(1, mro_lists)
# Set up the new MRO with the class itself
mro = []
print(2, cls)
# The real algorithm goes here
w... | 27.428571 | 74 | 0.690755 |
94ec6bb8a553e341c64bb05758629ca5d89785fd | 1,397 | py | Python | misc/python/materialize/feature_benchmark/executor.py | bobbyiliev/materialize | 44e3bcae151179075232ad436ae72f5883361fd1 | [
"MIT"
] | 1 | 2022-03-19T21:08:19.000Z | 2022-03-19T21:08:19.000Z | misc/python/materialize/feature_benchmark/executor.py | bobbyiliev/materialize | 44e3bcae151179075232ad436ae72f5883361fd1 | [
"MIT"
] | 203 | 2022-01-04T00:16:23.000Z | 2022-03-30T17:34:01.000Z | misc/python/materialize/feature_benchmark/executor.py | guswynn/materialize | f433173ed71f511d91311769ec58c2d427dd6c3b | [
"MIT"
] | null | null | null | # Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | 28.510204 | 70 | 0.621331 |
757c7481f4c6d15b2fe5ea28f08116ae8ebbd7dd | 3,774 | py | Python | ci/appveyor-download.py | metrasynth/sunvosc | 65ccd1015d55e6e91e6ac3d33ca7677ce4fbeb15 | [
"MIT"
] | 2 | 2017-02-27T06:05:50.000Z | 2017-07-31T12:14:35.000Z | ci/appveyor-download.py | metrasynth/SunVOSC | 65ccd1015d55e6e91e6ac3d33ca7677ce4fbeb15 | [
"MIT"
] | 1 | 2016-10-22T17:37:05.000Z | 2016-10-22T17:37:05.000Z | ci/appveyor-download.py | metrasynth/sunvosc | 65ccd1015d55e6e91e6ac3d33ca7677ce4fbeb15 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Use the AppVeyor API to download Windows artifacts.
Taken from: https://bitbucket.org/ned/coveragepy/src/tip/ci/download_appveyor.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""
i... | 34.944444 | 104 | 0.622682 |
a26eb550098198378abf34ad7d980227fc486a8b | 2,332 | py | Python | pythonprog/code/13/13.2/table.py | davidyshuang/python3 | 5200638f6c4450998d97a9ac24bcba0872786fb2 | [
"Unlicense"
] | null | null | null | pythonprog/code/13/13.2/table.py | davidyshuang/python3 | 5200638f6c4450998d97a9ac24bcba0872786fb2 | [
"Unlicense"
] | null | null | null | pythonprog/code/13/13.2/table.py | davidyshuang/python3 | 5200638f6c4450998d97a9ac24bcba0872786fb2 | [
"Unlicense"
] | null | null | null | # table.py
import sys
from abc import ABCMeta, abstractmethod
def print_table(objects, colnames, formatter):
'''
Make a nicely formatted table showing attributes from a list of objects
'''
if not isinstance(formatter, TableFormatter):
raise TypeError('formatter must be a TableFormatter')
f... | 28.096386 | 83 | 0.607204 |
6cd0c96185ad106f0b0f0bc9cddd05e459c2d191 | 914 | py | Python | Libraries/matrix.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | Libraries/matrix.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | Libraries/matrix.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | from copy import deepcopy
MOD = 1000000000
# 2x2行列 A * B
def multiply(A, B):
global MOD
C = [[0, 0], [0, 0]]
for i in range(2):
for j in range(2):
for k in range(2):
C[i][j] += A[i][k] * B[k][j]
C[i][j] %= MOD
return C
# Aのn乗
def power(A, n):
P ... | 21.255814 | 58 | 0.447484 |
dd5afae3f3e7fad9b3722ff3288cf2e11d34de11 | 5,683 | py | Python | CPG_core/controllers/CPG_controller_snake_sin.py | Jerryxiaoyu/maml_rl_v2 | 6091f996ff1be8e80d80331e510087868461b8e6 | [
"MIT"
] | null | null | null | CPG_core/controllers/CPG_controller_snake_sin.py | Jerryxiaoyu/maml_rl_v2 | 6091f996ff1be8e80d80331e510087868461b8e6 | [
"MIT"
] | null | null | null | CPG_core/controllers/CPG_controller_snake_sin.py | Jerryxiaoyu/maml_rl_v2 | 6091f996ff1be8e80d80331e510087868461b8e6 | [
"MIT"
] | null | null | null | from CPG_core.CPG_Sin_osillator import sin_oscillator
from CPG_core.CPG_Sin_osillator import CPG_Sinneutron
import math
class CPG_network(object):
def __init__(self, CPG_node_num, position_vector):
kf = position_vector[0]
self.CPG_node_num = CPG_node_num # 不包括placemarker
... | 36.197452 | 132 | 0.535633 |
892abbd826ef8c71aafc1bac57eb09f0cf32c912 | 12,691 | py | Python | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/tokenization_xlm_roberta.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 96 | 2021-06-16T09:06:52.000Z | 2022-03-26T09:56:32.000Z | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/tokenization_xlm_roberta.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 16 | 2021-07-01T05:34:48.000Z | 2022-03-28T09:40:15.000Z | packages/pytea/pytest/benchmarks/transformers/missing_idx/src/transformers/tokenization_xlm_roberta.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 24 | 2021-06-19T15:58:31.000Z | 2022-03-14T09:17:19.000Z | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
#
# 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://ww... | 44.529825 | 161 | 0.635332 |
a4edb60df9d6b652f3452c195cf7213519056769 | 4,672 | py | Python | tests/bugs/core_4484_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_4484_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_4484_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_4484
# title: Description (COMMENT ON) for package procedures and functions, and its parameters
# decription: Test verifies ability to store comments and also to encode them in UTF8
# tracker_id: CORE-4484
# min_versions: ['3.0']
# versions: 3.0
# qmid:
... | 31.782313 | 157 | 0.514769 |
fe144ee6367fc8208f408c8ed22d2e081abcda47 | 1,039 | py | Python | leetcode/054-Spiral-Matrix/SpiralMatrix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/054-Spiral-Matrix/SpiralMatrix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/054-Spiral-Matrix/SpiralMatrix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[][]} matrix
# @return {integer[]}
def spiralOrder(self, matrix):
if len(matrix) == 0 or len(matrix[0]) == 0:
return []
res = []
top, bottom = 0, len(matrix) - 1
left, right = 0, len(matrix[0]) - 1
while left < right and to... | 33.516129 | 51 | 0.455245 |
4ae91a99e63fd655034f5d722e78c72c3992e260 | 894 | py | Python | ultron8/api/resource.py | bossjones/ultron8 | 45db73d32542a844570d44bc83defa935e15803f | [
"Apache-2.0",
"MIT"
] | null | null | null | ultron8/api/resource.py | bossjones/ultron8 | 45db73d32542a844570d44bc83defa935e15803f | [
"Apache-2.0",
"MIT"
] | 43 | 2019-06-01T23:08:32.000Z | 2022-02-07T22:24:53.000Z | ultron8/api/resource.py | bossjones/ultron8 | 45db73d32542a844570d44bc83defa935e15803f | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Web Services Interface used by command-line clients and web frontend to
view current state, event history and send commands to trond.
"""
import collections
import datetime
import logging
import ujson as json
log = logging.getLogger(__name__)
class LogAdapter(object):
def __init__(self, logger):
sel... | 20.790698 | 71 | 0.645414 |
9cc282306f9cf31c6751620ab290c5227ba792d2 | 1,186 | py | Python | pyMacID.py | pudquick/pyMacID | d55a18fc30398813d9ed22411c573b80d1ffc3b0 | [
"MIT",
"Unlicense"
] | 1 | 2021-04-16T12:09:29.000Z | 2021-04-16T12:09:29.000Z | pyMacID.py | pudquick/pyMacID | d55a18fc30398813d9ed22411c573b80d1ffc3b0 | [
"MIT",
"Unlicense"
] | null | null | null | pyMacID.py | pudquick/pyMacID | d55a18fc30398813d9ed22411c573b80d1ffc3b0 | [
"MIT",
"Unlicense"
] | null | null | null | # Get the Computer Name from System Preferences -> Sharing
from SystemConfiguration import SCDynamicStoreCopyComputerName
try:
computer_name = SCDynamicStoreCopyComputerName(None, None)[0].encode('utf-8')
except:
computer_name = None
# Get the Bonjour .local name
from socket import gethostname
try:
bonjour... | 32.054054 | 140 | 0.79511 |
ef21e0efeaca211c3e46a7442f24a21bff6835a0 | 2,788 | py | Python | CIM15/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 58 | 2015-04-22T10:41:03.000Z | 2022-03-29T16:04:34.000Z | CIM15/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 12 | 2015-08-26T03:57:23.000Z | 2020-12-11T20:14:42.000Z | CIM15/IEC61970/Informative/InfGMLSupport/GmlFeatureType.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 35 | 2015-01-10T12:21:03.000Z | 2020-09-09T08:18:16.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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 use, copy, modify, merge, publish... | 39.267606 | 84 | 0.708034 |
36fe3b35dfaf120d17288c8dc1d14a96a1fb9707 | 37,111 | py | Python | libcxx/utils/generate_feature_test_macro_components.py | keryell/llvm-2 | 4dc23a26d1bd6ced23969c0525dedbddf8c6fddc | [
"Apache-2.0"
] | null | null | null | libcxx/utils/generate_feature_test_macro_components.py | keryell/llvm-2 | 4dc23a26d1bd6ced23969c0525dedbddf8c6fddc | [
"Apache-2.0"
] | null | null | null | libcxx/utils/generate_feature_test_macro_components.py | keryell/llvm-2 | 4dc23a26d1bd6ced23969c0525dedbddf8c6fddc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from builtins import range
from functools import reduce
def get_libcxx_paths():
utils_path = os.path.dirname(os.path.abspath(__file__))
script_name = os.path.basename(__file__)
assert os.path.exists(utils_path)
src_root = os.path.dirname(utils_path)
include_path = os.path.joi... | 33.046305 | 157 | 0.600711 |
b21ff581e97c70c0597fce0531d0c489d93d54b7 | 13 | py | Python | semiempy/integrals/__init__.py | amandadumi/semiempy | 2f8ed7e9fb033772f2c34381de3c3faa3a05e3ab | [
"BSD-3-Clause"
] | 6 | 2019-01-14T15:50:10.000Z | 2019-03-26T07:08:33.000Z | semiempy/integrals/__init__.py | amandadumi/semiempy | 2f8ed7e9fb033772f2c34381de3c3faa3a05e3ab | [
"BSD-3-Clause"
] | 4 | 2019-01-14T15:45:08.000Z | 2019-03-04T15:26:15.000Z | semiempy/integrals/__init__.py | amandadumi/semiempy | 2f8ed7e9fb033772f2c34381de3c3faa3a05e3ab | [
"BSD-3-Clause"
] | 2 | 2019-01-14T15:23:44.000Z | 2019-01-14T15:51:07.000Z | # Integrals
| 4.333333 | 11 | 0.692308 |
d251fe1da26e9b2d6bfd5387933a05b68272f3cc | 924 | py | Python | src/reformat-axiomata.py | mac389/sudo | 470dc2506bfed51c166ba8c13c818261ece32d56 | [
"MIT"
] | null | null | null | src/reformat-axiomata.py | mac389/sudo | 470dc2506bfed51c166ba8c13c818261ece32d56 | [
"MIT"
] | null | null | null | src/reformat-axiomata.py | mac389/sudo | 470dc2506bfed51c166ba8c13c818261ece32d56 | [
"MIT"
] | null | null | null | import csv, os
from tqdm import tqdm
from pprint import pprint
filename = os.path.join('..','jamia-axiomata.csv')
contents = list(csv.DictReader(open(filename,'r'),delimiter='\t',skipinitialspace=True))
PATH = os.path.join('..','problog','could-create-mln-file')
translation_table = {item['original']:item['convert... | 36.96 | 88 | 0.718615 |
8f3b186461d7c89f3b467d6376307b510711df82 | 1,854 | py | Python | WOTS.py | lothar1998/XMSS-tree | 3e491d6d4b82de1934f7a9b405730ec1ac7d2e54 | [
"MIT"
] | 1 | 2021-08-13T08:24:23.000Z | 2021-08-13T08:24:23.000Z | WOTS.py | lothar1998/XMSS-tree | 3e491d6d4b82de1934f7a9b405730ec1ac7d2e54 | [
"MIT"
] | null | null | null | WOTS.py | lothar1998/XMSS-tree | 3e491d6d4b82de1934f7a9b405730ec1ac7d2e54 | [
"MIT"
] | null | null | null | from utils import *
def WOTS_genSK(length, n):
secret_key = [bytes()] * length
for i in range(length):
SEED = generate_random_value(length)
secret_key[i] = pseudorandom_function(SEED, n)
return secret_key
def WOTS_genPK(private_key: [bytes], length: int, w: int in {4, 16}, SEED, addre... | 25.054054 | 89 | 0.618123 |
542bfdb8541c35e42a35caff1ee698791a97cc51 | 2,215 | py | Python | cpurger.py | updatedenis5300/compact-purger | 311daae1037e2bf3786f2e882732919586799e55 | [
"MIT"
] | null | null | null | cpurger.py | updatedenis5300/compact-purger | 311daae1037e2bf3786f2e882732919586799e55 | [
"MIT"
] | null | null | null | cpurger.py | updatedenis5300/compact-purger | 311daae1037e2bf3786f2e882732919586799e55 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import argparse
import os
import glob
# Defualt path
dir_path = os.path.dirname(os.path.realpath(__file__))
def create_parser ():
parser = argparse.ArgumentParser(description='Tool for revoming useless files')
parser.add_argument('file_types', metavar='T'... | 30.342466 | 111 | 0.695711 |
741097e99387db61805ca827d093de1d0e28b8f6 | 119 | py | Python | gitlean/urls.py | franck-roland/GitPlan | 76260186d2d78bbe5ba3b2c6222a437d6d535d7e | [
"Apache-2.0"
] | null | null | null | gitlean/urls.py | franck-roland/GitPlan | 76260186d2d78bbe5ba3b2c6222a437d6d535d7e | [
"Apache-2.0"
] | null | null | null | gitlean/urls.py | franck-roland/GitPlan | 76260186d2d78bbe5ba3b2c6222a437d6d535d7e | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.githook, name='githook'),
]
| 17 | 46 | 0.672269 |
4b366472b0401abeaa53135e4e8e7222e70f5dcc | 785 | py | Python | src/pyxltab/pyxltab.py | blakeNaccarato/pyxltab | 55963598cf70cebe3c5939e6f227f4e487839012 | [
"MIT"
] | null | null | null | src/pyxltab/pyxltab.py | blakeNaccarato/pyxltab | 55963598cf70cebe3c5939e6f227f4e487839012 | [
"MIT"
] | null | null | null | src/pyxltab/pyxltab.py | blakeNaccarato/pyxltab | 55963598cf70cebe3c5939e6f227f4e487839012 | [
"MIT"
] | null | null | null | """
Extends `openpyxl` classes for easier operation on Excel tables.
"""
__all__ = ["attach", "get_tables"]
from typing import Dict, Union
from pyxltab import classes
def attach(openpyxl_book: classes.openpyxl_Workbook) -> classes.Book:
"""
Attach to an `openpyxl` workbook, allowing other operations to be ... | 20.657895 | 80 | 0.66242 |
ae5a7020d43f3c0f2ab84412f5f95e076a73ae58 | 11,028 | py | Python | third_party/pybind11/tests/test_numpy_dtypes.py | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 29 | 2019-11-27T00:43:07.000Z | 2020-02-25T14:35:54.000Z | third_party/pybind11/tests/test_numpy_dtypes.py | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 7 | 2019-07-22T21:10:03.000Z | 2021-12-14T16:53:27.000Z | third_party/pybind11/tests/test_numpy_dtypes.py | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 13 | 2019-07-31T09:16:58.000Z | 2022-03-29T15:12:40.000Z | import re
import pytest
from pybind11_tests import numpy_dtypes as m
pytestmark = pytest.requires_numpy
with pytest.suppress(ImportError):
import numpy as np
@pytest.fixture(scope='module')
def simple_dtype():
ld = np.dtype('longdouble')
return np.dtype({'names': ['bool_', 'uint_', 'float_', 'ldbl_'],
... | 35.459807 | 99 | 0.547515 |
a3e37f377f172410daab48a533fc8797664db7ab | 549 | py | Python | Caller.py | Jemeni11/Lyric-Translator_ | 622e1e49e1af46d2d8bf6ecf3063a63dabddfcf1 | [
"MIT"
] | null | null | null | Caller.py | Jemeni11/Lyric-Translator_ | 622e1e49e1af46d2d8bf6ecf3063a63dabddfcf1 | [
"MIT"
] | null | null | null | Caller.py | Jemeni11/Lyric-Translator_ | 622e1e49e1af46d2d8bf6ecf3063a63dabddfcf1 | [
"MIT"
] | null | null | null | from translathor import translator
from apicalls import *
def caller():
intention = input(
"To get songs by an artist use (F)\nTo get music lyrics use(G)\nUse (H) to get lyrics and translate -->")
if intention.lower() not in ['f', 'g', 'h'] :
exit("Lmao, get serious abeg")
elif intention.lo... | 26.142857 | 113 | 0.593807 |
a79bed0c1856db5840981f989df3afe66885e31a | 521 | py | Python | pagetools/widgets/tests/test_commands.py | theithec/pagetools | f5fba7213864555275bddcc1882122f3be843f19 | [
"MIT"
] | null | null | null | pagetools/widgets/tests/test_commands.py | theithec/pagetools | f5fba7213864555275bddcc1882122f3be843f19 | [
"MIT"
] | null | null | null | pagetools/widgets/tests/test_commands.py | theithec/pagetools | f5fba7213864555275bddcc1882122f3be843f19 | [
"MIT"
] | null | null | null | from django.core.management import call_command
from django.test import TestCase
from pagetools.widgets.models import TemplateTagWidget
from pagetools.widgets.settings import TEMPLATETAG_WIDGETS
class CommandsTestCase(TestCase):
def test_mycommand(self):
"Test my custom command."
args = []
... | 30.647059 | 70 | 0.735125 |
d4c3ddd4fa3aa1f990f31ec2b2c50d9e5288b3a2 | 37,320 | py | Python | tensorflow_tts/models/tacotron2.py | krisk84/TensorFlowTTS | 4fe289cd0d6aca79bf2501271f048800a5071cd0 | [
"Apache-2.0"
] | 3 | 2020-12-09T11:29:22.000Z | 2021-07-23T07:53:56.000Z | tensorflow_tts/models/tacotron2.py | krisk84/TensorFlowTTS | 4fe289cd0d6aca79bf2501271f048800a5071cd0 | [
"Apache-2.0"
] | null | null | null | tensorflow_tts/models/tacotron2.py | krisk84/TensorFlowTTS | 4fe289cd0d6aca79bf2501271f048800a5071cd0 | [
"Apache-2.0"
] | 1 | 2021-01-27T08:54:48.000Z | 2021-01-27T08:54:48.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 The Tacotron-2 Authors, Minh Nguyen (@dathudeptrai), Eren Gölge (@erogol) and Jae Yoo (@jaeyoo)
#
# 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
#
# ... | 35.884615 | 112 | 0.632262 |
9f3e7b71d1c571aef430ba87aedd39ff6ad35ce9 | 2,614 | py | Python | venv/Lib/site-packages/pandas/core/internals/api.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/core/internals/api.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/core/internals/api.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | """
This is a pseudo-public API for downstream libraries. We ask that downstream
authors
1) Try to avoid using internals directly altogether, and failing that,
2) Use only functions exposed here (or in core.internals)
"""
from __future__ import annotations
import numpy as np
from pandas._libs.internals... | 29.370787 | 82 | 0.67062 |
d86bb1ae754832790703d6430562c7bd421c634e | 660 | py | Python | langford/langford.py | tlocke/geocache | 53add754625d00779f676671ea595dc660fa0e82 | [
"MIT"
] | null | null | null | langford/langford.py | tlocke/geocache | 53add754625d00779f676671ea595dc660fa0e82 | [
"MIT"
] | null | null | null | langford/langford.py | tlocke/geocache | 53add754625d00779f676671ea595dc660fa0e82 | [
"MIT"
] | null | null | null | sols = []
def langford(remain, sofar):
try:
c = sofar[-1]
idx = sofar[:-1].index(c)
if len(sofar) - idx - 2 != c:
return
except ValueError:
pass
except IndexError:
pass
if sum(remain.values()) == 0:
sols.append(sofar)
print("found sol... | 20.625 | 48 | 0.477273 |
89deace523bb9bafdda63049940ddf36279c9bc6 | 649 | py | Python | migrations/versions/2bc31ea34c8f_.py | bestwishfang/FrameWork | 99f5a0316335e9df7b9da7b2af092cc735c7473c | [
"MIT"
] | null | null | null | migrations/versions/2bc31ea34c8f_.py | bestwishfang/FrameWork | 99f5a0316335e9df7b9da7b2af092cc735c7473c | [
"MIT"
] | null | null | null | migrations/versions/2bc31ea34c8f_.py | bestwishfang/FrameWork | 99f5a0316335e9df7b9da7b2af092cc735c7473c | [
"MIT"
] | null | null | null | """empty message
Revision ID: 2bc31ea34c8f
Revises: 016b9025f91a
Create Date: 2021-02-05 09:34:20.910591
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2bc31ea34c8f'
down_revision = '016b9025f91a'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.37931 | 76 | 0.688752 |
e27294db4ec2e8ec8d2c7bf0551f007bf3a50bb1 | 53,516 | py | Python | test/orm/test_events.py | Cito/sqlalchemy | c4dede6e7c1420aacc54c9c326bf3a834dff45c7 | [
"MIT"
] | 1 | 2021-02-22T15:00:47.000Z | 2021-02-22T15:00:47.000Z | test/orm/test_events.py | xqzhou/sqlalchemy | e21cd0d95fb6cdcb4e10ea78abd5626bb92c37c3 | [
"MIT"
] | null | null | null | test/orm/test_events.py | xqzhou/sqlalchemy | e21cd0d95fb6cdcb4e10ea78abd5626bb92c37c3 | [
"MIT"
] | null | null | null | from sqlalchemy.testing import assert_raises_message, assert_raises
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy import Integer, String
from sqlalchemy.testing.schema import Table, Column
from sqlalchemy.orm import mapper, relationship, \
create_session, class_mapper, \
Mapper, column_... | 29.615938 | 96 | 0.560655 |
336d5f39291c302e648faafd72ed5d30ed611cae | 2,391 | py | Python | data_tools/train_test_split.py | bsm8734/formula-image-latex-recognition | 86d5070e8f907571a47967d64facaee246d92a35 | [
"MIT"
] | 13 | 2021-06-20T18:11:23.000Z | 2021-12-07T18:06:42.000Z | data_tools/train_test_split.py | bsm8734/formula-image-latex-recognition | 86d5070e8f907571a47967d64facaee246d92a35 | [
"MIT"
] | 9 | 2021-06-16T14:55:07.000Z | 2021-06-23T14:45:36.000Z | data_tools/train_test_split.py | bsm8734/formula-image-latex-recognition | 86d5070e8f907571a47967d64facaee246d92a35 | [
"MIT"
] | 6 | 2021-06-17T15:16:50.000Z | 2021-07-05T20:41:26.000Z | import argparse
import csv
import os
import random
test_percent = 0.2
output_dir = "gt-split"
# Split the ground truth into train, test sets
def split_gt(groundtruth, test_percent=0.2, data_num=None):
"""Split the ground truth into train, test sets
Args:
groundtruth (text file) : ground truth file
... | 28.464286 | 117 | 0.609787 |
5284a605bbfd1c8189766fc2dbe6944f6f59ea34 | 875 | py | Python | Desafios/desafio94.py | gustavodoamaral/115_Desafios_Python | 8baa1c0353a40f7a63f442293bc0f6852fd94da0 | [
"MIT"
] | 1 | 2022-02-07T01:12:19.000Z | 2022-02-07T01:12:19.000Z | Desafios/desafio94.py | gustavodoamaral/desafios_python_gustavo_guanabara | 8baa1c0353a40f7a63f442293bc0f6852fd94da0 | [
"MIT"
] | null | null | null | Desafios/desafio94.py | gustavodoamaral/desafios_python_gustavo_guanabara | 8baa1c0353a40f7a63f442293bc0f6852fd94da0 | [
"MIT"
] | null | null | null | pessoaslist = []
dicionario = {}
pessoastotal = 0
soma = media = 0
mulheres = []
acimamedia = []
while True:
dicionario['Nome'] = str(input("Nome: "))
dicionario['Sexo'] = str(input("Sexo: [M/F] "))
dicionario['Idade'] = int(input("Idade: "))
resp = str(input("Continuar?: [S/N]"))
pessoaslist.appe... | 33.653846 | 136 | 0.616 |
be2e5e45f9e44ebb2aae9217dd4bd949f6b5369f | 6,484 | py | Python | train_nerf.py | matajoh/fourier_feature_nets | 784140f01464e34a0dd4b813c50d20c4c15a8a59 | [
"MIT"
] | 88 | 2021-11-24T09:22:43.000Z | 2022-03-28T20:34:51.000Z | train_nerf.py | matajoh/fourier_feature_nets | 784140f01464e34a0dd4b813c50d20c4c15a8a59 | [
"MIT"
] | 1 | 2022-01-04T18:13:18.000Z | 2022-01-25T09:36:52.000Z | train_nerf.py | matajoh/fourier_feature_nets | 784140f01464e34a0dd4b813c50d20c4c15a8a59 | [
"MIT"
] | 5 | 2021-11-27T13:48:22.000Z | 2022-03-28T20:35:24.000Z | """Script to train a full NeRF model."""
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
import json
import os
import fourier_feature_nets as ffn
import numpy as np
import torch
def _parse_args():
parser = ArgumentParser("NeRF Training script",
formatter_class=Argu... | 45.661972 | 78 | 0.588834 |
8f21dd63c6cf72af25249fe99e952b46bddcdbbe | 128,199 | py | Python | lrs/tests/test_Statement.py | dblacksmith/ADL_LRS | 4732f62a53fecf76844a8b5fb420db0f5aed4647 | [
"Apache-2.0"
] | null | null | null | lrs/tests/test_Statement.py | dblacksmith/ADL_LRS | 4732f62a53fecf76844a8b5fb420db0f5aed4647 | [
"Apache-2.0"
] | null | null | null | lrs/tests/test_Statement.py | dblacksmith/ADL_LRS | 4732f62a53fecf76844a8b5fb420db0f5aed4647 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import base64
import uuid
import urllib
import hashlib
from datetime import datetime, timedelta
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.timezone import utc
from django.conf import settings
from django.test.utils import overrid... | 64.812437 | 306 | 0.536946 |
078aebba0281776544583a695d22daa9f51176e7 | 770 | py | Python | classroom/api/urls.py | anish1997bendarkar/pytest | de7bf758e75b7c4f921e89b2695aca14bf48ee05 | [
"MIT"
] | 16 | 2020-02-26T09:52:43.000Z | 2021-12-21T07:03:10.000Z | classroom/api/urls.py | anish1997bendarkar/pytest | de7bf758e75b7c4f921e89b2695aca14bf48ee05 | [
"MIT"
] | 4 | 2021-03-18T23:31:32.000Z | 2021-06-10T18:25:30.000Z | classroom/api/urls.py | anish1997bendarkar/pytest | de7bf758e75b7c4f921e89b2695aca14bf48ee05 | [
"MIT"
] | 11 | 2020-06-05T00:06:11.000Z | 2022-02-14T07:50:31.000Z | from django.contrib import admin
from django.urls import path
from .views import (
StudentListAPIView,
StudentCreateAPIView,
StudentDeleteAPIView,
StudentDetailAPIView,
ClassroomNumberAPIView,
)
urlpatterns = [
path("student/list/", StudentListAPIView.as_view(), name="student_list_api"),
p... | 26.551724 | 87 | 0.671429 |
aa8cdd7fde92cc507f56b0b25c5e7a6c822ceb32 | 17,630 | py | Python | peeringdb/http.py | adamgent/peering-manager | 46858766cf131da2378010189d13485dec98332f | [
"Apache-2.0"
] | null | null | null | peeringdb/http.py | adamgent/peering-manager | 46858766cf131da2378010189d13485dec98332f | [
"Apache-2.0"
] | null | null | null | peeringdb/http.py | adamgent/peering-manager | 46858766cf131da2378010189d13485dec98332f | [
"Apache-2.0"
] | null | null | null | import json
import logging
import requests
from django.db import transaction
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist, ValidationError
from django.utils import timezone
from .models import Network, NetworkIXLAN, PeerRecord, Prefix, Synchronization
NAMESPACES = {
"fac... | 35.26 | 87 | 0.57544 |
bd6eba807c280f3006e20fe7adcfa8cbeff7fa9e | 1,183 | py | Python | opencanary/modules/sip.py | amorrowbellarmine/opencanary | a25209888faa3fbaa15db09e419d03b42897a7d5 | [
"BSD-3-Clause"
] | 1,412 | 2015-08-06T03:54:37.000Z | 2022-03-29T07:30:54.000Z | opencanary/modules/sip.py | amorrowbellarmine/opencanary | a25209888faa3fbaa15db09e419d03b42897a7d5 | [
"BSD-3-Clause"
] | 170 | 2015-08-11T00:33:06.000Z | 2022-03-30T05:11:38.000Z | opencanary/modules/sip.py | amorrowbellarmine/opencanary | a25209888faa3fbaa15db09e419d03b42897a7d5 | [
"BSD-3-Clause"
] | 297 | 2015-08-17T09:25:41.000Z | 2022-03-31T08:25:41.000Z | from opencanary.modules import CanaryService
from twisted.application import internet
from twisted.protocols.sip import Base
from twisted.internet.address import IPv4Address
"""
A log-only SIP server. It won't respond, but it will log any
SIP requests sent its way.
"""
class SIPServer(Base):
def handle_r... | 33.8 | 81 | 0.682164 |
b811a63acad21c85cc38b3b6ac1e1026db9940c3 | 7,507 | py | Python | pytorch_optimizers/adam.py | madsbk/pytorch_optimizers | 10eefd83277237d3aa2788a2a5a47ba3294a6e50 | [
"Apache-2.0"
] | null | null | null | pytorch_optimizers/adam.py | madsbk/pytorch_optimizers | 10eefd83277237d3aa2788a2a5a47ba3294a6e50 | [
"Apache-2.0"
] | null | null | null | pytorch_optimizers/adam.py | madsbk/pytorch_optimizers | 10eefd83277237d3aa2788a2a5a47ba3294a6e50 | [
"Apache-2.0"
] | null | null | null | import math
import os
from distutils.util import strtobool
import torch
from torch.optim.optimizer import Optimizer
from torch.hub import _check_module_exists
NUMBA_CUDA_EXIST = False
NUMBA_CUDA_THREAD_PER_BLOCK = 512
if not strtobool(os.environ.get('NO_NUMBA', 'n')) and _check_module_exists("numba.cuda"):
import ... | 45.49697 | 100 | 0.515785 |
77a0c2c02d3262294696213f2e32732df83ea738 | 525 | py | Python | class4/exercise5.py | agonzo777/pynet | 8b2c2bbd71ea001ba0dc2acb20a4d46c7ddeaa12 | [
"Apache-2.0"
] | null | null | null | class4/exercise5.py | agonzo777/pynet | 8b2c2bbd71ea001ba0dc2acb20a4d46c7ddeaa12 | [
"Apache-2.0"
] | null | null | null | class4/exercise5.py | agonzo777/pynet | 8b2c2bbd71ea001ba0dc2acb20a4d46c7ddeaa12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import pexpect
import time
import netmiko
from netmiko import ConnectHandler
password = '88newclass'
pynet1 = {
'device_type': 'cisco_ios',
'ip': '50.76.53.27',
'username': 'pyclass',
'password': password,
}
pynet2 = {
'device_type': 'cisco_ios',
'ip': '50.76.53.27',
... | 15.909091 | 34 | 0.653333 |
0c65afa180db47038d20348fd747c92c3b44f8ef | 7,344 | py | Python | commands/views.py | guptaharsh13/notifIEEE | 359ba33410ba3cd0b16fdbdfe6bfb45117067ece | [
"MIT"
] | 1 | 2022-01-08T19:02:22.000Z | 2022-01-08T19:02:22.000Z | commands/views.py | guptaharsh13/notifIEEE | 359ba33410ba3cd0b16fdbdfe6bfb45117067ece | [
"MIT"
] | null | null | null | commands/views.py | guptaharsh13/notifIEEE | 359ba33410ba3cd0b16fdbdfe6bfb45117067ece | [
"MIT"
] | null | null | null | from datetime import datetime
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from django.conf import settings
import slack
import re
from utils.scheduler import scheduleMeet
from pprint import pprint
SLACK_VERIFICATION_TOKEN = getattr(settings, "... | 33.688073 | 123 | 0.513617 |
ec47428f90d74efe86c02bfc80e62ef3e5e23521 | 4,283 | py | Python | jesse/store/__init__.py | slipperlobster/flipper | 8482edd77604fcec2ea08913f1748c21be80dac7 | [
"MIT"
] | 3 | 2021-09-26T15:55:00.000Z | 2022-01-17T08:04:21.000Z | jesse/store/__init__.py | slipperlobster/flipper | 8482edd77604fcec2ea08913f1748c21be80dac7 | [
"MIT"
] | 26 | 2021-10-31T07:04:04.000Z | 2022-03-24T04:24:21.000Z | jesse/store/__init__.py | slipperlobster/flipper | 8482edd77604fcec2ea08913f1748c21be80dac7 | [
"MIT"
] | null | null | null | import jesse.helpers as jh
from jesse.config import config
from jesse.exceptions import InvalidRoutes
from jesse.routes import router
from .state_app import AppState
from .state_candles import CandlesState
from .state_completed_trades import CompletedTrades
from .state_exchanges import ExchangesState
from .state_logs i... | 34.264 | 148 | 0.68947 |
676a0da4bb76c8c3b76afd904abca4e5573bedaf | 1,677 | py | Python | tests/time_integration/chemistry_abc_explicit/rebless.py | sandialabs/Spitfire | 65670e3ba5d1ccb4ac72524b77957706345c5bf6 | [
"Apache-2.0"
] | 11 | 2020-03-20T02:10:17.000Z | 2021-12-14T10:08:09.000Z | tests/time_integration/chemistry_abc_explicit/rebless.py | sandialabs/Spitfire | 65670e3ba5d1ccb4ac72524b77957706345c5bf6 | [
"Apache-2.0"
] | 18 | 2020-03-18T18:58:56.000Z | 2021-12-21T02:35:35.000Z | tests/time_integration/chemistry_abc_explicit/rebless.py | sandialabs/Spitfire | 65670e3ba5d1ccb4ac72524b77957706345c5bf6 | [
"Apache-2.0"
] | 2 | 2021-05-31T17:24:56.000Z | 2021-06-20T05:27:41.000Z | import pickle
def run():
from spitfire.time.integrator import odesolve
from spitfire.time.methods import RK4ClassicalS4P4
import numpy as np
def right_hand_side(c, k_ab, k_bc):
"""
Computes the right-hand side function for the ODE system.
Note that time integration requires a... | 34.22449 | 103 | 0.588551 |
89ac80c2e0d6ab41956717b8048cc0f0b6bc574f | 389 | py | Python | src/algoritmia/problems/fourier/interfaces.py | DavidLlorens/algoritmia | 40ca0a89ea6de9b633fa5f697f0a28cae70816a2 | [
"MIT"
] | 6 | 2018-09-15T15:09:10.000Z | 2022-02-27T01:23:11.000Z | src/algoritmia/problems/fourier/interfaces.py | JeromeIllgner/algoritmia | 406afe7206f2411557859bf03480c16db7dcce0d | [
"MIT"
] | null | null | null | src/algoritmia/problems/fourier/interfaces.py | JeromeIllgner/algoritmia | 406afe7206f2411557859bf03480c16db7dcce0d | [
"MIT"
] | 5 | 2018-07-10T20:19:55.000Z | 2021-03-31T03:32:22.000Z | from abc import ABCMeta, abstractmethod
class IDiscreteFourierTransform(metaclass=ABCMeta): #[full
@abstractmethod
def transform(self, x: "IList<complex>") -> "IList<complex>": pass
def inverse_transform(self, x: "IList<complex>") -> "IList<complex>":
X = self.transform(x)
N = ... | 35.363636 | 74 | 0.611825 |
2e9562fe77f5ef4f7901bee933291de2728d023c | 2,796 | py | Python | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/delete_public_ip_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/delete_public_ip_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/delete_public_ip_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class DeletePublicIpRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the va... | 25.418182 | 74 | 0.54578 |
fa7c85a8eb4adae14ac06fcd91d0f50748a282b4 | 35,539 | py | Python | coremltools/test/neural_network/test_quantization.py | tonybove-apple/coremltools | 22a8877beec7bad136ba5612d5aacd8e323ecdfc | [
"BSD-3-Clause"
] | 2,740 | 2017-10-03T23:19:01.000Z | 2022-03-30T15:16:39.000Z | coremltools/test/neural_network/test_quantization.py | tonybove-apple/coremltools | 22a8877beec7bad136ba5612d5aacd8e323ecdfc | [
"BSD-3-Clause"
] | 1,057 | 2017-10-05T22:47:01.000Z | 2022-03-31T23:51:15.000Z | coremltools/test/neural_network/test_quantization.py | tonybove-apple/coremltools | 22a8877beec7bad136ba5612d5aacd8e323ecdfc | [
"BSD-3-Clause"
] | 510 | 2017-10-04T19:22:28.000Z | 2022-03-31T12:16:52.000Z | # Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""Module containing unit tests for verifying various quantization."""
import os
import shutil
import tem... | 33.527358 | 88 | 0.669068 |
e9ebfc09d99518cc92f5425ce0b5c199c61813df | 3,642 | py | Python | qa/rpc-tests/nodehandling.py | ripox/ripoffcoinv2 | c9d34fbf5350ea7b6a7e36465155bd8e195d2575 | [
"MIT"
] | null | null | null | qa/rpc-tests/nodehandling.py | ripox/ripoffcoinv2 | c9d34fbf5350ea7b6a7e36465155bd8e195d2575 | [
"MIT"
] | null | null | null | qa/rpc-tests/nodehandling.py | ripox/ripoffcoinv2 | c9d34fbf5350ea7b6a7e36465155bd8e195d2575 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test node handling
#
from test_framework.test_framework import BitcoinTestFramework
from t... | 41.862069 | 137 | 0.595003 |
8be1aa48d6dd07eebad7a646b20c39b0b7a61056 | 8,487 | py | Python | python_modules/dagster-graphql/dagster_graphql/schema/external.py | mitodl/dagster | c94cd8d0f5f67722790e8a176228aa4bdcaa0068 | [
"Apache-2.0"
] | 1 | 2021-04-30T00:19:20.000Z | 2021-04-30T00:19:20.000Z | python_modules/dagster-graphql/dagster_graphql/schema/external.py | mitodl/dagster | c94cd8d0f5f67722790e8a176228aa4bdcaa0068 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/schema/external.py | mitodl/dagster | c94cd8d0f5f67722790e8a176228aa4bdcaa0068 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from dagster import check
from dagster.core.host_representation import (
ExternalRepository,
ExternalRepositoryOrigin,
GrpcServerRepositoryLocationHandle,
ManagedGrpcPythonEnvRepositoryLocationHandle,
RepositoryLocation,
)
from dagster.core.host_representation... | 34.782787 | 99 | 0.712148 |
488e9122eeefe520eee11ed20bd429d681a29150 | 831 | py | Python | jnpy/experiments/Qt/zetcode_tutorial/C5_Events_and_signals/c1_signal_slot.py | jojoquant/jnpy | c874060af4b129ae09cee9f8542517b7b2f6573b | [
"MIT"
] | 5 | 2020-05-19T07:32:39.000Z | 2022-03-14T09:09:48.000Z | jnpy/experiments/Qt/zetcode_tutorial/C5_Events_and_signals/c1_signal_slot.py | jojoquant/jnpy | c874060af4b129ae09cee9f8542517b7b2f6573b | [
"MIT"
] | null | null | null | jnpy/experiments/Qt/zetcode_tutorial/C5_Events_and_signals/c1_signal_slot.py | jojoquant/jnpy | c874060af4b129ae09cee9f8542517b7b2f6573b | [
"MIT"
] | 3 | 2020-04-02T08:30:17.000Z | 2020-05-03T12:12:05.000Z | # !/usr/bin/env python3
# -*- coding:utf-8 -*-
'''
created by Fangyang on Time:2019/11/10
'''
__author__ = 'Fangyang'
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
QWidget, QLCDNumber, QSlider, QVBoxLayout, QApplication
)
class Example(QWidget):
def __init__(self):
super().__i... | 19.325581 | 59 | 0.622142 |
98db201b0c6af51ea318faf9e8cef5aa23787712 | 2,282 | py | Python | data/helpers.py | ZXisSpider/attention-is-all-you-need-pytorch | 431222202dbbb86daa4bca42d9a3bd215c27056c | [
"MIT"
] | null | null | null | data/helpers.py | ZXisSpider/attention-is-all-you-need-pytorch | 431222202dbbb86daa4bca42d9a3bd215c27056c | [
"MIT"
] | null | null | null | data/helpers.py | ZXisSpider/attention-is-all-you-need-pytorch | 431222202dbbb86daa4bca42d9a3bd215c27056c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import math
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import os
import re
import time
import unicodedata
def show_plot(points):
plt.figure()
fig, ax = plt.subplots()
# loc = ticker.MultipleLocator(base=0.2) # put ticks at regular intervals
# ax.yaxis.se... | 24.276596 | 137 | 0.594216 |
986027994312d05be41fe1383635710a3f74206a | 1,981 | py | Python | sourced/ml/tests/test_uast_struct_to_bag.py | vmarkovtsev/ml | 22699b2f44901b84507d15e732003955024e6755 | [
"Apache-2.0"
] | 122 | 2017-11-15T15:19:19.000Z | 2022-03-23T13:36:34.000Z | sourced/ml/tests/test_uast_struct_to_bag.py | vmarkovtsev/ml | 22699b2f44901b84507d15e732003955024e6755 | [
"Apache-2.0"
] | 176 | 2017-11-14T18:11:21.000Z | 2019-05-16T04:12:31.000Z | sourced/ml/tests/test_uast_struct_to_bag.py | vmarkovtsev/ml | 22699b2f44901b84507d15e732003955024e6755 | [
"Apache-2.0"
] | 58 | 2017-11-14T18:07:08.000Z | 2021-01-28T11:41:21.000Z | import unittest
from bblfsh import BblfshClient
from sourced.ml.algorithms import UastRandomWalk2Bag, UastSeq2Bag
from sourced.ml.tests.models import SOURCE_PY
class Uast2RandomWalk2BagTest(unittest.TestCase):
def setUp(self):
self.uast_random_walk2bag = UastRandomWalk2Bag(seq_len=[2, 3])
self.u... | 35.375 | 95 | 0.712267 |
4bffb15a753d1ebb80f44fceeb83073734c0d37b | 5,489 | py | Python | low_level_simulation/src/rosbridge_suite/rosbridge_library/test/internal/publishers/test_publisher_consistency_listener.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | 60 | 2021-09-07T12:42:48.000Z | 2022-03-12T09:30:36.000Z | low_level_simulation/src/rosbridge_suite/rosbridge_library/test/internal/publishers/test_publisher_consistency_listener.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | 222 | 2021-10-29T22:00:27.000Z | 2022-03-29T20:56:34.000Z | low_level_simulation/src/rosbridge_suite/rosbridge_library/test/internal/publishers/test_publisher_consistency_listener.py | abiantorres/autonomous-vehicles-system-simulation | 3f0112036b2b270f5055729c648a1310976df933 | [
"Apache-2.0"
] | 1 | 2021-08-13T08:30:25.000Z | 2021-08-13T08:30:25.000Z | #!/usr/bin/env python
from __future__ import print_function
import sys
import rospy
import rostest
import unittest
from time import sleep, time
from rosbridge_library.internal.publishers import *
from rosbridge_library.internal import ros_loader
from rosbridge_library.internal.message_conversion import *
from std_msg... | 30.837079 | 79 | 0.65276 |
dbe7a5199aaa83599cdfde26de4df1092a25d66c | 2,020 | py | Python | backend/sentiment-analysis/sentiment-analysis-sample.py | North-Seattle-College/ad440-winter2022-tuesday-repo | 0778958ec6ba3606819a7b24533366380467dbbb | [
"Apache-2.0"
] | null | null | null | backend/sentiment-analysis/sentiment-analysis-sample.py | North-Seattle-College/ad440-winter2022-tuesday-repo | 0778958ec6ba3606819a7b24533366380467dbbb | [
"Apache-2.0"
] | 116 | 2022-01-12T03:43:01.000Z | 2022-03-24T20:56:33.000Z | backend/sentiment-analysis/sentiment-analysis-sample.py | North-Seattle-College/ad440-winter2022-tuesday-repo | 0778958ec6ba3606819a7b24533366380467dbbb | [
"Apache-2.0"
] | 5 | 2022-01-16T22:40:18.000Z | 2022-03-09T01:44:11.000Z | import string
import nltk
import json
nltk.download('vader_lexicon')
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import matplotlib.pyplot as plt
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import matplotlib.pyplot as plt
import logging # Setting up the loggings to monitor gensim
logging... | 31.076923 | 135 | 0.751485 |
19f3be539d13bd34de28690516cc289e03d77947 | 5,263 | py | Python | configure_pretraining.py | trisongz/electra | 9dbb2b96edf6bb39965003eb126d41ef1e715eb3 | [
"Apache-2.0"
] | 1 | 2020-08-12T21:08:56.000Z | 2020-08-12T21:08:56.000Z | configure_pretraining.py | trisongz/electra | 9dbb2b96edf6bb39965003eb126d41ef1e715eb3 | [
"Apache-2.0"
] | null | null | null | configure_pretraining.py | trisongz/electra | 9dbb2b96edf6bb39965003eb126d41ef1e715eb3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 38.416058 | 80 | 0.689341 |
aeac0fabe4570d7ff3e22f2aea10abfbf127b47a | 9,051 | py | Python | othello.py | James-QiuHaoran/Othello | 6725bd0a581fa60e3403d71265f9f5aa174eda97 | [
"MIT"
] | 10 | 2018-02-24T21:54:27.000Z | 2021-11-29T02:41:49.000Z | othello.py | James-QiuHaoran/Othello | 6725bd0a581fa60e3403d71265f9f5aa174eda97 | [
"MIT"
] | null | null | null | othello.py | James-QiuHaoran/Othello | 6725bd0a581fa60e3403d71265f9f5aa174eda97 | [
"MIT"
] | 4 | 2018-02-24T21:54:29.000Z | 2021-04-03T23:00:11.000Z | import ai
class IllegalMove(Exception):
def __init__(self, message):
self.message = message
class Othello(object):
# 0 - Empty
# 1 - Black (Player 1)
# 2 - White (Player 2)
def __init__(self):
super().__init__()
self.player = 1
self.victory = 0 # 0 - ongoing | 1 - black win | 2 - white win | (-1) - dr... | 24.865385 | 129 | 0.623025 |
34e7022dda004ed53146afe78a2b502707097585 | 9,413 | py | Python | benchs/link_and_code/bench_link_and_code.py | ScriptBox99/facebook-faiss | 04d31fac53c609b6487a4cd6ead1c8b4ad926b0c | [
"MIT"
] | 17,006 | 2017-03-01T02:54:26.000Z | 2022-03-31T19:08:11.000Z | benchs/link_and_code/bench_link_and_code.py | ScriptBox99/facebook-faiss | 04d31fac53c609b6487a4cd6ead1c8b4ad926b0c | [
"MIT"
] | 2,154 | 2017-03-01T10:30:34.000Z | 2022-03-31T11:35:40.000Z | benchs/link_and_code/bench_link_and_code.py | ScriptBox99/facebook-faiss | 04d31fac53c609b6487a4cd6ead1c8b4ad926b0c | [
"MIT"
] | 2,790 | 2017-03-01T14:09:44.000Z | 2022-03-31T06:49:39.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.
from __future__ import print_function
import os
import sys
import time
import numpy as np
import re
import faiss
from multiprocessing.dummy im... | 30.963816 | 77 | 0.601509 |
4f8cffa7120fd1753e67a75afd4d1b3672d3d86b | 347 | py | Python | test/test_molecule.py | sunhwan/MoleculeX | d718870a6f64fd7d6b110e3d6792e9d92c224da8 | [
"MIT"
] | null | null | null | test/test_molecule.py | sunhwan/MoleculeX | d718870a6f64fd7d6b110e3d6792e9d92c224da8 | [
"MIT"
] | null | null | null | test/test_molecule.py | sunhwan/MoleculeX | d718870a6f64fd7d6b110e3d6792e9d92c224da8 | [
"MIT"
] | null | null | null | import pytest
import moleculex as mx
def test_add_atom():
m = mx.Molecule()
v = mx.Atom()
m.add_atom(v)
assert len(m.atoms()) == 1
def test_add_bond():
m = mx.Molecule()
v = mx.Atom()
w = mx.Atom()
m.add_atom(v)
m.add_atom(w)
m.add_bond(v, w)
assert len(m.bonds()) == 1
... | 18.263158 | 30 | 0.56196 |
e00d9a9cfd84ef1939acaf0096d5178e2513f863 | 13,347 | py | Python | lib/exabgp/reactor/protocol.py | mewbak/exabgp | 223ccc685e2f7fa2d891ddcf4ebdcbadae540f1d | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/reactor/protocol.py | mewbak/exabgp | 223ccc685e2f7fa2d891ddcf4ebdcbadae540f1d | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/reactor/protocol.py | mewbak/exabgp | 223ccc685e2f7fa2d891ddcf4ebdcbadae540f1d | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
"""
protocol.py
Created by Thomas Mangin on 2009-08-25.
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import os
from exabgp.vendoring import six
import traceback
# ================================================================ Regi... | 34.57772 | 154 | 0.716865 |
fdb77e7f25072280edd32d6f8d2c507df7e37f8f | 165 | py | Python | uspy/execution/compute_feature.py | jwarndt/uspy | ab5bb73f9243a1d7978c83ccb63e7189fc18cd8a | [
"MIT"
] | null | null | null | uspy/execution/compute_feature.py | jwarndt/uspy | ab5bb73f9243a1d7978c83ccb63e7189fc18cd8a | [
"MIT"
] | null | null | null | uspy/execution/compute_feature.py | jwarndt/uspy | ab5bb73f9243a1d7978c83ccb63e7189fc18cd8a | [
"MIT"
] | null | null | null |
import numpy as np
from nmapy.features import *
def compute_feature(in_array, feature_parameters):
"""
Parameters:
-----------
in_array: an np
""" | 15 | 51 | 0.630303 |
3617de5fb2b1fa49bb51079875687dc8af847c5c | 12,696 | py | Python | lib/galaxy/webapps/galaxy/api/cloudauthz.py | maikenp/galaxy | eb3f3c816f1f94bc328d092f30c8966d41a56a0d | [
"CC-BY-3.0"
] | 1 | 2021-10-08T02:14:24.000Z | 2021-10-08T02:14:24.000Z | lib/galaxy/webapps/galaxy/api/cloudauthz.py | maikenp/galaxy | eb3f3c816f1f94bc328d092f30c8966d41a56a0d | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/api/cloudauthz.py | maikenp/galaxy | eb3f3c816f1f94bc328d092f30c8966d41a56a0d | [
"CC-BY-3.0"
] | null | null | null | """
API operations on defining cloud authorizations.
Through means of cloud authorization a user is able to grant a Galaxy server a secure access to his/her
cloud-based resources without sharing his/her long-lasting credentials.
User provides a provider-specific configuration, which Galaxy users to request temporary ... | 49.209302 | 147 | 0.603497 |
ebea6f15e3db82b709db81df32d647649d6a8a93 | 2,889 | py | Python | node_registry/decorators.py | rahulkatiyar19955/node_registry | 42a2ed4ea7271a312223c724543e278ff9c9f54c | [
"BSD-3-Clause"
] | 2 | 2021-07-05T12:36:29.000Z | 2021-12-24T08:20:13.000Z | node_registry/decorators.py | rahulkatiyar19955/node_registry | 42a2ed4ea7271a312223c724543e278ff9c9f54c | [
"BSD-3-Clause"
] | null | null | null | node_registry/decorators.py | rahulkatiyar19955/node_registry | 42a2ed4ea7271a312223c724543e278ff9c9f54c | [
"BSD-3-Clause"
] | 4 | 2021-06-30T04:22:58.000Z | 2021-12-19T06:06:34.000Z | #!/usr/bin/env python3
# Copyright (c) 2021, DeepX-inc
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | 35.666667 | 77 | 0.695396 |
3245005919943544b4648dea45af507a74c2c488 | 4,219 | py | Python | couchjs/scons/scons-local-2.0.1/SCons/Node/Python.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 73 | 2015-03-19T04:04:52.000Z | 2021-08-16T10:45:11.000Z | couchjs/scons/scons-local-2.0.1/SCons/Node/Python.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 5 | 2016-04-26T13:19:25.000Z | 2017-03-11T14:11:22.000Z | couchjs/scons/scons-local-2.0.1/SCons/Node/Python.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 13 | 2015-03-27T05:21:42.000Z | 2017-05-22T11:45:30.000Z | """scons.Node.Python
Python nodes.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 w... | 32.705426 | 95 | 0.677886 |
2d897854d426c9d2fa9bd38ef33f0e71e81a4365 | 3,605 | py | Python | linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py | Siecje/integrations-core | b2f3ea4145b25394be0b274093d1f0723e8f968d | [
"BSD-3-Clause"
] | 5 | 2018-04-09T09:53:04.000Z | 2021-07-02T05:37:41.000Z | linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py | Siecje/integrations-core | b2f3ea4145b25394be0b274093d1f0723e8f968d | [
"BSD-3-Clause"
] | 19 | 2018-01-24T15:23:47.000Z | 2020-07-14T14:30:53.000Z | linux_proc_extras/datadog_checks/linux_proc_extras/linux_proc_extras.py | Siecje/integrations-core | b2f3ea4145b25394be0b274093d1f0723e8f968d | [
"BSD-3-Clause"
] | 6 | 2018-01-09T21:37:20.000Z | 2020-05-26T09:28:09.000Z | # (C) Cory Watson <cory@stripe.com> 2016
# (C) Datadog, Inc. 2016-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# project
from checks import AgentCheck
from utils.subprocess_output import get_subprocess_output
from collections import defaultdict
PROCESS_STATES = {
'D': 'uninterr... | 37.552083 | 105 | 0.601387 |
21c72c7cd993db13595d4a1e6122419a0a430f9b | 2,502 | py | Python | tests/test_referencing.py | chdemko/pandoc-numbering | 19e6dfd6d5c2e213e279bc6aed0b5caae84249c7 | [
"BSD-3-Clause"
] | 29 | 2016-03-16T10:46:25.000Z | 2021-09-09T19:03:57.000Z | tests/test_referencing.py | chdemko/pandoc-numbering | 19e6dfd6d5c2e213e279bc6aed0b5caae84249c7 | [
"BSD-3-Clause"
] | 24 | 2016-03-16T10:53:13.000Z | 2021-03-17T23:11:58.000Z | tests/test_referencing.py | chdemko/pandoc-numbering | 19e6dfd6d5c2e213e279bc6aed0b5caae84249c7 | [
"BSD-3-Clause"
] | 8 | 2017-08-28T21:30:30.000Z | 2020-12-27T21:04:15.000Z | # This Python file uses the following encoding: utf-8
from unittest import TestCase
from helper import verify_conversion
class ReferencincTest(TestCase):
def test_referencing_standard(self):
verify_conversion(
self,
r"""
Header
======
Section
-------
Exercise (First title) -.+.... | 29.093023 | 278 | 0.635891 |
2600d62b53f56277f242f4ca9cdaee54198ba665 | 48,641 | py | Python | kolibri/core/tasks/api.py | AtKristijan/kolibri | d9b4864a8e93205923c388b4387efc539ae82ec1 | [
"MIT"
] | null | null | null | kolibri/core/tasks/api.py | AtKristijan/kolibri | d9b4864a8e93205923c388b4387efc539ae82ec1 | [
"MIT"
] | null | null | null | kolibri/core/tasks/api.py | AtKristijan/kolibri | d9b4864a8e93205923c388b4387efc539ae82ec1 | [
"MIT"
] | null | null | null | import logging
import ntpath
import os
import shutil
from functools import partial
from tempfile import mkstemp
import requests
from django.apps.registry import AppRegistryNotReady
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.files.uploadedfile import UploadedFile
from django.core.m... | 33.615066 | 100 | 0.632985 |
ede987a47b1789a599cfaa7e3ad1e65412ed3d95 | 11,967 | py | Python | app/main/routes.py | justinsitarz/flask-toolio | f1ab22b2f9469a439af1c8436a378923a8c782ee | [
"MIT"
] | null | null | null | app/main/routes.py | justinsitarz/flask-toolio | f1ab22b2f9469a439af1c8436a378923a8c782ee | [
"MIT"
] | null | null | null | app/main/routes.py | justinsitarz/flask-toolio | f1ab22b2f9469a439af1c8436a378923a8c782ee | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import render_template, flash, redirect, url_for, request, g, \
jsonify, current_app
from flask_login import current_user, login_required
from flask_babel import _, get_locale
from guess_language import guess_language
from app import db
from app.main.forms import EditProfile... | 37.280374 | 104 | 0.654634 |
712787511adc3f3962be4c81c2d358cf40213f2d | 34,796 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_03_01/aio/operations_async/_public_ip_addresses_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 ... | 50.502177 | 395 | 0.673238 |
2fac46f82daec4abf9e2e66bfb2e5d95e78a4510 | 3,564 | py | Python | download_mid_from_csv.py | gu-ma/Neural-Metal | b0ae8d41c924a33fe5946713f570525d5bfcd59d | [
"MIT"
] | null | null | null | download_mid_from_csv.py | gu-ma/Neural-Metal | b0ae8d41c924a33fe5946713f570525d5bfcd59d | [
"MIT"
] | null | null | null | download_mid_from_csv.py | gu-ma/Neural-Metal | b0ae8d41c924a33fe5946713f570525d5bfcd59d | [
"MIT"
] | null | null | null | # Download files from a CSV scrapping
import os
import sys
import csv
import urllib.request
import urllib.parse
import urllib.error
import plistlib
import xattr
import re
from time import sleep
def parse_csv(file_name):
tracks_list = open(file_name, "r")
return csv.reader(tracks_list)
def write_xattr_tags(... | 33.308411 | 83 | 0.565376 |
178bf55f04e7d0179f642648109ab02296d64292 | 589 | py | Python | Binarization/Binarization_avgIntensity.py | PRAkTIKal24/CV | 7cc2cce95283c32730a0a3976980efd89ef91085 | [
"MIT"
] | null | null | null | Binarization/Binarization_avgIntensity.py | PRAkTIKal24/CV | 7cc2cce95283c32730a0a3976980efd89ef91085 | [
"MIT"
] | null | null | null | Binarization/Binarization_avgIntensity.py | PRAkTIKal24/CV | 7cc2cce95283c32730a0a3976980efd89ef91085 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
I = cv2.imread('hwf.jpeg')
cv2.namedWindow('hwf',cv2.WINDOW_AUTOSIZE)
cv2.imshow('',I)
cv2.waitKey(0)
r, c, cl = I.shape
Sum = 0
for i in range(r):
for j in range(c):
Sum += ((I[i,j,1]+I[i,j,2]+I[i,j,0])**2)
#Finding mean of all pixel intensities a... | 21.035714 | 70 | 0.631579 |
099673bc3bbd846f4c0ad9148601d6780292c1d0 | 403 | py | Python | monzo_to_ynab/wsgi.py | Ben-Hampson/monzo_to_ynab | 44e4e6fb48133d006b73540205b7768c4fca47d3 | [
"MIT"
] | null | null | null | monzo_to_ynab/wsgi.py | Ben-Hampson/monzo_to_ynab | 44e4e6fb48133d006b73540205b7768c4fca47d3 | [
"MIT"
] | null | null | null | monzo_to_ynab/wsgi.py | Ben-Hampson/monzo_to_ynab | 44e4e6fb48133d006b73540205b7768c4fca47d3 | [
"MIT"
] | null | null | null | """
WSGI config for monzo_to_ynab project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
f7194df8986a3f798477abbd22f0e92a006cfa20 | 967 | py | Python | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | 1 | 2021-10-10T20:21:18.000Z | 2021-10-10T20:21:18.000Z | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | valid-sudoku/valid-sudoku.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
BZip = list(zip(*board))
def Checkline(li):
temp = [i for i in li if i!="."]
return len(set(temp))==len(temp)
def check_row(board):
for i in b... | 31.193548 | 83 | 0.458118 |
3b859f50d54f28879ae73a8835b483b3e63c7152 | 1,134 | py | Python | rasa_nlu_gao/models/lenet.py | 1073521013/rasa_nlu_gq | 6c8bea1b14390246b39770abc544986f4c7acf26 | [
"Apache-2.0"
] | 298 | 2018-10-10T04:15:45.000Z | 2022-03-23T12:03:41.000Z | rasa_nlu_gao/models/lenet.py | 1073521013/rasa_nlu_gq | 6c8bea1b14390246b39770abc544986f4c7acf26 | [
"Apache-2.0"
] | 40 | 2019-01-28T07:04:52.000Z | 2022-02-10T00:30:06.000Z | rasa_nlu_gao/models/lenet.py | 1073521013/rasa_nlu_gq | 6c8bea1b14390246b39770abc544986f4c7acf26 | [
"Apache-2.0"
] | 107 | 2018-11-28T05:54:54.000Z | 2022-03-31T09:34:05.000Z | from __future__ import division, print_function, absolute_import
import numpy as np
import tensorflow as tf
# Build a convolutional neural network
def conv_net(x, n_classes, num_layers, layer_size, C2, dropout, is_training):
# Define a scope for reusing the variables
with tf.variable_scope('ConvNet'):... | 42 | 78 | 0.554674 |
e879fb672c74f7dea3595024bf8e4606e4bc7fb5 | 317 | py | Python | xamin/xamin/__init__.py | michaelmunje/Xamin-Python-Interface | d88ae596a32ec956beac045ec04c89a4ad8b5330 | [
"MIT"
] | null | null | null | xamin/xamin/__init__.py | michaelmunje/Xamin-Python-Interface | d88ae596a32ec956beac045ec04c89a4ad8b5330 | [
"MIT"
] | null | null | null | xamin/xamin/__init__.py | michaelmunje/Xamin-Python-Interface | d88ae596a32ec956beac045ec04c89a4ad8b5330 | [
"MIT"
] | null | null | null | from .get_all_names import get_all_names
from .get_all import get_all_tables as get_all_raw
from .get import run_table_query
from .helpers import get_inline_script_output
from .helpers import get_script_output
from .install import install
from .get_downloads import download_tables, multi_core_download, mc_gz_to_csv
| 39.625 | 77 | 0.870662 |
c9e50e9a0437a27c0467e5cea272cc29b2fef2ce | 2,445 | py | Python | tools/ftp/spider_ftp.py | ChristophBerg/pgweb | bf6e7a81c0a5f329ffd2f7b3e50c4c7c68735ffc | [
"PostgreSQL"
] | 1 | 2020-12-03T21:52:50.000Z | 2020-12-03T21:52:50.000Z | tools/ftp/spider_ftp.py | ChristophBerg/pgweb | bf6e7a81c0a5f329ffd2f7b3e50c4c7c68735ffc | [
"PostgreSQL"
] | null | null | null | tools/ftp/spider_ftp.py | ChristophBerg/pgweb | bf6e7a81c0a5f329ffd2f7b3e50c4c7c68735ffc | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/python
#
# spider_ftp.py - spider the ftp site and generate an output file with all
# the metadata we require, that can be transferred over to
# the master web server.
#
import sys
import os
from datetime import datetime
import cPickle as pickle
import codecs
import urllib2
... | 26.290323 | 75 | 0.641309 |
f50acf7b1a4b6e69601329c546719420984c4c70 | 2,503 | py | Python | modules/basic.py | eieio/pyy | dface9d5c8914bb74ef1ee4df112269b65e62bec | [
"Apache-2.0"
] | null | null | null | modules/basic.py | eieio/pyy | dface9d5c8914bb74ef1ee4df112269b65e62bec | [
"Apache-2.0"
] | 1 | 2020-09-29T22:20:49.000Z | 2020-09-29T22:20:49.000Z | modules/basic.py | eieio/pyy | dface9d5c8914bb74ef1ee4df112269b65e62bec | [
"Apache-2.0"
] | null | null | null | ''' basic.py
Basic module
Copyright 2008 Corey Tabaka
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 ... | 31.683544 | 110 | 0.674391 |
6886740f5f89338575a8fca451eac138d0005385 | 5,502 | py | Python | examples/id_pools_vmac_ranges.py | doziya/hpeOneView | ef9bee2a0e1529e93bd6e8d84eff07fb8533049d | [
"MIT"
] | 107 | 2015-02-16T12:40:36.000Z | 2022-03-09T05:27:58.000Z | examples/id_pools_vmac_ranges.py | doziya/hpeOneView | ef9bee2a0e1529e93bd6e8d84eff07fb8533049d | [
"MIT"
] | 148 | 2015-03-17T16:09:39.000Z | 2020-02-09T16:28:06.000Z | examples/id_pools_vmac_ranges.py | doziya/hpeOneView | ef9bee2a0e1529e93bd6e8d84eff07fb8533049d | [
"MIT"
] | 80 | 2015-01-03T22:58:53.000Z | 2021-04-16T11:37:03.000Z | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# 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 limi... | 35.496774 | 111 | 0.729553 |
7da30d5caed00294b86055736ab3a477c3d2d3d6 | 10,641 | py | Python | tests/test_schema_evolution.py | spenczar/fastavro | a6f18252415f23ad1ce06ce019ac2f1d9feef0aa | [
"MIT"
] | null | null | null | tests/test_schema_evolution.py | spenczar/fastavro | a6f18252415f23ad1ce06ce019ac2f1d9feef0aa | [
"MIT"
] | null | null | null | tests/test_schema_evolution.py | spenczar/fastavro | a6f18252415f23ad1ce06ce019ac2f1d9feef0aa | [
"MIT"
] | null | null | null | from fastavro import writer as fastavro_writer
from fastavro.read import SchemaResolutionError
import fastavro
import pytest
from io import BytesIO
schema_dict_a = {
"namespace": "example.avro2",
"type": "record",
"name": "evtest",
"fields": [{"name": "a", "type": "int"}],
}
record_a = {"a": 123}
s... | 28.52815 | 85 | 0.428813 |
c963b336d95e318394b319d0bcd9c3f3425079d8 | 290 | py | Python | files/read_binary.py | janbodnar/Python-Course | 51705ab5a2adef52bcdb99a800e94c0d67144a38 | [
"BSD-2-Clause"
] | 13 | 2017-08-22T12:26:07.000Z | 2021-07-29T16:13:50.000Z | files/read_binary.py | janbodnar/Python-Course | 51705ab5a2adef52bcdb99a800e94c0d67144a38 | [
"BSD-2-Clause"
] | 1 | 2021-02-08T10:24:33.000Z | 2021-02-08T10:24:33.000Z | files/read_binary.py | janbodnar/Python-Course | 51705ab5a2adef52bcdb99a800e94c0d67144a38 | [
"BSD-2-Clause"
] | 17 | 2018-08-13T11:10:33.000Z | 2021-07-29T16:14:02.000Z | #!/usr/bin/python
with open('web.png', 'rb') as f:
hexdata = f.read().hex()
n = 2
data = [hexdata[i:i+n] for i in range(0, len(hexdata), n)]
i = 0
for e in data:
print(e, end=' ')
i += 1
if i % 20 == 0:
print()
print()
| 14.5 | 62 | 0.427586 |
751695f991698f8fdd4543246c38e13a80c36f7f | 14,877 | py | Python | PaddleCV/PaddleGAN/trainer/CycleGAN.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 2 | 2021-09-13T06:48:23.000Z | 2021-09-13T06:48:28.000Z | PaddleCV/PaddleGAN/trainer/CycleGAN.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | null | null | null | PaddleCV/PaddleGAN/trainer/CycleGAN.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 1 | 2019-08-05T11:32:13.000Z | 2019-08-05T11:32:13.000Z | #copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
#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 l... | 43.121739 | 117 | 0.53734 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.