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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8c78e8271efecf6913f5a752c8091535f1b77071 | 2,102 | py | Python | python/flexflow/keras/utils/np_utils.py | zmxdream/FlexFlow | 7ea50d71a02e853af7ae573d88c911511b3e82e0 | [
"Apache-2.0"
] | 455 | 2018-12-09T01:57:46.000Z | 2022-03-22T01:56:47.000Z | python/flexflow/keras/utils/np_utils.py | zmxdream/FlexFlow | 7ea50d71a02e853af7ae573d88c911511b3e82e0 | [
"Apache-2.0"
] | 136 | 2019-04-19T08:24:27.000Z | 2022-03-28T01:39:19.000Z | python/flexflow/keras/utils/np_utils.py | zmxdream/FlexFlow | 7ea50d71a02e853af7ae573d88c911511b3e82e0 | [
"Apache-2.0"
] | 102 | 2018-12-22T07:38:05.000Z | 2022-03-30T06:04:39.000Z | """Numpy-related utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
def to_categorical(y, num_classes=None, dtype='float32'):
"""Converts a class vector (integers) to binary class matrix.
E.g. for use with categorical... | 29.605634 | 72 | 0.606089 |
c361a77664950df5626698537951f10868711e6f | 11,653 | py | Python | code/python/IRNMeetings/v1/fds/sdk/IRNMeetings/model/comment_summary_dto.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/IRNMeetings/v1/fds/sdk/IRNMeetings/model/comment_summary_dto.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/IRNMeetings/v1/fds/sdk/IRNMeetings/model/comment_summary_dto.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
IRN API v1
Allows users to extract, create, update and configure IRN data. # noqa: E501
The version of the OpenAPI document: 1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.IRNMeetings.model_utils import ( # noqa: F401
ApiTy... | 43.644195 | 121 | 0.569982 |
0c62986f3d2f27e3b503778004e325d52eb8ccb9 | 8,999 | py | Python | malcolm/core/views.py | aaron-parsons/pymalcolm | 4e7ebd6b09382ab7e013278a81097d17873fa5c4 | [
"Apache-2.0"
] | null | null | null | malcolm/core/views.py | aaron-parsons/pymalcolm | 4e7ebd6b09382ab7e013278a81097d17873fa5c4 | [
"Apache-2.0"
] | null | null | null | malcolm/core/views.py | aaron-parsons/pymalcolm | 4e7ebd6b09382ab7e013278a81097d17873fa5c4 | [
"Apache-2.0"
] | null | null | null | from annotypes import TYPE_CHECKING
from malcolm.compat import OrderedDict
from .context import Context
from .models import BlockModel, MethodModel, AttributeModel
from malcolm.core.models import Model
if TYPE_CHECKING:
from typing import Any
from .controller import Controller
class View(object):
"""Vie... | 34.21673 | 80 | 0.651517 |
47c6ec8d1f937fa53d41a812b2e70d6b2cc986f5 | 10,465 | py | Python | widgets/ButtonFrame.py | Legohead259/PCAN-RS232-Interface | 620a72299aa6866a95d8e329a284e17faeacf73b | [
"Unlicense"
] | null | null | null | widgets/ButtonFrame.py | Legohead259/PCAN-RS232-Interface | 620a72299aa6866a95d8e329a284e17faeacf73b | [
"Unlicense"
] | null | null | null | widgets/ButtonFrame.py | Legohead259/PCAN-RS232-Interface | 620a72299aa6866a95d8e329a284e17faeacf73b | [
"Unlicense"
] | null | null | null | from tkinter import Button, Entry, Frame, Label, OptionMenu, StringVar, Toplevel, messagebox
from tkinter.constants import DISABLED, NORMAL, RADIOBUTTON, RAISED, SUNKEN, TOP
import string
class ButtonFrame(Frame):
def __init__(self, master, *args, **kwargs):
Frame.__init__(self, master, *args, **kwargs)
... | 46.928251 | 135 | 0.620449 |
ef0c3f818b5697e6498f2b5b68a60772da3638a0 | 4,812 | py | Python | sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/_refresh_set_password_operations.py | ljos/azure-sdk-for-python | f64b1e269fc4f05a5a2ca68dda3c8f8b4ed0301e | [
"MIT"
] | 1 | 2021-09-07T18:35:07.000Z | 2021-09-07T18:35:07.000Z | sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/_refresh_set_password_operations.py | ljos/azure-sdk-for-python | f64b1e269fc4f05a5a2ca68dda3c8f8b4ed0301e | [
"MIT"
] | null | null | null | sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/_refresh_set_password_operations.py | ljos/azure-sdk-for-python | f64b1e269fc4f05a5a2ca68dda3c8f8b4ed0301e | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.269231 | 186 | 0.688695 |
0be138b0930fedc13dc372c08a5049ef3c5310bd | 763 | py | Python | Python/linked-list-random-node.py | paperfactory/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2021-09-07T16:36:07.000Z | 2021-09-07T16:36:07.000Z | Python/linked-list-random-node.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | null | null | null | Python/linked-list-random-node.py | se77enn/LeetCode-Solution | d29ef5358cae592b63952c3d293897a176fb75e1 | [
"MIT"
] | 1 | 2021-03-22T18:58:23.000Z | 2021-03-22T18:58:23.000Z | # Time: O(n)
# Space: O(1)
from random import randint
class Solution(object):
def __init__(self, head):
"""
@param head The linked list's head. Note that the head is guanranteed to be not null, so it contains at least one node.
:type head: ListNode
"""
self.__head = head
... | 26.310345 | 127 | 0.581913 |
8c76a00822010437c3ca53976adc5e98e0e8df17 | 4,596 | py | Python | data/projects/flutils/tests/unit/pathutils/test_exists_as.py | se2p/artifact-pynguin-ssbse2020 | 32b5f4d27ef1b81e5c541471e98fa6e50f5ce8a6 | [
"CC-BY-4.0"
] | 3 | 2020-08-20T10:27:13.000Z | 2021-11-02T20:28:16.000Z | data/projects/flutils/tests/unit/pathutils/test_exists_as.py | se2p/artifact-pynguin-ssbse2020 | 32b5f4d27ef1b81e5c541471e98fa6e50f5ce8a6 | [
"CC-BY-4.0"
] | null | null | null | data/projects/flutils/tests/unit/pathutils/test_exists_as.py | se2p/artifact-pynguin-ssbse2020 | 32b5f4d27ef1b81e5c541471e98fa6e50f5ce8a6 | [
"CC-BY-4.0"
] | null | null | null | import unittest
from unittest.mock import patch
from flutils.pathutils import exists_as
from ..mocks.pathlib import PosixPathMock
class TestExistsAsDirectory(unittest.TestCase):
def setUp(self):
self.path = PosixPathMock(
'/home/test_user/directory',
is_dir=True
)
... | 29.088608 | 68 | 0.637511 |
24f65fbfdde7bc77a5ab2db4bd63d87e9f198cc3 | 12,830 | py | Python | bowler/tool.py | Mariatta/Bowler | db54fa7c1a479061427726a886a7f38f6ae284c6 | [
"MIT"
] | 1 | 2021-01-03T00:57:19.000Z | 2021-01-03T00:57:19.000Z | bowler/tool.py | Mariatta/Bowler | db54fa7c1a479061427726a886a7f38f6ae284c6 | [
"MIT"
] | null | null | null | bowler/tool.py | Mariatta/Bowler | db54fa7c1a479061427726a886a7f38f6ae284c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import ast
import difflib
import logging
import multiprocessing
import os
import time
from queue import Empty
from ty... | 35.344353 | 87 | 0.536321 |
af9ff75b208808cb1542f9a251dcc225bc4efdd0 | 565 | py | Python | Tool/count_like.py | e117f7fbca/BiliBili_Backup | 4a77cdd2ae4e654d7bddef93615be799d0b9ae9f | [
"Unlicense"
] | 2 | 2021-09-01T04:42:08.000Z | 2022-01-23T19:40:25.000Z | Tool/count_like.py | e117f7fbca/BiliBili_Backup | 4a77cdd2ae4e654d7bddef93615be799d0b9ae9f | [
"Unlicense"
] | null | null | null | Tool/count_like.py | e117f7fbca/BiliBili_Backup | 4a77cdd2ae4e654d7bddef93615be799d0b9ae9f | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import re
import time
import sys
import os
import json
import glob
import hashlib
import zipfile
count=0
alluser=sorted(os.listdir(dyndir))
dyndir='/mnt/P4501/Raw/BB/Realtime/uid477306079/dynamic/'
dynstat=sorted(os.listdir(dyndir))
for eachdynpath in dynstat:
if os.path.e... | 24.565217 | 92 | 0.692035 |
1f76dd83ff3d8712d9820d45bb14944bfbeb2ce8 | 480 | py | Python | mms.py | AresCyber/Alexander | a76a0f8779db5c84c2b0f8257bf1b1e6deb8e7e8 | [
"MIT"
] | null | null | null | mms.py | AresCyber/Alexander | a76a0f8779db5c84c2b0f8257bf1b1e6deb8e7e8 | [
"MIT"
] | null | null | null | mms.py | AresCyber/Alexander | a76a0f8779db5c84c2b0f8257bf1b1e6deb8e7e8 | [
"MIT"
] | null | null | null | from twilio.rest import Client
def sendalert(msgbdy):
account_sid = 'AC3390bfac3ff99b978d12be2881f7b0c0'
auth_token = 'fefad7079ba0f7faeb4b0faf9502748b'
client = Client(account_sid, auth_token)
message = client.messages.create(
from_='+14344046180',
... | 34.285714 | 57 | 0.510417 |
331652b5c7eb9a7229bbad641b9665f0749231a2 | 30 | py | Python | py/.history/main_20210613192014.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | py/.history/main_20210613192014.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | py/.history/main_20210613192014.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | class IceCream:
pass
print | 10 | 15 | 0.733333 |
97c40fb66ddbc92a134dd424eed235b84dbe0e6f | 1,427 | py | Python | fit/predict_onestep.py | rachelcusack/pyBKT | af10442bcffcdd2dcbdd9ee7e437b81a002a55f8 | [
"MIT"
] | null | null | null | fit/predict_onestep.py | rachelcusack/pyBKT | af10442bcffcdd2dcbdd9ee7e437b81a002a55f8 | [
"MIT"
] | null | null | null | fit/predict_onestep.py | rachelcusack/pyBKT | af10442bcffcdd2dcbdd9ee7e437b81a002a55f8 | [
"MIT"
] | null | null | null | import numpy as np
from pyBKT.fit import E_step
from pyBKT.fit import predict_onestep_states
# correct_emission_predictions is a num_subparts x T array, where element
# (i,t) is predicted probability that answer to subpart i at time t+1 is correct
def run(model, data):
num_subparts = data["data"].shape[0] # mmm... | 46.032258 | 140 | 0.740014 |
d1996f71fea2633e0f61ebbf94441dfb1af0005a | 20,981 | py | Python | tests/test_annotations.py | datalogics/circulation | a4767404a63dd034d101e6ee76f824626e5d5269 | [
"Apache-2.0"
] | null | null | null | tests/test_annotations.py | datalogics/circulation | a4767404a63dd034d101e6ee76f824626e5d5269 | [
"Apache-2.0"
] | 6 | 2016-10-25T14:55:39.000Z | 2017-10-09T15:37:03.000Z | tests/test_annotations.py | datalogics/circulation | a4767404a63dd034d101e6ee76f824626e5d5269 | [
"Apache-2.0"
] | 2 | 2016-09-29T16:28:14.000Z | 2021-08-04T12:28:21.000Z | from nose.tools import (
eq_,
set_trace,
)
import json
import datetime
from pyld import jsonld
from . import DatabaseTest
from test_controller import ControllerTest
from core.model import (
Annotation,
create,
)
from api.annotations import (
AnnotationWriter,
AnnotationParser,
)
from api.prob... | 38.07804 | 121 | 0.596349 |
e74310a082a4758092dc93495a13cd02e0ab905c | 278 | py | Python | webproj/src/BetterResume/models/__init__.py | albert118/ProjectPM | 7b416d16df9ac61def392ee2c29ac95429cd6282 | [
"MIT"
] | null | null | null | webproj/src/BetterResume/models/__init__.py | albert118/ProjectPM | 7b416d16df9ac61def392ee2c29ac95429cd6282 | [
"MIT"
] | 7 | 2019-02-02T13:39:02.000Z | 2019-02-04T01:22:27.000Z | webproj/src/BetterResume/models/__init__.py | albert118/ProjectPM | 7b416d16df9ac61def392ee2c29ac95429cd6282 | [
"MIT"
] | null | null | null | """ The models used by the BetterResume application.
Profile is the model utilised by Applicant to define resume/portfolio data,
it implements; WorkHist, Education,
Skills (TODO) & Languages.
Author: Albert Ferguson """
from .profilemodel import Profile
| 30.888889 | 80 | 0.723022 |
6d25f54d000480c2d010231b3784e10c0ca0701c | 9,152 | py | Python | dopamine/agents/fourier/fourier_agent.py | Wujunlianges/dopamine | b397ce3018477d742409cbace6408042e324f75b | [
"Apache-2.0"
] | null | null | null | dopamine/agents/fourier/fourier_agent.py | Wujunlianges/dopamine | b397ce3018477d742409cbace6408042e324f75b | [
"Apache-2.0"
] | null | null | null | dopamine/agents/fourier/fourier_agent.py | Wujunlianges/dopamine | b397ce3018477d742409cbace6408042e324f75b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Dopamine 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... | 43.374408 | 86 | 0.625437 |
7b6b6d2e9a8beb89777d2d237428ee67788e3d5d | 906,589 | py | Python | standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py | jfsii/hive | e85731c42b6485412deefccf85f17e3ae9e0f403 | [
"Apache-2.0"
] | 3 | 2021-01-19T20:21:16.000Z | 2021-01-19T21:36:38.000Z | standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py | jfsii/hive | e85731c42b6485412deefccf85f17e3ae9e0f403 | [
"Apache-2.0"
] | null | null | null | standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ttypes.py | jfsii/hive | e85731c42b6485412deefccf85f17e3ae9e0f403 | [
"Apache-2.0"
] | 1 | 2021-08-12T08:48:46.000Z | 2021-08-12T08:48:46.000Z | #
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import fb303.ttypes
from thrift.transport import TTransport
from thrift.protocol import TBinaryP... | 32.691079 | 515 | 0.647915 |
e3d4a28a3cc1cf8e4f21f08ba99abd83b16ece8c | 2,700 | py | Python | scott_bot/cogs/spam_cog.py | TestyYay/scottbot | bdd4225611835c28a189455eca315af0f1082b52 | [
"MIT"
] | 1 | 2021-05-08T12:18:09.000Z | 2021-05-08T12:18:09.000Z | scott_bot/cogs/spam_cog.py | TestyYay/scottbot | bdd4225611835c28a189455eca315af0f1082b52 | [
"MIT"
] | null | null | null | scott_bot/cogs/spam_cog.py | TestyYay/scottbot | bdd4225611835c28a189455eca315af0f1082b52 | [
"MIT"
] | null | null | null | from collections import defaultdict
import discord
from discord.ext import commands, tasks
from ..bot import ScottBot
class SpamCog(commands.Cog, name="Spam"):
def __init__(self, bot: ScottBot):
self.bot = bot
self.loops = defaultdict(lambda: defaultdict(dict))
def send_message(self, channe... | 42.857143 | 190 | 0.625185 |
70f505b97864c787f770b9dda149c16e2aa6df9d | 663 | py | Python | backupper/run.py | gas1121/Backupper | ee48395d6d1a35ed8ab566c81c49b70cff3f36c1 | [
"MIT"
] | null | null | null | backupper/run.py | gas1121/Backupper | ee48395d6d1a35ed8ab566c81c49b70cff3f36c1 | [
"MIT"
] | null | null | null | backupper/run.py | gas1121/Backupper | ee48395d6d1a35ed8ab566c81c49b70cff3f36c1 | [
"MIT"
] | null | null | null | import subprocess
import os
import arrow
from bypy import ByPy
def main():
prefix = os.getenv('ARCHIVE_NAME_PREFIX', 'archive')
archive_name = prefix + '-' + arrow.now().format('YYYYMMDD') + '.7z'
snyc_folder = '/sync/'
backup_folder = '/backup/'
run_arguments = ['7z', 'a', snyc_folde... | 26.52 | 75 | 0.642534 |
be9ec85d95b17bd7c8d024d75d071ace8063848e | 2,250 | py | Python | azure-mgmt-web/azure/mgmt/web/models/source_control_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-web/azure/mgmt/web/models/source_control_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-web/azure/mgmt/web/models/source_control_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.290323 | 148 | 0.596444 |
6fc61fde3ce72a82871a4d890ca5d79934fd5934 | 1,614 | py | Python | cohesity_management_sdk/models/gcp_type_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | 1 | 2019-11-07T23:19:32.000Z | 2019-11-07T23:19:32.000Z | cohesity_management_sdk/models/gcp_type_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/gcp_type_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class GcpTypeEnum(object):
"""Implementation of the 'GcpType' enum.
Specifies the entity type such as 'kIAMUser' if the environment is kGCP.
Specifies the type of a GCP source entity.
'kIAMUser' indicates a unique user within a GCP account.
'... | 31.647059 | 77 | 0.708798 |
9e542e04c0c2af5670157af55db904b0904065cf | 4,670 | py | Python | scripts/mask2geo.py | nemaderinku/deepgis | 807567af739adfb7f2c7bc7e523f6b987cb6a0a9 | [
"Apache-2.0"
] | 4 | 2019-08-12T20:57:52.000Z | 2022-01-06T19:31:27.000Z | scripts/mask2geo.py | nemaderinku/deepgis | 807567af739adfb7f2c7bc7e523f6b987cb6a0a9 | [
"Apache-2.0"
] | 32 | 2019-10-11T09:30:18.000Z | 2021-02-02T17:32:12.000Z | scripts/mask2geo.py | nemaderinku/deepgis | 807567af739adfb7f2c7bc7e523f6b987cb6a0a9 | [
"Apache-2.0"
] | 2 | 2019-08-14T06:25:55.000Z | 2020-02-17T05:20:31.000Z | import pickle
from matplotlib import pyplot as plot
import osr
import gdal
from descartes import PolygonPatch
import pylab as pl
from shapely.ops import cascaded_union, polygonize
from scipy.spatial import Delaunay
import numpy as np
import math
import shapely.geometry as geometry
from geojson import Polygon, Point, Mu... | 37.36 | 237 | 0.680942 |
3f7af54779e3fd9e2895ee8acd55234d42f256a7 | 3,876 | py | Python | task_adaptation/data/diabetic_retinopathy_test.py | mcx/task_adaptation | d7630d3c43ba052b5a35546b312d9454a9f2c96b | [
"Apache-2.0"
] | 211 | 2019-09-19T16:50:43.000Z | 2022-03-28T13:08:56.000Z | task_adaptation/data/diabetic_retinopathy_test.py | mcx/task_adaptation | d7630d3c43ba052b5a35546b312d9454a9f2c96b | [
"Apache-2.0"
] | 19 | 2019-10-29T23:59:29.000Z | 2022-03-28T09:37:19.000Z | task_adaptation/data/diabetic_retinopathy_test.py | mcx/task_adaptation | d7630d3c43ba052b5a35546b312d9454a9f2c96b | [
"Apache-2.0"
] | 22 | 2019-10-21T12:59:40.000Z | 2022-01-16T12:10:29.000Z | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 36.914286 | 76 | 0.649381 |
263e689a8b2235091b997ebea4690140fd2d956d | 33,365 | py | Python | client.py | PuffinDev/PyChat | 47fef1fe33a4e0f9f622aa7f74fe5fd4fcaa45ab | [
"MIT"
] | 6 | 2020-11-12T17:49:03.000Z | 2021-04-29T16:45:34.000Z | client.py | harleytml/enhancedPyChat | 47fef1fe33a4e0f9f622aa7f74fe5fd4fcaa45ab | [
"MIT"
] | null | null | null | client.py | harleytml/enhancedPyChat | 47fef1fe33a4e0f9f622aa7f74fe5fd4fcaa45ab | [
"MIT"
] | 2 | 2021-02-14T13:27:50.000Z | 2021-03-16T06:35:46.000Z | import socket
import pickle
import tkinter
from tkinter import simpledialog
import tkinter.font as tkFont
import threading
from playsound import playsound
import time
import json
import random
import textwrap
import webbrowser #For /discord command
import hashlib
import difflib
HEADER = 64
FORMAT = 'utf-8'
DISCONNECT_... | 36.07027 | 163 | 0.543743 |
45355496c35173e8546348e1603ba28216c2467c | 152 | py | Python | hdstats/utils.py | daleroberts/hdstats | bd5fe85a0a299797f2f6bd6a476ef07e9ddeeb16 | [
"BSD-3-Clause"
] | 16 | 2021-03-01T05:49:48.000Z | 2022-03-10T08:07:48.000Z | hdstats/utils.py | daleroberts/hdstats | bd5fe85a0a299797f2f6bd6a476ef07e9ddeeb16 | [
"BSD-3-Clause"
] | 3 | 2021-03-09T05:28:36.000Z | 2021-06-01T01:14:35.000Z | hdstats/utils.py | daleroberts/hdstats | bd5fe85a0a299797f2f6bd6a476ef07e9ddeeb16 | [
"BSD-3-Clause"
] | 2 | 2021-03-04T04:01:53.000Z | 2021-03-28T09:04:53.000Z | # Author: Dale Roberts <dale.o.roberts@gmail.com>
#
# License: BSD 3 clause
import os
def get_max_threads():
n = os.cpu_count() or 1
return n
| 15.2 | 49 | 0.671053 |
2d61eae794b232233be6e71313dd7107748725fd | 10,409 | py | Python | build/lib.linux-x86_64-2.7/game/start_screen.py | agarwalrounak/brkout | 365a540c9d4cea29b6c0532b3908f6ebd24ce03a | [
"MIT"
] | 14 | 2018-01-17T20:50:44.000Z | 2019-01-09T11:20:56.000Z | build/lib.linux-x86_64-2.7/game/start_screen.py | agarwalrounak/brkout | 365a540c9d4cea29b6c0532b3908f6ebd24ce03a | [
"MIT"
] | 44 | 2017-12-16T17:45:30.000Z | 2019-05-05T10:13:58.000Z | build/lib.linux-x86_64-2.7/game/start_screen.py | agarwalrounak/brkout | 365a540c9d4cea29b6c0532b3908f6ebd24ce03a | [
"MIT"
] | 28 | 2017-12-18T08:43:34.000Z | 2021-02-18T10:19:55.000Z | from global_funcs import *
from constants import *
from global_objects import Ball
from highscore import *
import constants
# initiating the ball
menu_ball = Ball(scr_width/2, scr_height-wall_brick_height-ball_radius)
first = 1
# main function to display and handle menu screen
def menu_screen(screen, clock):
# d... | 46.67713 | 111 | 0.527044 |
d568e96f90eae0b18a8418ff654d3a3e53b1bfa9 | 733 | py | Python | advent_of_code_2017/day 11/solution.py | jvanelteren/advent_of_code | 3c547645250adb2d95ebac43d5d2111cdf9b09e9 | [
"MIT"
] | 1 | 2021-12-23T11:24:11.000Z | 2021-12-23T11:24:11.000Z | advent_of_code_2017/day 11/solution.py | jvanelteren/advent_of_code | 3c547645250adb2d95ebac43d5d2111cdf9b09e9 | [
"MIT"
] | null | null | null | advent_of_code_2017/day 11/solution.py | jvanelteren/advent_of_code | 3c547645250adb2d95ebac43d5d2111cdf9b09e9 | [
"MIT"
] | null | null | null | #%%
# read full assignment
# think algo before implementing
# dont use a dict when you need a list
# assignment is still = and not ==
# dont use itertools when you can use np.roll
# check mathemathical functions if the parentheses are ok
# %%
import os
try:
os.chdir(os.path.join(os.getcwd(), 'day 11'))
print(os.getcw... | 20.942857 | 57 | 0.581173 |
c9c49fd1eb524ccaf59cd111e3baf852a1101f6c | 1,156 | py | Python | Chapter 12/link-verify.py | ostin-r/automate-boring-stuff-solutions | 78f0a2981e6520ff2907285e666168a0f35eba02 | [
"FTL"
] | 4 | 2021-06-14T10:37:58.000Z | 2021-12-30T17:49:17.000Z | Chapter 12/link-verify.py | ostin-r/automate-boring-stuff-solutions | 78f0a2981e6520ff2907285e666168a0f35eba02 | [
"FTL"
] | null | null | null | Chapter 12/link-verify.py | ostin-r/automate-boring-stuff-solutions | 78f0a2981e6520ff2907285e666168a0f35eba02 | [
"FTL"
] | 1 | 2021-07-29T15:26:54.000Z | 2021-07-29T15:26:54.000Z | '''
Austin Richards 3/14/21
'''
import requests, bs4
import logging as log
log.basicConfig(level=log.DEBUG, format='%(asctime)s: %(message)s')
#log.disable(log.CRITICAL)
def verify_links(url):
'''
checks that all links on a page are valid by downloading
them with the requests module. Returns True if all... | 25.688889 | 67 | 0.581315 |
6fd30243ab7de4ba2d00ce60f8d5e3dd4fb3439b | 2,129 | py | Python | CowsAndBulls.py | Katz05/VSA-2018 | 0bf9ff4b8a6ed17cedba4700c5dce8f1c5ee3d28 | [
"MIT"
] | null | null | null | CowsAndBulls.py | Katz05/VSA-2018 | 0bf9ff4b8a6ed17cedba4700c5dce8f1c5ee3d28 | [
"MIT"
] | null | null | null | CowsAndBulls.py | Katz05/VSA-2018 | 0bf9ff4b8a6ed17cedba4700c5dce8f1c5ee3d28 | [
"MIT"
] | null | null | null | # Create a program that will play the 'cows and bulls' game with the user. The game works
# like this:
#
# Randomly generate a 4-digit number. Ask the user to guess a 4-digit number. For every
# digit that the user guessed correctly in the correct place, they have a 'cow'. For
# every digit the user guessed correctly i... | 34.33871 | 90 | 0.602161 |
523cab9c7beeed4901e4a8dbdd4380f46604785a | 2,669 | py | Python | BinaryAuthorization/owlbot.py | nick-lai/google-cloud-php | 52130ee60f03c61ef0ada04c31b1268af87bacb6 | [
"Apache-2.0"
] | 524 | 2018-09-26T02:29:52.000Z | 2022-03-30T12:57:26.000Z | BinaryAuthorization/owlbot.py | nick-lai/google-cloud-php | 52130ee60f03c61ef0ada04c31b1268af87bacb6 | [
"Apache-2.0"
] | 2,028 | 2018-09-20T22:35:42.000Z | 2022-03-31T18:13:07.000Z | BinaryAuthorization/owlbot.py | nick-lai/google-cloud-php | 52130ee60f03c61ef0ada04c31b1268af87bacb6 | [
"Apache-2.0"
] | 262 | 2018-10-02T15:43:46.000Z | 2022-03-29T19:37:04.000Z | # Copyright 2021 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 agreed to in writing, s... | 29.01087 | 94 | 0.67441 |
0e06b7d4f30dd59b3b03ad49c81b58bcffdeab75 | 1,627 | py | Python | github_user_management/check_github_users_in_ldap.py | rashamalek/github-user-management | 9d242351ba2491c6ec8fe15cd6abbaa0e231ab8a | [
"Apache-2.0"
] | 3 | 2016-10-06T09:44:13.000Z | 2017-07-17T04:16:38.000Z | github_user_management/check_github_users_in_ldap.py | rashamalek/github-user-management | 9d242351ba2491c6ec8fe15cd6abbaa0e231ab8a | [
"Apache-2.0"
] | 1 | 2019-01-25T09:08:36.000Z | 2019-01-25T09:08:36.000Z | github_user_management/check_github_users_in_ldap.py | rashamalek/github-user-management | 9d242351ba2491c6ec8fe15cd6abbaa0e231ab8a | [
"Apache-2.0"
] | 3 | 2016-10-05T13:05:03.000Z | 2019-01-25T08:50:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 Noa Resare
import collections
from clients import ldap_client
from clients import github_client
def print_dict_keys_per_value(d, exclude, check_existence_for_these):
by_value = collections.defaultdict(list)
for k in d:
by_value[d[k]].append(k)
pri... | 32.54 | 79 | 0.622004 |
8dec125b09336d3881a6bf5a9d9b5d9294154a97 | 20,314 | gyp | Python | modules/modules.gyp | LineageOS/android_external_chromium_org_third_party_webrtc | 2dc33605704d570ebd2ab5f0428ea94672ce6a7e | [
"DOC",
"BSD-3-Clause"
] | 1 | 2019-02-22T05:37:57.000Z | 2019-02-22T05:37:57.000Z | modules/modules.gyp | LineageOS/android_external_chromium_org_third_party_webrtc | 2dc33605704d570ebd2ab5f0428ea94672ce6a7e | [
"DOC",
"BSD-3-Clause"
] | null | null | null | modules/modules.gyp | LineageOS/android_external_chromium_org_third_party_webrtc | 2dc33605704d570ebd2ab5f0428ea94672ce6a7e | [
"DOC",
"BSD-3-Clause"
] | 2 | 2016-04-27T21:12:18.000Z | 2016-12-25T05:26:28.000Z | # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 47.685446 | 92 | 0.620705 |
d89b94ffc73698786b53fa49a0f755e5deb43c58 | 9,652 | py | Python | files/scripts/acg_migration_tracker.py | webosce/pmtrace | 2e0e112fb9a6105e54d367f03186d72184878e21 | [
"Apache-2.0"
] | null | null | null | files/scripts/acg_migration_tracker.py | webosce/pmtrace | 2e0e112fb9a6105e54d367f03186d72184878e21 | [
"Apache-2.0"
] | null | null | null | files/scripts/acg_migration_tracker.py | webosce/pmtrace | 2e0e112fb9a6105e54d367f03186d72184878e21 | [
"Apache-2.0"
] | 1 | 2018-08-24T11:11:29.000Z | 2018-08-24T11:11:29.000Z | #!/usr/bin/python
# Copyright (c) 2018 LG Electronics, Inc.
#
# 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... | 43.477477 | 127 | 0.563303 |
de7f63dc18820ecefab53065502c0aa010633672 | 1,255 | py | Python | setup.py | doaa-altarawy/RTP_python_template | 0fe955ad4a9cb8c53833b12a88fc1fc4fb5dc0fe | [
"BSD-3-Clause"
] | null | null | null | setup.py | doaa-altarawy/RTP_python_template | 0fe955ad4a9cb8c53833b12a88fc1fc4fb5dc0fe | [
"BSD-3-Clause"
] | 2 | 2018-06-29T18:14:12.000Z | 2018-06-29T18:35:08.000Z | setup.py | doaa-altarawy/RTP_python_template | 0fe955ad4a9cb8c53833b12a88fc1fc4fb5dc0fe | [
"BSD-3-Clause"
] | 1 | 2018-06-29T18:03:25.000Z | 2018-06-29T18:03:25.000Z | import setuptools
if __name__ == "__main__":
setuptools.setup(
name='RTP_python_template',
version="0.3.0",
description='A starting template for Python programs',
author='Doaa Altarawy',
author_email='daltarawy@vt.edu',
url="https://github.com/doaa-altarawy/RTP_pytho... | 27.888889 | 67 | 0.465339 |
5b23ef3869f8de198c246900e4e0d4423d4af8c8 | 39,061 | py | Python | nova/virt/xenapi/driver.py | gyliu513/nova | 14e974a5f77c72a9bb44c6801746abb2eda8e91d | [
"Apache-2.0"
] | 1 | 2016-07-18T22:05:01.000Z | 2016-07-18T22:05:01.000Z | nova/virt/xenapi/driver.py | gyliu513/nova | 14e974a5f77c72a9bb44c6801746abb2eda8e91d | [
"Apache-2.0"
] | 1 | 2021-03-31T19:29:01.000Z | 2021-03-31T19:29:01.000Z | nova/virt/xenapi/driver.py | gyliu513/nova | 14e974a5f77c72a9bb44c6801746abb2eda8e91d | [
"Apache-2.0"
] | 1 | 2020-07-22T22:14:40.000Z | 2020-07-22T22:14:40.000Z | # Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 OpenStack Foundation
#
# 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... | 44.086907 | 79 | 0.624229 |
c3c90be2e419d82ad5fba571cc91be8159bed765 | 6,514 | py | Python | owcsimpy/geoobjects/models/roomcube_py.py | ardimasp/owcsimpy | 155b0f26dd5e247cef9a84265256b0d70ba0b139 | [
"MIT"
] | null | null | null | owcsimpy/geoobjects/models/roomcube_py.py | ardimasp/owcsimpy | 155b0f26dd5e247cef9a84265256b0d70ba0b139 | [
"MIT"
] | null | null | null | owcsimpy/geoobjects/models/roomcube_py.py | ardimasp/owcsimpy | 155b0f26dd5e247cef9a84265256b0d70ba0b139 | [
"MIT"
] | null | null | null | import math
import itertools
import numpy as np
from owcsimpy.geoobjects.bases.vector_py import Vector_py as Vector
from owcsimpy.geoobjects.bases.cube_py import Cube_py as Cube
class RoomCube_py(Cube):
""" A room model using a cube.
The room is defined on the postive axis.
RoomCube_py is inherited from... | 39.719512 | 105 | 0.331286 |
a0b32a311ea08332cf8c63f0e5841ec89914029b | 8,624 | py | Python | src/classes/dataset/Dataset.py | dayinzi/sketch-code | 48544b9e0df90e34d9347242a464b1cbe733c8ca | [
"MIT",
"Unlicense"
] | 4,801 | 2018-03-10T04:36:40.000Z | 2022-03-31T20:16:36.000Z | src/classes/dataset/Dataset.py | lotapp/sketch-code | 48544b9e0df90e34d9347242a464b1cbe733c8ca | [
"MIT",
"Unlicense"
] | 34 | 2018-03-21T03:16:24.000Z | 2022-03-18T06:46:24.000Z | src/classes/dataset/Dataset.py | lotapp/sketch-code | 48544b9e0df90e34d9347242a464b1cbe733c8ca | [
"MIT",
"Unlicense"
] | 687 | 2018-02-21T14:04:03.000Z | 2022-02-10T09:59:18.000Z | from __future__ import absolute_import
import os
import shutil
import pdb
import hashlib
import numpy as np
from keras.preprocessing.text import Tokenizer, one_hot
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from .ImagePreprocessor import *
VOCAB_FILE =... | 42.068293 | 136 | 0.614564 |
a2a2773a49562cf20d74180afa0199bd2ac1fd58 | 8,775 | py | Python | tea_admin/tea_admin/doctype/make_payment/make_payment.py | nivedita05/Tea-Admin | 4267cfa9d0c97e586bd9b5401e310bcd8ec93268 | [
"MIT"
] | null | null | null | tea_admin/tea_admin/doctype/make_payment/make_payment.py | nivedita05/Tea-Admin | 4267cfa9d0c97e586bd9b5401e310bcd8ec93268 | [
"MIT"
] | null | null | null | tea_admin/tea_admin/doctype/make_payment/make_payment.py | nivedita05/Tea-Admin | 4267cfa9d0c97e586bd9b5401e310bcd8ec93268 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cstr, flt
from frappe.model.document import Document
from datetime import datetime,timedelta
from frappe imp... | 45 | 280 | 0.712934 |
0f4473171ea8137271f6f7e3a781bc226b1e6fcf | 4,338 | py | Python | specviz/plugins/loader_wizard/parse_initial_file.py | ibusko/specviz | b8bcd495e5b43dc2b90f7bf2d5bad2d27c6990aa | [
"BSD-3-Clause"
] | null | null | null | specviz/plugins/loader_wizard/parse_initial_file.py | ibusko/specviz | b8bcd495e5b43dc2b90f7bf2d5bad2d27c6990aa | [
"BSD-3-Clause"
] | null | null | null | specviz/plugins/loader_wizard/parse_initial_file.py | ibusko/specviz | b8bcd495e5b43dc2b90f7bf2d5bad2d27c6990aa | [
"BSD-3-Clause"
] | null | null | null | from numbers import Number
import numpy as np
from astropy import units as u
from astropy.wcs import WCS
from astropy.table import Table
from qtpy.QtWidgets import QMessageBox
UNIT_FIXES = {
'COUNTS SEC-1 METER-1': u.count / u.s / u.m,
'MICRONS': u.micron,
'HZ': u.Hz,
'Angstroms': u.Angstrom,
'er... | 27.455696 | 93 | 0.529507 |
762657940480b70c8cd94a9e95c56696aaa004b1 | 10,424 | py | Python | implementations/metagan/.ipynb_checkpoints/cyclegan-checkpoint.py | duongnhatthang/PyTorch-GAN | 9fa124518d0cbeb3dede2d04d53a8c49c486902f | [
"MIT"
] | null | null | null | implementations/metagan/.ipynb_checkpoints/cyclegan-checkpoint.py | duongnhatthang/PyTorch-GAN | 9fa124518d0cbeb3dede2d04d53a8c49c486902f | [
"MIT"
] | null | null | null | implementations/metagan/.ipynb_checkpoints/cyclegan-checkpoint.py | duongnhatthang/PyTorch-GAN | 9fa124518d0cbeb3dede2d04d53a8c49c486902f | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import math
import itertools
import datetime
import time
import torchvision.transforms as transforms
from torchvision.utils import save_image, make_grid
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from model... | 36.320557 | 116 | 0.666635 |
d486cb22a021f7971eda1cc12d4c29b755ce81e0 | 5,686 | py | Python | dojo/tools/burp_api/parser.py | steven-hadfield/django-DefectDojo | 38609f7316cf6bf6cb30736f644fe2c66cc71061 | [
"BSD-3-Clause"
] | 1 | 2021-09-16T18:30:16.000Z | 2021-09-16T18:30:16.000Z | dojo/tools/burp_api/parser.py | steven-hadfield/django-DefectDojo | 38609f7316cf6bf6cb30736f644fe2c66cc71061 | [
"BSD-3-Clause"
] | 89 | 2021-05-10T04:35:07.000Z | 2022-03-31T05:08:07.000Z | dojo/tools/burp_api/parser.py | steven-hadfield/django-DefectDojo | 38609f7316cf6bf6cb30736f644fe2c66cc71061 | [
"BSD-3-Clause"
] | 2 | 2021-09-16T18:30:17.000Z | 2021-09-17T00:46:38.000Z | import json
import logging
import base64
from urllib.parse import urlparse
from dojo.models import Endpoint, Finding
logger = logging.getLogger(__name__)
DESCRIPTION_TEMPLATE = """**{title}**
**Serial Number**: {serial_number}
**Type Index**: {type_index}
**Confidence**: {confidence}
**Description**: {description_t... | 37.163399 | 106 | 0.493317 |
d91a287402378591526cccd978cff02e465d8831 | 1,730 | py | Python | prepic/base.py | berceanu/prepic | 62466832a4a8c8da20848d981ef75854b228dbad | [
"BSD-3-Clause"
] | 7 | 2019-06-18T18:02:12.000Z | 2021-07-17T11:50:39.000Z | prepic/base.py | berceanu/prepic | 62466832a4a8c8da20848d981ef75854b228dbad | [
"BSD-3-Clause"
] | 240 | 2019-06-18T14:03:09.000Z | 2021-03-03T14:18:28.000Z | prepic/base.py | berceanu/prepic | 62466832a4a8c8da20848d981ef75854b228dbad | [
"BSD-3-Clause"
] | 4 | 2019-07-31T19:02:38.000Z | 2020-11-12T08:58:25.000Z | """
Abstract base classes and interface for prepic.
"""
import warnings
from unyt import allclose_units
from prepic.util import todict, flatten_dict
class BaseClass:
"""Implements equality testing between class instances which inherit it.
Does a floating point comparison (including unit checking) between ... | 30.350877 | 87 | 0.617341 |
615efcc206ac9ebaabbe19d66ac48009c0730a10 | 16,846 | py | Python | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/urllib3/poolmanager.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/urllib3/poolmanager.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.6/site-packages/pip/_vendor/urllib3/poolmanager.py | 1tracy/3.3.1.1-flask-blog | 05ba85340cf90109038492b81c670cba8829a375 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import collections
import functools
import logging
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValueError, MaxRetryError, ProxyScheme... | 35.995726 | 92 | 0.642526 |
0862e6c44723f97d9257e78cb0daac7071256957 | 450 | py | Python | ImageProcessing/midterm3.py | annisanurdiana/python_programming | 33ad8285b14de3527ed9524793153352c2f3e6cf | [
"MIT"
] | null | null | null | ImageProcessing/midterm3.py | annisanurdiana/python_programming | 33ad8285b14de3527ed9524793153352c2f3e6cf | [
"MIT"
] | null | null | null | ImageProcessing/midterm3.py | annisanurdiana/python_programming | 33ad8285b14de3527ed9524793153352c2f3e6cf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 29 15:26:36 2021
@author: Annisa Nurdiana
"""
import cv2 as cv
import numpy as np
image = cv.imread('Lena.bmp')
image = cv.cvtColor(image, cv.COLOR_BGR2HSV)
increase = 100
v = image[:, :, 2]
v = np.where(v <= 255 - increase, v + increase, 255)
image[:, ... | 19.565217 | 53 | 0.631111 |
b1fb2c99ffc1ef4e5d1348bf34c6b9e0ffc9580a | 21,892 | py | Python | examples/token-classification/run_ner_no_trainer.py | Sangameshkodge/transformers | e72cc4f34a22c91ad66403f49c227051f42b7138 | [
"Apache-2.0"
] | null | null | null | examples/token-classification/run_ner_no_trainer.py | Sangameshkodge/transformers | e72cc4f34a22c91ad66403f49c227051f42b7138 | [
"Apache-2.0"
] | null | null | null | examples/token-classification/run_ner_no_trainer.py | Sangameshkodge/transformers | e72cc4f34a22c91ad66403f49c227051f42b7138 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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/LI... | 40.843284 | 147 | 0.661886 |
ac0ce45ad7946819cfa967a8375de37eeff9028f | 88,064 | py | Python | release/e2e.py | takeshi-yoshimura/ray | cc577c10edbfc8b4248e2776947e1e0d5dbf4585 | [
"Apache-2.0"
] | null | null | null | release/e2e.py | takeshi-yoshimura/ray | cc577c10edbfc8b4248e2776947e1e0d5dbf4585 | [
"Apache-2.0"
] | 21 | 2022-01-30T15:49:41.000Z | 2022-03-19T07:14:33.000Z | release/e2e.py | takeshi-yoshimura/ray | cc577c10edbfc8b4248e2776947e1e0d5dbf4585 | [
"Apache-2.0"
] | null | null | null | """
This is an end to end release test automation script used to kick off periodic
release tests, running on Anyscale.
The tool leverages app configs and compute templates.
Calling this script will run a single release test.
Example:
python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-... | 34.794153 | 143 | 0.592603 |
04886df689278fe998b49be7092b8324c42d806f | 2,434 | py | Python | L1TriggerConfig/GMTConfigProducers/python/L1MuGMTParameters_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1TriggerConfig/GMTConfigProducers/python/L1MuGMTParameters_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1TriggerConfig/GMTConfigProducers/python/L1MuGMTParameters_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
L1MuGMTParameters = cms.ESProducer("L1MuGMTParametersProducer",
EtaWeight_barrel = cms.double(0.028),
PhiWeight_barrel = cms.double(1.0),
EtaPhiThreshold_barrel = cms.double(0.062),
EtaWeight_endcap = cms.double(0.13),
PhiWeight_endcap = cms.double(1.0),
... | 38.03125 | 63 | 0.70871 |
ef02d7f1cd1b602cba2a5989f270e6b9267a9106 | 606 | py | Python | process_calabi_yau.py | guillefix/nn-pacbayes | a10bb6fd26bea2163f41a4ef9171bf914db5bc76 | [
"MIT"
] | 1 | 2020-12-08T01:58:03.000Z | 2020-12-08T01:58:03.000Z | process_calabi_yau.py | guillefix/nn-pacbayes | a10bb6fd26bea2163f41a4ef9171bf914db5bc76 | [
"MIT"
] | 2 | 2021-01-10T01:25:13.000Z | 2021-12-11T03:07:53.000Z | process_calabi_yau.py | guillefix/nn-pacbayes | a10bb6fd26bea2163f41a4ef9171bf914db5bc76 | [
"MIT"
] | null | null | null | import numpy as np
exec("inputs="+open("/home/guillefix/Downloads/ConfigurationMatrices.txt","r").read())
def process(x):
flat_x = np.array(x).flatten()
return np.concatenate([flat_x,np.zeros(180-len(flat_x))])
inputs = [process(x) for x in inputs]
inputs = np.array(inputs)
inputs
exec("targets="+open("/ho... | 22.444444 | 86 | 0.726073 |
b37335c0bf228d38db111177c50c8a5563b2f44a | 2,038 | py | Python | Udemy_Py_DataScience_ML/Sec05_dataAnalysis_NumPy.py | gonzalosc2/LearningPython | 0210d4cbbb5e154f12007b8e8f825fd3d0022be0 | [
"MIT"
] | null | null | null | Udemy_Py_DataScience_ML/Sec05_dataAnalysis_NumPy.py | gonzalosc2/LearningPython | 0210d4cbbb5e154f12007b8e8f825fd3d0022be0 | [
"MIT"
] | null | null | null | Udemy_Py_DataScience_ML/Sec05_dataAnalysis_NumPy.py | gonzalosc2/LearningPython | 0210d4cbbb5e154f12007b8e8f825fd3d0022be0 | [
"MIT"
] | null | null | null | ####################################
# author: Gonzalo Salazar
# course: Python for Data Science and Machine Learning Bootcamp
# purpose: lecture notes
# description: Section 05 - Python for Data Analysis, NumPy
# other: N/A
####################################
# NUMPY
import numpy as np
print(np.zeros((5,5))) # not... | 25.475 | 89 | 0.686457 |
4bec74dfaa017e57fa599a45c5c04c6d45772153 | 1,666 | py | Python | src/python/m5/objects/__init__.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 765 | 2015-01-14T16:17:04.000Z | 2022-03-28T07:46:28.000Z | src/python/m5/objects/__init__.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 148 | 2018-07-20T00:58:36.000Z | 2021-11-16T01:52:33.000Z | src/python/m5/objects/__init__.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 807 | 2015-01-06T09:55:38.000Z | 2022-03-30T10:23:36.000Z | # Copyright (c) 2010 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of... | 55.533333 | 72 | 0.787515 |
c18f6c1248a449a1ff44088bb198dc7b86d58516 | 4,113 | py | Python | MWR_red_object_detection/open_cv_obj_detection.py | LOpuchlik/pjatk | 7488436e4af3252ee281578a040af8958746ca87 | [
"MIT"
] | 1 | 2021-12-08T19:52:47.000Z | 2021-12-08T19:52:47.000Z | MWR_red_object_detection/open_cv_obj_detection.py | LOpuchlik/pjatk | 7488436e4af3252ee281578a040af8958746ca87 | [
"MIT"
] | 2 | 2021-11-10T20:22:16.000Z | 2022-02-10T05:33:29.000Z | MWR_red_object_detection/open_cv_obj_detection.py | LOpuchlik/pjatk | 7488436e4af3252ee281578a040af8958746ca87 | [
"MIT"
] | null | null | null | import argparse
import cv2
import numpy as np
def nothing(x):
pass
def parse_arguments():
parser = argparse.ArgumentParser(description=('Divides video stream into frames and R,G,B channels'))
parser.add_argument('-i', '--input_video', type=str, required=True, help='Input video file that will be processed'... | 37.733945 | 132 | 0.625821 |
67fcd27799438764ac9386e9a66fa6aa466da3a3 | 3,299 | py | Python | saleor/graphql/middleware.py | kazakjokes/saleor | 938243c33283b049f43b14166a415dd77aaae92f | [
"CC-BY-4.0"
] | null | null | null | saleor/graphql/middleware.py | kazakjokes/saleor | 938243c33283b049f43b14166a415dd77aaae92f | [
"CC-BY-4.0"
] | 1 | 2020-04-14T18:35:00.000Z | 2020-04-14T18:35:00.000Z | saleor/graphql/middleware.py | kazakjokes/saleor | 938243c33283b049f43b14166a415dd77aaae92f | [
"CC-BY-4.0"
] | null | null | null | from typing import Optional
import opentracing
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.utils.functional import SimpleLazyObject
from graphene_django.settings import graphene_settings
from graphql_jwt.middleware import JSONWebTokenMiddleware
from ..account.mode... | 33.323232 | 85 | 0.715368 |
df0ac112f4a5b3b72a508e07f17bfb5b50669103 | 1,128 | bzl | Python | third_party/toolchains/preconfig/generate/containers.bzl | carchrae/tensorflow | 6a69a6b2e286b14ac9ae813998bb0d78b6fee440 | [
"Apache-2.0"
] | 1 | 2020-02-15T14:00:01.000Z | 2020-02-15T14:00:01.000Z | third_party/toolchains/preconfig/generate/containers.bzl | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:58:27.000Z | 2022-02-10T02:04:40.000Z | third_party/toolchains/preconfig/generate/containers.bzl | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 2 | 2021-04-28T20:57:17.000Z | 2022-01-11T13:05:41.000Z | """SHA 256 values for each image."""
container_digests = {
"ubuntu16.04": "sha256:b90dcf2f35f3354909f4491bdf019c110b4b4d95ef0395ebf178bc5d523a4208",
"centos6": "sha256:d09c12fb26fbbe8398b4973260c75172eb67d509dae9d6f4ad54279b7d6b0494",
"ubuntu16.04-manylinux2010": "sha256:b5227c4069980005336dd5cf04e312297498... | 80.571429 | 123 | 0.842199 |
62cc09bf5b0f8ca21bd6743005af5297178b231b | 1,218 | py | Python | blog/migrations/0004_auto_20170620_1719.py | kontspace/Athena | 4cb92a3d947c1c5b1adf3228851b83eb47a4e958 | [
"MIT"
] | 1 | 2017-09-11T15:37:40.000Z | 2017-09-11T15:37:40.000Z | blog/migrations/0004_auto_20170620_1719.py | kontspace/kont-bs | 4cb92a3d947c1c5b1adf3228851b83eb47a4e958 | [
"MIT"
] | null | null | null | blog/migrations/0004_auto_20170620_1719.py | kontspace/kont-bs | 4cb92a3d947c1c5b1adf3228851b83eb47a4e958 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-20 09:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20170403_1930'),
]
operations = [
migrations.DeleteModel(... | 26.478261 | 79 | 0.560755 |
b550475564418c3fe1c09a34b54c3bb322e351a1 | 221 | py | Python | rich_editor/urls.py | lesspointless/Shakal-NG | eee491af94527228735c2bca7644605effd74b37 | [
"MIT"
] | null | null | null | rich_editor/urls.py | lesspointless/Shakal-NG | eee491af94527228735c2bca7644605effd74b37 | [
"MIT"
] | null | null | null | rich_editor/urls.py | lesspointless/Shakal-NG | eee491af94527228735c2bca7644605effd74b37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.urls import path
from . import views
app_name = 'rich_editor'
urlpatterns = [
path('preview/', views.Preview.as_view(), name='preview'),
]
| 15.785714 | 59 | 0.705882 |
268ef267787a0fcdb1ccca4b3b781845c8999146 | 4,071 | py | Python | deepcell/layers/upsample_test.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/layers/upsample_test.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/layers/upsample_test.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 38.40566 | 80 | 0.651928 |
939fcffda4733a2334c8eef5f2dae7610e48d30e | 410 | py | Python | car-management/docker-dev-lpr/src/module/test.py | treeandgrass/Miscellaneous | 377660870dc9559b1aa7bba1d78c67ad256ed4a7 | [
"MIT"
] | null | null | null | car-management/docker-dev-lpr/src/module/test.py | treeandgrass/Miscellaneous | 377660870dc9559b1aa7bba1d78c67ad256ed4a7 | [
"MIT"
] | null | null | null | car-management/docker-dev-lpr/src/module/test.py | treeandgrass/Miscellaneous | 377660870dc9559b1aa7bba1d78c67ad256ed4a7 | [
"MIT"
] | null | null | null | import module as _module
import numpy as np
import constant
import sys
sys.path.append('../')
import utils.ImageUtils as IGU
utils = IGU.ImageUtils()
random_image = np.random.rand(1, 400, 400, 3)
predict = _module.build_model.predict(random_image)
y_predict = utils.getlistargmax(predict)
y_predict_label = utils.... | 20.5 | 90 | 0.782927 |
9ae7f41df536b9f8e6f1438a902cd502a05f8d02 | 1,342 | py | Python | pelatihanGhanis/face_detection.py | ahmaddidiks/image-processing | 47861c75c140224b62e8b74878b61ea5a5296fd3 | [
"MIT"
] | null | null | null | pelatihanGhanis/face_detection.py | ahmaddidiks/image-processing | 47861c75c140224b62e8b74878b61ea5a5296fd3 | [
"MIT"
] | null | null | null | pelatihanGhanis/face_detection.py | ahmaddidiks/image-processing | 47861c75c140224b62e8b74878b61ea5a5296fd3 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
# detector wajah dan mata
deteksi_wajah = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_default.xml')
deteksi_mata = cv2.CascadeClassifier('haarcascades/haarcascade_eye.xml')
cap = cv2.VideoCapture(1)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) # 640 x 480 || 1280 x 720
cap.se... | 30.5 | 89 | 0.637109 |
a460c5f252777db85a98ca01d16c4bb39ab3b344 | 16,885 | py | Python | python/paddle/fluid/tests/unittests/test_faster_tokenizer_op.py | RangeKing/Paddle | 2d87300809ae75d76f5b0b457d8112cb88dc3e27 | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/test_faster_tokenizer_op.py | RangeKing/Paddle | 2d87300809ae75d76f5b0b457d8112cb88dc3e27 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_faster_tokenizer_op.py | RangeKing/Paddle | 2d87300809ae75d76f5b0b457d8112cb88dc3e27 | [
"Apache-2.0"
] | null | null | null | # 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 app... | 40.883777 | 81 | 0.64199 |
58e2a39321dd53352cf44ba37e05ac66de8675e8 | 17,688 | py | Python | qubovert/sim/_anneal_results.py | panaali/qubovert | d5ea46349d2a058954fb2cb06f559c0d3fb382c5 | [
"Apache-2.0"
] | 15 | 2020-07-10T20:46:50.000Z | 2021-12-29T05:01:55.000Z | qubovert/sim/_anneal_results.py | panaali/qubovert | d5ea46349d2a058954fb2cb06f559c0d3fb382c5 | [
"Apache-2.0"
] | 13 | 2020-02-07T00:10:31.000Z | 2020-04-05T22:58:55.000Z | qubovert/sim/_anneal_results.py | panaali/qubovert | d5ea46349d2a058954fb2cb06f559c0d3fb382c5 | [
"Apache-2.0"
] | 4 | 2020-05-13T06:02:38.000Z | 2022-03-22T20:45:23.000Z | # Copyright 2020 Joseph T. Iosue
#
# 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... | 26.204444 | 79 | 0.537031 |
0f2789bfc5bdc06880d360f93a7155863b7c0a44 | 1,782 | py | Python | lib/utils/blob.py | leochangzliao/OPBM | 9688e03cbf3f8efea2feb8813fa80c702b3e3ed6 | [
"BSD-2-Clause"
] | null | null | null | lib/utils/blob.py | leochangzliao/OPBM | 9688e03cbf3f8efea2feb8813fa80c702b3e3ed6 | [
"BSD-2-Clause"
] | null | null | null | lib/utils/blob.py | leochangzliao/OPBM | 9688e03cbf3f8efea2feb8813fa80c702b3e3ed6 | [
"BSD-2-Clause"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Blob helper functions."""
import numpy as np
import cv2
def im_li... | 34.941176 | 75 | 0.612233 |
50748c6d2501ec7cb420991161337dcc30067a49 | 18,644 | py | Python | main/gen_batch.py | tienhaophung/PoseFix_RELEASE | 53694de368d179b139f43f0fe07d35969a2a426c | [
"MIT"
] | null | null | null | main/gen_batch.py | tienhaophung/PoseFix_RELEASE | 53694de368d179b139f43f0fe07d35969a2a426c | [
"MIT"
] | null | null | null | main/gen_batch.py | tienhaophung/PoseFix_RELEASE | 53694de368d179b139f43f0fe07d35969a2a426c | [
"MIT"
] | null | null | null | import os
import os.path as osp
import numpy as np
import cv2
from config import cfg
import random
import time
import math
from PIL import Image, ImageDraw
import matplotlib.pyplot as plt
def get_affine_transform(center,
scale,
rot,
output_size... | 40.885965 | 196 | 0.541676 |
0508bf4870347b4fb704ba6ebff5c10a14916479 | 2,466 | py | Python | homeassistant/components/hangouts/const.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | homeassistant/components/hangouts/const.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 57 | 2020-10-15T06:47:00.000Z | 2022-03-31T06:11:18.000Z | homeassistant/components/hangouts/const.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Constants for Google Hangouts Component."""
import logging
import voluptuous as vol
from homeassistant.components.notify import ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(".")
DOMAIN = "hangouts"
CONF_2FA = "2fa"
CONF_AUTH_CODE = "autho... | 28.674419 | 81 | 0.734388 |
f395022744c9a171800252c2d8c387b317d77c17 | 2,331 | py | Python | btb/selection/selector.py | dataronio/BTB | 5053ed705cf2542e320e8a7605642f5b01db8272 | [
"MIT"
] | 161 | 2017-12-20T00:17:35.000Z | 2020-11-25T18:18:15.000Z | btb/selection/selector.py | pvk-developer/BTB | 49d2f3c00881919a23c6578cd02fcfb6f4d33354 | [
"MIT"
] | 162 | 2017-12-26T18:44:38.000Z | 2020-11-19T15:53:03.000Z | btb/selection/selector.py | pvk-developer/BTB | 49d2f3c00881919a23c6578cd02fcfb6f4d33354 | [
"MIT"
] | 37 | 2018-01-03T09:28:08.000Z | 2020-09-23T10:23:46.000Z | import numpy as np
class Selector(object):
"""Base selector
Args:
choices (list): a list of discrete choices from which the selector must choose at every
call to ``select``.
"""
def __init__(self, choices):
self.choices = choices
def compute_rewards(self, scores):
... | 35.318182 | 99 | 0.603604 |
d5967e8a70bb9d9210af807f0de33988e1e640e2 | 816 | py | Python | main.py | iBigDane/AIBit2.0 | a1e0b3497063fdf09bd9291f8e48ba7eb163a6f5 | [
"MIT"
] | null | null | null | main.py | iBigDane/AIBit2.0 | a1e0b3497063fdf09bd9291f8e48ba7eb163a6f5 | [
"MIT"
] | null | null | null | main.py | iBigDane/AIBit2.0 | a1e0b3497063fdf09bd9291f8e48ba7eb163a6f5 | [
"MIT"
] | null | null | null |
def connectToWifiAndUpdate():
import time, machine, network, gc
time.sleep(1)
print('Memory free', gc.mem_free())
from app.ota_updater import OTAUpdater
sta_if = network.WLAN(network.STA_IF)
if not sta_if.isconnected():
print('connecting to network...')
sta_if.active(True)
... | 26.322581 | 114 | 0.659314 |
bba425571c33ed968f877c4f09b14cfe5dad6b65 | 20,116 | py | Python | test/test_chaos.py | bbc/chaos-lambda | 96f1f2296aa0a4cacef4103557c8abcb82c884ed | [
"Apache-2.0"
] | 170 | 2016-04-25T10:21:13.000Z | 2021-10-01T19:27:21.000Z | test/test_chaos.py | bbc/chaos-lambda | 96f1f2296aa0a4cacef4103557c8abcb82c884ed | [
"Apache-2.0"
] | 9 | 2016-05-10T11:15:01.000Z | 2021-01-21T15:48:10.000Z | test/test_chaos.py | bbc/chaos-lambda | 96f1f2296aa0a4cacef4103557c8abcb82c884ed | [
"Apache-2.0"
] | 26 | 2016-04-26T05:00:13.000Z | 2020-10-07T13:56:34.000Z | from __future__ import print_function
import json
import re
from unittest import mock
from base import mock_imports, PatchingTestCase
mock_imports([
"boto3"
]) # noqa
import chaos
class TestGetASGTag(PatchingTestCase):
def test_finds_tag_key_case_insensitively(self):
asg = {"Tags": [{"Key": "na... | 36.775137 | 79 | 0.620103 |
48fa4041c0df2ea9afdab2912affd00587f62c46 | 955 | py | Python | mep/people/migrations/0014_library_location.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | 3 | 2020-05-12T19:19:41.000Z | 2021-04-07T13:56:32.000Z | mep/people/migrations/0014_library_location.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | 736 | 2017-06-21T16:24:42.000Z | 2022-02-26T17:46:10.000Z | mep/people/migrations/0014_library_location.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-05 20:45
from __future__ import unicode_literals
from django.db import migrations
def add_library_address(apps, schema_editor):
# adds the known location for the Shakespeare and Company lending library
# as a Location, so it can be used to draw... | 34.107143 | 80 | 0.627225 |
677eaca112d783f91f67109e13a068bf0094938e | 1,396 | py | Python | tests/splitters/test_mae_avl.py | picwell/pyboretum | dd2af812ea2156ddec57aa252c79333f3bd81b0d | [
"MIT"
] | 1 | 2019-04-05T01:57:12.000Z | 2019-04-05T01:57:12.000Z | tests/splitters/test_mae_avl.py | picwell/pyboretum | dd2af812ea2156ddec57aa252c79333f3bd81b0d | [
"MIT"
] | null | null | null | tests/splitters/test_mae_avl.py | picwell/pyboretum | dd2af812ea2156ddec57aa252c79333f3bd81b0d | [
"MIT"
] | null | null | null | import numpy as np
from pyboretum.splitters.mae_splitter import MAE_AVL
def test_mae_avl_keeps_balance_with_add_remove():
y = range(500)
left_tree = None
right_tree = MAE_AVL(y)
subtree_size = 250
assert len(right_tree.less_than) == len(right_tree.greater_than) == subtree_size
assert right_t... | 31.727273 | 94 | 0.674069 |
d6a6844b59a49420f0ec843efeed300c79bd2eb9 | 4,546 | py | Python | sakila/admin.py | blackway/django-gentelella | 63e4b888c4ffa655c4b1d09b3b61c31b06f5c990 | [
"MIT"
] | null | null | null | sakila/admin.py | blackway/django-gentelella | 63e4b888c4ffa655c4b1d09b3b61c31b06f5c990 | [
"MIT"
] | null | null | null | sakila/admin.py | blackway/django-gentelella | 63e4b888c4ffa655c4b1d09b3b61c31b06f5c990 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django import forms as django_forms
from django.db.models import Count
from django.forms import BaseModelFormSet
# from django_filters import DateRangeFilter
from rangefilter.filter import DateRangeFilter
from conf import settings
from .models import Film, Language
class Languag... | 38.201681 | 164 | 0.679278 |
bec1c10cd8b77d8ee26315426774c6647435b7a2 | 4,581 | py | Python | yaticker/util/util.py | sebasrp/yaticker | ca86586f37ca252813d5a8941e92826a16e62098 | [
"MIT"
] | null | null | null | yaticker/util/util.py | sebasrp/yaticker | ca86586f37ca252813d5a8941e92826a16e62098 | [
"MIT"
] | null | null | null | yaticker/util/util.py | sebasrp/yaticker | ca86586f37ca252813d5a8941e92826a16e62098 | [
"MIT"
] | null | null | null | import socket
import textwrap
from tempfile import NamedTemporaryFile
import requests
from matplotlib.image import imread
from PIL import Image, ImageDraw, ImageFont
def is_connected(url="http://www.google.com/", timeout=3):
try:
requests.head(url, timeout=timeout)
return True
except requests... | 26.789474 | 108 | 0.642654 |
204677aab1714fb93d0e334818d04801339a11cd | 3,085 | py | Python | src/compare_nn.py | trukanduk/pq_huffman | 79b11d719b80352549ce519847cabd89ac0e5c7d | [
"MIT"
] | 1 | 2020-03-05T16:07:10.000Z | 2020-03-05T16:07:10.000Z | src/compare_nn.py | trukanduk/pq_huffman | 79b11d719b80352549ce519847cabd89ac0e5c7d | [
"MIT"
] | null | null | null | src/compare_nn.py | trukanduk/pq_huffman | 79b11d719b80352549ce519847cabd89ac0e5c7d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import utils
import numpy as np
import utils.io as io
import json
import math
from collections import Iterable
def safe_inf(x):
return x if not math.isinf(x) else 1e100
def calc_main_metrics(dists, prefix):
n, nn = dists.shape
result = {
'num_vectors': n,
... | 29.951456 | 102 | 0.623987 |
09e8698c98f986a269efd19c334932085e8043ab | 2,792 | py | Python | cluster_constants.py | Infosys/High-Availability-Hadoop | c3284cb1601ad4981eb36d8d4f59189e89cec223 | [
"MIT"
] | 2 | 2015-11-26T09:11:00.000Z | 2017-09-25T09:24:22.000Z | cluster_constants.py | Infosys/High-Availability-Hadoop | c3284cb1601ad4981eb36d8d4f59189e89cec223 | [
"MIT"
] | null | null | null | cluster_constants.py | Infosys/High-Availability-Hadoop | c3284cb1601ad4981eb36d8d4f59189e89cec223 | [
"MIT"
] | 1 | 2016-05-13T11:28:13.000Z | 2016-05-13T11:28:13.000Z | # The MIT License (MIT)
# Copyright (c) 2015 Infosys Ltd
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 31.727273 | 80 | 0.77937 |
a68fae1ca5fc7c26351290cdb0690054ff057662 | 325 | py | Python | graphgallery/nn/models/dgl/__init__.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | 1 | 2020-07-29T08:00:32.000Z | 2020-07-29T08:00:32.000Z | graphgallery/nn/models/dgl/__init__.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | null | null | null | graphgallery/nn/models/dgl/__init__.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | null | null | null | from .gcn import GCN
from .sgc import SGC
from .gat import GAT
from .appnp import APPNP
from .dagnn import DAGNN
from .jknet import JKNet
from .mixhop import MixHop
from .grand import GRAND
from .lgc import LGC, EGC, hLGC
from .mediangcn import MedianGCN
from .robust_gcn import RobustGCN
from . import ala_... | 23.214286 | 34 | 0.76 |
a41dcffa2991db7eb87609c8136ef3b96abcdaf1 | 449 | py | Python | packages/python/plotly/plotly/validators/icicle/textfont/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/icicle/textfont/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/icicle/textfont/_color.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(self, plotly_name="color", parent_name="icicle.textfont", **kwargs):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 34.538462 | 85 | 0.659243 |
b889f942415fb339431d1101b01af18beb7f9a0f | 609 | py | Python | tests/basic_tests/test_player.py | sriteja777/My_Mario | ee90abb1f40d42805cf6a92f9773aa04a1743a44 | [
"MIT"
] | 1 | 2021-03-24T13:52:15.000Z | 2021-03-24T13:52:15.000Z | tests/basic_tests/test_player.py | sriteja777/My_Mario | ee90abb1f40d42805cf6a92f9773aa04a1743a44 | [
"MIT"
] | null | null | null | tests/basic_tests/test_player.py | sriteja777/My_Mario | ee90abb1f40d42805cf6a92f9773aa04a1743a44 | [
"MIT"
] | 1 | 2018-12-18T13:59:29.000Z | 2018-12-18T13:59:29.000Z | # from path import mymario as m
import sys
sys.path.append('/home/sriteja/PycharmProjects/My_Mario/mymario')
# sys.path.insert(0, '../mymario/')
import motion as m
import config as c
import old_game as g
player = m.Player({'max_x': 4, 'max_y': 5, 'min_x': 6, 'min_y': 7}, c.PLAYER)
def test_init():
assert (playe... | 25.375 | 106 | 0.692939 |
002df73c6d5c909a2a95acd723a9abadc24ea28a | 385 | py | Python | app/__init__.py | baishuchao/flask_microservices_demo | 7839546a15735da352980273dc72ca3a7f9f5563 | [
"Apache-2.0"
] | 1 | 2021-09-06T03:50:35.000Z | 2021-09-06T03:50:35.000Z | app/__init__.py | cf1998/flask_microservices_demo | 7839546a15735da352980273dc72ca3a7f9f5563 | [
"Apache-2.0"
] | null | null | null | app/__init__.py | cf1998/flask_microservices_demo | 7839546a15735da352980273dc72ca3a7f9f5563 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @time: 2020/9/12 8:01 下午
# @Author: John.bai
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from app.config import read_config
# 创建 app
app = Flask(__name__)
# 创建 db
db = SQLAlchemy()
def create_app(env):
# 读取环境变量
app.config.from_object(rea... | 14.259259 | 44 | 0.672727 |
7da5b55a47ac967edb8ee56a61a646d86dbe1797 | 70,997 | py | Python | salt/netapi/rest_cherrypy/app.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | 2 | 2015-11-07T12:05:15.000Z | 2018-10-29T13:21:06.000Z | salt/netapi/rest_cherrypy/app.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | salt/netapi/rest_cherrypy/app.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
'''
A REST API for Salt
===================
.. versionadded:: 2014.7.0
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends: - CherryPy Python module (strongly recommend 3.2.x versions due to
an as yet unknown SSL error).
- salt-api package
:optdepends: - ws4p... | 31.554222 | 250 | 0.573813 |
7cfba7801e78a8649bcfaee7706e05b874f01142 | 4,266 | py | Python | docs/tutorials/Boosting-classifier-accuracy-by-grouping-categories/pets.py | mr-yamraj/ELL | 208e9b07ab9d5f69692f13da739d33c8e626e972 | [
"MIT"
] | null | null | null | docs/tutorials/Boosting-classifier-accuracy-by-grouping-categories/pets.py | mr-yamraj/ELL | 208e9b07ab9d5f69692f13da739d33c8e626e972 | [
"MIT"
] | null | null | null | docs/tutorials/Boosting-classifier-accuracy-by-grouping-categories/pets.py | mr-yamraj/ELL | 208e9b07ab9d5f69692f13da739d33c8e626e972 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
###############################################################################
#
# Project: Embedded Learning Library (ELL)
# File: pets.py
# Authors: Chris Lovett
# Byron Changuion
#
# Requires: Python 3.x
#
##################################################################... | 34.682927 | 104 | 0.620722 |
07cf83ee049a352795ac596039789988385cf928 | 1,642 | py | Python | SoftLayer/CLI/block/replication/locations.py | ko101/softlayer-python | f4cc9fa2eb01d97c0e890907ef6735390f1a5b10 | [
"MIT"
] | null | null | null | SoftLayer/CLI/block/replication/locations.py | ko101/softlayer-python | f4cc9fa2eb01d97c0e890907ef6735390f1a5b10 | [
"MIT"
] | null | null | null | SoftLayer/CLI/block/replication/locations.py | ko101/softlayer-python | f4cc9fa2eb01d97c0e890907ef6735390f1a5b10 | [
"MIT"
] | null | null | null | """List suitable replication datacenters for the given volume."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import columns as column_helper
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
COLUMNS = [
column_helper.Column('ID', ('id',... | 32.84 | 72 | 0.672351 |
ecd100697fe9b97623687df3cf7a9627206f363c | 2,947 | py | Python | lib/grizzled/grizzled/test/collections/TestLRUDict.py | brianrodri/google_appengine | ec4e7cdfa1afd99de23b0a32eb94563fe5e6ef43 | [
"Apache-2.0"
] | 1 | 2017-12-07T18:47:45.000Z | 2017-12-07T18:47:45.000Z | lib/grizzled/grizzled/test/collections/TestLRUDict.py | brianrodri/google_appengine | ec4e7cdfa1afd99de23b0a32eb94563fe5e6ef43 | [
"Apache-2.0"
] | 1 | 2020-04-14T07:06:58.000Z | 2020-04-14T07:06:58.000Z | lib/grizzled/grizzled/test/collections/TestLRUDict.py | brianrodri/google_appengine | ec4e7cdfa1afd99de23b0a32eb94563fe5e6ef43 | [
"Apache-2.0"
] | null | null | null | # $Id: d013d05ce2f81cd44ec98b5568c26fef11333e0e $
"""
Tester.
"""
from __future__ import print_function
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
from timeit import Timer
from grizzled.collec... | 27.036697 | 77 | 0.413302 |
ddd3c8de1967c63b7004ff6c862d0bd3671742bc | 14,298 | py | Python | dataprofiler/profilers/float_column_profile.py | gautomdas/DataProfiler | 7afaa61a814c1bf24c51272dc2aa657397d9f1e5 | [
"Apache-2.0"
] | 690 | 2021-02-19T19:57:31.000Z | 2022-03-29T23:08:39.000Z | dataprofiler/profilers/float_column_profile.py | gautomdas/DataProfiler | 7afaa61a814c1bf24c51272dc2aa657397d9f1e5 | [
"Apache-2.0"
] | 179 | 2021-02-17T20:49:16.000Z | 2022-03-21T18:49:49.000Z | dataprofiler/profilers/float_column_profile.py | gautomdas/DataProfiler | 7afaa61a814c1bf24c51272dc2aa657397d9f1e5 | [
"Apache-2.0"
] | 48 | 2021-02-19T19:25:32.000Z | 2022-03-21T17:36:50.000Z | import re
import copy
import math
import numpy as np
from . import utils
from .numerical_column_stats import NumericStatsMixin
from .base_column_profilers import BaseColumnProfiler, \
BaseColumnPrimitiveTypeProfiler
from .profiler_options import FloatOptions
class FloatColumn(NumericStatsMixin, BaseColumnPrimiti... | 39.606648 | 93 | 0.603931 |
13dd2c52225b17dfd759767de871c3d7f5e623ca | 3,329 | py | Python | eahub/profiles/migrations/0023_add_fields_from_EAG.py | walambert/eahub.org | 21b6111b2626e4739c249d0881d16fbc818094cb | [
"MIT"
] | 36 | 2019-02-22T23:07:14.000Z | 2022-02-10T13:24:27.000Z | eahub/profiles/migrations/0023_add_fields_from_EAG.py | walambert/eahub.org | 21b6111b2626e4739c249d0881d16fbc818094cb | [
"MIT"
] | 717 | 2019-02-21T22:07:55.000Z | 2022-02-26T15:17:49.000Z | eahub/profiles/migrations/0023_add_fields_from_EAG.py | walambert/eahub.org | 21b6111b2626e4739c249d0881d16fbc818094cb | [
"MIT"
] | 19 | 2019-04-14T14:37:56.000Z | 2022-02-14T22:05:16.000Z | from django.db import migrations, models
import eahub.profiles.models
from eahub.profiles.models import ProfileTagType, ProfileTagTypeEnum
def create_profile_tag_types(apps, schema_editor):
for enum_member in ProfileTagTypeEnum:
ProfileTagType.objects.get_or_create(type=enum_member)
class Migration(mig... | 32.009615 | 76 | 0.518174 |
46e08e1c2045affc67fd2e3c6485d2190c79baf3 | 1,158 | py | Python | controllers/leaderboard.py | PP-HashInclude/cfc-quiz | beabe81e073919d59b543c7d4b5078cb3b950e5d | [
"Apache-2.0"
] | null | null | null | controllers/leaderboard.py | PP-HashInclude/cfc-quiz | beabe81e073919d59b543c7d4b5078cb3b950e5d | [
"Apache-2.0"
] | 1 | 2020-05-02T13:44:27.000Z | 2020-05-02T13:44:27.000Z | controllers/leaderboard.py | PP-HashInclude/cfc-quiz | beabe81e073919d59b543c7d4b5078cb3b950e5d | [
"Apache-2.0"
] | null | null | null | from flask import render_template, session
from repositories import db
def leaderboard():
playerid = ""
statusmessage = ""
competition = ""
dbrows = []
try:
playerid = session.get("mobileno")
if playerid is None:
statusmessage = "Please login to view your score... | 34.058824 | 95 | 0.599309 |
106f40345e73703973bbb437603ac1170fae2985 | 6,867 | py | Python | packages/nsis-installer/SCons/Tools/crossmingw.py | intel-secl/trustagent | ceab632ed0dd4ee73860d4ba4776c80b469eda2b | [
"BSD-3-Clause"
] | 2 | 2019-07-19T11:20:12.000Z | 2019-07-19T11:26:26.000Z | packages/nsis-installer/SCons/Tools/crossmingw.py | intel-secl/trustagent | ceab632ed0dd4ee73860d4ba4776c80b469eda2b | [
"BSD-3-Clause"
] | 3 | 2019-07-19T08:58:50.000Z | 2021-02-03T19:42:00.000Z | packages/nsis-installer/SCons/Tools/crossmingw.py | intel-secl/trustagent | ceab632ed0dd4ee73860d4ba4776c80b469eda2b | [
"BSD-3-Clause"
] | null | null | null | """SCons.Tool.gcc
Tool-specific initialization for MinGW (http://www.mingw.org/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# Permission i... | 35.95288 | 135 | 0.649774 |
118309024eefc82963314d26f1e0ffb0e0145b66 | 814 | py | Python | blog_app/posts/migrations/0002_auto_20190420_1124.py | haddercone/Blog.github.io | 1908706312bfd2946b01e988806d37d861d6395d | [
"MIT"
] | 1 | 2019-06-10T10:49:02.000Z | 2019-06-10T10:49:02.000Z | blog_app/posts/migrations/0002_auto_20190420_1124.py | haddercone/Blog.github.io | 1908706312bfd2946b01e988806d37d861d6395d | [
"MIT"
] | null | null | null | blog_app/posts/migrations/0002_auto_20190420_1124.py | haddercone/Blog.github.io | 1908706312bfd2946b01e988806d37d861d6395d | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-04-20 05:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='auther',
... | 29.071429 | 114 | 0.588452 |
8613c4bd8eaf87aa141fcfe90f3c6ab2730b7f2f | 355 | py | Python | src/constant_properties_protector/constant_properties_protector.py | BehzadShayegh/constant-properties-protector | e88f830641c482b256507f7107e09f9b46be1d77 | [
"MIT"
] | null | null | null | src/constant_properties_protector/constant_properties_protector.py | BehzadShayegh/constant-properties-protector | e88f830641c482b256507f7107e09f9b46be1d77 | [
"MIT"
] | null | null | null | src/constant_properties_protector/constant_properties_protector.py | BehzadShayegh/constant-properties-protector | e88f830641c482b256507f7107e09f9b46be1d77 | [
"MIT"
] | null | null | null | class CPP:
@staticmethod
def __protection_exception(prop):
raise Exception(f'Can not modify constant property: {prop}')
@staticmethod
def protect(obj, prop):
setattr(obj.__class__, prop, property(
lambda self: getattr(self, '_'+prop),
lambda self, value: CPP.__pr... | 32.272727 | 68 | 0.63662 |
1620b9110eed3bb61c91a65ec671a116c58f871b | 343 | py | Python | plugin.py | jfcherng/LSP-batch | dd4c7886680901ef1e834a64c4193cc29a230347 | [
"MIT"
] | 1 | 2020-06-14T20:45:12.000Z | 2020-06-14T20:45:12.000Z | plugin.py | jfcherng/LSP-batch | dd4c7886680901ef1e834a64c4193cc29a230347 | [
"MIT"
] | null | null | null | plugin.py | jfcherng/LSP-batch | dd4c7886680901ef1e834a64c4193cc29a230347 | [
"MIT"
] | null | null | null | import os
from lsp_utils import NpmClientHandler
def plugin_loaded():
LspBatchPlugin.setup()
def plugin_unloaded():
LspBatchPlugin.cleanup()
class LspBatchPlugin(NpmClientHandler):
package_name = __package__
server_directory = "language-server"
server_binary_path = os.path.join(server_director... | 20.176471 | 75 | 0.758017 |
c46eb207c75f622a6cd8349a96d97d3b2c2533f3 | 17,900 | py | Python | python/openapi_client/model/tokenize_request_schema.py | Mastercard/mcapi_oauth_encryption_tutorial | 0c24f778ad57a867eefd8aad44466a49f3f89826 | [
"MIT"
] | 26 | 2019-08-15T10:48:16.000Z | 2022-03-03T21:57:52.000Z | python/openapi_client/model/tokenize_request_schema.py | Mastercard/mcapi_oauth_encryption_tutorial | 0c24f778ad57a867eefd8aad44466a49f3f89826 | [
"MIT"
] | 12 | 2019-12-30T08:36:00.000Z | 2022-03-29T22:37:50.000Z | python/openapi_client/model/tokenize_request_schema.py | Mastercard/mcapi_oauth_encryption_tutorial | 0c24f778ad57a867eefd8aad44466a49f3f89826 | [
"MIT"
] | 36 | 2019-08-14T14:27:35.000Z | 2022-02-13T18:02:36.000Z | """
MDES Digital Enablement API
These APIs are designed as RPC style stateless web services where each API endpoint represents an operation to be performed. All request and response payloads are sent in the JSON (JavaScript Object Notation) data-interchange format. Each endpoint in the API specifies the HTTP ... | 55.417957 | 2,146 | 0.625363 |
c8560daba139666f0542a06855d2cc0652bef222 | 672 | py | Python | src/radish/models/constant_tag.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 182 | 2015-06-27T16:17:17.000Z | 2022-03-19T11:49:10.000Z | src/radish/models/constant_tag.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 357 | 2015-11-06T19:30:19.000Z | 2022-03-28T19:49:04.000Z | src/radish/models/constant_tag.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 52 | 2015-08-22T08:36:37.000Z | 2022-03-01T06:04:06.000Z | """
radish
~~~~~~
The root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from radish.models.tag import Tag
class ConstantTag(Tag):
"""Represents a single radish Constant Tag"""
def __init__(self, key: str... | 25.846154 | 75 | 0.61756 |
e610cf596555091411583117cd57e70dffed3b7d | 8,407 | py | Python | adversarial_attack/yolov3/detect.py | Akila-Ayanthi/adversarial | f0f37dda406b56f7da03b27a4809a703b64011b0 | [
"MIT"
] | 8 | 2020-08-18T14:57:28.000Z | 2021-10-04T06:20:09.000Z | adversarial_attack/yolov3/detect.py | Akila-Ayanthi/adversarial | f0f37dda406b56f7da03b27a4809a703b64011b0 | [
"MIT"
] | 2 | 2021-10-04T06:24:14.000Z | 2021-11-28T11:32:56.000Z | adversarial_attack/yolov3/detect.py | Akila-Ayanthi/adversarial | f0f37dda406b56f7da03b27a4809a703b64011b0 | [
"MIT"
] | 6 | 2020-10-20T12:43:22.000Z | 2022-01-21T09:30:05.000Z | import argparse
from models import * # set ONNX_EXPORT in models.py
from utils.datasets import *
from utils.utils import *
def detect(save_img=False):
imgsz = (320, 192) if ONNX_EXPORT else opt.img_size # (320, 192) or (416, 256) or (608, 352) for (height, width)
out, source, weights, half, view_img, save_t... | 44.015707 | 126 | 0.585583 |
ebfc8479158a1b04f6cfa0296302a0aac3d7b572 | 2,739 | py | Python | Maths - Statistics/Mathematics_for_ML/special_matrices.py | dimi-fn/Various-Data-Science-Scripts | 82ec30178ce4b7e2fedd9552e05cfc99e92ed52a | [
"MIT"
] | 8 | 2021-04-02T18:50:20.000Z | 2022-02-05T13:23:03.000Z | Maths - Statistics/Mathematics_for_ML/special_matrices.py | dimi-fn/Various-Data-Science-Scripts | 82ec30178ce4b7e2fedd9552e05cfc99e92ed52a | [
"MIT"
] | 1 | 2021-03-03T21:17:38.000Z | 2021-03-07T14:07:41.000Z | Maths - Statistics/Mathematics_for_ML/special_matrices.py | dimi-fn/Various-Data-Science-Scripts | 82ec30178ce4b7e2fedd9552e05cfc99e92ed52a | [
"MIT"
] | 2 | 2021-03-07T12:58:59.000Z | 2022-02-18T10:34:02.000Z | import numpy as np
# Creating a function that will go through the matrix replacing each row in order to turn it into the echelon form.
def is_Singular(a) :
# making matrix b as a copy of a (since its values are going to be altered)
b = np.array(a, dtype=np.float_)
try:
fix_row_zero(b)
fix_... | 28.831579 | 115 | 0.535597 |
b30129e1315eab6b7f6671131c7fd8834b5711bc | 7,680 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_job.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_job.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/ovirt/ovirt/plugins/modules/ovirt_job.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
#... | 32.268908 | 126 | 0.629688 |
58226e66ee27946bd1d13e5186e975c748ffd923 | 145 | py | Python | prado/datasets/__init__.py | suflaj/prado | 844ff63cfab1198e717cf72c72ec74caf9f4888d | [
"Apache-2.0"
] | 2 | 2021-03-31T18:34:31.000Z | 2021-07-15T09:11:48.000Z | prado/datasets/__init__.py | suflaj/prado | 844ff63cfab1198e717cf72c72ec74caf9f4888d | [
"Apache-2.0"
] | null | null | null | prado/datasets/__init__.py | suflaj/prado | 844ff63cfab1198e717cf72c72ec74caf9f4888d | [
"Apache-2.0"
] | null | null | null | from .collates import pad_projections
from .datasets import ProcessedDataset
from .transforms import BasicPradoTransform, BasicPradoAugmentation
| 36.25 | 67 | 0.882759 |
09a3cb03fdc6c93f97888f81b9ebf7ebc26c878e | 2,659 | py | Python | server.py | ShafinRez/CMPUT-404-Assignment-1 | 6776c31c884bb21661d2694e6d4403165c8ebf62 | [
"Apache-2.0"
] | null | null | null | server.py | ShafinRez/CMPUT-404-Assignment-1 | 6776c31c884bb21661d2694e6d4403165c8ebf62 | [
"Apache-2.0"
] | null | null | null | server.py | ShafinRez/CMPUT-404-Assignment-1 | 6776c31c884bb21661d2694e6d4403165c8ebf62 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import socketserver
import os
# Copyright 2013 Abram Hindle, Eddie Antonio Santos
#
# 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/L... | 31.282353 | 103 | 0.621662 |
6a45e8b394ef5f1bbe1356c885384f819449e6dc | 7,544 | py | Python | tools/experimental/trt-engine-explorer/trex/lint.py | L-Net-1992/TensorRT | 34b664d404001bd724cb56b52a6e0e05e1fd97f2 | [
"Apache-2.0"
] | null | null | null | tools/experimental/trt-engine-explorer/trex/lint.py | L-Net-1992/TensorRT | 34b664d404001bd724cb56b52a6e0e05e1fd97f2 | [
"Apache-2.0"
] | null | null | null | tools/experimental/trt-engine-explorer/trex/lint.py | L-Net-1992/TensorRT | 34b664d404001bd724cb56b52a6e0e05e1fd97f2 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 37.532338 | 88 | 0.561241 |
d940b43f767e44a3f07c47344d7f386fd080dd87 | 996 | py | Python | interim.py | micxmusic/TourItineraryPlanning | 18ca8b9e450f7081a0596e6d4b995e8a0e385b43 | [
"MIT"
] | 1 | 2021-05-11T02:51:39.000Z | 2021-05-11T02:51:39.000Z | interim.py | micxmusic/TourItineraryPlanning | 18ca8b9e450f7081a0596e6d4b995e8a0e385b43 | [
"MIT"
] | null | null | null | interim.py | micxmusic/TourItineraryPlanning | 18ca8b9e450f7081a0596e6d4b995e8a0e385b43 | [
"MIT"
] | null | null | null | """
The function takes in a tour with multiple locations and a list of
locations with coordinates to output the toal length of the tour.
"""
def tourlength(tour, locations):
total_distance = 0.0
#returns length 0.0 if there is only 0 or 1 location provided
if len(tour)<2:
return total_di... | 34.344828 | 71 | 0.569277 |
888b04d37c461aab6fd65c643da4850b201f67cc | 2,527 | py | Python | Matplotlib Graphing XY HexBin.py | wackymaster/UpStat | 60a0b3572045e53473f7409d27b305d496a02d94 | [
"Apache-2.0"
] | null | null | null | Matplotlib Graphing XY HexBin.py | wackymaster/UpStat | 60a0b3572045e53473f7409d27b305d496a02d94 | [
"Apache-2.0"
] | null | null | null | Matplotlib Graphing XY HexBin.py | wackymaster/UpStat | 60a0b3572045e53473f7409d27b305d496a02d94 | [
"Apache-2.0"
] | null | null | null | import csv
import matplotlib.pyplot as plt
from tkinter import *
import tkinter.messagebox
from tkinter.filedialog import askopenfilename
import numpy as np
save_png = True
def plot(x, y):
# Get Name of Headers and Remove them to keep Data Fresh
x_header, y_header = x[0], y[0]
plt.title(x_he... | 27.769231 | 80 | 0.585279 |
35f17513acc87a69b316fd4e2880748572762bb8 | 1,028 | py | Python | meiduo1/apps/meiduo_admin/serializer/admins.py | woobrain/nginx-uwsgi-web | 5b3ca1fba8205c2c0a2b91d951f812f1c30e12ae | [
"MIT"
] | null | null | null | meiduo1/apps/meiduo_admin/serializer/admins.py | woobrain/nginx-uwsgi-web | 5b3ca1fba8205c2c0a2b91d951f812f1c30e12ae | [
"MIT"
] | 2 | 2021-05-28T19:45:17.000Z | 2021-11-02T15:49:34.000Z | meiduo1/apps/meiduo_admin/serializer/admins.py | woobrain/nginx-uwsgi-web | 5b3ca1fba8205c2c0a2b91d951f812f1c30e12ae | [
"MIT"
] | null | null | null | from rest_framework import serializers
# from django.contrib.auth.models import
from apps.user.models import User
class AdminSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__'
extra_kwargs = {
'username': {
'max_length': 20,
... | 27.052632 | 58 | 0.553502 |
1d79a3a008bd57f74e43784e35e58507279f91b8 | 698 | py | Python | 24_vgg19_architecture.py | zelosdev/TensorflowKerasTutorial | 0f773aaf3ec9aa42587b855f72e0c7a2f159a54b | [
"MIT"
] | 2 | 2020-05-21T22:47:57.000Z | 2020-11-28T12:40:14.000Z | 24_vgg19_architecture.py | zelosdev/TensorflowKerasTutorial | 0f773aaf3ec9aa42587b855f72e0c7a2f159a54b | [
"MIT"
] | null | null | null | 24_vgg19_architecture.py | zelosdev/TensorflowKerasTutorial | 0f773aaf3ec9aa42587b855f72e0c7a2f159a54b | [
"MIT"
] | 1 | 2020-05-28T09:12:19.000Z | 2020-05-28T09:12:19.000Z | ##########################################
# to turn off warnings #
import warnings #
warnings.filterwarnings('ignore') #
#
import os #
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #
... | 36.736842 | 92 | 0.472779 |
7de5bf1f1b5e58a06428e851b76a5f13199fb6a5 | 92 | py | Python | easyquant/chanlunx_cpp/ctest/helloworld.py | dizzy21c/easyqtrs | 4704674d2175d40afdc306afd8a002a486c83220 | [
"MIT"
] | 2 | 2021-12-30T13:43:13.000Z | 2022-01-23T13:39:54.000Z | easyquant/chanlunx_cpp/ctest/helloworld.py | dizzy21c/easyqtrs | 4704674d2175d40afdc306afd8a002a486c83220 | [
"MIT"
] | null | null | null | easyquant/chanlunx_cpp/ctest/helloworld.py | dizzy21c/easyqtrs | 4704674d2175d40afdc306afd8a002a486c83220 | [
"MIT"
] | 4 | 2021-10-22T01:44:47.000Z | 2022-01-05T05:49:20.000Z | import ctypes
libc = ctypes.cdll.LoadLibrary("./hello_module.so")
libc.main()
libc.main2() | 15.333333 | 51 | 0.73913 |
e1a053a211c6e0cf0d228448116d475d9f3dbdfa | 1,755 | py | Python | tests/test_inject_template.py | MacHu-GWU/sanhe_devops_tools-project | bc617a962db69818d6279277bf24ac45a43f2030 | [
"MIT"
] | null | null | null | tests/test_inject_template.py | MacHu-GWU/sanhe_devops_tools-project | bc617a962db69818d6279277bf24ac45a43f2030 | [
"MIT"
] | null | null | null | tests/test_inject_template.py | MacHu-GWU/sanhe_devops_tools-project | bc617a962db69818d6279277bf24ac45a43f2030 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import pytest
from pytest import raises, approx
from sanhe_devops_tools.inject_template import inject_variable, apply_common_tag
def test_inject_variable():
assert inject_variable(
"{{ FIRST_NAME }} {{ LAST_NAME }}",
dict(FIRST_NAME="Obama", LAST_NAME="Barrack"... | 23.4 | 84 | 0.518519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.