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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8447896d53f2cfa76711d4e57a891cffdbf52cf5 | 2,325 | py | Python | src/anli_submission.py | kanishkamisra/minicons-experiments | 04972e93829cdb1d1f111186fb4ba587230da6de | [
"MIT"
] | 2 | 2022-03-25T23:56:52.000Z | 2022-03-28T08:46:42.000Z | src/anli_submission.py | kanishkamisra/minicons-experiments | 04972e93829cdb1d1f111186fb4ba587230da6de | [
"MIT"
] | null | null | null | src/anli_submission.py | kanishkamisra/minicons-experiments | 04972e93829cdb1d1f111186fb4ba587230da6de | [
"MIT"
] | null | null | null | import os
import json
import csv
import torch
import argparse
from minicons import scorer
from torch.utils.data import DataLoader
from tqdm import tqdm
from sklearn.metrics import accuracy_score, f1_score
os.environ["TOKENIZERS_PARALLELISM"] = "false"
def get_anli(split = "anli"):
anli = []
with open(f"../... | 22.794118 | 107 | 0.650323 |
9b47b486d99c6d04a5a84e02d9cd4a6674c1ec49 | 1,468 | py | Python | Easy/1668.MaximumRepeatingSubstring.py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 39 | 2020-07-04T11:15:13.000Z | 2022-02-04T22:33:42.000Z | Easy/1668.MaximumRepeatingSubstring.py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 1 | 2020-07-15T11:53:37.000Z | 2020-07-15T11:53:37.000Z | Easy/1668.MaximumRepeatingSubstring.py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 20 | 2020-07-14T19:12:53.000Z | 2022-03-02T06:28:17.000Z | '''
For a string sequence, a string word is k-repeating if word
concatenated k times is a substring of sequence. The word's
maximum k-repeating value is the highest value k where word
is k-repeating in sequence. If word is not a substring of
sequence, word's maximum k-repeating value is 0.
... | 31.234043 | 103 | 0.642371 |
4a82e5e76003a0d18f01e01f02efd5c4d2db5708 | 113,583 | py | Python | BaseTools/Source/Python/Ecc/c.py | nicklela/edk2 | dfafa8e45382939fb5dc78e9d37b97b500a43613 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 3,012 | 2015-01-01T19:58:18.000Z | 2022-03-31T22:07:14.000Z | BaseTools/Source/Python/Ecc/c.py | nicklela/edk2 | dfafa8e45382939fb5dc78e9d37b97b500a43613 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 1,199 | 2015-01-12T08:00:01.000Z | 2022-03-29T18:14:42.000Z | BaseTools/Source/Python/Ecc/c.py | nicklela/edk2 | dfafa8e45382939fb5dc78e9d37b97b500a43613 | [
"Python-2.0",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | 1,850 | 2015-01-01T11:28:12.000Z | 2022-03-31T18:10:59.000Z | ## @file
# This file is used to be the c coding style checking of ECC tool
#
# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
from __future__ import print_function
from __future... | 42.780791 | 297 | 0.565912 |
66e12f325aca42c8a50289209d04ab5cdd63691b | 42,953 | py | Python | google-cloud-sdk/platform/bq/third_party/yaml/lib3/emitter.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 11 | 2015-04-07T05:36:11.000Z | 2021-04-20T19:22:04.000Z | google-cloud-sdk/platform/bq/third_party/yaml/lib3/emitter.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 4 | 2020-07-21T12:51:46.000Z | 2022-01-22T10:29:25.000Z | google-cloud-sdk/platform/bq/third_party/yaml/lib3/emitter.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | 37.744288 | 85 | 0.525551 |
ccaf0d48aae03ecb19540a7439be309d76586fd5 | 398 | py | Python | tokenauth/migrations/0002_authtoken_next_url.py | skorokithakis/django-tokenauth | 41f494f077abd4326642e0c76a318e7e0aee1fbe | [
"BSD-3-Clause"
] | 62 | 2017-06-29T05:34:33.000Z | 2022-03-21T10:06:41.000Z | tokenauth/migrations/0002_authtoken_next_url.py | skorokithakis/django-tokenauth | 41f494f077abd4326642e0c76a318e7e0aee1fbe | [
"BSD-3-Clause"
] | 4 | 2017-12-08T11:48:13.000Z | 2021-06-12T13:00:09.000Z | tokenauth/migrations/0002_authtoken_next_url.py | skorokithakis/django-tokenauth | 41f494f077abd4326642e0c76a318e7e0aee1fbe | [
"BSD-3-Clause"
] | 4 | 2017-12-07T21:58:42.000Z | 2020-06-24T19:16:37.000Z | # Generated by Django 2.0.3 on 2018-04-02 14:38
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("tokenauth", "0001_initial")]
operations = [
migrations.AddField(
model_name="authtoken",
name="next_url",
... | 23.411765 | 64 | 0.638191 |
f33c6d9a6bca2a199e5c97a2480d08e9ea0bcaa0 | 2,038 | py | Python | tempest/api/compute/servers/test_server_addresses_negative.py | rishabh20111990/tempest | df15531cd4231000b0da016f5cd8641523ce984e | [
"Apache-2.0"
] | 2 | 2015-08-13T00:07:49.000Z | 2020-08-07T06:38:44.000Z | tempest/api/compute/servers/test_server_addresses_negative.py | rishabh20111990/tempest | df15531cd4231000b0da016f5cd8641523ce984e | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/servers/test_server_addresses_negative.py | rishabh20111990/tempest | df15531cd4231000b0da016f5cd8641523ce984e | [
"Apache-2.0"
] | 3 | 2016-08-30T06:53:54.000Z | 2021-03-22T16:54:39.000Z | # Copyright 2012 OpenStack Foundation
# 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 requ... | 39.960784 | 78 | 0.71737 |
4bd2fbf8f963d20e6175aa29f1566dd900406b90 | 7,697 | py | Python | libcloud/test/dns/test_google.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | null | null | null | libcloud/test/dns/test_google.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T12:29:13.000Z | 2021-12-06T12:29:13.000Z | libcloud/test/dns/test_google.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T10:26:33.000Z | 2021-12-06T10:26:33.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 39.471795 | 92 | 0.693127 |
6c4b3d48101a3c2abbf4c52b7e036a9a58b003e8 | 7,092 | py | Python | dataset.py | Jeremyczhj/FashionAI_Tianchi_2018 | 79eafdfd8f5af89a63548615dad40eb120d40066 | [
"MIT"
] | 122 | 2018-06-05T03:36:56.000Z | 2021-12-27T12:11:28.000Z | dataset.py | wchzh/FashionAI_Tianchi_2018 | 79eafdfd8f5af89a63548615dad40eb120d40066 | [
"MIT"
] | 7 | 2018-07-08T15:49:35.000Z | 2019-03-21T02:00:25.000Z | dataset.py | wchzh/FashionAI_Tianchi_2018 | 79eafdfd8f5af89a63548615dad40eb120d40066 | [
"MIT"
] | 42 | 2018-06-05T03:39:09.000Z | 2022-03-20T02:57:00.000Z | from imgaug import augmenters as iaa
from keras.preprocessing.image import *
import cv2
from tqdm import tqdm
from config import *
# rotate images
def rotate(image, angle, center=None, scale=1.0):
(h, w) = image.shape[:2]
if center is None:
center = (w / 2, h / 2)
M = cv2.getRotationMatrix2D(center... | 39.620112 | 99 | 0.502115 |
f644261e40dd6971176c7024cd583922bb929597 | 974 | py | Python | 基础教程/A2-神经网络基本原理/第1步 - 基本知识/src/ch02-BASIC/Level5_LearningRate.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 11,094 | 2019-05-07T02:48:50.000Z | 2022-03-31T08:49:42.000Z | 基础教程/A2-神经网络基本原理/第1步 - 基本知识/src/ch02-BASIC/Level5_LearningRate.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 157 | 2019-05-13T15:07:19.000Z | 2022-03-23T08:52:32.000Z | 基础教程/A2-神经网络基本原理/第1步 - 基本知识/src/ch02-BASIC/Level5_LearningRate.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 2,412 | 2019-05-07T02:55:15.000Z | 2022-03-30T06:56:52.000Z | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
import numpy as np
import matplotlib.pyplot as plt
def targetFunction(x):
y = (x-1)**2 + 0.1
return y
def derivativeFun(x):
y = 2*(x-1)
return y
def cr... | 19.877551 | 100 | 0.544148 |
7363bbde04c646cf8503f4c1a8e38da7970a2e23 | 49 | py | Python | pyTrain/src/anjila/trial/day4/multithreading.py | atamraka/PythonExamples | c3954712147992054def49a922cf0fa7c4f8b0ef | [
"MIT"
] | null | null | null | pyTrain/src/anjila/trial/day4/multithreading.py | atamraka/PythonExamples | c3954712147992054def49a922cf0fa7c4f8b0ef | [
"MIT"
] | null | null | null | pyTrain/src/anjila/trial/day4/multithreading.py | atamraka/PythonExamples | c3954712147992054def49a922cf0fa7c4f8b0ef | [
"MIT"
] | null | null | null | '''
Created on May 14, 2017
@author: rujina
'''
| 8.166667 | 23 | 0.612245 |
cdbae2de0179ff965fa9287b2fa56bd1711b0850 | 3,535 | py | Python | bindings/python/ensmallen/datasets/string/roseobacterspccs2.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/roseobacterspccs2.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/roseobacterspccs2.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Roseobacter sp. CCS2.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein a... | 32.731481 | 223 | 0.674682 |
792104ba5f4e743f02b6438780bbb47792f2671b | 3,519 | py | Python | Tensorflow/fashionMni1.py | aaavinash85/100-Days-of-ML- | d055d718f7972e3a4469279b9112867a42cf652f | [
"Apache-2.0"
] | 3 | 2021-01-15T14:59:57.000Z | 2021-07-01T07:32:19.000Z | Tensorflow/fashionMni1.py | aaavinash85/100-Days-of-ML- | d055d718f7972e3a4469279b9112867a42cf652f | [
"Apache-2.0"
] | null | null | null | Tensorflow/fashionMni1.py | aaavinash85/100-Days-of-ML- | d055d718f7972e3a4469279b9112867a42cf652f | [
"Apache-2.0"
] | 1 | 2021-07-01T07:32:23.000Z | 2021-07-01T07:32:23.000Z | # TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
fashion_mnist = keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
class_names = ... | 27.27907 | 84 | 0.700483 |
d2ab97ef4f630ad9a44a201bfdac0dc78fda6c39 | 22,780 | py | Python | google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/base.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/base.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/base.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.15873 | 103 | 0.657155 |
8838292a4d2f9894ce15eefd6b66e6b6cd28dd88 | 347 | py | Python | cards/table.py | michael-michelotti/blackjack | d7e7242f57a30fbbc4e37c0b6f3cbabd63d23ec1 | [
"MIT"
] | null | null | null | cards/table.py | michael-michelotti/blackjack | d7e7242f57a30fbbc4e37c0b6f3cbabd63d23ec1 | [
"MIT"
] | null | null | null | cards/table.py | michael-michelotti/blackjack | d7e7242f57a30fbbc4e37c0b6f3cbabd63d23ec1 | [
"MIT"
] | null | null | null | class Table:
def __init__(self, dealer, players):
self.dealer = dealer
self.players = players
# self.participants = players + dealer
def __repr__(self):
return f'Table(dealer={self.dealer}, players={self.players})'
def render(self):
return f'{"".join(hand.render() f... | 28.916667 | 69 | 0.622478 |
f0e1835de8142714952d3f7a122a9a71a7e37b64 | 352 | py | Python | neighborhood_analysis/__init__.py | Mr-Milk/neighborhood_analysis | 19cd2970b847acc911e40c720efff3db6c795c31 | [
"MIT"
] | null | null | null | neighborhood_analysis/__init__.py | Mr-Milk/neighborhood_analysis | 19cd2970b847acc911e40c720efff3db6c795c31 | [
"MIT"
] | 6 | 2021-01-11T21:23:02.000Z | 2021-08-23T21:11:19.000Z | neighborhood_analysis/__init__.py | Mr-Milk/neighborhood_analysis | 19cd2970b847acc911e40c720efff3db6c795c31 | [
"MIT"
] | null | null | null | from .neighborhood_analysis import (neighbor_components,
get_bbox,
get_bbox_neighbors,
get_point_neighbors,
comb_bootstrap,
CellCombs,
... | 50.285714 | 56 | 0.335227 |
b0a09e44e9c6c1b7ccde8fc19b19fdcf0b33f10b | 1,662 | py | Python | setup.py | dennisvang/pcv | b62d745e06f6c4f6873a5c451df76be907dc0382 | [
"MIT"
] | null | null | null | setup.py | dennisvang/pcv | b62d745e06f6c4f6873a5c451df76be907dc0382 | [
"MIT"
] | null | null | null | setup.py | dennisvang/pcv | b62d745e06f6c4f6873a5c451df76be907dc0382 | [
"MIT"
] | null | null | null | import setuptools
from pathlib import Path
"""
create package:
python setup.py sdist bdist_wheel
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://docs.python.org/3.8/distutils/setupscript.html#installing-package-data
we can also install the package locally using
pipenv... | 29.157895 | 78 | 0.666667 |
9cfc5d4e4bd363a9f3917be257e6f8a8b0661722 | 2,372 | py | Python | simulator/flow_change_gen.py | faywh/read_ez | d26a14aed473291b896664faf284ef3027c8be90 | [
"Apache-2.0"
] | 7 | 2017-05-28T21:00:09.000Z | 2021-04-05T16:14:07.000Z | simulator/flow_change_gen.py | faywh/read_ez | d26a14aed473291b896664faf284ef3027c8be90 | [
"Apache-2.0"
] | null | null | null | simulator/flow_change_gen.py | faywh/read_ez | d26a14aed473291b896664faf284ef3027c8be90 | [
"Apache-2.0"
] | 3 | 2018-12-27T07:59:30.000Z | 2021-05-02T07:47:42.000Z | import argparse
import os
import random
from random import Random
from misc import logger
from domain.network_premitives import *
from flow_gen.link_failure_change_generator import LinkFailureChangeGenerator
from flow_gen.random_change_generator import RandomChangeGenerator
if __name__ == '__main__':
parser = arg... | 43.127273 | 89 | 0.637437 |
017da45d335c53ed1f14a96c4ca100544976c5d1 | 343 | py | Python | list_input_devices.py | FyodorLikhachev/Keyworder | 70c3f1057d382a84bbb0079980b5b7b96fbdbb7d | [
"Apache-2.0"
] | 5 | 2021-04-19T09:46:13.000Z | 2021-04-23T17:45:35.000Z | list_input_devices.py | FyodorLikhachev/Keyworder | 70c3f1057d382a84bbb0079980b5b7b96fbdbb7d | [
"Apache-2.0"
] | null | null | null | list_input_devices.py | FyodorLikhachev/Keyworder | 70c3f1057d382a84bbb0079980b5b7b96fbdbb7d | [
"Apache-2.0"
] | null | null | null | from pyaudio import PyAudio
p = PyAudio()
info = p.get_host_api_info_by_index(0)
numdevices = info.get('deviceCount')
for i in range(0, numdevices):
if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
print("Input Device id ", i, " - ", p.get_device_info_by_host_api_device_in... | 38.111111 | 105 | 0.723032 |
8fa41fedbd2e6c04c0a470ef3027398bc9ec0bf3 | 830 | py | Python | pyaz/batch/pool/supported_images/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/batch/pool/supported_images/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | null | null | null | pyaz/batch/pool/supported_images/__init__.py | py-az-cli/py-az-cli | 9a7dc44e360c096a5a2f15595353e9dad88a9792 | [
"MIT"
] | 1 | 2022-02-03T09:12:01.000Z | 2022-02-03T09:12:01.000Z | from .... pyaz_utils import _call_az
def list(account_endpoint=None, account_key=None, account_name=None, filter=None):
'''
Lists all Virtual Machine Images supported by the Azure Batch service.
Optional Parameters:
- account_endpoint -- Batch service endpoint. Alternatively, set by environment variab... | 55.333333 | 193 | 0.76506 |
17d0414a1aefe7c1a92b61cac593ebded3fc7d00 | 20,165 | py | Python | examples/lbx.py | brandhsn/pysat | 95f2dd9760091bf3453ba6c0c7c12172cffefbb7 | [
"MIT"
] | null | null | null | examples/lbx.py | brandhsn/pysat | 95f2dd9760091bf3453ba6c0c7c12172cffefbb7 | [
"MIT"
] | null | null | null | examples/lbx.py | brandhsn/pysat | 95f2dd9760091bf3453ba6c0c7c12172cffefbb7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## lbx.py
##
## Created on: Jan 9, 2017
## Author: Alexey S. Ignatiev
## E-mail: aignatiev@ciencias.ulisboa.pt
##
"""
===============
List of classes
===============
.. autosummary::
:nosignatures:
LBX
LBXPlus
====... | 33.890756 | 118 | 0.543714 |
2c06d565b962f52198110b76a92815e63c2c3108 | 4,186 | py | Python | experiments/object-diagnosticity/make_permutations.py | hawkrobe/graphical_conventions | d227b29aef749e6e510e2abcedea5d7e7c6111a1 | [
"MIT"
] | null | null | null | experiments/object-diagnosticity/make_permutations.py | hawkrobe/graphical_conventions | d227b29aef749e6e510e2abcedea5d7e7c6111a1 | [
"MIT"
] | null | null | null | experiments/object-diagnosticity/make_permutations.py | hawkrobe/graphical_conventions | d227b29aef749e6e510e2abcedea5d7e7c6111a1 | [
"MIT"
] | null | null | null | import pandas as pd
import itertools
shapenet_30afd2ef2ed30238aa3d0a2f00b54836 = {'url': "https://s3.amazonaws.com/shapenet-graphical-conventions/30afd2ef2ed30238aa3d0a2f00b54836.png"};
shapenet_30dc9d9cfbc01e19950c1f85d919ebc2 = {'url': "https://s3.amazonaws.com/shapenet-graphical-conventions/30dc9d9cfbc01e19950c1f85... | 61.558824 | 148 | 0.793598 |
4709e261c71ce96379fdf12f9ee34e23e502579e | 179 | py | Python | wagtail/admin/tests/api/utils.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/admin/tests/api/utils.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/admin/tests/api/utils.py | brownaa/wagtail | c97bc56c6822eb1b6589d5c33e07f71acfc48845 | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | from django.test import TestCase
from wagtail.tests.utils import WagtailTestUtils
class AdminAPITestCase(TestCase, WagtailTestUtils):
def setUp(self):
self.login()
| 19.888889 | 51 | 0.765363 |
41cea5232e793eba429214dbdd9d6913133be2db | 991 | py | Python | webScraper/tagParsing.py | InternationalSchoolAberdeen/deeptext | aab4915e006c8bf417bff19a2f1cbb91f1a571b9 | [
"MIT"
] | 1 | 2021-04-29T13:49:32.000Z | 2021-04-29T13:49:32.000Z | webScraper/tagParsing.py | InternationalSchoolAberdeen/deeptext | aab4915e006c8bf417bff19a2f1cbb91f1a571b9 | [
"MIT"
] | null | null | null | webScraper/tagParsing.py | InternationalSchoolAberdeen/deeptext | aab4915e006c8bf417bff19a2f1cbb91f1a571b9 | [
"MIT"
] | 1 | 2021-05-03T15:49:34.000Z | 2021-05-03T15:49:34.000Z | from bs4 import BeautifulSoup
import re
import glob
import os
newFile = open("bs4output/articletext.txt", "w", encoding='utf8')
# Character codedc decode error -> needs fixing, occures when parsing 1articles.html ->
def returnnotags(text):
p = re.compile(r'<.*?>')
# print(p.sub('', text))
return p.sub('... | 21.085106 | 87 | 0.613522 |
6731a5c45269c2aca173108eb81e444a652a4633 | 28,016 | py | Python | theano/compile/tests/test_function_module.py | royxue/Theano | 626104a8c2b16898d270dc99e16a3ddb4a74678e | [
"BSD-3-Clause"
] | 2 | 2015-01-20T04:53:37.000Z | 2015-01-20T04:53:40.000Z | theano/compile/tests/test_function_module.py | RoyXue/Theano | 626104a8c2b16898d270dc99e16a3ddb4a74678e | [
"BSD-3-Clause"
] | null | null | null | theano/compile/tests/test_function_module.py | RoyXue/Theano | 626104a8c2b16898d270dc99e16a3ddb4a74678e | [
"BSD-3-Clause"
] | null | null | null | import copy
import cPickle
import numpy
import unittest
from theano import config, gof
from theano.compile.io import In, Out
from theano.compile import function
from theano.compile import UnusedInputError
from theano.gof import MissingInputError
from theano.compat import all, exc_message
from theano import tensor
fr... | 37.454545 | 129 | 0.558252 |
91eda6c2a5850e04de42f0ad586b4d85bfc077f1 | 191 | py | Python | run.py | defhook/flask-blog | 157f910a5dd85158e8aaea314a5143fd59f6a399 | [
"MIT"
] | 1 | 2017-04-27T09:05:14.000Z | 2017-04-27T09:05:14.000Z | run.py | defhook/flask-blog | 157f910a5dd85158e8aaea314a5143fd59f6a399 | [
"MIT"
] | null | null | null | run.py | defhook/flask-blog | 157f910a5dd85158e8aaea314a5143fd59f6a399 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, absolute_import
from manage import master
if __name__ == '__main__':
master.run()
| 21.222222 | 72 | 0.727749 |
75fb5f941cc5d22126648335bf4d14f8e9122ec2 | 33,630 | py | Python | yt/data_objects/selection_data_containers.py | bkhamesra/yt-EinsteinToolkit | 576bf88b5cd706fd577c513c23b1db07ec5f4cd2 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-11-29T21:59:06.000Z | 2021-11-29T21:59:06.000Z | yt/data_objects/selection_data_containers.py | bkhamesra/yt-EinsteinToolkit | 576bf88b5cd706fd577c513c23b1db07ec5f4cd2 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/data_objects/selection_data_containers.py | bkhamesra/yt-EinsteinToolkit | 576bf88b5cd706fd577c513c23b1db07ec5f4cd2 | [
"BSD-3-Clause-Clear"
] | null | null | null | """
Data containers based on geometric selection
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software... | 39.150175 | 92 | 0.613886 |
ffa47fba51f8a02b05fce309a04dc4aa9ee38e2b | 17,775 | py | Python | lingvo/core/learner.py | keithachorn-intel/peoples-speech | b7623488dff36d343f8f5a6ead0a5a3a82f723bd | [
"Apache-2.0"
] | 62 | 2021-03-07T06:15:48.000Z | 2022-03-24T18:58:57.000Z | lingvo/core/learner.py | keithachorn-intel/peoples-speech | b7623488dff36d343f8f5a6ead0a5a3a82f723bd | [
"Apache-2.0"
] | 59 | 2021-02-26T21:37:03.000Z | 2022-03-24T16:57:12.000Z | lingvo/core/learner.py | keithachorn-intel/peoples-speech | b7623488dff36d343f8f5a6ead0a5a3a82f723bd | [
"Apache-2.0"
] | 9 | 2021-02-26T21:34:11.000Z | 2022-02-09T04:00:50.000Z | # Lint as: python3
# Copyright 2018 The TensorFlow 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 ... | 39.065934 | 80 | 0.686864 |
1a8bf19c2c3d237ae4daa34972c1d431e83985e0 | 3,180 | py | Python | models/context_encoder.py | mcao610/NEU-Graduate-Project | 2d07ed288ddb3bf033cf27e4054d7103c02cc2f5 | [
"Apache-2.0"
] | null | null | null | models/context_encoder.py | mcao610/NEU-Graduate-Project | 2d07ed288ddb3bf033cf27e4054d7103c02cc2f5 | [
"Apache-2.0"
] | null | null | null | models/context_encoder.py | mcao610/NEU-Graduate-Project | 2d07ed288ddb3bf033cf27e4054d7103c02cc2f5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import torch
from copy import deepcopy
from torch import nn
from torch.nn.utils.rnn import pack_padded_sequence
class ContextEncoder(nn.Module):
"""Sinal directional LSTM network, encoding pre- and pos-context.
"""
def __init__(self,
input_... | 34.565217 | 81 | 0.600943 |
b32dc72ee5ca1f6c77d3a6bd8f15e43dcac15ecd | 3,854 | py | Python | widgets/statusbar/codegen.py | ardovm/wxGlade | a4cf8e65bcc6df5f65cf8ca5c49b9a628bf1e8eb | [
"MIT"
] | 225 | 2018-03-26T11:23:22.000Z | 2022-03-24T09:44:08.000Z | widgets/statusbar/codegen.py | ardovm/wxGlade | a4cf8e65bcc6df5f65cf8ca5c49b9a628bf1e8eb | [
"MIT"
] | 403 | 2018-01-03T19:47:28.000Z | 2018-03-23T17:43:39.000Z | widgets/statusbar/codegen.py | ardovm/wxGlade | a4cf8e65bcc6df5f65cf8ca5c49b9a628bf1e8eb | [
"MIT"
] | 47 | 2018-04-08T16:48:38.000Z | 2021-12-21T20:08:44.000Z | """\
Code generator functions for wxStatusBar objects
@copyright: 2002-2007 Alberto Griggio
@copyright: 2014-2016 Carsten Grohmann
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import common
import wcodegen
class PythonStatusBarGenerator(wcodegen.PythonWidgetCodeWriter):
tmpl = '%(na... | 36.018692 | 92 | 0.622989 |
91d90b4ec72487a59e9ddb74c59962b67c965847 | 1,032 | py | Python | dataworkspace/dataworkspace/apps/accounts/models.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 1 | 2019-06-10T08:22:56.000Z | 2019-06-10T08:22:56.000Z | dataworkspace/dataworkspace/apps/accounts/models.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 2 | 2019-05-17T13:10:42.000Z | 2019-06-17T10:48:46.000Z | dataworkspace/dataworkspace/apps/accounts/models.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth import get_user_model
class Profile(models.Model):
user = models.OneToOneField(get_user_model(), on_delete=models.CASCADE)
sso_id = models.UUIDField(unique=Tru... | 33.290323 | 97 | 0.754845 |
9a369a52271d7e9da15009d42b35ca5e9bfb70f3 | 2,815 | py | Python | launch_on_workspace/displays.py | xblahoud/Launch-on-workspace | 485252e70b84be2f44ba752eb8491b289c15aacc | [
"MIT"
] | 3 | 2020-01-16T06:49:39.000Z | 2021-07-01T14:12:53.000Z | launch_on_workspace/displays.py | xblahoud/launch_on_workspace | 485252e70b84be2f44ba752eb8491b289c15aacc | [
"MIT"
] | 1 | 2019-10-25T17:20:07.000Z | 2019-10-25T17:20:07.000Z | launch_on_workspace/displays.py | xblahoud/Launch-on-workspace | 485252e70b84be2f44ba752eb8491b289c15aacc | [
"MIT"
] | null | null | null | import subprocess
from .launcher import get_window_args
import sys
def parse_displays():
"""Parse the output of `xrandr` and extract info about displays.
Return
======
displays: dict (display-name → size&position)
primary : name of primary display
xrandr has to be installed in the sys... | 28.72449 | 79 | 0.588277 |
ad226497caa31e29eb4b522fcc767eada7c801b0 | 1,212 | py | Python | src/python/pants/backend/graph_info/tasks/minimal_cover.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | 1 | 2020-08-26T03:30:31.000Z | 2020-08-26T03:30:31.000Z | src/python/pants/backend/graph_info/tasks/minimal_cover.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | 1 | 2021-09-02T21:06:31.000Z | 2021-09-02T21:06:31.000Z | src/python/pants/backend/graph_info/tasks/minimal_cover.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.build_graph.target import Target
from pants.task.console_task import ConsoleTask
class MinimalCover(ConsoleTask):
"""Print a minimal covering set of targets.
For a given ... | 35.647059 | 97 | 0.754125 |
e6b78d28ffd52fd3950bb42fe9083d59ad462fc3 | 8,801 | py | Python | util/SysModel.py | SSubhnil/RacingCARLA | 0134e9daa9988f806db9b2f4f9ab99f95dd7fac3 | [
"MIT"
] | 11 | 2020-09-30T13:56:22.000Z | 2022-01-10T04:39:05.000Z | util/SysModel.py | SSubhnil/RacingCARLA | 0134e9daa9988f806db9b2f4f9ab99f95dd7fac3 | [
"MIT"
] | null | null | null | util/SysModel.py | SSubhnil/RacingCARLA | 0134e9daa9988f806db9b2f4f9ab99f95dd7fac3 | [
"MIT"
] | 3 | 2021-05-08T01:36:11.000Z | 2022-01-18T13:41:30.000Z | import numpy as np
import pdb
import datetime
from Utilities import Curvature
import math
class Simulator:
"""Vehicle simulator
Attributes:
Sim: given a Controller object run closed-loop simulation and write the data in the ClosedLoopData object
"""
def __init__(self, Dynamic, map, lap = 0, flag... | 39.823529 | 155 | 0.498466 |
d235d7bf232d697f885a28e183fbe3cd14dbb007 | 26,062 | py | Python | tests/milvus_python_test/test_collection_count.py | vvyadrincev/milvus | 45c66b3cd5e75ef41ed5bcc9c79fd19502c914c8 | [
"Apache-2.0"
] | null | null | null | tests/milvus_python_test/test_collection_count.py | vvyadrincev/milvus | 45c66b3cd5e75ef41ed5bcc9c79fd19502c914c8 | [
"Apache-2.0"
] | null | null | null | tests/milvus_python_test/test_collection_count.py | vvyadrincev/milvus | 45c66b3cd5e75ef41ed5bcc9c79fd19502c914c8 | [
"Apache-2.0"
] | 1 | 2021-11-18T12:44:39.000Z | 2021-11-18T12:44:39.000Z | import pdb
import pytest
import logging
import itertools
from time import sleep
import threading
from multiprocessing import Process
from milvus import IndexType, MetricType
from utils import *
dim = 128
index_file_size = 10
add_time_interval = 3
tag = "1970-01-01"
nb = 6000
class TestCollectionCount:
"""
par... | 40.406202 | 108 | 0.649643 |
bf421513cba75da6023dcbd93529a44bf601e6f0 | 1,981 | py | Python | src/etc/generate-keyword-tests.py | TimDumol/rust | 31590bd34900403a18079bf4623cd35f9da0c100 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2021-02-16T17:01:36.000Z | 2021-02-18T03:27:39.000Z | src/etc/generate-keyword-tests.py | TimDumol/rust | 31590bd34900403a18079bf4623cd35f9da0c100 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2016-05-16T12:14:42.000Z | 2016-06-06T22:15:09.000Z | src/etc/generate-keyword-tests.py | TimDumol/rust | 31590bd34900403a18079bf4623cd35f9da0c100 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-07-29T22:20:48.000Z | 2021-02-10T10:21:24.000Z | #!/usr/bin/env python
#
# Copyright 2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
#... | 33.016667 | 76 | 0.720848 |
7c677f4b26ad323269a2215bd252c7d182f715b6 | 898 | py | Python | libc___so___6/__ctype_toupper_loc.py | Agnishom/SummerTrace | 8135a600cec0d670f9ead6d0545919fbca4b7ce9 | [
"MIT"
] | null | null | null | libc___so___6/__ctype_toupper_loc.py | Agnishom/SummerTrace | 8135a600cec0d670f9ead6d0545919fbca4b7ce9 | [
"MIT"
] | null | null | null | libc___so___6/__ctype_toupper_loc.py | Agnishom/SummerTrace | 8135a600cec0d670f9ead6d0545919fbca4b7ce9 | [
"MIT"
] | null | null | null | import simuvex
######################################
# __ctype_toupper_loc
######################################
class __ctype_toupper_loc(simuvex.SimProcedure):
"""
Following is the description from linuxfoundation.org:
The __ctype_toupper_loc() function shall return a pointer into an array
of cha... | 33.259259 | 77 | 0.67706 |
57c4c1c5386b7beb6361a29d1c244e3cc06d458d | 2,955 | py | Python | open_seq2seq/parts/transformer/ffn_layer.py | gioannides/OpenSeq2Seq | 9e13da51eda2d239539cad6a56f8db2bf11492d6 | [
"Apache-2.0"
] | 1,459 | 2017-09-11T17:58:19.000Z | 2022-03-27T06:42:04.000Z | open_seq2seq/parts/transformer/ffn_layer.py | gioannides/OpenSeq2Seq | 9e13da51eda2d239539cad6a56f8db2bf11492d6 | [
"Apache-2.0"
] | 307 | 2017-09-14T05:52:16.000Z | 2021-06-05T16:08:53.000Z | open_seq2seq/parts/transformer/ffn_layer.py | gioannides/OpenSeq2Seq | 9e13da51eda2d239539cad6a56f8db2bf11492d6 | [
"Apache-2.0"
] | 422 | 2017-09-11T19:13:21.000Z | 2022-03-31T23:43:10.000Z | # Copyright 2018 MLBenchmark Group. 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 applicable l... | 33.965517 | 86 | 0.670051 |
ba834b85ae80e277dabbf2b89eada37169cc04ae | 463 | py | Python | src/ggrc/builder/__init__.py | j0gurt/ggrc-core | 84662dc85aa8864c907eabe70b8efccf92298a1f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | src/ggrc/builder/__init__.py | j0gurt/ggrc-core | 84662dc85aa8864c907eabe70b8efccf92298a1f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/builder/__init__.py | j0gurt/ggrc-core | 84662dc85aa8864c907eabe70b8efccf92298a1f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Resource state representation handlers for GGRC models. Builder modules will
produce specific resource state representations for GGRC models as well as
update/create GGRC model instances from resource st... | 24.368421 | 79 | 0.788337 |
9032d63bd552e835e799fc851070d70ea768962b | 1,232 | py | Python | module1/protect_triangle.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | module1/protect_triangle.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | module1/protect_triangle.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | # Кириллов Алексей, ИУ7-12
# Защита лабораторной "Определение св-в треугольника"
# Для заданной координатами точки, лежащей в треугольнике, найти расстояние
# до ближайшей стороны.
from math import sqrt
try:
ax,ay,bx,by,cx,cy = map(float,input('Введите координаты вершин:').split())
dx,dy = map(float,... | 34.222222 | 80 | 0.62013 |
e96b7877aef82acf5cbda13946fbca2972de55f0 | 389 | py | Python | yearpercent.py | ChrisDavison/scripts | ebbe52626aac041f37a1143607dc0cc74515a198 | [
"MIT"
] | null | null | null | yearpercent.py | ChrisDavison/scripts | ebbe52626aac041f37a1143607dc0cc74515a198 | [
"MIT"
] | null | null | null | yearpercent.py | ChrisDavison/scripts | ebbe52626aac041f37a1143607dc0cc74515a198 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from datetime import date, timedelta
today = date.today()
year_end = date(year=today.year + 1, month=1, day=1) - timedelta(days=1)
year_start = date(year=today.year, month=1, day=1)
days_in_year = (year_end - year_start).days
days_through_year = (today - year_start).days
print("{} days ({:.1f}%)... | 38.9 | 92 | 0.730077 |
0aa9b25c9c8ea80634d85b4a192dd6ca6ec4f2fc | 1,826 | py | Python | app/UserCounter/tests.py | horzym/UserCounterAPI | 56463e77e9d22c34c50d0eb4890030b62f9f1d24 | [
"MIT"
] | null | null | null | app/UserCounter/tests.py | horzym/UserCounterAPI | 56463e77e9d22c34c50d0eb4890030b62f9f1d24 | [
"MIT"
] | null | null | null | app/UserCounter/tests.py | horzym/UserCounterAPI | 56463e77e9d22c34c50d0eb4890030b62f9f1d24 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
import time
class PublicUserCounterApiTest(TestCase):
"""Test Publicly UserCounter API"""
def setUp(self):
self.client = APIClient()
def testCountForCorr... | 30.433333 | 76 | 0.625958 |
e4a092cb89020132f554c45b535a9f1dfcad7832 | 1,312 | py | Python | FWCore/PythonUtilities/scripts/interactivePythonTest.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | FWCore/PythonUtilities/scripts/interactivePythonTest.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | FWCore/PythonUtilities/scripts/interactivePythonTest.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import readline
import atexit
import ctypes
def interactive_inspect_mode():
# http://stackoverflow.com/questions/640389/tell-whether-python-is-in-i-mode
flagPtr = ctypes.cast(ctypes.pythonapi.Py_InteractiveFlag,
... | 29.818182 | 84 | 0.645579 |
da274076ac389e477ca68941551e736401e52d41 | 13,283 | py | Python | alipay/aop/api/domain/AntMerchantExpandIsvShopCreateModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AntMerchantExpandIsvShopCreateModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AntMerchantExpandIsvShopCreateModel.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ShopBusinessTime import ShopBusinessTime
class AntMerchantExpandIsvShopCreateModel(object):
def __init__(self):
self._address = None
self._address_memo = None... | 34.681462 | 99 | 0.607318 |
615876c3c8ddef74095cbcb8ab41e04c858d2edd | 161 | py | Python | pygdpr/specifications/dpa_node_type_specification/__init__.py | GDPRxiv/crawler | 178ef9ff6c3641ba8b761a49e42c2579e453c1ca | [
"MIT"
] | null | null | null | pygdpr/specifications/dpa_node_type_specification/__init__.py | GDPRxiv/crawler | 178ef9ff6c3641ba8b761a49e42c2579e453c1ca | [
"MIT"
] | 2 | 2022-02-19T06:56:03.000Z | 2022-02-19T07:00:00.000Z | pygdpr/specifications/dpa_node_type_specification/__init__.py | GDPRxiv/crawler | 178ef9ff6c3641ba8b761a49e42c2579e453c1ca | [
"MIT"
] | null | null | null | class DPANodeTypeSpecification:
def is_satisfied_by(self, dpa_node):
classname = dpa_node.__class__.__name__
return (classname == 'DPANode')
| 32.2 | 47 | 0.714286 |
8a3a8634e875c800cb7cf7e2ce47d23c7b664b29 | 17,016 | py | Python | landsat_L1_qa_tool.py | and-viceversa/landsat_L1_qa_tool | 38294d3201524b48004217f97f155fb883b4e17f | [
"Unlicense"
] | 3 | 2020-06-11T00:20:23.000Z | 2022-01-22T19:41:37.000Z | landsat_L1_qa_tool.py | and-viceversa/landsat_L1_qa_tool | 38294d3201524b48004217f97f155fb883b4e17f | [
"Unlicense"
] | 1 | 2020-11-12T06:07:31.000Z | 2020-11-17T09:26:14.000Z | landsat_L1_qa_tool.py | and-viceversa/landsat_L1_qa_tool | 38294d3201524b48004217f97f155fb883b4e17f | [
"Unlicense"
] | 1 | 2020-11-12T02:11:17.000Z | 2020-11-12T02:11:17.000Z | #!/usr/bin/env python
# Python 3.7
import argparse
import os
import sys
from osgeo import gdal
from osgeo import gdalconst
class QualityBandConverter:
def __init__(self, args):
self.args = args
self.bqa_dict = {}
self.nodatavalue = gdal.GDT_UInt16
if args.fill: self.fill_dict =... | 45.376 | 119 | 0.542372 |
4f7127fd472edf5cecc11cd35d68900e9863cd34 | 10,703 | py | Python | collections/ansible_collections/community/general/plugins/modules/rundeck_job_run.py | escalate/my-smart-home | a9579c845761b980515ff34d2a95568c6e7c2b6c | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/general/plugins/modules/rundeck_job_run.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 1 | 2022-03-12T02:25:26.000Z | 2022-03-12T02:25:26.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/general/plugins/modules/rundeck_job_run.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, Phillipe Smith <phsmithcc@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: run... | 33.657233 | 122 | 0.589928 |
dcc6fca56e74d20cac487a5d6c63ebc2ebd75ff5 | 18,054 | py | Python | flaml/tune/sample.py | wuchihsu/FLAML | 54d303a95ab8615ec298a5a7a530f8d1d477bf68 | [
"MIT"
] | 1 | 2021-12-03T06:48:31.000Z | 2021-12-03T06:48:31.000Z | flaml/tune/sample.py | wuchihsu/FLAML | 54d303a95ab8615ec298a5a7a530f8d1d477bf68 | [
"MIT"
] | 4 | 2022-01-16T04:25:26.000Z | 2022-02-23T04:50:37.000Z | flaml/tune/sample.py | wuchihsu/FLAML | 54d303a95ab8615ec298a5a7a530f8d1d477bf68 | [
"MIT"
] | 1 | 2022-01-20T02:40:07.000Z | 2022-01-20T02:40:07.000Z | # Copyright 2020 The Ray Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 33.745794 | 88 | 0.58458 |
8ba9b1c3e4ff8eedc96b699521d8b8f97bba500d | 979 | py | Python | tests/ResourceInstance.py | jamesregis/ibmcloud-python-sdk | 90d00d9ac903c68b1e3084f4aab5f58614cea89b | [
"Apache-2.0"
] | 1 | 2021-07-21T11:46:40.000Z | 2021-07-21T11:46:40.000Z | tests/ResourceInstance.py | jamesregis/ibmcloud-python-sdk | 90d00d9ac903c68b1e3084f4aab5f58614cea89b | [
"Apache-2.0"
] | null | null | null | tests/ResourceInstance.py | jamesregis/ibmcloud-python-sdk | 90d00d9ac903c68b1e3084f4aab5f58614cea89b | [
"Apache-2.0"
] | null | null | null | import os.path
import json
import re
from tests.Common import Common
class ResourceInstance(Common):
json_content = Common.get_json_resource_content("resource_instances")
name = json_content["resources"][0]["name"]
id = json_content["resources"][0]["id"]
resource_group_id = json_content["resources"]... | 27.971429 | 73 | 0.657814 |
a6dd4d2d0e65123b06a93280aed3060dc8d9561f | 7,409 | py | Python | django/core/servers/basehttp.py | cpsimpson/django | d60b96d98881b47c845125e82269ea6a9b268fbb | [
"BSD-3-Clause"
] | null | null | null | django/core/servers/basehttp.py | cpsimpson/django | d60b96d98881b47c845125e82269ea6a9b268fbb | [
"BSD-3-Clause"
] | null | null | null | django/core/servers/basehttp.py | cpsimpson/django | d60b96d98881b47c845125e82269ea6a9b268fbb | [
"BSD-3-Clause"
] | null | null | null | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | 36.678218 | 90 | 0.65164 |
47a635f97cc77718b4116946e9dd27def4b69678 | 1,794 | py | Python | app/app/permissions.py | Tupek/meetUp-clone | 27267730cc6443e50b64a05dfc0f3d994346a03c | [
"MIT"
] | 8 | 2020-04-23T02:57:04.000Z | 2022-03-17T08:11:23.000Z | app/app/permissions.py | Tupek/meetUp-clone | 27267730cc6443e50b64a05dfc0f3d994346a03c | [
"MIT"
] | 3 | 2021-03-19T02:30:07.000Z | 2021-09-08T01:10:23.000Z | app/app/permissions.py | Tupek/meetUp-clone | 27267730cc6443e50b64a05dfc0f3d994346a03c | [
"MIT"
] | 1 | 2020-04-29T06:14:39.000Z | 2020-04-29T06:14:39.000Z | from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsOwnerOrAdminOrReadOnly(BasePermission):
message = "You have to be an admin or owner of this object"
def has_object_permission(self, request, view, obj):
if request.method in ['GET']:
return True
try:
... | 28.47619 | 69 | 0.62709 |
b8f6d7e0b2f906eb6ef9967ec721785aeb99c42c | 2,206 | py | Python | indico/modules/events/registration/controllers/management/__init__.py | jgrigera/indico | b5538f2755bc38a02313d079bac831ee3dfb44ab | [
"MIT"
] | 1 | 2018-11-12T21:29:26.000Z | 2018-11-12T21:29:26.000Z | indico/modules/events/registration/controllers/management/__init__.py | jgrigera/indico | b5538f2755bc38a02313d079bac831ee3dfb44ab | [
"MIT"
] | 9 | 2020-09-08T09:25:57.000Z | 2022-01-13T02:59:05.000Z | indico/modules/events/registration/controllers/management/__init__.py | jgrigera/indico | b5538f2755bc38a02313d079bac831ee3dfb44ab | [
"MIT"
] | 3 | 2020-07-20T09:09:44.000Z | 2020-10-19T00:29:49.000Z | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from flask import request
from sqlalchemy.orm import contains_eag... | 38.701754 | 91 | 0.665458 |
0346e2717fa6db53cca5f46d5050a4fd1d929c4f | 344 | py | Python | 032/main.py | autozimu/projecteuler | 12a8244b7ef9358ac6ca30698cd761c81c3ec925 | [
"MIT"
] | null | null | null | 032/main.py | autozimu/projecteuler | 12a8244b7ef9358ac6ca30698cd761c81c3ec925 | [
"MIT"
] | null | null | null | 032/main.py | autozimu/projecteuler | 12a8244b7ef9358ac6ca30698cd761c81c3ec925 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from sets import Set
s = Set()
for a in range(2, 100):
for b in range(a + 1, 10000):
if a * b > 10000:
break
p = str(a) + str(b) + str(a * b)
if sorted(list(p)) == ['1', '2', '3', '4', '5', '6', '7', '8', '9']:
print a, b, a * b
s.a... | 21.5 | 76 | 0.415698 |
d3d1ded658f9d100332db4e4baca3011baadf2cd | 1,423 | py | Python | examples/src/main/python/ml/sql_transformer.py | hochoy18/spark-2.2 | 421979234f03e698d61b2d14010deb0c6d34d890 | [
"0BSD",
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 9 | 2018-08-08T05:40:20.000Z | 2020-07-25T12:21:41.000Z | examples/src/main/python/ml/sql_transformer.py | rongyousu/spark-2.2 | 421979234f03e698d61b2d14010deb0c6d34d890 | [
"0BSD",
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 2 | 2020-05-15T21:40:43.000Z | 2021-01-21T00:17:29.000Z | examples/src/main/python/ml/sql_transformer.py | rongyousu/spark-2.2 | 421979234f03e698d61b2d14010deb0c6d34d890 | [
"0BSD",
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"BSD-2-Clause",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 14 | 2019-01-14T07:01:36.000Z | 2021-01-06T01:45:08.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 n... | 33.880952 | 78 | 0.67955 |
bd3cdfeb859bb58da4bea886499a8a770aca155f | 1,550 | py | Python | Scripts/parameters/ott_params.py | tpool2/RCInitialCond | c0f66fbbbb116619b8a9fff9a98f97a1ef93c72a | [
"MIT"
] | null | null | null | Scripts/parameters/ott_params.py | tpool2/RCInitialCond | c0f66fbbbb116619b8a9fff9a98f97a1ef93c72a | [
"MIT"
] | null | null | null | Scripts/parameters/ott_params.py | tpool2/RCInitialCond | c0f66fbbbb116619b8a9fff9a98f97a1ef93c72a | [
"MIT"
] | null | null | null | """
Defines default constant parameters for opt_then_test.py
"""
from numpy import exp
DATADIR = "../Data/" # Contains priors and soft robot data
BIG_ROBO_DATA = "bellows_arm1_whitened.mat"
SMALL_ROBO_DATA = "bellows_arm_whitened.mat"
VPTTOL = 0.5 # Valid prediction time error tolerance
TRAINPER = 0.66 # Percentage o... | 20.12987 | 63 | 0.658065 |
c46ba668fb38c61aba115aae30a47e5d2dcf09b4 | 5,517 | py | Python | tools/compression/hss-deflate.py | vauban353/hart-software-services | 01e82e3e05b5b00a22920eba811d95ed885ff16d | [
"MIT"
] | 1 | 2021-12-22T15:14:48.000Z | 2021-12-22T15:14:48.000Z | tools/compression/hss-deflate.py | ButterflyNetwork/hart-software-services | ae14baa0b4a26de2063a610ac54a883a91db7646 | [
"MIT"
] | null | null | null | tools/compression/hss-deflate.py | ButterflyNetwork/hart-software-services | ae14baa0b4a26de2063a610ac54a883a91db7646 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#==============================================================================
#
# MPFS HSS Deflate Stage
#
# Copyright 2021 Microchip Corporation.
#
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated... | 34.055556 | 87 | 0.692224 |
a426ec583747f7a92971a053145d7e02c9e1a6da | 2,322 | py | Python | ttt.py | dubey-sakshi0702/tic-tac-toe | 540a3656466720399987b6583dd3ba1f9601d825 | [
"Apache-2.0"
] | null | null | null | ttt.py | dubey-sakshi0702/tic-tac-toe | 540a3656466720399987b6583dd3ba1f9601d825 | [
"Apache-2.0"
] | 2 | 2022-03-08T16:26:53.000Z | 2022-03-08T16:55:41.000Z | ttt.py | dubey-sakshi0702/tic-tac-toe | 540a3656466720399987b6583dd3ba1f9601d825 | [
"Apache-2.0"
] | null | null | null | import random
def choose_first():
if random.randint(0, 1) == 0:
return 'Player 2'
else:
return 'Player 1'
def change_player(player):
if player=='Player 1':
return 'Player 2'
else:
return 'Player 1'
def board_input(board):
i=0
while i not in [1,2,3,4,5... | 30.155844 | 77 | 0.478467 |
1e1a4a9695bf3342964ec460e2e77e168226867f | 84 | py | Python | python/package/autodiff/__init__.py | ruelj2/autodiff | 2c241bec04d3924fdd42a342165d0cc168a843c6 | [
"MIT"
] | 991 | 2018-08-12T11:59:15.000Z | 2022-03-28T22:27:59.000Z | python/package/autodiff/__init__.py | ruelj2/autodiff | 2c241bec04d3924fdd42a342165d0cc168a843c6 | [
"MIT"
] | 166 | 2019-01-16T16:31:31.000Z | 2022-03-30T04:18:13.000Z | python/package/autodiff/__init__.py | ruelj2/autodiff | 2c241bec04d3924fdd42a342165d0cc168a843c6 | [
"MIT"
] | 123 | 2019-01-20T21:40:46.000Z | 2022-03-23T16:07:50.000Z | from autodiff.autodiff4py import *
# from autodiff._extensions.some_module import *
| 28 | 48 | 0.821429 |
8efd17f83d494ccae5af04df0bc4bcb7badf4bc6 | 2,603 | py | Python | migri/interfaces.py | RonquilloAeon/migri | ec108a27ec3ec1798b7fdf2b46dd89bdd550a7a7 | [
"MIT"
] | 11 | 2020-11-25T18:25:04.000Z | 2022-03-09T20:27:03.000Z | migri/interfaces.py | RonquilloAeon/migri | ec108a27ec3ec1798b7fdf2b46dd89bdd550a7a7 | [
"MIT"
] | 46 | 2019-12-11T16:24:44.000Z | 2022-02-21T23:45:54.000Z | migri/interfaces.py | RonquilloAeon/migri | ec108a27ec3ec1798b7fdf2b46dd89bdd550a7a7 | [
"MIT"
] | 1 | 2022-02-15T06:38:34.000Z | 2022-02-15T06:38:34.000Z | from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
if TYPE_CHECKING:
from aiomysql import Connection as MySQLConnection
from aiosqlite import Connection as SQLiteConnection
from asyncpg import Connection as PostgreSQLConnection
from migri.elements import Query
from migri.utils import Echo
... | 26.835052 | 82 | 0.659624 |
a118a981980fc511877aef6cb6e6d47e85126f2e | 107 | py | Python | content_b_variables/ex6_whitespaces.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | 3 | 2020-11-28T08:26:54.000Z | 2020-12-23T18:37:37.000Z | content_b_variables/ex6_whitespaces.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | 1 | 2020-10-22T02:05:11.000Z | 2020-10-22T02:05:53.000Z | content_b_variables/ex6_whitespaces.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | null | null | null | print('\n Python \n C++ \n Java')
print('\n\t Python \n\t C++ \n\t Java')
print('\n Python \n C++ \n Java') | 35.666667 | 39 | 0.560748 |
76d2e73794c785741c593a6ddd042889ff535649 | 1,940 | py | Python | test/functional/rpc_coinjoin.py | thelazier/dash | 22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd | [
"MIT"
] | null | null | null | test/functional/rpc_coinjoin.py | thelazier/dash | 22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd | [
"MIT"
] | null | null | null | test/functional/rpc_coinjoin.py | thelazier/dash | 22a24ab5b7b42d06a78d8fd092c3351bdf5aafdd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019-2021 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
... | 30.3125 | 69 | 0.675258 |
3783c0e756ad89fdafba01186b3abb829e748045 | 4,827 | py | Python | simulation-ros/src/turtlebot2i/turtlebot2i_msdn/msdn/faster_rcnn/fast_rcnn/mps_base.py | EricssonResearch/scott-eu | aad7fd2f767a3c5e7d89223a593fd979ad596db3 | [
"Apache-2.0"
] | 19 | 2017-06-29T07:41:26.000Z | 2021-11-03T18:48:48.000Z | simulation-ros/src/turtlebot2i/turtlebot2i_msdn/msdn/faster_rcnn/fast_rcnn/mps_base.py | EricssonResearch/scott-eu | aad7fd2f767a3c5e7d89223a593fd979ad596db3 | [
"Apache-2.0"
] | 175 | 2017-06-29T09:37:43.000Z | 2021-07-09T12:55:28.000Z | simulation-ros/src/turtlebot2i/turtlebot2i_msdn/msdn/faster_rcnn/fast_rcnn/mps_base.py | EricssonResearch/scott-eu | aad7fd2f767a3c5e7d89223a593fd979ad596db3 | [
"Apache-2.0"
] | 8 | 2017-10-31T08:53:12.000Z | 2021-07-21T06:14:43.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn import Parameter
from ..utils.timer import Timer
import pdb
class Message_Passing_Unit_v2(nn.Module):
def __init__(self, fea_size, filter_size = 128):
super(Message_Passing_Unit_v... | 40.225 | 111 | 0.745183 |
ab8cbd24c47a31073445d6e4c354263032e26caa | 8,340 | py | Python | estimators/test.py | mrgomaa/Automated-Cardiac-Segmentation-and-Disease-Diagnosis | f33f3c08a221ba559127537f9218e572c03df643 | [
"MIT"
] | null | null | null | estimators/test.py | mrgomaa/Automated-Cardiac-Segmentation-and-Disease-Diagnosis | f33f3c08a221ba559127537f9218e572c03df643 | [
"MIT"
] | null | null | null | estimators/test.py | mrgomaa/Automated-Cardiac-Segmentation-and-Disease-Diagnosis | f33f3c08a221ba559127537f9218e572c03df643 | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
import os, shutil, sys
import SimpleITK as sitk
import glob
from datetime import datetime
import time
import re, nibabel
import pandas as pd
from config import *
from test_utils import *
#sys.path.insert(0,'../models/')
from network import *
from network_ops import *... | 48.77193 | 122 | 0.510432 |
09db8d2b933cd8af4bd31a40fe01258b5f046835 | 7,551 | py | Python | sphinx/builders/singlehtml.py | supyrow/sphinx | 680417a10df7e5c35c0ff65979bd22906b9a5f1e | [
"BSD-2-Clause"
] | 2 | 2022-01-19T02:33:11.000Z | 2022-01-19T02:33:13.000Z | sphinx/builders/singlehtml.py | supyrow/sphinx | 680417a10df7e5c35c0ff65979bd22906b9a5f1e | [
"BSD-2-Clause"
] | 4 | 2022-01-23T07:54:28.000Z | 2022-03-02T14:35:14.000Z | sphinx/builders/singlehtml.py | supyrow/sphinx | 680417a10df7e5c35c0ff65979bd22906b9a5f1e | [
"BSD-2-Clause"
] | null | null | null | """
sphinx.builders.singlehtml
~~~~~~~~~~~~~~~~~~~~~~~~~~
Single HTML builders.
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from os import path
from typing import Any, Dict, List, Tuple, Union
from docutils import nodes
from docuti... | 37.755 | 92 | 0.611177 |
2012369e0c4f7d78ee560a3ec80cd588a6754ae9 | 5,530 | py | Python | examples/ad_manager/v201808/custom_field_service/set_line_item_custom_field_value.py | khanhnhk/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | 1 | 2021-12-30T15:21:42.000Z | 2021-12-30T15:21:42.000Z | examples/ad_manager/v201808/custom_field_service/set_line_item_custom_field_value.py | benlistyg/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201808/custom_field_service/set_line_item_custom_field_value.py | benlistyg/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. 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 requir... | 39.5 | 80 | 0.711754 |
04eb5f87196f1cb829db2aeef266529ec3e3181b | 1,594 | py | Python | ml_engine/custom-prediction-routines/preprocess.py | HoleCat/echarlosperros | b67460de0467e05b42a763c4430b26ecfd97c2aa | [
"Apache-2.0"
] | null | null | null | ml_engine/custom-prediction-routines/preprocess.py | HoleCat/echarlosperros | b67460de0467e05b42a763c4430b26ecfd97c2aa | [
"Apache-2.0"
] | null | null | null | ml_engine/custom-prediction-routines/preprocess.py | HoleCat/echarlosperros | b67460de0467e05b42a763c4430b26ecfd97c2aa | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | 36.227273 | 80 | 0.667503 |
935268b30f5ddb0ec37cbd0f52dc7742319f16f8 | 5,679 | py | Python | sqlalchemy_utils/view.py | tteaka/sqlalchemy-utils | 4754a9e93d661144dfffb674fd762becb607514b | [
"BSD-3-Clause"
] | 3 | 2021-03-29T03:19:20.000Z | 2021-03-29T03:28:04.000Z | sqlalchemy_utils/view.py | tteaka/sqlalchemy-utils | 4754a9e93d661144dfffb674fd762becb607514b | [
"BSD-3-Clause"
] | 3 | 2021-08-30T16:30:50.000Z | 2022-03-01T23:15:44.000Z | sqlalchemy_utils/view.py | tteaka/sqlalchemy-utils | 4754a9e93d661144dfffb674fd762becb607514b | [
"BSD-3-Clause"
] | 3 | 2021-03-22T14:24:40.000Z | 2021-04-02T08:05:27.000Z | import sqlalchemy as sa
from sqlalchemy.ext import compiler
from sqlalchemy.schema import DDLElement, PrimaryKeyConstraint
class CreateView(DDLElement):
def __init__(self, name, selectable, materialized=False):
self.name = name
self.selectable = selectable
self.materialized = materialized
... | 29.273196 | 78 | 0.648354 |
7f1f9cf0a507574564ff79ce048f003f8e1f241f | 67,026 | py | Python | dqn_ep/ale_agents.py | ShibiHe/Model-Free-Episodic-Control | 782129dc89dd0c2be3789f39fcd49e1bba2379ce | [
"MIT"
] | 37 | 2016-07-20T08:13:01.000Z | 2021-06-05T06:05:20.000Z | dqn_ep/ale_agents.py | ShibiHe/Model-Free-Episodic-Control | 782129dc89dd0c2be3789f39fcd49e1bba2379ce | [
"MIT"
] | 4 | 2016-07-14T20:38:48.000Z | 2020-09-09T20:54:59.000Z | dqn_ep/ale_agents.py | ShibiHe/Model-Free-Episodic-Control | 782129dc89dd0c2be3789f39fcd49e1bba2379ce | [
"MIT"
] | 12 | 2016-07-29T02:07:57.000Z | 2022-01-25T08:29:10.000Z | __author__ = 'frankhe'
"""
episodic control and DQN agents
"""
import time
import os
import logging
import numpy as np
import cPickle
import EC_functions
from images2gif import writeGif
import ale_data_set
import sys
sys.setrecursionlimit(10000)
class EpisodicControl(object):
def __init__(self, qec_table, ec_dis... | 37.133518 | 120 | 0.562811 |
5ae9287c2dd0ebc3a008e716e2cee3159ad3567d | 2,955 | py | Python | tests/system/action/assignment/test_update.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/action/assignment/test_update.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | 19 | 2021-11-22T16:25:54.000Z | 2021-11-25T13:38:13.000Z | tests/system/action/assignment/test_update.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from openslides_backend.permissions.permissions import Permissions
from tests.system.action.base import BaseActionTestCase
class AssignmentUpdateActionTest(BaseActionTestCase):
def test_update_correct(self) -> None:
self.set_models(
{
"meeting/110": {
"name"... | 36.481481 | 81 | 0.539763 |
a58c020261f92827103adfe6f668d90ae85475f8 | 726 | py | Python | main.py | cablespaghetti/bigben | 202e1232519208e04452a3e9580a95c997efc75e | [
"MIT"
] | 9 | 2017-04-16T14:16:39.000Z | 2021-08-06T10:04:48.000Z | main.py | cablespaghetti/bigben | 202e1232519208e04452a3e9580a95c997efc75e | [
"MIT"
] | 1 | 2019-06-19T14:42:36.000Z | 2019-06-19T14:42:36.000Z | main.py | cablespaghetti/bigben | 202e1232519208e04452a3e9580a95c997efc75e | [
"MIT"
] | 3 | 2019-02-08T09:10:28.000Z | 2020-11-05T02:41:28.000Z | from mastodon import Mastodon
import datetime
import os
import pytz
def handler(event, context):
access_token = os.environ.get('MASTODON_ACCESS_TOKEN', '')
api_base_url = os.environ.get('MASTODON_BASE_URL', '')
if not access_token or not api_base_url:
print('You must set both a MASTODON_ACCESS_TO... | 30.25 | 101 | 0.69697 |
4514c17169e4fe6e4fd8805c92e0da222f97981c | 2,501 | py | Python | src/setup.py | vapolonio/kedro_etl | e74fc408d0f48b43a0a5e85c8bcfa0782753edad | [
"CC0-1.0"
] | null | null | null | src/setup.py | vapolonio/kedro_etl | e74fc408d0f48b43a0a5e85c8bcfa0782753edad | [
"CC0-1.0"
] | null | null | null | src/setup.py | vapolonio/kedro_etl | e74fc408d0f48b43a0a5e85c8bcfa0782753edad | [
"CC0-1.0"
] | null | null | null | # Copyright 2021 QuantumBlack Visual Analytics 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 37.893939 | 77 | 0.694522 |
d3d6260f4f042aefd29f2b01ee29a7f53dadd878 | 7,562 | py | Python | flatland/envs/agent_utils.py | HarryTanNguyen/flatland-railway-enviroment | 5306871a6dbedd8d2745be4ff0caf0515e4d88ac | [
"MIT"
] | 1 | 2021-04-27T12:31:07.000Z | 2021-04-27T12:31:07.000Z | flatland/envs/agent_utils.py | HarryTanNguyen/flatland-railway-enviroment | 5306871a6dbedd8d2745be4ff0caf0515e4d88ac | [
"MIT"
] | null | null | null | flatland/envs/agent_utils.py | HarryTanNguyen/flatland-railway-enviroment | 5306871a6dbedd8d2745be4ff0caf0515e4d88ac | [
"MIT"
] | null | null | null | from enum import IntEnum
from itertools import starmap
from typing import Tuple, Optional, NamedTuple
from attr import attrs, attrib, Factory
from flatland.core.grid.grid4 import Grid4TransitionsEnum
from flatland.envs.schedule_utils import Schedule
class RailAgentStatus(IntEnum):
READY_TO_DEPART = 0... | 46.968944 | 117 | 0.584634 |
a380c891505f57e41273ccaa49f1878e20ba96b7 | 665 | py | Python | firsttime.py | lilpea/simplemusicbot | 73fd736627e88bcc85999a2dd51fa3f789bc7e21 | [
"MIT"
] | 8 | 2017-09-23T17:10:37.000Z | 2018-05-10T13:38:28.000Z | firsttime.py | lilpea/simplemusicbot | 73fd736627e88bcc85999a2dd51fa3f789bc7e21 | [
"MIT"
] | 1 | 2018-05-05T15:50:59.000Z | 2018-05-09T14:34:01.000Z | firsttime.py | lilpea/simplemusicbot | 73fd736627e88bcc85999a2dd51fa3f789bc7e21 | [
"MIT"
] | 2 | 2018-09-01T09:52:21.000Z | 2018-12-12T15:19:54.000Z | ''' First-time setup '''
import os
import json
import discord
import time
with open('bot.json') as data:
CONFIG = json.load(data)
client = discord.Client(max_messages=100)
@client.event
async def on_ready():
''' Setup '''
if os.path.isfile('avy.png'):
await client.edit_profile(avat... | 25.576923 | 71 | 0.613534 |
cac6e8b25d21af72ba321a984ab08388f9750002 | 9,223 | py | Python | Lib/test/test_type_comments.py | praleena/newpython | cb0748d3939c31168ab5d3b80e3677494497d5e3 | [
"CNRI-Python-GPL-Compatible"
] | 2 | 2019-05-26T16:03:33.000Z | 2019-06-15T10:18:13.000Z | Lib/test/test_type_comments.py | praleena/newpython | cb0748d3939c31168ab5d3b80e3677494497d5e3 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-03-29T09:43:04.000Z | 2019-03-29T09:43:04.000Z | Lib/test/test_type_comments.py | praleena/newpython | cb0748d3939c31168ab5d3b80e3677494497d5e3 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2021-02-01T20:44:21.000Z | 2021-02-01T20:44:21.000Z | import ast
import sys
import unittest
funcdef = """\
def foo():
# type: () -> int
pass
def bar(): # type: () -> None
pass
"""
asyncdef = """\
async def foo():
# type: () -> int
return await bar()
async def bar(): # type: () -> int
return await bar()
"""
asyncvar = """\
async = 12
await =... | 25.834734 | 88 | 0.559471 |
51160c47bd0b9ff5fac4b626b7600228de38c323 | 2,307 | py | Python | tests/test_inputs.py | brlec/effmass | cd0add6a40a16ad8f0250f8e5e7a2e07c284a497 | [
"MIT"
] | 34 | 2018-10-05T14:52:42.000Z | 2022-03-29T14:23:11.000Z | tests/test_inputs.py | brlec/effmass | cd0add6a40a16ad8f0250f8e5e7a2e07c284a497 | [
"MIT"
] | 43 | 2018-07-06T16:31:27.000Z | 2022-03-29T11:00:31.000Z | tests/test_inputs.py | brlec/effmass | cd0add6a40a16ad8f0250f8e5e7a2e07c284a497 | [
"MIT"
] | 31 | 2018-06-26T12:10:00.000Z | 2022-03-29T14:23:12.000Z | #! /usr/bin/env python3
import pytest
# using pytest-lazy-fixture plugin
import numpy as np
from effmass import inputs
from effmass import kt_to_ev
import math
@pytest.mark.parametrize("settings_object,extrema_search_depth,energy_range",[
(pytest.lazy_fixture('MAPI_settings_object'), 0.025, 0.25),
])
def test_setting... | 57.675 | 309 | 0.764196 |
3a5d9cb541d4d6a4d269193a31128dab320080da | 324 | py | Python | pythonexercicios/aula015.py | andrebatist4/cursoemvideo-python | a12b0023f01a38cc3fc5bb59aad5ad8a3e54f6d3 | [
"MIT"
] | null | null | null | pythonexercicios/aula015.py | andrebatist4/cursoemvideo-python | a12b0023f01a38cc3fc5bb59aad5ad8a3e54f6d3 | [
"MIT"
] | null | null | null | pythonexercicios/aula015.py | andrebatist4/cursoemvideo-python | a12b0023f01a38cc3fc5bb59aad5ad8a3e54f6d3 | [
"MIT"
] | null | null | null | '''
[ex1]
cont = 1
while True:
print(cont, '→ ', end='')
cont += 1
print('Acabou')'''
'''
[ex2]
n = cont = 0
while cont < 5:
n = int(input('Digite um número: '))
cont += 1'''
n = s = 0
while True:
n = int(input('Digite um número: '))
if n == 999:
break
s += n
print(f'A soma vale {s... | 14.086957 | 40 | 0.481481 |
4e84c94d8dea70f636829b4dda159c5117c576f9 | 3,989 | py | Python | setup.py | clement/django | daf7f6ebbb584d3f62dc74be7711fe737aab6c5b | [
"BSD-3-Clause"
] | 2 | 2016-05-09T17:02:39.000Z | 2016-07-19T11:28:31.000Z | setup.py | joetyson/django | c3699190186561d5c216b2a77ecbfc487d42a734 | [
"BSD-3-Clause"
] | null | null | null | setup.py | joetyson/django | c3699190186561d5c216b2a77ecbfc487d42a734 | [
"BSD-3-Clause"
] | null | null | null | from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
class osx_install_data(install_data):
# On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
# which is wrong. Python 2... | 40.704082 | 117 | 0.661319 |
341da9eee10f73cbe3d7e7e5cf91b57b4d2a89b4 | 3,634 | py | Python | charmhelpers/contrib/hardening/apache/checks/config.py | AurelienLourot/charm-helpers | b5725ac546372e7d4004d15095f79cdd5e7da687 | [
"Apache-2.0"
] | 19 | 2016-04-22T10:00:05.000Z | 2022-02-09T07:34:12.000Z | charmhelpers/contrib/hardening/apache/checks/config.py | AurelienLourot/charm-helpers | b5725ac546372e7d4004d15095f79cdd5e7da687 | [
"Apache-2.0"
] | 313 | 2017-09-15T13:22:58.000Z | 2022-02-25T17:55:01.000Z | charmhelpers/contrib/hardening/apache/checks/config.py | AurelienLourot/charm-helpers | b5725ac546372e7d4004d15095f79cdd5e7da687 | [
"Apache-2.0"
] | 136 | 2017-09-19T13:37:33.000Z | 2022-03-29T11:08:00.000Z | # Copyright 2016 Canonical 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 agreed to in writi... | 34.609524 | 78 | 0.588883 |
a0fb43f7419ebf8bfa4e9743270ebeceedac8172 | 228 | py | Python | Chapter 7 - Loops in Python/10_pr_01.py | alex-dsouza777/Python-Basics | 8f1c406f2319cd65b5d54dfea990d09fa69d9adf | [
"MIT"
] | null | null | null | Chapter 7 - Loops in Python/10_pr_01.py | alex-dsouza777/Python-Basics | 8f1c406f2319cd65b5d54dfea990d09fa69d9adf | [
"MIT"
] | null | null | null | Chapter 7 - Loops in Python/10_pr_01.py | alex-dsouza777/Python-Basics | 8f1c406f2319cd65b5d54dfea990d09fa69d9adf | [
"MIT"
] | 1 | 2021-04-21T10:23:08.000Z | 2021-04-21T10:23:08.000Z | #Program to print multiplication table of a given number using for loop
num = int(input("Enter the number "))
for i in range(1, 11):
# print(str(num) + " X " +str(i) + " = " + str(i*num))
print(f"{num} X {i} = {num*i}") | 38 | 71 | 0.596491 |
8cdb4e34826d50d9898d79e2ffe09c369026b3e5 | 640 | py | Python | paddlespeech/cli/st/__init__.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 1,540 | 2017-11-14T13:26:33.000Z | 2021-11-09T14:05:08.000Z | paddlespeech/cli/st/__init__.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 599 | 2017-11-14T13:19:12.000Z | 2021-11-09T01:58:26.000Z | paddlespeech/cli/st/__init__.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 449 | 2017-11-14T12:48:46.000Z | 2021-11-06T09:34:33.000Z | # Copyright (c) 2021 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 appli... | 42.666667 | 74 | 0.767188 |
f6bb954505d856498d7912cbcb075db6154f2203 | 8,989 | py | Python | doc/conf.py | ffsouza/SimpleCV | ce40db995d2f252ba7e6ea3a21790d709564f2bd | [
"BSD-3-Clause"
] | 14 | 2015-02-10T13:07:27.000Z | 2021-02-10T16:26:48.000Z | doc/conf.py | hav3n/SimpleCV | a9bb3fc2eb7b47d2ae106c2e8efc28b61eb497c1 | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | hav3n/SimpleCV | a9bb3fc2eb7b47d2ae106c2e8efc28b61eb497c1 | [
"BSD-3-Clause"
] | 16 | 2015-02-23T21:18:28.000Z | 2019-04-17T11:10:28.000Z | # -*- coding: utf-8 -*-
#
# SimpleCV documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 8 16:38:59 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 31.320557 | 80 | 0.714095 |
e69c534327b0789d53a60c97ba4153d624ee41ac | 7,333 | py | Python | xontrib/vox.py | oh-my-xonsh/xonsh | 7331d8aee50e8939f8fe4d5b7133ed3907f204f4 | [
"BSD-2-Clause-FreeBSD"
] | 4,716 | 2016-06-07T05:48:42.000Z | 2022-03-31T22:30:15.000Z | xontrib/vox.py | oh-my-xonsh/xonsh | 7331d8aee50e8939f8fe4d5b7133ed3907f204f4 | [
"BSD-2-Clause-FreeBSD"
] | 3,644 | 2016-06-07T05:55:42.000Z | 2022-03-31T13:25:57.000Z | xontrib/vox.py | agoose77/xonsh | 7331d8aee50e8939f8fe4d5b7133ed3907f204f4 | [
"BSD-2-Clause-FreeBSD"
] | 576 | 2016-06-07T06:28:32.000Z | 2022-03-31T02:46:15.000Z | """Python virtual environment manager for xonsh."""
import xonsh.cli_utils as xcli
import xontrib.voxapi as voxapi
from xonsh.built_ins import XSH
__all__ = ()
def venv_names_completer(command, alias: "VoxHandler", **_):
envs = alias.vox.keys()
from xonsh.completers.path import complete_dir
yield from ... | 31.072034 | 92 | 0.548889 |
9711dfad2175d84705a81409670eaf3801248b46 | 9,419 | py | Python | mbed_flasher/erase.py | bridadan/mbed-flasher | 39d27a41926b7a3c8e8c29690cae9bf48583eb1d | [
"Apache-2.0"
] | null | null | null | mbed_flasher/erase.py | bridadan/mbed-flasher | 39d27a41926b7a3c8e8c29690cae9bf48583eb1d | [
"Apache-2.0"
] | null | null | null | mbed_flasher/erase.py | bridadan/mbed-flasher | 39d27a41926b7a3c8e8c29690cae9bf48583eb1d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2016 ARM 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 agreed to in writing, software
di... | 39.911017 | 96 | 0.644973 |
2f3704f236028ccfc3257cf1485a1b62058d781b | 2,782 | py | Python | POC/classes.py | pmfrank/TextAdventure | 6512bc532e2056dd3578841756033a21df33e2bd | [
"MIT"
] | null | null | null | POC/classes.py | pmfrank/TextAdventure | 6512bc532e2056dd3578841756033a21df33e2bd | [
"MIT"
] | null | null | null | POC/classes.py | pmfrank/TextAdventure | 6512bc532e2056dd3578841756033a21df33e2bd | [
"MIT"
] | null | null | null | from math import floor
class Entity():
def __init__(self, **attributes):
self.ability = {
"Strength": int(attributes['strength']),
"Dexterity": int(attributes['dexterity']),
"Constitution": int(attributes['constitution']),
"Intelligence": int(attributes['in... | 41.522388 | 88 | 0.608914 |
2e9f4e8dc34886b3f90088a1632b39492f7cce23 | 7,871 | py | Python | S4/S4 Library/simulation/situations/complex/scarecrow_situation.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Library/simulation/situations/complex/scarecrow_situation.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Library/simulation/situations/complex/scarecrow_situation.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | from _functools import partial
from _sims4_collections import frozendict
from event_testing.resolver import SingleObjectResolver
from event_testing.test_events import TestEvent
from interactions import ParticipantType
from interactions.utils.loot import LootActions
from role.role_state import RoleState
from sims4.tunin... | 66.142857 | 1,724 | 0.730022 |
fdf005eccdddb7e23213f845e934172226991e33 | 5,413 | py | Python | kmeans.py | kittyonex1/improved-bi-kmeans | 42b4a6f1d456f37e45684c6e48523c09bb2054bb | [
"BSD-3-Clause"
] | 2 | 2019-10-16T05:18:35.000Z | 2021-03-09T13:12:29.000Z | kmeans.py | kittyonex1/improved-bi-kmeans | 42b4a6f1d456f37e45684c6e48523c09bb2054bb | [
"BSD-3-Clause"
] | 1 | 2020-05-05T11:36:21.000Z | 2020-05-05T11:36:21.000Z | kmeans.py | kittyonex1/improved-bi-kmeans | 42b4a6f1d456f37e45684c6e48523c09bb2054bb | [
"BSD-3-Clause"
] | null | null | null | # %load kmeans.py
# kmeans.py
import numpy as np
def loadDataSet(filename):
"""
读取数据集
Args:
filename: 文件名
Returns:
dataMat: 数据样本矩阵
"""
dataMat = []
fr = open(filename)
for line in fr.readlines():
curLine = line.strip().split('\t')
# 通过map函数批量转换
... | 32.220238 | 97 | 0.580824 |
8f121c7024b9fd176e0924931dcf0c1bb8c19a50 | 1,974 | py | Python | samsung/[cutz]lab3.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | 3 | 2019-11-26T14:31:01.000Z | 2020-01-10T18:19:46.000Z | samsung/[cutz]lab3.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | samsung/[cutz]lab3.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | import sys
from itertools import combinations
import copy
from collections import deque
def bfs(res, comb, ans):
queue = deque()
virus_num, cnt = inactive, 0
for row, col in comb:
queue.append((row, col, cnt))
while queue:
row, col, cnt = queue.popleft()
res[row][col] ... | 24.073171 | 70 | 0.47771 |
f0d86c0e7fbf566655cdf90d476d01dedcf0fbac | 11,768 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv4_te_router_id/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv4_te_router_id/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/ipv4_te_router_id/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 37.006289 | 375 | 0.591774 |
3b4bbb36ef23b7c4b19a599109bd3d135a9f7b6a | 1,103 | py | Python | python/misc/change_to_next_letter.py | christopher-burke/warmups | 140c96ada87ec5e9faa4622504ddee18840dce4a | [
"MIT"
] | null | null | null | python/misc/change_to_next_letter.py | christopher-burke/warmups | 140c96ada87ec5e9faa4622504ddee18840dce4a | [
"MIT"
] | 2 | 2022-03-10T03:49:14.000Z | 2022-03-14T00:49:54.000Z | python/misc/change_to_next_letter.py | christopher-burke/warmups | 140c96ada87ec5e9faa4622504ddee18840dce4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Change Every Letter to the Next Letter.
Source:
https://edabit.com/challenge/oiHH7qocTyM3JqNf8
"""
from string import ascii_lowercase
def move_letter(letter: str, moves: int) -> str:
"""Move letter based on the number of moves."""
case = 'upper' if letter.isupper() else 'lower'
... | 23.468085 | 57 | 0.644606 |
7f897f757dd7d94f8f37443f8742f1728469ed6f | 23,925 | py | Python | pyprophet/runner.py | shubham1637/pyprophet | 4befd9ba3fcca2cc4e411dd3760cb1695045b09a | [
"BSD-3-Clause"
] | 22 | 2016-09-26T14:19:25.000Z | 2021-10-05T08:35:45.000Z | pyprophet/runner.py | shubham1637/pyprophet | 4befd9ba3fcca2cc4e411dd3760cb1695045b09a | [
"BSD-3-Clause"
] | 58 | 2016-07-19T18:09:30.000Z | 2022-03-24T16:26:08.000Z | pyprophet/runner.py | shubham1637/pyprophet | 4befd9ba3fcca2cc4e411dd3760cb1695045b09a | [
"BSD-3-Clause"
] | 21 | 2016-07-12T06:07:21.000Z | 2022-03-22T22:00:47.000Z | import abc
import click
import sys
import os
import time
import warnings
import pandas as pd
import numpy as np
import sqlite3
import pickle
from .pyprophet import PyProphet
from .report import save_report
from .data_handling import is_sqlite_file, check_sqlite_table
from shutil import copyfile
try:
profile
excep... | 49.228395 | 564 | 0.644263 |
8e4804cb3fc56b4b7b7d12ba6c6d1c8373b1ffc5 | 8,886 | py | Python | keras/optimizers/optimizer_experimental/adam.py | shraddhazpy/keras | 21a78464c191c40a90ed4e3ddfed747ae994703e | [
"Apache-2.0"
] | 1 | 2020-02-02T04:43:33.000Z | 2020-02-02T04:43:33.000Z | keras/optimizers/optimizer_experimental/adam.py | CloudboySolutions/keras | b96518a22bfd92a29811e507dec0b34248a8a3f5 | [
"Apache-2.0"
] | null | null | null | keras/optimizers/optimizer_experimental/adam.py | CloudboySolutions/keras | b96518a22bfd92a29811e507dec0b34248a8a3f5 | [
"Apache-2.0"
] | 1 | 2020-12-13T22:14:48.000Z | 2020-12-13T22:14:48.000Z | # Copyright 2021 The TensorFlow 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 applica... | 41.915094 | 80 | 0.682084 |
dd68e9b1056f7e84c9aab6d997a1a3730a22030b | 20,602 | py | Python | tools/json_schema_compiler/model.py | SlimKatLegacy/android_external_chromium_org | ee480ef5039d7c561fc66ccf52169ead186f1bea | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-04T02:36:53.000Z | 2016-06-25T11:22:17.000Z | tools/json_schema_compiler/model.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/json_schema_compiler/model.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4 | 2015-02-09T08:49:30.000Z | 2017-08-26T02:03:34.000Z | # Copyright (c) 2012 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.
import os.path
from json_parse import OrderedDict
from memoize import memoize
class ParseException(Exception):
"""Thrown when data in the model is i... | 35.767361 | 80 | 0.658189 |
93614b08ca2152672c4a3216e7f06f61dd16cfe1 | 30,019 | py | Python | collectors/python.d.plugin/elasticsearch/elasticsearch.chart.py | phiberoptick/community | d5ec318d65d4addda6162b5f77cc1bdbf71a5f59 | [
"MIT"
] | 2 | 2020-10-22T13:09:16.000Z | 2020-10-22T22:02:43.000Z | collectors/python.d.plugin/elasticsearch/elasticsearch.chart.py | phiberoptick/community | d5ec318d65d4addda6162b5f77cc1bdbf71a5f59 | [
"MIT"
] | 1 | 2020-10-27T12:11:49.000Z | 2020-10-27T15:23:07.000Z | collectors/python.d.plugin/elasticsearch/elasticsearch.chart.py | phiberoptick/community | d5ec318d65d4addda6162b5f77cc1bdbf71a5f59 | [
"MIT"
] | 1 | 2020-10-22T19:15:41.000Z | 2020-10-22T19:15:41.000Z | # -*- coding: utf-8 -*-
# Description: elastic search node stats netdata python.d module
# Author: ilyam8
# SPDX-License-Identifier: GPL-3.0-or-later
import json
import threading
from collections import namedtuple
from socket import gethostbyname, gaierror
try:
from queue import Queue
except ImportError:
fro... | 37.106304 | 116 | 0.579366 |
5a73ec1186b69c13028793036439f767b7743c54 | 2,683 | py | Python | examples/stick_tetrahedron.py | rancheng/mkl_random | 262498cca231dc8d568277b2801817331e2cdddb | [
"BSD-3-Clause"
] | 15 | 2017-11-15T14:36:39.000Z | 2022-01-24T16:36:34.000Z | examples/stick_tetrahedron.py | rancheng/mkl_random | 262498cca231dc8d568277b2801817331e2cdddb | [
"BSD-3-Clause"
] | 11 | 2017-12-11T10:51:58.000Z | 2021-07-23T16:30:22.000Z | examples/stick_tetrahedron.py | rancheng/mkl_random | 262498cca231dc8d568277b2801817331e2cdddb | [
"BSD-3-Clause"
] | 8 | 2017-11-15T14:36:40.000Z | 2022-02-14T18:58:42.000Z | import numpy as np
from parallel_mc import parallel_mc_run, sequential_mc_run
from parallel_random_states import build_MT2203_random_states
from sticky_math import mc_six_piece_stick_tetrahedron_prob
from arg_parsing import parse_arguments
def mc_runner(rs):
return mc_six_piece_stick_tetrahedron_prob(rs, batch_siz... | 35.302632 | 126 | 0.706299 |
f9eda18a1c712c017626deeda5308557b9ac8d11 | 2,372 | py | Python | Source Code/functions/moustache.py | deeppss/Cartoonify | 448d2a4d51cf523b340664c73f233eafb098bcef | [
"MIT"
] | 1 | 2021-05-17T15:05:16.000Z | 2021-05-17T15:05:16.000Z | Source Code/functions/moustache.py | deeppss/Cartoonify | 448d2a4d51cf523b340664c73f233eafb098bcef | [
"MIT"
] | 2 | 2021-07-26T18:36:37.000Z | 2022-03-12T01:02:22.000Z | Source Code/functions/moustache.py | deeppss/Cartoonify | 448d2a4d51cf523b340664c73f233eafb098bcef | [
"MIT"
] | 2 | 2021-06-07T10:09:41.000Z | 2021-08-04T07:46:03.000Z | import cv2
import numpy as np
def AddMoustache(cartoonimg,img):
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
nose_cascade = cv2.CascadeClassifier('source code\Haarcascades\\nose.xml')
must=cv2.imread("source code\Assets\mustache.png",cv2.IMREAD_UNCHANGE... | 43.127273 | 103 | 0.528246 |
8a2d8aff2489db1a32e8890348890c309407966c | 5,610 | py | Python | test/02_test.py | SimonForgot/Kay | 623242538b897fe593bd40f2a6f4712bdd02a181 | [
"MIT"
] | null | null | null | test/02_test.py | SimonForgot/Kay | 623242538b897fe593bd40f2a6f4712bdd02a181 | [
"MIT"
] | null | null | null | test/02_test.py | SimonForgot/Kay | 623242538b897fe593bd40f2a6f4712bdd02a181 | [
"MIT"
] | null | null | null | from subprocess import call
import torch
import pykay
import kay
import random
import math
from tqdm import tqdm
pic_res = 256
objs = []
bunny = pykay.OBJ("./models/01/", "bunny.obj")
objs.append(bunny)
rt = kay.Rtcore()
vertex = []
index = []
for i in range(len(objs)):
vertex.append(torch.Tensor(objs[i].vertices... | 34.207317 | 127 | 0.568806 |
e3134094bc3f1d2666134721f3bb005ccef79ecb | 259 | py | Python | examples/setup-test-app/setup.py | juliusvonkohout/s2i-python-container | 53776fd7876dd7cc2a0470adf593bc5917cfeba8 | [
"Apache-2.0"
] | 207 | 2016-07-12T04:51:58.000Z | 2022-03-18T23:31:38.000Z | examples/setup-test-app/setup.py | juliusvonkohout/s2i-python-container | 53776fd7876dd7cc2a0470adf593bc5917cfeba8 | [
"Apache-2.0"
] | 387 | 2016-06-10T14:28:43.000Z | 2022-03-30T20:04:29.000Z | examples/setup-test-app/setup.py | juliusvonkohout/s2i-python-container | 53776fd7876dd7cc2a0470adf593bc5917cfeba8 | [
"Apache-2.0"
] | 314 | 2016-06-14T09:27:06.000Z | 2022-02-22T07:46:31.000Z | from setuptools import setup, find_packages
setup (
name = "testapp",
version = "0.1",
description = "Example application to be deployed.",
packages = find_packages(),
install_requires = ["gunicorn"],
)
| 23.545455 | 61 | 0.57529 |
d8fde053b4c39cb406c403ab053023b08afee925 | 638 | py | Python | examples/2-get-all-table-names.py | sprucegum/lucid-dynamodb | 1e7145b14f1f462e2d8fe320b46b3820967bbcbf | [
"MIT"
] | 70 | 2021-05-30T13:34:57.000Z | 2021-06-13T21:05:06.000Z | examples/2-get-all-table-names.py | dineshsonachalam/Course_Registration_System | 1e7145b14f1f462e2d8fe320b46b3820967bbcbf | [
"MIT"
] | 21 | 2021-07-31T07:10:51.000Z | 2022-02-05T23:46:21.000Z | examples/2-get-all-table-names.py | dineshsonachalam/Course_Registration_System | 1e7145b14f1f462e2d8fe320b46b3820967bbcbf | [
"MIT"
] | 3 | 2021-07-12T10:52:36.000Z | 2021-12-06T19:51:05.000Z | from LucidDynamodb import DynamoDb
from LucidDynamodb.exceptions import (
UnexpectedError
)
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
try:
db = DynamoDb()
table_names = db.read_all_table_names()
logging.info(f"Table names: {table_names}")
exce... | 31.9 | 86 | 0.719436 |
ede459cccc090dd8484bb2e3def34a86c1c4e50b | 788 | py | Python | azure_auth/forms.py | masterashu/django_azure_auth | 7f11aaf7eff1f5d85624884a6cac76f70a939def | [
"MIT"
] | null | null | null | azure_auth/forms.py | masterashu/django_azure_auth | 7f11aaf7eff1f5d85624884a6cac76f70a939def | [
"MIT"
] | 4 | 2021-04-08T21:22:21.000Z | 2021-09-22T19:25:02.000Z | azure_auth/forms.py | masterashu/django_azure_auth | 7f11aaf7eff1f5d85624884a6cac76f70a939def | [
"MIT"
] | 1 | 2021-10-05T10:59:05.000Z | 2021-10-05T10:59:05.000Z | from django import forms
class UserCreateForm(forms.Form):
username = forms.CharField(max_length=40, required=True, strip=True)
first_name = forms.CharField(max_length=64, required=True)
last_name = forms.CharField(max_length=64, required=True)
password = forms.CharField(widget=forms.PasswordInput,
... | 37.52381 | 72 | 0.672589 |
eae238177c85fe5672de784f11f4f09b29da2318 | 5,086 | py | Python | ipysheet/sheet.py | chaffra/ipysheet | e9a24057af1d95590d1b7c78cc63caa033c9061c | [
"MIT"
] | null | null | null | ipysheet/sheet.py | chaffra/ipysheet | e9a24057af1d95590d1b7c78cc63caa033c9061c | [
"MIT"
] | null | null | null | ipysheet/sheet.py | chaffra/ipysheet | e9a24057af1d95590d1b7c78cc63caa033c9061c | [
"MIT"
] | null | null | null | import ipywidgets as widgets
import traitlets
from traitlets import Unicode, CFloat, CInt, List, Tuple, Instance, Union, Dict, Bool, Float, Int, Any
import ipysheet._version
semver_range_frontend = "~" + ipysheet._version.__version_js__
@widgets.register('ipysheet.Cell')
class Cell(widgets.Widget):
_model_name = ... | 43.101695 | 113 | 0.664963 |
6ea19bc82fe9d6f294e1eaf499ec979258929a48 | 444 | py | Python | processPKPD.py | rscottweekly/processPKPD | eaf0a095bc2b8b3cc4486f7594f093223db57b49 | [
"Apache-2.0"
] | null | null | null | processPKPD.py | rscottweekly/processPKPD | eaf0a095bc2b8b3cc4486f7594f093223db57b49 | [
"Apache-2.0"
] | null | null | null | processPKPD.py | rscottweekly/processPKPD | eaf0a095bc2b8b3cc4486f7594f093223db57b49 | [
"Apache-2.0"
] | null | null | null | from process.BIS.ProcessBIS import *
from process.general.general import *
from process.MonitorData.ProcessMonitor import *
from process.produceMasterData.produce import *
print "PROCESSING RAW DATA FILES"
coding_info = load_coding_data()
# convert_bis_full(coding_info, True)
# convert_monitordata_full(coding_info, T... | 27.75 | 48 | 0.84009 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.