hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
81d2e92136c305836487f7cd719abbdf22087fbd | 1,222 | py | Python | users/forms.py | KristenZuber/pawpals | e4da24c9e407544aecc56fa764b3fbf0d0dc865c | [
"MIT"
] | null | null | null | users/forms.py | KristenZuber/pawpals | e4da24c9e407544aecc56fa764b3fbf0d0dc865c | [
"MIT"
] | null | null | null | users/forms.py | KristenZuber/pawpals | e4da24c9e407544aecc56fa764b3fbf0d0dc865c | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from.models import Profile, Apply
# Define fields for the registration form
class UserRegistrationForm(UserCreationForm):
email = forms.EmailField(required = False)
class Meta:
m... | 30.55 | 91 | 0.643208 |
92ec402ceffd6cc26e8edbb3abcfd3c720717c09 | 26,239 | py | Python | myuw/dao/visual_schedule.py | uw-it-aca/myuw | 3fa1fabeb3c09d81a049f7c1a8c94092d612438a | [
"Apache-2.0"
] | 18 | 2015-02-04T01:09:11.000Z | 2021-11-25T03:10:39.000Z | myuw/dao/visual_schedule.py | uw-it-aca/myuw | 3fa1fabeb3c09d81a049f7c1a8c94092d612438a | [
"Apache-2.0"
] | 2,323 | 2015-01-15T19:45:10.000Z | 2022-03-21T19:57:06.000Z | myuw/dao/visual_schedule.py | uw-it-aca/myuw | 3fa1fabeb3c09d81a049f7c1a8c94092d612438a | [
"Apache-2.0"
] | 9 | 2015-01-15T19:29:26.000Z | 2022-02-11T04:51:23.000Z | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import logging
from myuw.dao.registration import get_schedule_by_term
from myuw.dao.instructor_schedule import get_instructor_schedule_by_term
from myuw.dao.term import get_current_quarter, get_current_summer_term
from myuw.dao.buil... | 33.298223 | 78 | 0.623156 |
2c758ed187d6e17ad0937d52dc8deabe9a28d926 | 16,301 | py | Python | mbed_lstools/platform_database.py | bentcooke/mbed-ls | 04e57d6f632245ba636efbf00e8b75815871c4c5 | [
"Apache-2.0"
] | null | null | null | mbed_lstools/platform_database.py | bentcooke/mbed-ls | 04e57d6f632245ba636efbf00e8b75815871c4c5 | [
"Apache-2.0"
] | null | null | null | mbed_lstools/platform_database.py | bentcooke/mbed-ls | 04e57d6f632245ba636efbf00e8b75815871c4c5 | [
"Apache-2.0"
] | null | null | null | """
mbed SDK
Copyright (c) 2017 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... | 34.245798 | 103 | 0.554751 |
fcbeaf9744d51a550160cb7231612f65b4a220c2 | 4,169 | py | Python | src/1-Phenotype-web/ext/wgetdl/csv/python/preTaskAnalysis.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 8 | 2019-09-17T10:22:40.000Z | 2022-03-30T22:22:19.000Z | src/1-Phenotype-web/ext/wgetdl/csv/python/preTaskAnalysis.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 4 | 2021-02-02T10:36:55.000Z | 2021-11-30T13:17:52.000Z | src/1-Phenotype-web/ext/wgetdl/csv/python/preTaskAnalysis.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 2 | 2019-09-11T00:10:26.000Z | 2021-01-21T22:38:01.000Z | #Analysis of the pre-task results
#How to run:
#python preTaskAnalysis.py oldFileName newFileName_UserAnalysis newFileName2_QuestionAnalysis
import sys
commandList = sys.argv
oldFileName = commandList[1]
newFileName = commandList[2]
newFileName2 = commandList[3]
numUsers = 0 #set when reading in the file
perfectSco... | 37.223214 | 99 | 0.730631 |
9a24691505909a174e09ac1cb4802106fadc0459 | 43,905 | py | Python | data_utils.py | glahr/RGAN | 91541616c1bb6ecc4db4aa8032c8667fc9758618 | [
"MIT"
] | null | null | null | data_utils.py | glahr/RGAN | 91541616c1bb6ecc4db4aa8032c8667fc9758618 | [
"MIT"
] | null | null | null | data_utils.py | glahr/RGAN | 91541616c1bb6ecc4db4aa8032c8667fc9758618 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import pdb
import re
from time import time
import json
import random
import os
import model
import paths
from scipy.spatial.distance import pdist, squareform
from scipy.stats import multivariate_normal, invgamma, mode
from scipy.special import gamma
# from scipy.misc import imre... | 43.817365 | 217 | 0.645348 |
23eafa61085f883bdf5c8f10f88dee3b0dc1b00e | 9,979 | py | Python | train.py | saravana611/Cardiac-Image-Segmentation | 9b6a5e0762c5a8829415d3ec50f9c33220d70d9c | [
"MIT"
] | 3 | 2022-01-12T07:11:13.000Z | 2022-02-20T16:52:18.000Z | train.py | saravana611/Cardiac-Image-Segmentation | 9b6a5e0762c5a8829415d3ec50f9c33220d70d9c | [
"MIT"
] | null | null | null | train.py | saravana611/Cardiac-Image-Segmentation | 9b6a5e0762c5a8829415d3ec50f9c33220d70d9c | [
"MIT"
] | 1 | 2022-03-28T07:53:58.000Z | 2022-03-28T07:53:58.000Z | import os
import argparse
import datetime
import uuid
import tensorflow as tf
import matplotlib.pyplot as plt
from azureml.core.run import Run
from azureml.core import Datastore
from azureml.core.model import Model, Dataset
from tensorflow.keras import backend as K
from tensorflow.keras.layers import (
Flatten, De... | 36.822878 | 103 | 0.609179 |
a44d73f5bc986a8fa986dd82d7e5409a5ed60964 | 1,238 | py | Python | remotedocker/manage/handler.py | Plesoun/remotedocker | 14ee1bf4095199650c2e976d3b48ee022a207ee7 | [
"Apache-2.0"
] | null | null | null | remotedocker/manage/handler.py | Plesoun/remotedocker | 14ee1bf4095199650c2e976d3b48ee022a207ee7 | [
"Apache-2.0"
] | null | null | null | remotedocker/manage/handler.py | Plesoun/remotedocker | 14ee1bf4095199650c2e976d3b48ee022a207ee7 | [
"Apache-2.0"
] | null | null | null | import logging
import asab
import asab.web.rest
L = logging.getLogger(__name__)
class ManageWebHandler:
def __init__(self, app, svc):
self.ManageWebservice = svc
web_app = app.WebContainer.WebApp
web_app.router.add_get(
r"/manage/cli/{manage_command}/{manage_arguments}", self.manage_cli
)
web_app.rout... | 30.95 | 79 | 0.760905 |
ff6abce402a494f7ee18cc60f7257cb3fdec2178 | 688 | py | Python | manage.py | vijujo/Assignment | a59c3834c95eccc48079c69d7c3168e7bc112352 | [
"MIT"
] | null | null | null | manage.py | vijujo/Assignment | a59c3834c95eccc48079c69d7c3168e7bc112352 | [
"MIT"
] | null | null | null | manage.py | vijujo/Assignment | a59c3834c95eccc48079c69d7c3168e7bc112352 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Assignment.settings')
try:
from django.core.management import execute_from_command_line
... | 29.913043 | 75 | 0.65843 |
f420b34f064b3d4b21d2f4dd19a3776f3dc0fc46 | 16,136 | py | Python | lip_model/training_graph.py | danoneata/deep_lip_reading | bb46cd7ee2764e1d932d9ea95cc405bef0934332 | [
"Apache-2.0"
] | null | null | null | lip_model/training_graph.py | danoneata/deep_lip_reading | bb46cd7ee2764e1d932d9ea95cc405bef0934332 | [
"Apache-2.0"
] | null | null | null | lip_model/training_graph.py | danoneata/deep_lip_reading | bb46cd7ee2764e1d932d9ea95cc405bef0934332 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
from config import load_args
from lip_model.losses import cer
from lip_model.modules import (
embedding,
sinusoid_encoding,
multihead_attention,
feedforward,
label_smoothing,
)
from lip_model.visual_frontend import VisualFrontend
from util.tf_util import s... | 35.699115 | 165 | 0.542885 |
d11fa03986d691a17bddcda5a687a6b525c2e106 | 1,149 | py | Python | tresearcher/researcher/test_records.py | Lewington-pitsos/tabularresearcher | bb69d15e24a1734e6c7293e00867a25fd5fb99a3 | [
"MIT"
] | null | null | null | tresearcher/researcher/test_records.py | Lewington-pitsos/tabularresearcher | bb69d15e24a1734e6c7293e00867a25fd5fb99a3 | [
"MIT"
] | null | null | null | tresearcher/researcher/test_records.py | Lewington-pitsos/tabularresearcher | bb69d15e24a1734e6c7293e00867a25fd5fb99a3 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from tresearcher.researcher.records import *
class TestRecordManagement(unittest.TestCase):
def setUp(self):
self.data_path = "tresearcher/researcher/data/"
def test_does_not_mutate_params(self):
params = {"a": 4, "b": 8, "c": [5, 6, 7, ]}
expected =... | 34.818182 | 100 | 0.557006 |
deafcc77d9540673b7c3960a7a999e31536adfd7 | 38,833 | py | Python | umsgpack.py | wzab/micropython-msgpack | 6d50c6d393939b694b53bf832e72ad7d4b5e457c | [
"MIT"
] | null | null | null | umsgpack.py | wzab/micropython-msgpack | 6d50c6d393939b694b53bf832e72ad7d4b5e457c | [
"MIT"
] | null | null | null | umsgpack.py | wzab/micropython-msgpack | 6d50c6d393939b694b53bf832e72ad7d4b5e457c | [
"MIT"
] | 1 | 2021-07-11T13:35:54.000Z | 2021-07-11T13:35:54.000Z | # u-msgpack-python v2.5.1 - v at sergeev.io
# https://github.com/vsergeev/u-msgpack-python
#
# u-msgpack-python is a lightweight MessagePack serializer and deserializer
# module, compatible with both Python 2 and 3, as well CPython and PyPy
# implementations of Python. u-msgpack-python is fully compliant with the
# lat... | 33.133959 | 79 | 0.595576 |
52b1f41cadf3c452cb66dda411edb0199e475466 | 2,349 | py | Python | som.py | arnav1598/som0 | f24ae597bfd0577f560615f869f2edb5f3b07119 | [
"CC-BY-3.0"
] | 5 | 2018-11-10T11:33:02.000Z | 2018-12-15T20:44:30.000Z | som.py | arnav1598/som0 | f24ae597bfd0577f560615f869f2edb5f3b07119 | [
"CC-BY-3.0"
] | null | null | null | som.py | arnav1598/som0 | f24ae597bfd0577f560615f869f2edb5f3b07119 | [
"CC-BY-3.0"
] | null | null | null | # Self Organizing Map
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Untitled form.csv')
X = dataset.iloc[:, 3:].values
y = dataset.iloc[:, 1].values
#Encoding Categorical Data
from sklearn.preprocessing imp... | 34.043478 | 115 | 0.684121 |
d6b9d91db56ca222979fb0b61f438d0b5ecb51d0 | 24,036 | py | Python | rasa/model.py | City-of-Turku/PaohRasaForBotfront | ea0eb32405be7a7359d1db717f30e090aea63f52 | [
"Apache-2.0",
"MIT"
] | null | null | null | rasa/model.py | City-of-Turku/PaohRasaForBotfront | ea0eb32405be7a7359d1db717f30e090aea63f52 | [
"Apache-2.0",
"MIT"
] | null | null | null | rasa/model.py | City-of-Turku/PaohRasaForBotfront | ea0eb32405be7a7359d1db717f30e090aea63f52 | [
"Apache-2.0",
"MIT"
] | null | null | null | import copy
import glob
import hashlib
import logging
import os
import shutil
from subprocess import CalledProcessError, DEVNULL, check_output # skipcq:BAN-B404
import tempfile
import typing
from packaging import version
from pathlib import Path
from typing import Any, Text, Tuple, Union, Optional, List, Dict, NamedTu... | 32.437247 | 89 | 0.671493 |
18464535bb8cff18949ddcc2a25b271a0462f73f | 1,579 | py | Python | game/renderer/pantool.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | 5 | 2021-06-25T16:44:38.000Z | 2021-12-31T01:29:00.000Z | game/renderer/pantool.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | null | null | null | game/renderer/pantool.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | 1 | 2021-06-25T20:33:47.000Z | 2021-06-25T20:33:47.000Z | class PanTool:
def __init__(self, size):
self.total_x = 0.0
self.total_y = 0.0
self.zoom = 800.0
self.zoom_level = 4
self.zoom_options = [12000, 7000, 4600, 3000, 2000, 1200, 800, 100]
self.size = size
def on_tick(self, time, frame_time):
frame_time = m... | 25.467742 | 78 | 0.529449 |
c05f1e17fe09ef7fd4f2eb29f937f0d6dffefa19 | 3,167 | py | Python | qikify/tests/test_controllers.py | brucedispassion/qikify | ed1384a1cbaf57fe4d570937e8a5859ab0858fde | [
"MIT"
] | 1 | 2019-09-07T12:16:12.000Z | 2019-09-07T12:16:12.000Z | qikify/tests/test_controllers.py | brucedispassion/qikify | ed1384a1cbaf57fe4d570937e8a5859ab0858fde | [
"MIT"
] | null | null | null | qikify/tests/test_controllers.py | brucedispassion/qikify | ed1384a1cbaf57fe4d570937e8a5859ab0858fde | [
"MIT"
] | 4 | 2017-01-09T02:44:43.000Z | 2022-02-15T03:30:32.000Z | import pandas
import numpy as np
from scipy.stats.stats import kurtosis
from scipy import c_, r_
from qikify.helpers.identify_outliers import identify_outliers
from qikify.controllers.KNN import KNN
from qikify.controllers.KDE import KDE
from qikify.controllers.LSFS import LSFS
from qikify.models.chip import Chip
fro... | 35.58427 | 79 | 0.619198 |
93c820b0969f704c19e953a1f3a4fea86a9f7ec0 | 634 | py | Python | src/utils/logging/handlers.py | gcdevops/OdooImport | 44b2396d48dfb2eed0843554b59a738497af103d | [
"MIT"
] | null | null | null | src/utils/logging/handlers.py | gcdevops/OdooImport | 44b2396d48dfb2eed0843554b59a738497af103d | [
"MIT"
] | null | null | null | src/utils/logging/handlers.py | gcdevops/OdooImport | 44b2396d48dfb2eed0843554b59a738497af103d | [
"MIT"
] | null | null | null | import os
import requests
import json
from logging import Handler, Formatter, ERROR
class SlackHandler(Handler):
def __init__(self, level=ERROR, slack_url=None):
super().__init__()
if slack_url is None:
self.slack_url = os.environ.get("SLACK_URL")
else:
self.slack_... | 28.818182 | 60 | 0.578864 |
817e659b7c8fe3e62e1a3ee8f490f81cc7586018 | 2,313 | py | Python | presidio-analyzer/analyzer/predefined_recognizers/iban_recognizer.py | eliperkins/presidio | 5c73e679c2982c047e2198895d153260406cb162 | [
"MIT"
] | 1 | 2019-08-31T19:57:55.000Z | 2019-08-31T19:57:55.000Z | presidio-analyzer/analyzer/predefined_recognizers/iban_recognizer.py | eliperkins/presidio | 5c73e679c2982c047e2198895d153260406cb162 | [
"MIT"
] | null | null | null | presidio-analyzer/analyzer/predefined_recognizers/iban_recognizer.py | eliperkins/presidio | 5c73e679c2982c047e2198895d153260406cb162 | [
"MIT"
] | null | null | null | import string
from analyzer.predefined_recognizers.iban_patterns import regex_per_country
from analyzer import Pattern, PatternRecognizer
from analyzer.entity_recognizer import EntityRecognizer
# Import 're2' regex engine if installed, if not- import 'regex'
try:
import re2 as re
except ImportError:
import re... | 33.521739 | 77 | 0.641159 |
b8ef5fb423fff03b0888000970ffc56a34ff3c59 | 25,347 | py | Python | assignment2/cs231n/layers.py | halimacc/CS231n-assignments | e2095450c42780a090d596e7790daf59ac80712b | [
"Unlicense"
] | null | null | null | assignment2/cs231n/layers.py | halimacc/CS231n-assignments | e2095450c42780a090d596e7790daf59ac80712b | [
"Unlicense"
] | null | null | null | assignment2/cs231n/layers.py | halimacc/CS231n-assignments | e2095450c42780a090d596e7790daf59ac80712b | [
"Unlicense"
] | null | null | null | from builtins import range
import numpy as np
def affine_forward(x, w, b):
"""
Computes the forward pass for an affine (fully-connected) layer.
The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N
examples, where each example x[i] has shape (d_1, ..., d_k). We will
reshape each ... | 42.104651 | 83 | 0.458121 |
3251bda8209f79bcfc51a0fcf97c533d8548a6bc | 2,182 | py | Python | budget/templatetags/budget.py | kwabena-aboah/ofos | b0ed9b36a7f2364777aa12abf398324ecf5e2ef2 | [
"MIT"
] | null | null | null | budget/templatetags/budget.py | kwabena-aboah/ofos | b0ed9b36a7f2364777aa12abf398324ecf5e2ef2 | [
"MIT"
] | 1 | 2021-06-08T19:39:41.000Z | 2021-06-08T19:39:41.000Z | budget/templatetags/budget.py | kwabena-aboah/ofos | b0ed9b36a7f2364777aa12abf398324ecf5e2ef2 | [
"MIT"
] | null | null | null | from decimal import Decimal
from django import template
from django.conf import settings
register = template.Library()
# To override, copy to your settings file. Make sure to keep the tuples in
# descending order by percentage.
BUDGET_DEFAULT_COLORS = (
# (percentage, CSS color class)
(1.001, 'red... | 28.710526 | 112 | 0.631531 |
8387182a627a7af8563cf07273718e3a7e506ace | 9,061 | py | Python | src/files/scripts/neutron_offline_network_type_update.py | openstack/charm-neutron-api-plugin-ovn | a676eb9d90ea576b0036f3f4a0e8752d1a934992 | [
"Apache-2.0"
] | 1 | 2020-07-27T09:07:46.000Z | 2020-07-27T09:07:46.000Z | src/files/scripts/neutron_offline_network_type_update.py | openstack/charm-neutron-api-plugin-ovn | a676eb9d90ea576b0036f3f4a0e8752d1a934992 | [
"Apache-2.0"
] | null | null | null | src/files/scripts/neutron_offline_network_type_update.py | openstack/charm-neutron-api-plugin-ovn | a676eb9d90ea576b0036f3f4a0e8752d1a934992 | [
"Apache-2.0"
] | 1 | 2019-10-30T15:46:53.000Z | 2019-10-30T15:46:53.000Z | #!/usr/bin/env python3
# Copyright 2020 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.394531 | 111 | 0.691094 |
21fb0d3896a0abe4ca4f7145c31526b23f153848 | 8,555 | py | Python | oneflow/compatible_single_client_python/ops/math_binary_elementwise_ops.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | oneflow/compatible_single_client_python/ops/math_binary_elementwise_ops.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | oneflow/compatible_single_client_python/ops/math_binary_elementwise_ops.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 28.516667 | 114 | 0.630392 |
4418e830c2457fdf55ce7302adc9f341a9c1849a | 4,462 | py | Python | codebase/train.py | RuiShu/dirt-t | 2da404a0c67d4eadbec0fd223f40fcfa07cdfb2d | [
"MIT"
] | 167 | 2018-03-18T05:52:45.000Z | 2022-03-20T15:29:36.000Z | codebase/train.py | RuiShu/dirt-t | 2da404a0c67d4eadbec0fd223f40fcfa07cdfb2d | [
"MIT"
] | 4 | 2018-06-17T04:34:39.000Z | 2021-05-19T14:10:23.000Z | codebase/train.py | RuiShu/dirt-t | 2da404a0c67d4eadbec0fd223f40fcfa07cdfb2d | [
"MIT"
] | 36 | 2018-03-20T05:39:01.000Z | 2022-03-28T08:15:14.000Z | import tensorflow as tf
import tensorbayes as tb
from codebase.args import args
from codebase.datasets import PseudoData, get_info
from utils import delete_existing, save_value, save_model
import os
import sys
import numpy as np
def update_dict(M, feed_dict, src=None, trg=None, bs=100):
"""Update feed_dict with ne... | 34.323077 | 80 | 0.598162 |
a3481edcf3aa45c42f182bb2eb2f817e4781fa17 | 4,708 | py | Python | updated_pr.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | null | null | null | updated_pr.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | null | null | null | updated_pr.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | null | null | null | # This algorith is based around DQN, parameterised like so:
# Q-function is a dense network with 2x100 node hidden layers
# experience replay contained the most recent 10000 state, action, reward triplets.
# learning took place after every episode using a minibatch size of 100
# learning rate = 0.01
# gamma = 0.99
# ... | 31.597315 | 269 | 0.566058 |
0de744a4bb705147ff8173f9e9c01029aabd464e | 15,980 | py | Python | test_elasticsearch/test_server/test_helpers.py | turtle321/elasticsearch-py | 80cd96ef96f34e3bb291fdf4f643da5a1016a8d7 | [
"Apache-2.0"
] | null | null | null | test_elasticsearch/test_server/test_helpers.py | turtle321/elasticsearch-py | 80cd96ef96f34e3bb291fdf4f643da5a1016a8d7 | [
"Apache-2.0"
] | null | null | null | test_elasticsearch/test_server/test_helpers.py | turtle321/elasticsearch-py | 80cd96ef96f34e3bb291fdf4f643da5a1016a8d7 | [
"Apache-2.0"
] | null | null | null | from elasticsearch6 import helpers, TransportError
from . import ElasticsearchTestCase
from ..test_cases import SkipTest
class FailingBulkClient(object):
def __init__(self, client, fail_at=(2, ), fail_with=TransportError(599, "Error!", {})):
self.client = client
self._called = 0
self._fai... | 42.613333 | 149 | 0.548874 |
40ab58f847fd18fe9b9cfdb2441e9660eeaad600 | 4,118 | py | Python | metricbeat/module/haproxy/test_haproxy.py | ContinuumLLC/beats | 4b9bc97d7e95c187a0326ba52d5fb052dd5d5a30 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-05-29T06:02:52.000Z | 2020-09-16T00:59:05.000Z | metricbeat/module/haproxy/test_haproxy.py | ContinuumLLC/beats | 4b9bc97d7e95c187a0326ba52d5fb052dd5d5a30 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2021-06-08T22:35:14.000Z | 2022-01-13T03:22:26.000Z | metricbeat/module/haproxy/test_haproxy.py | ContinuumLLC/beats | 4b9bc97d7e95c187a0326ba52d5fb052dd5d5a30 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-03-04T03:40:53.000Z | 2020-03-05T12:44:51.000Z | import os
import sys
import unittest
from nose.plugins.attrib import attr
sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system'))
import metricbeat
HAPROXY_FIELDS = metricbeat.COMMON_FIELDS + ["haproxy"]
@metricbeat.parameterized_with_supported_versions
class HaproxyTest(metricbeat.BaseTest)... | 34.316667 | 111 | 0.58815 |
20e9c7a28db07ca3013ded9f7e97289464755668 | 38 | py | Python | tri_distance/__init__.py | EdwardSmith1884/GEOMetrics | a39d4a45dfd33c257ff0f68069a5a3072bda7071 | [
"MIT"
] | 123 | 2019-02-01T03:34:04.000Z | 2022-02-20T21:02:17.000Z | tri_distance/__init__.py | EdwardSmith1884/GEOMetrics | a39d4a45dfd33c257ff0f68069a5a3072bda7071 | [
"MIT"
] | 18 | 2019-02-20T21:22:45.000Z | 2020-10-13T12:57:05.000Z | tri_distance/__init__.py | EdwardSmith1884/GEOMetrics | a39d4a45dfd33c257ff0f68069a5a3072bda7071 | [
"MIT"
] | 15 | 2019-04-17T13:50:04.000Z | 2021-02-07T20:34:54.000Z | from .tri_distance import TriDistance
| 19 | 37 | 0.868421 |
b6dbb64bb82e1b459f6b554c1b37c50c884799bd | 5,127 | py | Python | tools/gen_length_codes.py | selavy/plszip | 638bc10f715b77fdf3e1fb50325013c94594fd79 | [
"MIT"
] | null | null | null | tools/gen_length_codes.py | selavy/plszip | 638bc10f715b77fdf3e1fb50325013c94594fd79 | [
"MIT"
] | null | null | null | tools/gen_length_codes.py | selavy/plszip | 638bc10f715b77fdf3e1fb50325013c94594fd79 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
length_info = (
# code, extra_bits, start, stop
( 257, 0, 3, 3, ),
( 258, 0, 4, 4, ),
( 259, 0, 5, 5, ),
( 260, 0, 6, 6, ),
( 261, 0, 7, 7, ),
( 262, 0, 8, 8, ),
( 263, 0, 9, 9, ),
( 264, 0, 10, 10, ... | 27.86413 | 78 | 0.503998 |
6911b9930d99e11e39cfd04df0aded504c63f7cf | 1,025 | py | Python | schedulers/mosaic_schedulers/__init__.py | nasa/MOSAIC | af396ec450bd9f6f95fc5c603e13964035e05cd6 | [
"Apache-2.0"
] | 18 | 2019-04-01T02:58:38.000Z | 2022-01-02T07:31:03.000Z | schedulers/mosaic_schedulers/__init__.py | nasa/MOSAIC | af396ec450bd9f6f95fc5c603e13964035e05cd6 | [
"Apache-2.0"
] | null | null | null | schedulers/mosaic_schedulers/__init__.py | nasa/MOSAIC | af396ec450bd9f6f95fc5c603e13964035e05cd6 | [
"Apache-2.0"
] | 3 | 2019-11-04T01:52:50.000Z | 2021-09-13T01:52:50.000Z | """
Copyright 2019 by California Institute of Technology. ALL RIGHTS RESERVED.
United States Government sponsorship acknowledged. Any commercial use
must be negotiated with the Office of Technology Transfer at the
California Institute of Technology.
This software may be subject to U.S. export ... | 44.565217 | 76 | 0.76 |
62533a878cb5174178126f3a1183e5aeb87c4985 | 28,120 | py | Python | pytorch_lightning/core/step_result.py | shivdhar/pytorch-lightning | e4f7223c6384a65520c958f64b02db1952c61430 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/core/step_result.py | shivdhar/pytorch-lightning | e4f7223c6384a65520c958f64b02db1952c61430 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/core/step_result.py | shivdhar/pytorch-lightning | e4f7223c6384a65520c958f64b02db1952c61430 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.121319 | 115 | 0.56394 |
541101bb86b65efbe25cfa0f4aaf8bd63e460f4a | 356 | py | Python | default_cfg.py | mantoshkumar1/daily_task_automation | 113615938d81a39c9237e089ee300a64e767dd0e | [
"MIT"
] | null | null | null | default_cfg.py | mantoshkumar1/daily_task_automation | 113615938d81a39c9237e089ee300a64e767dd0e | [
"MIT"
] | null | null | null | default_cfg.py | mantoshkumar1/daily_task_automation | 113615938d81a39c9237e089ee300a64e767dd0e | [
"MIT"
] | null | null | null | from logics.app_constants import *
import os
APP_CFG = {
HOSTNAME: "10.100.57.99",
USERNAME: 'root',
PASSWORD: '',
DEFAULT_LOCAL_FILES_DIR: os.path.join(os.getcwd(), 'files_container'),
REMOTE_DIR_PATH: '/tmp',
UPLOAD_FILE_NAMES: ['upgmgr', 'dcoField.tar.gz'],
LOG_LOC: os.path.join(os.getcw... | 27.384615 | 74 | 0.657303 |
016583c7ec3b87971245a34a1580f9c7058f1e37 | 106 | py | Python | csat/collectors/pipermail/admin.py | GaretJax/csat | db63441136369436140a91c9657444353c8944e6 | [
"MIT"
] | null | null | null | csat/collectors/pipermail/admin.py | GaretJax/csat | db63441136369436140a91c9657444353c8944e6 | [
"MIT"
] | 7 | 2020-06-05T17:15:29.000Z | 2022-02-11T03:38:15.000Z | csat/collectors/pipermail/admin.py | GaretJax/csat | db63441136369436140a91c9657444353c8944e6 | [
"MIT"
] | null | null | null | from csat.acquisition import admin
class PipermailConfigAdmin(admin.DataCollectorConfigAdmin):
pass
| 17.666667 | 59 | 0.830189 |
681b53f9d3856fe14cb1ce61fc9415ada10d07a9 | 960 | py | Python | setup.py | kamicut/tilepie | 103ae2be1c3c4e6f7ec4a3bdd265ffcddee92b96 | [
"MIT"
] | 9 | 2017-12-14T17:38:26.000Z | 2021-04-06T18:30:46.000Z | setup.py | kamicut/tilepie | 103ae2be1c3c4e6f7ec4a3bdd265ffcddee92b96 | [
"MIT"
] | 5 | 2017-12-20T20:40:39.000Z | 2018-01-17T22:42:35.000Z | setup.py | kamicut/tilepie | 103ae2be1c3c4e6f7ec4a3bdd265ffcddee92b96 | [
"MIT"
] | 2 | 2017-12-20T20:40:56.000Z | 2018-09-21T04:14:16.000Z | from setuptools import setup
from codecs import open
from os import path
long_description='''
tilepie
=======
Simple ``.mbtiles`` processor for python. Built with the `QA Tiles <https://osmlab.github.io/osm-qa-tiles/>`_ in mind.
Based on the map/reduce/end structure in `@mapbox/tilereduce <https://github.com/mapbox/... | 32 | 118 | 0.673958 |
34aa102172500f27be027593c14874c03bb5e37b | 1,171 | py | Python | pyvisdk/do/vm_config_missing_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/vm_config_missing_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/vm_config_missing_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VmConfigMissingEvent(vim, *args, **kwargs):
'''This event records if the configuratio... | 34.441176 | 124 | 0.607173 |
70805bfcf649e63cdaab32468b761cea705d3868 | 1,492 | py | Python | Sentiment Detection/ConfusionMatrix.py | nafiul-araf/Sentiment-Detection | 51080bb9b8f1735dc765e01b3ca1cb7afa10c87f | [
"Apache-2.0"
] | null | null | null | Sentiment Detection/ConfusionMatrix.py | nafiul-araf/Sentiment-Detection | 51080bb9b8f1735dc765e01b3ca1cb7afa10c87f | [
"Apache-2.0"
] | null | null | null | Sentiment Detection/ConfusionMatrix.py | nafiul-araf/Sentiment-Detection | 51080bb9b8f1735dc765e01b3ca1cb7afa10c87f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
# In[2]:
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.RdBu):
"""
Source:
htt... | 25.288136 | 101 | 0.609249 |
d505b49c812b599e5706a510c44721645e607a38 | 1,731 | py | Python | egs/wham/TwoStep/local/preprocess_wham.py | michelolzam/asteroid | d69e1567577f8c830af9d4a942eb3e1a40eb8f9b | [
"MIT"
] | 2 | 2020-06-22T14:06:40.000Z | 2020-07-15T00:46:27.000Z | egs/wham/TwoStep/local/preprocess_wham.py | michelolzam/asteroid | d69e1567577f8c830af9d4a942eb3e1a40eb8f9b | [
"MIT"
] | null | null | null | egs/wham/TwoStep/local/preprocess_wham.py | michelolzam/asteroid | d69e1567577f8c830af9d4a942eb3e1a40eb8f9b | [
"MIT"
] | null | null | null | """
WHAM directory preprocessing
@author : Manuel Pariente, Inria-Nancy
Modified and extended from github.com/kaituoxu/Conv-TasNet/
MIT Copyright (c) 2018 Kaituo XU
"""
import argparse
import json
import os
import soundfile as sf
def preprocess_one_dir(in_dir, out_dir, out_filename):
""" Create .json file for on... | 33.288462 | 78 | 0.626228 |
e0605dac2ffd70fabf12b3dfe09acd0e25481ca3 | 11,630 | py | Python | tests/test_visibility.py | Cadair/synapse | 466866a1d9dd1fcf82348a36c0532cb0c6614767 | [
"Apache-2.0"
] | 1 | 2019-09-14T03:24:03.000Z | 2019-09-14T03:24:03.000Z | tests/test_visibility.py | Cadair/synapse | 466866a1d9dd1fcf82348a36c0532cb0c6614767 | [
"Apache-2.0"
] | 4 | 2020-03-04T23:47:05.000Z | 2021-12-09T21:41:44.000Z | tests/test_visibility.py | Cadair/synapse | 466866a1d9dd1fcf82348a36c0532cb0c6614767 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.820359 | 83 | 0.591745 |
1df23406d6524513058e9b84d79ce3c3ad281875 | 1,175 | py | Python | pysubunit/tests/sample-script.py | mtreinish/pysubunit | 5588ae7308dd51abb748212373eec00652179504 | [
"Apache-2.0"
] | null | null | null | pysubunit/tests/sample-script.py | mtreinish/pysubunit | 5588ae7308dd51abb748212373eec00652179504 | [
"Apache-2.0"
] | null | null | null | pysubunit/tests/sample-script.py | mtreinish/pysubunit | 5588ae7308dd51abb748212373eec00652179504 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# 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
... | 31.756757 | 79 | 0.729362 |
55d5dd8a97b8ff713e5e6792aaf9ae491895931f | 953 | py | Python | xlsxwriter/test/comparison/test_table03.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-01-09T19:43:43.000Z | 2019-01-09T19:43:43.000Z | xlsxwriter/test/comparison/test_table03.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_table03.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 23.243902 | 79 | 0.609654 |
67977a64c382aa8736fc174c2467b67eb6120245 | 465 | pyw | Python | py/hGen_19000101_Test Example Person.pyw | pinecoding/scrappydox | 274b8c0b046ae66b4f637acf3cedaa3b0def7afe | [
"MIT"
] | null | null | null | py/hGen_19000101_Test Example Person.pyw | pinecoding/scrappydox | 274b8c0b046ae66b4f637acf3cedaa3b0def7afe | [
"MIT"
] | 55 | 2015-12-19T16:13:14.000Z | 2016-09-13T22:44:58.000Z | py/hGen_19000101_Test Example Person.pyw | pinecoding/scrappydox | 274b8c0b046ae66b4f637acf3cedaa3b0def7afe | [
"MIT"
] | null | null | null | import person
id = "hGen_19000101_Test"
this = person.Person(f"""\
ID: {id}
Name: Example Person
Date of Birth: 1 January 1900
Location of Birth: Berkeley, CA
Date of Death: 01 January 1995
Location of Death: Los Angeles, CA
Children:
- type: daughter
file: hGen_19250101_Test2
""",
"""\
Born {p["Dat... | 24.473684 | 106 | 0.647312 |
d093639e6eba0376b858264b1396ddc82ff8a81a | 10,694 | py | Python | vistrails/core/inspector.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 83 | 2015-01-05T14:50:50.000Z | 2021-09-17T19:45:26.000Z | vistrails/core/inspector.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 254 | 2015-01-02T20:39:19.000Z | 2018-11-28T17:16:44.000Z | vistrails/core/inspector.py | remram44/VisTrails-mybinder | ee7477b471920d738f3ac430932f01901b56ed44 | [
"BSD-3-Clause"
] | 40 | 2015-04-17T16:46:36.000Z | 2021-09-28T22:43:24.000Z | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | 41.449612 | 80 | 0.590331 |
bf936492ceaf4a3fd0404f4bb605aa16011e8a05 | 624 | py | Python | ros/build/waypoint_follower/catkin_generated/pkg.installspace.context.pc.py | mahfuz195/sdc_capstone | 9a8c09c65bd6c5abcb243d83d8ec51df17cb2385 | [
"MIT"
] | null | null | null | ros/build/waypoint_follower/catkin_generated/pkg.installspace.context.pc.py | mahfuz195/sdc_capstone | 9a8c09c65bd6c5abcb243d83d8ec51df17cb2385 | [
"MIT"
] | null | null | null | ros/build/waypoint_follower/catkin_generated/pkg.installspace.context.pc.py | mahfuz195/sdc_capstone | 9a8c09c65bd6c5abcb243d83d8ec51df17cb2385 | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/student/Desktop/git_folder/sdc_capstone/ros/install/include".split(';') if "/home/student/Desktop/git_folder/sdc_capstone/ros/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "roscpp;std_m... | 69.333333 | 197 | 0.783654 |
b3ea272e3e5095daeb2a77409e0556eaa1b55e07 | 243 | py | Python | unicaps/__init__.py | sergey-scat/unicaps | 8f4a3c3f802c58464e93f953bcf11ecf44ef8f3b | [
"Apache-2.0"
] | 8 | 2020-07-27T19:18:27.000Z | 2022-02-23T04:05:56.000Z | unicaps/__init__.py | sergey-scat/unicaps | 8f4a3c3f802c58464e93f953bcf11ecf44ef8f3b | [
"Apache-2.0"
] | 2 | 2021-01-19T07:06:03.000Z | 2021-09-03T13:27:12.000Z | unicaps/__init__.py | sergey-scat/unicaps | 8f4a3c3f802c58464e93f953bcf11ecf44ef8f3b | [
"Apache-2.0"
] | 5 | 2021-03-22T23:09:05.000Z | 2022-01-21T09:00:14.000Z | # -*- coding: UTF-8 -*-
"""
Unicaps package
~~~~~~~~~~~~~~~
"""
# pylint: disable=unused-import,import-error
from ._solver import CaptchaSolver
from ._service import CaptchaSolvingService
__all__ = ('CaptchaSolver', 'CaptchaSolvingService')
| 20.25 | 52 | 0.699588 |
8673d9c7840f20408fd7aff2d180eba7ddc30548 | 7,135 | py | Python | ptolemy.py | yunruse/ptolemy | e672dc275bf88975bbc86ec3c28520db567b9692 | [
"MIT"
] | null | null | null | ptolemy.py | yunruse/ptolemy | e672dc275bf88975bbc86ec3c28520db567b9692 | [
"MIT"
] | null | null | null | ptolemy.py | yunruse/ptolemy | e672dc275bf88975bbc86ec3c28520db567b9692 | [
"MIT"
] | null | null | null | '''
Ptolemy: a mapping tile fetch-and-stitch tool.
Tiles are fetches to the tiles/ folder for caching/use,
and the output is stitched together with optional debugging symbols.
'''
import argparse
import csv
import os
from itertools import product
import urllib.request
import sys
import numpy as np
from PIL import Im... | 35.147783 | 99 | 0.568605 |
2d15c6aa239f61970192f728fccbeb1254fc2d7e | 2,395 | py | Python | cloudformation/tests/test_cloudformation.py | semyonmor/aqua-aws | 81a707e62a5cf2172a3e50269f919945ce1b4d7e | [
"Apache-2.0"
] | null | null | null | cloudformation/tests/test_cloudformation.py | semyonmor/aqua-aws | 81a707e62a5cf2172a3e50269f919945ce1b4d7e | [
"Apache-2.0"
] | null | null | null | cloudformation/tests/test_cloudformation.py | semyonmor/aqua-aws | 81a707e62a5cf2172a3e50269f919945ce1b4d7e | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
# import pytest
# Main
from dep_aws import cloudformation
from dep_aws import boto3
logging.root.setLevel(logging.INFO)
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
parser = argparse.ArgumentParser(description='Personal ... | 50.957447 | 165 | 0.781628 |
6441019136a953d1718e547a675878a570e7bdf0 | 4,049 | py | Python | RaftEscortSim/states/State.py | gluver/RAFTEscortSim | 3a37b6e78fabe8503278d648df6078e28d25b1b0 | [
"MIT"
] | null | null | null | RaftEscortSim/states/State.py | gluver/RAFTEscortSim | 3a37b6e78fabe8503278d648df6078e28d25b1b0 | [
"MIT"
] | null | null | null | RaftEscortSim/states/State.py | gluver/RAFTEscortSim | 3a37b6e78fabe8503278d648df6078e28d25b1b0 | [
"MIT"
] | null | null | null | from RaftEscortSim.messages.LogRP import LogRP
from RaftEscortSim.messages.LogRQ import LogRQ
from RaftEscortSim.messages.VoteResponseRP import VoteRequestRP
from RaftEscortSim.messages.BaseMessage import BaseMessage
# from RaftEscortSim.nodes.ServerNode import Node
from RaftEscortSim.messages.VoteRequestRQ import Vote... | 42.177083 | 118 | 0.642381 |
a477cf8962e26bdf54210d85cf1df3fa09ae52aa | 3,594 | py | Python | tests/integration/docusaurus/connecting_to_your_data/database/redshift_python_example.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | 2 | 2022-01-28T15:51:32.000Z | 2022-02-02T05:07:58.000Z | tests/integration/docusaurus/connecting_to_your_data/database/redshift_python_example.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | null | null | null | tests/integration/docusaurus/connecting_to_your_data/database/redshift_python_example.py | UtahDave/great_expectations | 99a54370f7ebeea5d95bca726200db01c7326d68 | [
"Apache-2.0"
] | 1 | 2021-10-08T01:24:50.000Z | 2021-10-08T01:24:50.000Z | import os
from ruamel import yaml
import great_expectations as ge
from great_expectations.core.batch import BatchRequest, RuntimeBatchRequest
redshift_username = os.environ.get("REDSHIFT_USERNAME")
redshift_password = os.environ.get("REDSHIFT_PASSWORD")
redshift_host = os.environ.get("REDSHIFT_HOST")
redshift_port =... | 37.051546 | 163 | 0.766834 |
805585238638fd582d6cca0c278a2ec190a6da89 | 1,133 | py | Python | wd-orgs/main.py | tocororo/py-labs | ba16ae26df90f38030e6094c8740edb814150469 | [
"MIT"
] | null | null | null | wd-orgs/main.py | tocororo/py-labs | ba16ae26df90f38030e6094c8740edb814150469 | [
"MIT"
] | null | null | null | wd-orgs/main.py | tocororo/py-labs | ba16ae26df90f38030e6094c8740edb814150469 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from DataCollect import collect, getDataInstance
from Database.instanceOfDao import InstanceOfDao
import sys
value = ''
# Q43229
while value != '6':
value = input(str("""
1 - Crear tablas instanceOf y subClass
2 - Obtener instancias y subclases de wikidata.
3 - Actualizar infor... | 29.051282 | 67 | 0.638129 |
a7ae2fc6dcd8e8e4dc9579e5bbc57a146b5b522e | 800 | py | Python | game_data.py | KomalKalyan/connect4 | 08e9abc550b4ed8a73798bac43209ca338bcf3f2 | [
"MIT"
] | 16 | 2019-11-13T15:08:47.000Z | 2021-04-16T11:40:07.000Z | game_data.py | KomalKalyan/connect4 | 08e9abc550b4ed8a73798bac43209ca338bcf3f2 | [
"MIT"
] | 38 | 2019-10-06T05:36:15.000Z | 2021-06-01T22:03:42.000Z | game_data.py | KomalKalyan/connect4 | 08e9abc550b4ed8a73798bac43209ca338bcf3f2 | [
"MIT"
] | 35 | 2019-10-06T00:39:59.000Z | 2021-03-27T04:46:47.000Z | from typing import Tuple
from game_board import GameBoard
class GameData:
"""
The game data class contains all of the data for the game.
"""
radius: int
height: int
width: int
sq_size: int
size: Tuple[int, int]
game_over: bool
turn: int
last_move_row: [int]
last_move_... | 22.857143 | 62 | 0.59625 |
4d5f71a9b1a4d8199d162fe51e36c29d021ed1fe | 18,690 | py | Python | test/test.py | thsuanwu/aegea | 6ccc386f7615d6a380c6f827b1a20676cd4e6b33 | [
"Apache-2.0"
] | null | null | null | test/test.py | thsuanwu/aegea | 6ccc386f7615d6a380c6f827b1a20676cd4e6b33 | [
"Apache-2.0"
] | null | null | null | test/test.py | thsuanwu/aegea | 6ccc386f7615d6a380c6f827b1a20676cd4e6b33 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, unittest, argparse, collections, copy, re, subprocess, importlib, pkgutil, json, datetime, glob, time
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) # n... | 58.773585 | 119 | 0.604815 |
0603055312d7e5060a3097e0891a49d96fb12656 | 5,038 | py | Python | content/solving-traveling-salesmans-problem-with-genetic-algorithm/example.py | root-11/root-11.github.io | 8099f32abb46a21fce51dac326be78ea1e613d79 | [
"MIT"
] | 2 | 2021-12-20T11:03:04.000Z | 2022-02-23T23:53:36.000Z | content/solving-traveling-salesmans-problem-with-genetic-algorithm/example.py | root-11/root-11.github.io | 8099f32abb46a21fce51dac326be78ea1e613d79 | [
"MIT"
] | null | null | null | content/solving-traveling-salesmans-problem-with-genetic-algorithm/example.py | root-11/root-11.github.io | 8099f32abb46a21fce51dac326be78ea1e613d79 | [
"MIT"
] | null | null | null | # Understanding the principles of genes and mutation as the driving mechanism
# for evolution is common today. Less common is the availability of a minimal
# viable example, that showcases the method.
# So here's an example I've used to enlighten friends, where I deliberately
# deviate from pep-8 to only introduce impo... | 28.788571 | 85 | 0.672092 |
5cb4b4cf24196c14bac7e05e971d2f816ce518b1 | 12,816 | py | Python | transition_sampling/engines/gromacs/gromacs_engine.py | UWPRG/transition-sampling | 6602bd87a66b70fb74711685f0ecfcb2d7bcbfe9 | [
"MIT"
] | 2 | 2020-12-04T01:54:44.000Z | 2021-03-09T18:44:15.000Z | transition_sampling/engines/gromacs/gromacs_engine.py | UWPRG/transition-sampling | 6602bd87a66b70fb74711685f0ecfcb2d7bcbfe9 | [
"MIT"
] | 10 | 2020-11-26T18:32:43.000Z | 2021-03-14T00:09:24.000Z | transition_sampling/engines/gromacs/gromacs_engine.py | UWPRG/transition-sampling | 6602bd87a66b70fb74711685f0ecfcb2d7bcbfe9 | [
"MIT"
] | null | null | null | """
Engine implementation of GROMACS
"""
from __future__ import annotations
import asyncio
import os
import subprocess
from typing import Sequence
import numpy as np
import parmed
from parmed.gromacs import GromacsGroFile
from mdtraj.formats import TRRTrajectoryFile
from .mdp import MDPHandler
from .. import Abstra... | 40.175549 | 93 | 0.612516 |
95bc48431dfedb4813e88ada7667a66eebe785df | 398 | py | Python | pyethmobisir/__init__.py | balakrishnan2/pyethmobisir | 208083afe169e2178c07bf52209cbe0844caf0c9 | [
"Unlicense"
] | null | null | null | pyethmobisir/__init__.py | balakrishnan2/pyethmobisir | 208083afe169e2178c07bf52209cbe0844caf0c9 | [
"Unlicense"
] | null | null | null | pyethmobisir/__init__.py | balakrishnan2/pyethmobisir | 208083afe169e2178c07bf52209cbe0844caf0c9 | [
"Unlicense"
] | null | null | null | from pyethmobisir.client import (EthJsonRpc, ParityEthJsonRpc,
ETH_DEFAULT_RPC_PORT, GETH_DEFAULT_RPC_PORT,
PYETHAPP_DEFAULT_RPC_PORT)
from pyethmobisir.exceptions import (ConnectionError, BadStatusCodeError,
BadJsonError,... | 44.222222 | 75 | 0.663317 |
77a7cbe68714ba66dd555d7f0813ae7ad403c2cb | 27,936 | py | Python | src/cuisine.py | ghuntley/cuisine | 69b470e7acb7d613f18ddae9d2f6bc74166dc03f | [
"BSD-3-Clause"
] | 1 | 2019-06-27T11:39:30.000Z | 2019-06-27T11:39:30.000Z | src/cuisine.py | ghuntley/cuisine | 69b470e7acb7d613f18ddae9d2f6bc74166dc03f | [
"BSD-3-Clause"
] | null | null | null | src/cuisine.py | ghuntley/cuisine | 69b470e7acb7d613f18ddae9d2f6bc74166dc03f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Project : Cuisine - Functions to write Fabric recipes
# -----------------------------------------------------------------------------
# Author : Sebastien Pierre <sebastien@ffctn.com... | 32.445993 | 170 | 0.628078 |
f04ae0f96ffa44f86da23dfad82a859d0ec77f66 | 3,369 | py | Python | profiles_project/settings.py | SahilShingari/profiles-rest-api | cae36c8ea340c78b61727cd4ec194b3ec2a53019 | [
"MIT"
] | null | null | null | profiles_project/settings.py | SahilShingari/profiles-rest-api | cae36c8ea340c78b61727cd4ec194b3ec2a53019 | [
"MIT"
] | 6 | 2019-12-05T00:33:17.000Z | 2021-06-10T19:04:56.000Z | profiles_project/settings.py | SahilShingari/profiles-rest-api | cae36c8ea340c78b61727cd4ec194b3ec2a53019 | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 25.717557 | 91 | 0.69813 |
730f2c1d58571063fe02a5387733ac0fc410f7da | 81 | py | Python | setup.py | derek1906/YouTube2Spotify | d16244a0a7327195261c8f045c7c8125c8d11866 | [
"MIT"
] | 1 | 2017-11-24T14:08:31.000Z | 2017-11-24T14:08:31.000Z | setup.py | derek1906/YouTube2Spotify | d16244a0a7327195261c8f045c7c8125c8d11866 | [
"MIT"
] | null | null | null | setup.py | derek1906/YouTube2Spotify | d16244a0a7327195261c8f045c7c8125c8d11866 | [
"MIT"
] | null | null | null | """Setup"""
from setuptools import setup
setup(name="apis", packages=["apis"])
| 13.5 | 37 | 0.679012 |
c36d518ef32ca854db4a7af849f2b9612de92543 | 4,177 | py | Python | package/spack-gettext/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-gettext/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-gettext/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 39.037383 | 78 | 0.618865 |
1c69eb1ccdf56dde4659304634fd471f30e86c9a | 14,641 | py | Python | morecantile/scripts/cli.py | geospatial-jeff/morecantile | 4f1041daae3cadb6dcf6c11eee515c521b637665 | [
"MIT"
] | null | null | null | morecantile/scripts/cli.py | geospatial-jeff/morecantile | 4f1041daae3cadb6dcf6c11eee515c521b637665 | [
"MIT"
] | null | null | null | morecantile/scripts/cli.py | geospatial-jeff/morecantile | 4f1041daae3cadb6dcf6c11eee515c521b637665 | [
"MIT"
] | null | null | null | """Morecantile command line interface"""
import json
import logging
import click
from mercantile.scripts import configure_logging, coords, iter_lines, normalize_input
from rasterio.crs import CRS
import morecantile
logger = logging.getLogger(__name__)
def normalize_source(input):
"""Yield features from GeoJSO... | 29.458753 | 88 | 0.587255 |
13df792e3fccd2f930c81cb349eb146d2435498e | 1,480 | py | Python | pycon/finaid/context_processors.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | null | null | null | pycon/finaid/context_processors.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | null | null | null | pycon/finaid/context_processors.py | azkarmoulana/pycon | 931388e6f640c35b892bb4b2d12581ba7ec8cf4e | [
"BSD-3-Clause"
] | null | null | null | from pycon.finaid.utils import applications_open, has_application, is_reviewer,\
offer_accepted, has_withdrawn_application
def financial_aid(request):
open = applications_open()
if has_application(request.user):
application = request.user.financial_aid
else:
application = None
ctx... | 47.741935 | 106 | 0.762162 |
db4dd58e7aec13e04a2fce9a7152df4053ae8e0c | 4,477 | py | Python | tests/test_client_server.py | zsheep5/pyModbusTCP | 1f12010bffae56e81ae406690008213e34d03768 | [
"MIT"
] | 177 | 2015-02-25T19:00:35.000Z | 2022-03-31T16:58:22.000Z | tests/test_client_server.py | zsheep5/pyModbusTCP | 1f12010bffae56e81ae406690008213e34d03768 | [
"MIT"
] | 52 | 2015-01-22T12:18:39.000Z | 2022-03-24T16:39:24.000Z | tests/test_client_server.py | zsheep5/pyModbusTCP | 1f12010bffae56e81ae406690008213e34d03768 | [
"MIT"
] | 90 | 2015-01-19T15:44:19.000Z | 2022-03-31T16:58:24.000Z | # -*- coding: utf-8 -*-
import unittest
from random import randint, getrandbits
from pyModbusTCP.server import ModbusServer
from pyModbusTCP.client import ModbusClient
class TestModbusClient(unittest.TestCase):
def test_except_init_host(self):
# should raise an exception for bad hostname
self.ass... | 41.841121 | 114 | 0.665848 |
61b5a03f43cb1be517957f5b40da103fe25e0918 | 9,961 | py | Python | tests/notrun_test_lme_forecast_verbose.py | ramittal/lme-for-forecast | 17b76f131ae00519ee66d6913246f4ed109e507b | [
"BSD-2-Clause"
] | null | null | null | tests/notrun_test_lme_forecast_verbose.py | ramittal/lme-for-forecast | 17b76f131ae00519ee66d6913246f4ed109e507b | [
"BSD-2-Clause"
] | null | null | null | tests/notrun_test_lme_forecast_verbose.py | ramittal/lme-for-forecast | 17b76f131ae00519ee66d6913246f4ed109e507b | [
"BSD-2-Clause"
] | 1 | 2020-10-23T04:24:47.000Z | 2020-10-23T04:24:47.000Z | import numpy as np
import pytest
from flme.lme_forecast_verbose import LME
import flme.rutils as rutils
class TestLME:
"""Tests for `lme.lme_forecast_verbose` """
@pytest.mark.parametrize("dimensions", [[5, 4, 3, 2], [5, 4, 1, 2]])
@pytest.mark.parametrize("random_intercept", [[5, 4, 1, 1], [5, 1, 1, 1],... | 46.765258 | 113 | 0.560988 |
c2a2860e107ce3de9e6c67d53a2ef0d9ef61844e | 561 | py | Python | django_tasker/migrations/0009_auto_20170512_2240.py | wooyek/django-tasker | dc411dd0438f523afb770d4f82c4369f93ea34ed | [
"MIT"
] | 2 | 2018-05-05T16:57:59.000Z | 2019-03-05T10:40:54.000Z | django_tasker/migrations/0009_auto_20170512_2240.py | wooyek/django-tasker | dc411dd0438f523afb770d4f82c4369f93ea34ed | [
"MIT"
] | 5 | 2017-03-09T17:30:04.000Z | 2019-04-19T20:22:31.000Z | django_tasker/migrations/0009_auto_20170512_2240.py | wooyek/django-tasker | dc411dd0438f523afb770d4f82c4369f93ea34ed | [
"MIT"
] | 1 | 2022-03-18T20:31:51.000Z | 2022-03-18T20:31:51.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-12 20:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_tasker', '0008_taskinfo_name'),
]
operations = [
migrations.Al... | 28.05 | 172 | 0.566845 |
76d570f7dea44aef275599d24d9fea3e7fbee879 | 490 | py | Python | pessoas/migrations/0012_auto_20200304_2251.py | iamgomes/ichurch | c6569aeb0388102affc8cf17c5fc0c781b2c2732 | [
"MIT"
] | 2 | 2020-02-26T22:43:27.000Z | 2022-01-07T01:26:00.000Z | pessoas/migrations/0012_auto_20200304_2251.py | iamgomes/ichurch | c6569aeb0388102affc8cf17c5fc0c781b2c2732 | [
"MIT"
] | 9 | 2020-02-11T23:41:49.000Z | 2021-09-22T18:26:57.000Z | pessoas/migrations/0012_auto_20200304_2251.py | iamgomes/ichurch | c6569aeb0388102affc8cf17c5fc0c781b2c2732 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.1 on 2020-03-05 01:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pessoas', '0011_auto_20200302_0205'),
]
operations = [
migrations.RemoveField(
model_name='pessoa',
name='situacao',... | 21.304348 | 52 | 0.569388 |
1b978030ef56219b744a9a6200471337f5455917 | 1,305 | py | Python | Youtube_Downloader.py | ThunderboltSH/Youtube-Video-Downloader-Program-with-GUI | 5bbd3b246277a1d189feedfba27a48c94f315767 | [
"Apache-2.0"
] | 3 | 2021-05-16T14:38:50.000Z | 2021-05-17T10:01:43.000Z | Youtube_Downloader.py | ThunderboltSH/Youtube-Video-Downloader-Program-with-GUI | 5bbd3b246277a1d189feedfba27a48c94f315767 | [
"Apache-2.0"
] | null | null | null | Youtube_Downloader.py | ThunderboltSH/Youtube-Video-Downloader-Program-with-GUI | 5bbd3b246277a1d189feedfba27a48c94f315767 | [
"Apache-2.0"
] | null | null | null | #Youtube Downloader GUI
#ThunderboltSH
#Limitations - no validation for invalid URLs but a fix will be coming soon
#Program will be reuploaded with more comments later
from tkinter import *
from pytube import YouTube as yt
root = Tk()
root.title("YouTube Video Downloader")
root.resizable(False, False)
def ... | 33.461538 | 124 | 0.695019 |
beee2799112ba9cf8de32c23a028f44687aa167c | 1,310 | py | Python | mysite/urls.py | bayazidtamim/Safaesying-verssion-0.0.0 | eaf86a211a26ea8e47326c15475eb76bb4e42214 | [
"Apache-2.0"
] | null | null | null | mysite/urls.py | bayazidtamim/Safaesying-verssion-0.0.0 | eaf86a211a26ea8e47326c15475eb76bb4e42214 | [
"Apache-2.0"
] | 2 | 2020-07-27T18:42:54.000Z | 2020-07-27T18:42:54.000Z | mysite/urls.py | bayazidtamim/Safaesying-verssion-0.0.0 | eaf86a211a26ea8e47326c15475eb76bb4e42214 | [
"Apache-2.0"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 38.529412 | 96 | 0.70687 |
febfa1ac7faa120472fbc6623731ffe2530782c1 | 2,611 | py | Python | src/gtk_helper.py | RipcordSoftware/avancedb-replication-monitor | bfa59cc36f5d8aa383a43ffeb6c82e938625ce34 | [
"MIT"
] | 8 | 2016-03-01T15:29:34.000Z | 2019-06-16T21:15:45.000Z | src/gtk_helper.py | RipcordSoftware/avancedb-replication-monitor | bfa59cc36f5d8aa383a43ffeb6c82e938625ce34 | [
"MIT"
] | 38 | 2015-12-27T20:34:25.000Z | 2016-02-19T15:48:12.000Z | src/gtk_helper.py | RipcordSoftware/replication-monitor | bfa59cc36f5d8aa383a43ffeb6c82e938625ce34 | [
"MIT"
] | null | null | null | import threading
from gi.repository import Gtk, GObject
class GtkHelper:
"""
A class which makes living with GTK and multiple threads slightly easier
"""
@staticmethod
def is_gtk_thread():
"""
Determines if the current thread is the main GTK thread
:return: True if the cur... | 30.360465 | 116 | 0.599387 |
1b057b7d04ec9baf1829ee5a6861424dfcb3ff05 | 247 | py | Python | module1-web-application-development-with-flask/assignment1.py | Nburkhal/DS-Unit-3-Sprint-3-Productization-and-Cloud | 64ea058d0584b442b48e091ca3001cd3bf9c9a06 | [
"MIT"
] | null | null | null | module1-web-application-development-with-flask/assignment1.py | Nburkhal/DS-Unit-3-Sprint-3-Productization-and-Cloud | 64ea058d0584b442b48e091ca3001cd3bf9c9a06 | [
"MIT"
] | null | null | null | module1-web-application-development-with-flask/assignment1.py | Nburkhal/DS-Unit-3-Sprint-3-Productization-and-Cloud | 64ea058d0584b442b48e091ca3001cd3bf9c9a06 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route("/about")
def pred():
return render_template('about.html')
if __name__ == "__main__":
app.run(debug=True) | 16.466667 | 40 | 0.672065 |
01d4e08b18a17c2b9d02b077a6a673c7ee7c4c6b | 6,542 | py | Python | feeder_utilities/rpc_message_processor.py | LandRegistry/feeder-utilities | 580f2ba09a8aa62c52103e46c4c105210c05fcbb | [
"MIT"
] | null | null | null | feeder_utilities/rpc_message_processor.py | LandRegistry/feeder-utilities | 580f2ba09a8aa62c52103e46c4c105210c05fcbb | [
"MIT"
] | null | null | null | feeder_utilities/rpc_message_processor.py | LandRegistry/feeder-utilities | 580f2ba09a8aa62c52103e46c4c105210c05fcbb | [
"MIT"
] | 1 | 2021-04-11T05:25:09.000Z | 2021-04-11T05:25:09.000Z | from feeder_utilities.health import FeederHealth
from feeder_utilities.exceptions import RpcMessageProcessingException
from feeder_utilities.dependencies.rabbitmq import ErrorQueueClient
from feeder_utilities.dependencies import rabbitmq
from feeder_utilities.dependencies.register import Register
class RpcMessageProc... | 58.936937 | 117 | 0.585906 |
85eb6d4d75c5ec87b9f02732fe9e31db36a596a5 | 6,936 | py | Python | jython_kernel.py | birnam/IJython | 3bd55fe20eeb99e65244e0ee0b4f368f4e53ad02 | [
"MIT"
] | null | null | null | jython_kernel.py | birnam/IJython | 3bd55fe20eeb99e65244e0ee0b4f368f4e53ad02 | [
"MIT"
] | null | null | null | jython_kernel.py | birnam/IJython | 3bd55fe20eeb99e65244e0ee0b4f368f4e53ad02 | [
"MIT"
] | null | null | null | from ipykernel.kernelbase import Kernel
from IPython.paths import locate_profile
from pexpect import replwrap,EOF,spawn
import signal
import re
import os
from distutils.spawn import find_executable
import sys
__version__ = '1.0.1'
class JythonKernel(Kernel):
implementation = 'Jython Kernel'
implementation_ve... | 42.292683 | 302 | 0.581027 |
25a1800a57f62dfe1799b7e50d190497fd37ecd1 | 822 | py | Python | openzgy/__init__.py | equinor/pyzgy | 94cd3d9050c3027d042a83b98779da9182041137 | [
"Apache-2.0"
] | null | null | null | openzgy/__init__.py | equinor/pyzgy | 94cd3d9050c3027d042a83b98779da9182041137 | [
"Apache-2.0"
] | null | null | null | openzgy/__init__.py | equinor/pyzgy | 94cd3d9050c3027d042a83b98779da9182041137 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2017-2020, Schlumberger
#
# 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... | 39.142857 | 77 | 0.765207 |
3f85c39e329a824aad3ed9a7b3b7a31257a1b4fc | 2,294 | py | Python | slot_language/object_slot/unet_params.py | jiaqi-xi/slot_attention | 8420414eb261501e5b056e4d409c338d909397ef | [
"Apache-2.0"
] | null | null | null | slot_language/object_slot/unet_params.py | jiaqi-xi/slot_attention | 8420414eb261501e5b056e4d409c338d909397ef | [
"Apache-2.0"
] | null | null | null | slot_language/object_slot/unet_params.py | jiaqi-xi/slot_attention | 8420414eb261501e5b056e4d409c338d909397ef | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from typing import Tuple
import attr
@attr.s(auto_attribs=True)
class SlotAttentionParams:
# model configs
resolution: Tuple[int, int] = (128, 128) # since we not using ViT
num_slots: int = 7 # at most 6 obj per image/video
# dim of slots embedding
slot_size: int = 6... | 32.771429 | 87 | 0.672624 |
05032aa8420dca4efde4f65aafc62d5de043cdac | 52 | py | Python | project/ctnotify/__init__.py | yosukesuzuki/let-me-notify | 39f50214403822712329c1cd953167d6e9b315d6 | [
"MIT"
] | null | null | null | project/ctnotify/__init__.py | yosukesuzuki/let-me-notify | 39f50214403822712329c1cd953167d6e9b315d6 | [
"MIT"
] | null | null | null | project/ctnotify/__init__.py | yosukesuzuki/let-me-notify | 39f50214403822712329c1cd953167d6e9b315d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kay application: ctnotify
| 17.333333 | 27 | 0.615385 |
202f6e4bf55eaf16230d634a607eacd8624379eb | 1,012 | py | Python | derp/__init__.py | bfolie/derp | 2f69f9f2d867988d4433221b24e1fa5c0b4f3bcc | [
"MIT"
] | 1 | 2021-05-27T21:30:10.000Z | 2021-05-27T21:30:10.000Z | derp/__init__.py | bfolie/derp | 2f69f9f2d867988d4433221b24e1fa5c0b4f3bcc | [
"MIT"
] | 1 | 2021-07-13T23:48:22.000Z | 2021-07-13T23:48:22.000Z | derp/__init__.py | bfolie/derp | 2f69f9f2d867988d4433221b24e1fa5c0b4f3bcc | [
"MIT"
] | null | null | null | import ast
from derp.deprecation import PythonDeprecation
"""Tuple of ast node types that could contain deprecation warnings, either on themselves
or on a node some levels down. This (functions and classes) captures the typical cases.
I would not be surprised if there are situations in which a deprecation warning is m... | 53.263158 | 95 | 0.80336 |
6531c9228e04d21058fe27f765814353ae5c80a7 | 1,730 | py | Python | scraping/drymask.py | Asyikin98/SkinFerm | 72fd1ad6339c96adf5ec154bde566de9eb1472c3 | [
"MIT"
] | null | null | null | scraping/drymask.py | Asyikin98/SkinFerm | 72fd1ad6339c96adf5ec154bde566de9eb1472c3 | [
"MIT"
] | 2 | 2021-02-03T01:55:13.000Z | 2021-04-30T12:46:33.000Z | scraping/drymask.py | Asyikin98/SkinFerm | 72fd1ad6339c96adf5ec154bde566de9eb1472c3 | [
"MIT"
] | null | null | null | import urllib.request
import random
from bs4 import BeautifulSoup
from requests import get
import mysql.connector
conn = mysql.connector.connect(user="root", passwd="",host="localhost", database="product")
cursor = conn.cursor()
sql = """INSERT INTO drymask (image, name, price, rating) VALUES (%s, %s, %s, %s)"""
d... | 37.608696 | 164 | 0.643353 |
8f9adf575a0c076c066b2ff151012ff9bc8bf5c2 | 2,753 | py | Python | pwn/middleagedheap/solve/solve.py | b01lers/b01lers-ctf-2021 | 1b6eb358bd0a36458fbefc72da2a88d9b3103faf | [
"MIT"
] | 6 | 2021-04-10T10:46:01.000Z | 2022-03-15T08:04:53.000Z | pwn/middleagedheap/solve/solve.py | b01lers/b01lers-ctf-2021 | 1b6eb358bd0a36458fbefc72da2a88d9b3103faf | [
"MIT"
] | 1 | 2021-05-20T03:38:52.000Z | 2021-05-20T03:44:55.000Z | pwn/middleagedheap/solve/solve.py | b01lers/b01lers-ctf-2021 | 1b6eb358bd0a36458fbefc72da2a88d9b3103faf | [
"MIT"
] | 3 | 2021-04-10T12:10:01.000Z | 2021-11-05T18:05:44.000Z | from pwn import *
import time
context.terminal = ['tmux', 'splitw', '-h']
# gcc - libc_start is 0x5bcff0 after the alloc at 0
elf_header_ptr = 0x2edff0
print("elf_header_ptr: {}".format(hex(elf_header_ptr)))
# readelf -S /libc
gnu_hash = elf_header_ptr + 0x00003930
dynsym = elf_header_ptr + 0x00007660
# readelf --d... | 32.388235 | 100 | 0.701053 |
49202e93bb60483a4754f707aa8d12e8351e108b | 3,475 | py | Python | app/app/settings.py | ogelinas/recipe-app-api | 5da3b7801eb77e79e6008a42487135810cb21f61 | [
"MIT"
] | null | null | null | app/app/settings.py | ogelinas/recipe-app-api | 5da3b7801eb77e79e6008a42487135810cb21f61 | [
"MIT"
] | null | null | null | app/app/settings.py | ogelinas/recipe-app-api | 5da3b7801eb77e79e6008a42487135810cb21f61 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib imp... | 24.64539 | 91 | 0.678849 |
05af2ecf65b342563377e4c91356e76a8249ac94 | 11,717 | py | Python | python/cucim/src/cucim/skimage/transform/pyramids.py | aasthajh/cucim | a95cc5c4ab25beffeac42d642dea8cb1bbf21408 | [
"Apache-2.0"
] | 131 | 2021-04-09T19:02:10.000Z | 2022-03-25T08:49:11.000Z | python/cucim/src/cucim/skimage/transform/pyramids.py | aasthajh/cucim | a95cc5c4ab25beffeac42d642dea8cb1bbf21408 | [
"Apache-2.0"
] | 222 | 2021-04-12T07:15:14.000Z | 2022-03-31T20:01:01.000Z | python/cucim/src/cucim/skimage/transform/pyramids.py | aasthajh/cucim | a95cc5c4ab25beffeac42d642dea8cb1bbf21408 | [
"Apache-2.0"
] | 34 | 2021-04-09T18:54:13.000Z | 2022-03-29T12:59:26.000Z | import math
from functools import reduce
import cupy as cp
from cupyx.scipy import ndimage as ndi
from .._shared.utils import convert_to_float
from ..transform import resize
def _smooth(image, sigma, mode, cval, multichannel=None):
"""Return image with each channel smoothed by the Gaussian filter."""
smooth... | 36.501558 | 101 | 0.661603 |
706d67f2affc6d88216f0ce914577f690eb84d4d | 155 | py | Python | ponyexpress/api/lib/providers/provider.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | ponyexpress/api/lib/providers/provider.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | ponyexpress/api/lib/providers/provider.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | # Base class
class Provider:
def __init__(self):
pass
def set_url(self, url):
pass
def fetch_metadata(self):
pass
| 11.071429 | 29 | 0.56129 |
be3c5640c355a22baa418702c757e9e766adbf21 | 71 | py | Python | insta.py | shubhamg0sai/hack-wifi | bb200d57b102f93bd0a64558086ed99949920a35 | [
"MIT"
] | 13 | 2022-01-09T10:20:03.000Z | 2022-03-08T07:17:44.000Z | insta.py | shubhamg0sai/hack-wifi | bb200d57b102f93bd0a64558086ed99949920a35 | [
"MIT"
] | 1 | 2022-01-03T17:42:21.000Z | 2022-01-09T17:46:10.000Z | insta.py | shubhamg0sai/hack-wifi | bb200d57b102f93bd0a64558086ed99949920a35 | [
"MIT"
] | null | null | null | import os
os.system('xdg-open https://www.instagram.com/shubhamg0sai')
| 23.666667 | 60 | 0.774648 |
687b649dc01d4b776822211dd2ac4bcfedbd03b5 | 1,753 | py | Python | config/wsgi.py | kirmishov/redesigned-winner | 6d23a334665ae20ead031a656855d7364ddcb35a | [
"MIT"
] | null | null | null | config/wsgi.py | kirmishov/redesigned-winner | 6d23a334665ae20ead031a656855d7364ddcb35a | [
"MIT"
] | null | null | null | config/wsgi.py | kirmishov/redesigned-winner | 6d23a334665ae20ead031a656855d7364ddcb35a | [
"MIT"
] | null | null | null | """
WSGI config for My cookiecutter-Django project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via th... | 43.825 | 79 | 0.803195 |
cf3b157e3db878a2947c7c8fc63039318614069e | 5,072 | py | Python | tensorflow/lite/testing/op_tests/strided_slice_np_style.py | ashutom/tensorflow-upstream | c16069c19de9e286dd664abb78d0ea421e9f32d4 | [
"Apache-2.0"
] | 10 | 2021-05-25T17:43:04.000Z | 2022-03-08T10:46:09.000Z | tensorflow/lite/testing/op_tests/strided_slice_np_style.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/lite/testing/op_tests/strided_slice_np_style.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | # Copyright 2019 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... | 31.7 | 80 | 0.500197 |
ceb1be692b75965215e6ea72edf6ebc043d04efb | 18,392 | py | Python | tests/examples/minlplib/smallinvDAXr4b200-220.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/smallinvDAXr4b200-220.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/smallinvDAXr4b200-220.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 04/21/18 13:54:14
#
# Equation counts
# Total E G L N X C B
# 4 0 2 2 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 94.317949 | 120 | 0.54241 |
8bfabb3a26d1109b23091cf41cae4efce0005b07 | 21,550 | py | Python | api_tests/identifiers/views/test_identifier_list.py | felliott/osf.io | b3221387f3995cdc7d7ae2da2e631f258d4afc86 | [
"Apache-2.0"
] | null | null | null | api_tests/identifiers/views/test_identifier_list.py | felliott/osf.io | b3221387f3995cdc7d7ae2da2e631f258d4afc86 | [
"Apache-2.0"
] | 72 | 2016-06-16T18:59:37.000Z | 2022-03-08T23:40:07.000Z | api_tests/identifiers/views/test_identifier_list.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | null | null | null | import pytest
from future.moves.urllib.parse import urlparse
import responses
from django.utils import timezone
from framework.auth.core import Auth
from api.base.settings.defaults import API_BASE
from osf.models import Identifier
from osf_tests.factories import (
RegistrationFactory,
AuthUserFactory,
Id... | 39.324818 | 116 | 0.686636 |
02e506e15e4d3be220173e04bdf1885da41524d3 | 102 | py | Python | CodingBat/Python/List-1 > max_end3.py | JLJTECH/TutorialTesting | f2dbbd49a86b3b086d0fc156ac3369fb74727f86 | [
"MIT"
] | null | null | null | CodingBat/Python/List-1 > max_end3.py | JLJTECH/TutorialTesting | f2dbbd49a86b3b086d0fc156ac3369fb74727f86 | [
"MIT"
] | null | null | null | CodingBat/Python/List-1 > max_end3.py | JLJTECH/TutorialTesting | f2dbbd49a86b3b086d0fc156ac3369fb74727f86 | [
"MIT"
] | null | null | null | def max_end3(nums):
if nums[0] > nums[-1]:
i = nums[0]
else:
i = nums[-1]
return [i,i,i] | 17 | 24 | 0.509804 |
fead5b9f97689452bd9790e99f9ae02c215bdf74 | 7,296 | py | Python | experiment.py | zackchase/icu_rnn | 766ee8355f74b8a43c4fa78d2c0ebfde24ce4e49 | [
"MIT"
] | 43 | 2015-12-22T07:28:16.000Z | 2021-04-09T11:37:49.000Z | experiment.py | jiangzhongkai/icu_rnn | 766ee8355f74b8a43c4fa78d2c0ebfde24ce4e49 | [
"MIT"
] | 1 | 2016-11-24T02:36:33.000Z | 2017-11-15T22:18:49.000Z | experiment.py | jiangzhongkai/icu_rnn | 766ee8355f74b8a43c4fa78d2c0ebfde24ce4e49 | [
"MIT"
] | 27 | 2016-03-22T14:42:57.000Z | 2020-01-22T04:56:59.000Z | import cPickle
import numpy as np
import os
import re
import sys
from progressbar import ProgressBar
from sklearn.linear_model import LogisticRegression
from sklearn.multiclass import OneVsRestClassifier
from evaluation import compute_micro_evaluations
from lib import floatX
from m2m_rnn import M2M_RNN
def train_lin... | 44.218182 | 162 | 0.590598 |
b105cb386d09d1b3b75ac779ad0d713362cc6eab | 1,223 | py | Python | generateattcks/generateattcks/c2matrix.py | frbor/pyattck | 36339ce67b7e4ddeba1a7832892cf08936f7e99d | [
"MIT"
] | 377 | 2019-07-11T20:26:19.000Z | 2022-03-30T00:35:19.000Z | generateattcks/generateattcks/c2matrix.py | frbor/pyattck | 36339ce67b7e4ddeba1a7832892cf08936f7e99d | [
"MIT"
] | 68 | 2019-07-22T15:24:29.000Z | 2022-02-25T10:14:48.000Z | generateattcks/generateattcks/c2matrix.py | frbor/pyattck | 36339ce67b7e4ddeba1a7832892cf08936f7e99d | [
"MIT"
] | 78 | 2019-06-14T05:41:26.000Z | 2022-03-18T19:13:41.000Z | import csv
import requests
from .attacktemplate import AttackTemplate
from .base import Base
class C2Matrix(Base):
"""
Data Source: https://www.thec2matrix.com/
Authors:
- [Jorge Orchilles](https://twitter.com/jorgeorchilles)
- [Bryson Bort](https://twitter.com/brysonbort)
- [Ada... | 29.829268 | 139 | 0.614064 |
68ce7c7c945a2cc5691805416002dfebee341f4c | 6,758 | py | Python | video_server/views/room.py | jgeneaguilar/video_server | da16bc287a5c32638195e1efe4626ecf4d324d88 | [
"MIT"
] | null | null | null | video_server/views/room.py | jgeneaguilar/video_server | da16bc287a5c32638195e1efe4626ecf4d324d88 | [
"MIT"
] | null | null | null | video_server/views/room.py | jgeneaguilar/video_server | da16bc287a5c32638195e1efe4626ecf4d324d88 | [
"MIT"
] | null | null | null | from pyramid.view import view_config
from pyramid.httpexceptions import HTTPForbidden, HTTPNotFound, HTTPBadRequest
from paginate_sqlalchemy import SqlalchemyOrmPage
from sqlalchemy import desc, asc
from ..models import Room, RoomMembership, User
from ..services import encoding
# Room public views
from ..services.h... | 31.877358 | 107 | 0.660846 |
fa196f1d56443d7d357af0244cf5a7b99a7a07c5 | 14,740 | py | Python | salt/returners/local_cache.py | jwagoner0/salt | ece5b8867300143f7a2b859d55200b1800f28bf2 | [
"Apache-2.0"
] | null | null | null | salt/returners/local_cache.py | jwagoner0/salt | ece5b8867300143f7a2b859d55200b1800f28bf2 | [
"Apache-2.0"
] | null | null | null | salt/returners/local_cache.py | jwagoner0/salt | ece5b8867300143f7a2b859d55200b1800f28bf2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Return data to local job cache
'''
from __future__ import absolute_import
# Import python libs
import errno
import glob
import logging
import os
import shutil
import time
import hashlib
import bisect
# Import salt libs
import salt.payload
import salt.utils
import salt.utils.files
import s... | 30.966387 | 88 | 0.584464 |
b3cb72ebd5e4d0b7ea4d99cd954815fcaf3edadb | 470 | py | Python | Python code/lbp_function.py | AlessandroFornasier/Finger-veins-based-recognition-system-PYTHON | 6c48c505b17c02fce41095e38b946f29161b132a | [
"MIT"
] | 4 | 2019-07-02T03:57:55.000Z | 2022-03-18T09:06:40.000Z | Python code/lbp_function.py | AlessandroFornasier/Finger-veins-based-recognition-system-PYTHON | 6c48c505b17c02fce41095e38b946f29161b132a | [
"MIT"
] | null | null | null | Python code/lbp_function.py | AlessandroFornasier/Finger-veins-based-recognition-system-PYTHON | 6c48c505b17c02fce41095e38b946f29161b132a | [
"MIT"
] | 3 | 2019-09-09T04:02:29.000Z | 2022-01-12T13:13:44.000Z | import numpy as np
def lbp(I):
[r,c] = I.shape[:2]
LBPM = np.zeros((r-2, c-2),np.uint32)
xmask = [[1, 2, 4],
[128, 0, 8],
[64, 32, 16]]
mask = np.array(xmask, np.uint16);
for j in range(2,r-1):
for k in range(2,c-1):
temp = I[j-... | 23.5 | 46 | 0.404255 |
fd11c41862d6836fcb2cd266a59b33fcd3185c6c | 14,618 | py | Python | airflow/providers/microsoft/azure/operators/azure_container_instances.py | donnut/airflow | ce66bc944d246aa3b51cce6e2fc13cd25da08d6e | [
"Apache-2.0"
] | 1 | 2020-09-15T02:32:55.000Z | 2020-09-15T02:32:55.000Z | airflow/providers/microsoft/azure/operators/azure_container_instances.py | donnut/airflow | ce66bc944d246aa3b51cce6e2fc13cd25da08d6e | [
"Apache-2.0"
] | 14 | 2019-12-03T02:54:42.000Z | 2020-02-27T16:08:10.000Z | airflow/providers/microsoft/azure/operators/azure_container_instances.py | donnut/airflow | ce66bc944d246aa3b51cce6e2fc13cd25da08d6e | [
"Apache-2.0"
] | 1 | 2020-11-04T03:12:47.000Z | 2020-11-04T03:12:47.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... | 40.832402 | 110 | 0.611643 |
fbef21a2630c3b33988afaf239efb83d5b72b01d | 67,597 | py | Python | sklearn/metrics/_ranking.py | dPys/scikit-learn | e11c4d21a4579f0d49f414a4b76e386f80f0f074 | [
"BSD-3-Clause"
] | null | null | null | sklearn/metrics/_ranking.py | dPys/scikit-learn | e11c4d21a4579f0d49f414a4b76e386f80f0f074 | [
"BSD-3-Clause"
] | null | null | null | sklearn/metrics/_ranking.py | dPys/scikit-learn | e11c4d21a4579f0d49f414a4b76e386f80f0f074 | [
"BSD-3-Clause"
] | null | null | null | """Metrics to assess performance on classification task given scores.
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better.
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inr... | 37.975843 | 88 | 0.653298 |
8ceea913757ee9544a0fd9392dc3a1de45648202 | 66,614 | py | Python | spambayes/Options.py | mpwillson/spambayes3 | b51d7bb9016066234ce88dad65faabed85f63d78 | [
"PSF-2.0"
] | 1 | 2020-03-21T15:17:22.000Z | 2020-03-21T15:17:22.000Z | spambayes/Options.py | mpwillson/spambayes3 | b51d7bb9016066234ce88dad65faabed85f63d78 | [
"PSF-2.0"
] | 1 | 2022-02-22T22:23:55.000Z | 2022-02-22T22:23:55.000Z | spambayes/Options.py | mpwillson/spambayes3 | b51d7bb9016066234ce88dad65faabed85f63d78 | [
"PSF-2.0"
] | null | null | null | """Options
Abstract:
Options.options is a globally shared options object.
This object is initialised when the module is loaded: the envar
BAYESCUSTOMIZE is checked for a list of names, if nothing is found
then the local directory and the home directory are checked for a
file called bayescustomize.ini or .spambayesrc ... | 47.513552 | 97 | 0.675699 |
6ba32a332e3e24f934d0d4b4fd0199349fc0b763 | 1,579 | py | Python | class/cricket-player-team/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | class/cricket-player-team/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | class/cricket-player-team/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | import random
class Player():
def __init__(self, name):
self.name = name
self.score = 0
def run(self):
self.score += random.randint(0, 6)
def __str__(self):
return "{} (score: {})".format(self.name, self.score)
class Team():
def __init__(self, players):
... | 25.063492 | 67 | 0.587714 |
64716f5c2867bb3790f6d8919dd1dc42604d7a30 | 2,973 | py | Python | src/social_auth/backends/asana.py | jianyuan/sentry | ceb8389c54d29f80b27703bb76c3880d923a3a5a | [
"BSD-3-Clause"
] | null | null | null | src/social_auth/backends/asana.py | jianyuan/sentry | ceb8389c54d29f80b27703bb76c3880d923a3a5a | [
"BSD-3-Clause"
] | 5 | 2020-07-17T11:20:41.000Z | 2021-05-09T12:16:53.000Z | src/social_auth/backends/asana.py | zaasmi/codeerrorhelp | 1ab8d3e314386b9b2d58dad9df45355bf6014ac9 | [
"BSD-3-Clause"
] | 1 | 2021-11-18T12:44:04.000Z | 2021-11-18T12:44:04.000Z | """
Obtain
ASANA_CLIENT_ID & ASANA_CLIENT_SECRET
and put into sentry.conf.py
"""
from __future__ import absolute_import
import requests
from social_auth.backends import BaseOAuth2, OAuthBackend
from social_auth.exceptions import AuthCanceled, AuthUnknownError
ASANA_TOKEN_EXCHANGE_URL = 'https://app.asana.com/-/oauth... | 31.294737 | 72 | 0.615876 |
e1fc232410999af0ad66828f6385f508d6740d63 | 19,963 | py | Python | pymc3_ext/variational/approximations.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/variational/approximations.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/variational/approximations.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import theano
from theano import tensor as tt
import pymc3_ext as pm
from pymc3_ext.distributions.dist_math import rho2sigma
from . import opvi
from pymc3_ext.variational.opvi import Group, Approximation, node_property
from pymc3_ext.util import update_start_vals
from pymc3_ext.theanof import change... | 33.106136 | 106 | 0.585734 |
fe8a7c2431d3014a0acfdd0269081081a7e36c19 | 12,928 | py | Python | homeassistant/components/mold_indicator/sensor.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 4 | 2021-07-11T09:11:00.000Z | 2022-02-27T14:43:50.000Z | homeassistant/components/mold_indicator/sensor.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 277 | 2021-10-04T06:39:33.000Z | 2021-12-28T22:04:17.000Z | homeassistant/components/mold_indicator/sensor.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 3 | 2021-11-14T13:29:33.000Z | 2021-12-27T17:05:22.000Z | """Calculates mold growth indication from temperature and humidity."""
from __future__ import annotations
import logging
import math
import voluptuous as vol
from homeassistant import util
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATTR_UNIT_OF_MEA... | 31.764128 | 86 | 0.595142 |
547467f5ece2bab5feb1a793b69c903eedaa8f37 | 9,098 | py | Python | conceptnet5/vectors/formats.py | DbrRoxane/conceptnet5 | 82e9f6456ceadf35ffa31cee5bf500c638f3f449 | [
"Apache-2.0"
] | 2,195 | 2015-01-02T20:07:43.000Z | 2022-03-31T02:25:39.000Z | conceptnet5/vectors/formats.py | DbrRoxane/conceptnet5 | 82e9f6456ceadf35ffa31cee5bf500c638f3f449 | [
"Apache-2.0"
] | 178 | 2015-01-01T18:57:45.000Z | 2022-03-22T06:34:50.000Z | conceptnet5/vectors/formats.py | DbrRoxane/conceptnet5 | 82e9f6456ceadf35ffa31cee5bf500c638f3f449 | [
"Apache-2.0"
] | 333 | 2015-01-08T09:09:40.000Z | 2022-03-19T21:17:43.000Z | import gzip
import pickle
import struct
import numpy as np
import pandas as pd
from ordered_set import OrderedSet
from .transforms import l1_normalize_columns, l2_normalize_rows, standardize_row_labels
def load_hdf(filename):
"""
Load a semantic vector space from an HDF5 file.
HDF5 is a complex format... | 31.157534 | 87 | 0.640031 |
93455688b2a0e35979a22898fb0cfce42064d42d | 587 | py | Python | setup.py | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | null | null | null | setup.py | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | 8 | 2019-08-12T23:33:12.000Z | 2020-12-09T01:31:17.000Z | setup.py | hasii2011/Chip8Emulator | 96be8c0d01ccae0492ce0f980af905ec5c690f1a | [
"MIT"
] | null | null | null | import pathlib
from setuptools import setup
from setuptools import find_packages
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setup(
name="Chip8 Emulator",
version="1.0.0",
description="An OO oriented Pyt... | 26.681818 | 55 | 0.739353 |
33e7b129777e248ccef9193466bea05ef4cfe967 | 2,234 | py | Python | pydarknet2/classes.py | dapperfu/pydarknet2 | 0457771152d4fbb8cfb512aada62a1c7e50862af | [
"MIT"
] | 2 | 2018-11-13T04:44:29.000Z | 2019-08-06T08:25:34.000Z | pydarknet2/classes.py | dapperfu/pydarknet2 | 0457771152d4fbb8cfb512aada62a1c7e50862af | [
"MIT"
] | null | null | null | pydarknet2/classes.py | dapperfu/pydarknet2 | 0457771152d4fbb8cfb512aada62a1c7e50862af | [
"MIT"
] | null | null | null | """Custom classes.
Custom classes to abstract away darknet bits.
"""
from cached_property import cached_property
class Detections:
"""High level class for all found detected objects.
Attributes
----------
num : int
Numbed of detections.
detections_ptr : ctypes.c_void_p
Pointer to... | 25.976744 | 68 | 0.614145 |
27d04c90ec0030124f1785ef0a569e8e8e432b21 | 8,751 | py | Python | ProjectFiles/bin/Release/2.80/scripts/startup/bl_operators/uvcalc_follow_active.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-07-08T15:51:14.000Z | 2019-07-08T15:51:14.000Z | ProjectFiles/bin/Release/2.80/scripts/startup/bl_operators/uvcalc_follow_active.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | ProjectFiles/bin/Release/2.80/scripts/startup/bl_operators/uvcalc_follow_active.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distri... | 31.142349 | 118 | 0.529539 |
3bf8085479c1dac4c262092b3838e3d28cd14ffa | 2,239 | py | Python | pypy/module/cpyext/__init__.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/cpyext/__init__.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/cpyext/__init__.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | from pypy.interpreter.mixedmodule import MixedModule
from pypy.module.cpyext.state import State
from pypy.module.cpyext import api
class Module(MixedModule):
interpleveldefs = {
'load_module': 'api.load_extension_module',
}
appleveldefs = {
}
atexit_funcs = []
def startup(self, space... | 31.535211 | 77 | 0.800804 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.