hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aae2ca36a949bc8987839b2e06ad9a66b03318da | 318 | py | Python | ___Python/KarPoo/po1_kennenlernen/p03_lambda/m01_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p03_lambda/m01_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p03_lambda/m01_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | celsius_temperaturen = [0.7, 2.1, 4.2, 8.2, 12.5, 15.6, 16.9, 16.3, 13.6, 9.5, 4.6, 2.3] #Durchschnittstemperaturen in Bilefeld nach Monat
# Alle Temperaturen >= 15:
gefiltert = []
for temperatur in celsius_temperaturen:
if temperatur >= 15:
gefiltert.append(temperatur)
print(gefiltert)
print() | 31.8 | 139 | 0.669811 |
2173d7a0d159688bd01411cec21550906d3676e9 | 20,614 | py | Python | Bert/modeling.py | SmileTM/paper_coding | 992c4ff95358649130958d10b9dbe0bb31b6d1cb | [
"Apache-2.0"
] | 3 | 2020-02-14T17:05:59.000Z | 2020-11-16T03:41:07.000Z | Bert/modeling.py | SmileTM/paper_coding | 992c4ff95358649130958d10b9dbe0bb31b6d1cb | [
"Apache-2.0"
] | null | null | null | Bert/modeling.py | SmileTM/paper_coding | 992c4ff95358649130958d10b9dbe0bb31b6d1cb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# File: modeling.py
# Author: SmileTM
# Site: s-tm.cn
# Github: https://github.com/SmileTM
# Time: 02.09.2020
#
import tensorflow as tf
import utils
import copy
import json
import six
class BertConfig(object):
def __init__(self,
vocab_size=30522, # 字典大小
... | 45.606195 | 114 | 0.579703 |
96f04db0c6ebb8cd2fbf8cbb698fadabe1d378a5 | 2,429 | py | Python | abcli/commands/csv/classify.py | john5f35/abcli | fa696cf6bcc2f26fbd754e01952553ce09e5e006 | [
"MIT"
] | 3 | 2019-10-19T15:07:34.000Z | 2022-01-07T01:49:24.000Z | abcli/commands/csv/classify.py | john5f35/abcli | fa696cf6bcc2f26fbd754e01952553ce09e5e006 | [
"MIT"
] | null | null | null | abcli/commands/csv/classify.py | john5f35/abcli | fa696cf6bcc2f26fbd754e01952553ce09e5e006 | [
"MIT"
] | 1 | 2022-03-12T03:22:29.000Z | 2022-03-12T03:22:29.000Z | import csv
import logging
import re
from pathlib import Path
from pprint import PrettyPrinter
import click
import yaml
from abcli.utils import PathType
pformat = PrettyPrinter().pformat
logger = logging.getLogger()
def classify(txns: [dict], rulebook: dict) -> ([dict], int):
restxns = []
def _lookup_ruleb... | 31.141026 | 116 | 0.645121 |
80ac54c228d273e31c5a2a723b6d2a4643ed42f5 | 1,942 | py | Python | libraries/botbuilder-core/botbuilder/core/__init__.py | congysu/botbuilder-python | 274663dd91c811bae6ac4488915ba5880771b0a7 | [
"MIT"
] | null | null | null | libraries/botbuilder-core/botbuilder/core/__init__.py | congysu/botbuilder-python | 274663dd91c811bae6ac4488915ba5880771b0a7 | [
"MIT"
] | null | null | null | libraries/botbuilder-core/botbuilder/core/__init__.py | congysu/botbuilder-python | 274663dd91c811bae6ac4488915ba5880771b0a7 | [
"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.
# ---------------------------------------------------------------------... | 38.078431 | 83 | 0.659629 |
b00d21e7e3c96f5b3d581f223d3818e1259bd694 | 3,648 | py | Python | mycwpjt/mycwpjt/middlewares.py | aibittek/PythonSpider | 64b2d6f8fe016d79a990ee735754b811cf285df0 | [
"MIT"
] | null | null | null | mycwpjt/mycwpjt/middlewares.py | aibittek/PythonSpider | 64b2d6f8fe016d79a990ee735754b811cf285df0 | [
"MIT"
] | null | null | null | mycwpjt/mycwpjt/middlewares.py | aibittek/PythonSpider | 64b2d6f8fe016d79a990ee735754b811cf285df0 | [
"MIT"
] | null | null | null | # Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class MycwpjtSpiderMiddleware:
... | 35.076923 | 78 | 0.674342 |
ab13e8e7fc69150cbc4bb5aa0e3772435d69d37a | 29,848 | py | Python | tests/unit/lib/schemas/test_schemas_api_caller.py | G4brym/aws-sam-cli | 0601140f031f5b325b1861b298a6a589cf9c072b | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2019-05-01T08:27:35.000Z | 2019-05-01T08:27:35.000Z | tests/unit/lib/schemas/test_schemas_api_caller.py | G4brym/aws-sam-cli | 0601140f031f5b325b1861b298a6a589cf9c072b | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-10-05T17:15:43.000Z | 2020-10-05T17:15:43.000Z | tests/unit/lib/schemas/test_schemas_api_caller.py | G4brym/aws-sam-cli | 0601140f031f5b325b1861b298a6a589cf9c072b | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2021-11-29T19:10:17.000Z | 2021-11-29T19:10:17.000Z | import io
import tempfile
from unittest.mock import Mock, call
from unittest import TestCase
import botocore
from botocore.exceptions import WaiterError
from samcli.lib.schemas.schemas_constants import DEFAULT_EVENT_SOURCE, DEFAULT_EVENT_DETAIL_TYPE
from samcli.commands.exceptions import SchemasApiException
from sam... | 57.957282 | 171 | 0.615586 |
89c42b7c4edbffece3c822fb68e5f419cefc32a6 | 1,677 | py | Python | dyslexia/app/api.py | SharonBrg/batch9_dyslexia | 97d1584ca9e0e834a311e98d7fd3549ae0901328 | [
"MIT"
] | null | null | null | dyslexia/app/api.py | SharonBrg/batch9_dyslexia | 97d1584ca9e0e834a311e98d7fd3549ae0901328 | [
"MIT"
] | null | null | null | dyslexia/app/api.py | SharonBrg/batch9_dyslexia | 97d1584ca9e0e834a311e98d7fd3549ae0901328 | [
"MIT"
] | null | null | null | from dyslexia.app import pipeline
from dyslexia.app.errors import NoTextFoundError, ImageBlurryError
from dyslexia.io import load_image_from_string
from PIL import Image
from io import BytesIO
import numpy as np
def load_image_into_numpy_array(data):
return np.array(Image.open(BytesIO(data)))
def get_results(d... | 29.421053 | 79 | 0.665474 |
559069d2a2f804d1795ae1c149d30702d5375349 | 3,785 | py | Python | membershipmanagement/hooks.py | parthagrawal9/MembershipManagement | 11a61475a135da4d73efdfbd742b79b4ed261a0f | [
"MIT"
] | null | null | null | membershipmanagement/hooks.py | parthagrawal9/MembershipManagement | 11a61475a135da4d73efdfbd742b79b4ed261a0f | [
"MIT"
] | null | null | null | membershipmanagement/hooks.py | parthagrawal9/MembershipManagement | 11a61475a135da4d73efdfbd742b79b4ed261a0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "membershipmanagement"
app_title = "Members"
app_publisher = "Parth - M20Zero"
app_description = "Membership Management System"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = ... | 25.066225 | 88 | 0.692734 |
8310e7b4d71b5e1bfb1b1c40cd7d107e4de10bf9 | 1,851 | py | Python | flask_api.py | IK-R-S/flask-api | fd5b1b56181c9272e62326a064e6c10eb2727db3 | [
"MIT"
] | 2 | 2021-11-06T15:12:22.000Z | 2022-02-28T22:43:42.000Z | flask_api.py | IK-R-S/flask-api | fd5b1b56181c9272e62326a064e6c10eb2727db3 | [
"MIT"
] | null | null | null | flask_api.py | IK-R-S/flask-api | fd5b1b56181c9272e62326a064e6c10eb2727db3 | [
"MIT"
] | null | null | null | import requests
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/")
def home():
return """
<h1>Bem vindo ao exemplo básico de API com Flask!</h1>
<p>Nesse exemplo você pode explorar as seguintes rotas, algumas delas com parâmetros:</p>
<li><a href="/olamundo">Olá mundo no f... | 28.921875 | 127 | 0.615343 |
7b2bccc0f9db1d3a3646604f94ac9c330a27494b | 2,674 | py | Python | dvc/command/pkg.py | zb0th/dvc | 5fdbc1882f73162419d5b84ed47a33e9e321f151 | [
"Apache-2.0"
] | 1 | 2020-07-25T08:23:32.000Z | 2020-07-25T08:23:32.000Z | dvc/command/pkg.py | aliseramirez/dvc | 92cc9f7e6f19f3b92f43e28131fe50c20b297214 | [
"Apache-2.0"
] | null | null | null | dvc/command/pkg.py | aliseramirez/dvc | 92cc9f7e6f19f3b92f43e28131fe50c20b297214 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import argparse
import logging
from dvc.exceptions import DvcException
from dvc.command.base import CmdBase, fix_subparsers, append_doc_link
logger = logging.getLogger(__name__)
class CmdPkgInstall(CmdBase):
def run(self):
try:
self.repo.pkg.install(... | 29.711111 | 76 | 0.618175 |
1444af2072201f142ac237687dca77258cdf9cdf | 1,843 | py | Python | gennav/envs/base.py | threewisemonkeys-as/gennav | 41e86b841a0ce44402f31debc65d5c82109b13a3 | [
"MIT"
] | null | null | null | gennav/envs/base.py | threewisemonkeys-as/gennav | 41e86b841a0ce44402f31debc65d5c82109b13a3 | [
"MIT"
] | null | null | null | gennav/envs/base.py | threewisemonkeys-as/gennav | 41e86b841a0ce44402f31debc65d5c82109b13a3 | [
"MIT"
] | null | null | null | class Environment(object):
"""
Base class for an envrionment.
An environment object should encapsulate all data processing
related to a specific environment representation and should
provide the ability to check for collision using this API
"""
def get_status(self, state):
... | 30.716667 | 84 | 0.640803 |
108fb0a494ed3eeac305be8125ced8fbd2efd592 | 7,667 | py | Python | zoofs/dragonflyoptimization.py | ganesh3/zoofs | 8f2109b5316d4b1ab42f25419dd80ae1d0582e89 | [
"Apache-2.0"
] | null | null | null | zoofs/dragonflyoptimization.py | ganesh3/zoofs | 8f2109b5316d4b1ab42f25419dd80ae1d0582e89 | [
"Apache-2.0"
] | null | null | null | zoofs/dragonflyoptimization.py | ganesh3/zoofs | 8f2109b5316d4b1ab42f25419dd80ae1d0582e89 | [
"Apache-2.0"
] | null | null | null | import plotly.graph_objects as go
from zoofs.baseoptimizationalgorithm import BaseOptimizationAlgorithm
import numpy as np
import pandas as pd
import logging as log
class DragonFlyOptimization(BaseOptimizationAlgorithm):
"""
Dragon Fly Optimization
Parameters
----------
objective_function: use... | 45.636905 | 161 | 0.589018 |
ab6a5a018d17bea76d1611f7e1b8a162e26e3f07 | 2,107 | py | Python | chaospy/descriptives/quantity_of_interest.py | agonzs11/Polinomio-del-caos | 5a415ece07e6535488174bac69a6c0fcc2ca272d | [
"MIT"
] | 1 | 2020-04-29T20:53:25.000Z | 2020-04-29T20:53:25.000Z | chaospy/descriptives/quantity_of_interest.py | agonzs11/Polinomio-del-caos | 5a415ece07e6535488174bac69a6c0fcc2ca272d | [
"MIT"
] | null | null | null | chaospy/descriptives/quantity_of_interest.py | agonzs11/Polinomio-del-caos | 5a415ece07e6535488174bac69a6c0fcc2ca272d | [
"MIT"
] | null | null | null | import numpy
from .. import distributions, poly as polynomials
from ..external import SampleDist
def QoI_Dist(poly, dist, sample=10000, **kws):
"""
Constructs distributions for the quantity of interests.
The function constructs a kernel density estimator (KDE) for each
polynomial (poly) by sampling ... | 30.1 | 79 | 0.619364 |
b5d041c8c768aa936280fc7e3b3ce1c0ff239740 | 11,301 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py | toptaldev92/tensorflow | 1fd1f65d1b0896149e44a1f105267c27994010d9 | [
"Apache-2.0"
] | 2 | 2019-07-05T15:17:01.000Z | 2020-04-16T07:25:56.000Z | tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py | kiliczsh/tensorflow | f49aca4532c155597c669cf2189f211cafbebf96 | [
"Apache-2.0"
] | 1 | 2021-04-12T03:51:59.000Z | 2021-04-12T03:51:59.000Z | tensorflow/contrib/distributions/python/kernel_tests/distribution_util_test.py | kiliczsh/tensorflow | f49aca4532c155597c669cf2189f211cafbebf96 | [
"Apache-2.0"
] | 1 | 2021-04-22T09:17:52.000Z | 2021-04-22T09:17:52.000Z | # Copyright 2016 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... | 36.931373 | 80 | 0.637377 |
192df4ac7d4b320dbd5a89a50bbadbd326738208 | 1,227 | py | Python | tests/unit/html/test_regular_season_player_box_scores_table.py | tttgm/basketball_reference_web_scraper | 2dbd9d7bacbcfee17f08bcf8629bd7d50893761d | [
"MIT"
] | 325 | 2015-10-27T03:15:49.000Z | 2022-03-16T06:49:12.000Z | tests/unit/html/test_regular_season_player_box_scores_table.py | tttgm/basketball_reference_web_scraper | 2dbd9d7bacbcfee17f08bcf8629bd7d50893761d | [
"MIT"
] | 173 | 2018-10-16T04:11:05.000Z | 2022-03-29T17:52:08.000Z | tests/unit/html/test_regular_season_player_box_scores_table.py | tttgm/basketball_reference_web_scraper | 2dbd9d7bacbcfee17f08bcf8629bd7d50893761d | [
"MIT"
] | 97 | 2016-04-09T19:11:28.000Z | 2022-03-21T09:57:50.000Z | from unittest import TestCase
from unittest.mock import MagicMock
from basketball_reference_web_scraper.html import PlayerSeasonBoxScoresTable, PlayerSeasonBoxScoresRow
class TestPlayerSeasonBoxScoresTable(TestCase):
def setUp(self):
self.html = MagicMock()
def test_rows_query(self):
self.as... | 39.580645 | 102 | 0.717196 |
4ceb9cfdb1f68aaf5d3b8b8d51f43e192da3501e | 11,178 | py | Python | doc/conf.py | AnnIsaacs7/PypeIt | 07e84b1885bd136aa6e33916bb15d24d8e405c2c | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | AnnIsaacs7/PypeIt | 07e84b1885bd136aa6e33916bb15d24d8e405c2c | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | AnnIsaacs7/PypeIt | 07e84b1885bd136aa6e33916bb15d24d8e405c2c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# PypeIt documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 13 13:39:35 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 32.213256 | 104 | 0.71927 |
ef958845d70e683f6818234a3c71540e85e9aa81 | 26,858 | py | Python | yyetsweb/handler.py | kuyacai/YYeTsBot | 9d73aecce87dc3a0f0ebc6da230d548555d00a59 | [
"MIT"
] | 1 | 2021-09-14T19:45:53.000Z | 2021-09-14T19:45:53.000Z | yyetsweb/handler.py | kuyacai/YYeTsBot | 9d73aecce87dc3a0f0ebc6da230d548555d00a59 | [
"MIT"
] | 3 | 2022-02-28T14:37:36.000Z | 2022-03-31T14:31:05.000Z | yyetsweb/handler.py | kuyacai/YYeTsBot | 9d73aecce87dc3a0f0ebc6da230d548555d00a59 | [
"MIT"
] | 1 | 2021-09-16T14:30:34.000Z | 2021-09-16T14:30:34.000Z | #!/usr/local/bin/python3
# coding: utf-8
# YYeTsBot - handler.py
# 6/16/21 20:30
#
__author__ = "Benny <benny.think@gmail.com>"
import contextlib
import importlib
import json
import logging
import os
import re
import sys
import time
import uuid
from concurrent.futures import ThreadPoolExecutor
from datetime import d... | 30.076148 | 119 | 0.627113 |
f1518de746aa823bafcd534f1a182c0d9465f9ce | 850 | py | Python | easy/21.py | pisskidney/leetcode | 08c19cbf3d7afc897908ea05db4ad11a5487f523 | [
"MIT"
] | null | null | null | easy/21.py | pisskidney/leetcode | 08c19cbf3d7afc897908ea05db4ad11a5487f523 | [
"MIT"
] | null | null | null | easy/21.py | pisskidney/leetcode | 08c19cbf3d7afc897908ea05db4ad11a5487f523 | [
"MIT"
] | null | null | null | """
21. Merge Two Sorted Lists
https://leetcode.com/problems/merge-two-sorted-lists/
"""
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeTwoLists(self, list1: Optional[ListNode], list2: Optio... | 19.318182 | 104 | 0.497647 |
2d4b7572ecca73027bd482cf0fa94446cfcb48af | 10,077 | py | Python | tools/tcptop.py | amadio/bcc | 57e7af7c8ac8e32b2ad62d973ae63edcddc8a32c | [
"Apache-2.0"
] | null | null | null | tools/tcptop.py | amadio/bcc | 57e7af7c8ac8e32b2ad62d973ae63edcddc8a32c | [
"Apache-2.0"
] | null | null | null | tools/tcptop.py | amadio/bcc | 57e7af7c8ac8e32b2ad62d973ae63edcddc8a32c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# tcptop Summarize TCP send/recv throughput by host.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: tcptop [-h] [-C] [-S] [-p PID] [interval [count]]
#
# This uses dynamic tracing of kernel functions, and will need to be updated
# to mat... | 32.401929 | 85 | 0.628262 |
f22c073970b181796df511e591af946f9ffbc9dd | 1,195 | py | Python | libpysal/io/iohandlers/tests/test_dat.py | Kanahiro/dbf-df-translator | 6603ca1ac306203bf8c95e6545685c509324a438 | [
"MIT"
] | null | null | null | libpysal/io/iohandlers/tests/test_dat.py | Kanahiro/dbf-df-translator | 6603ca1ac306203bf8c95e6545685c509324a438 | [
"MIT"
] | null | null | null | libpysal/io/iohandlers/tests/test_dat.py | Kanahiro/dbf-df-translator | 6603ca1ac306203bf8c95e6545685c509324a438 | [
"MIT"
] | null | null | null | import unittest
from ...fileio import FileIO as psopen
from ..dat import DatIO
from .... import examples as pysal_examples
import tempfile
import os
class test_DatIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal_examples.get_path("wmat.dat")
self.obj = DatIO(test_file, "r... | 25.978261 | 72 | 0.609205 |
461daf837402df13de840b1c692fbdc7f747b923 | 921 | py | Python | examples/src/dbnd_examples/tests/documentation/orchestration/task_pipeline/test_doc_tasks_pipeline_data.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | null | null | null | examples/src/dbnd_examples/tests/documentation/orchestration/task_pipeline/test_doc_tasks_pipeline_data.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | null | null | null | examples/src/dbnd_examples/tests/documentation/orchestration/task_pipeline/test_doc_tasks_pipeline_data.py | dmytrostriletskyi/dbnd | d4a5f5167523e80439c9d64182cdc87b40cbc48f | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from pandas import DataFrame
from dbnd import pipeline, task
from dbnd_examples.data import data_repo
class TestDocTasksPipelinesData:
def test_pipelines(self):
#### DOC START
@task
def prepare_data(data: pd.DataFrame) -> pd.DataFrame:
return data
... | 24.236842 | 61 | 0.602606 |
2a419057ed32d0d72a2ab5830767804b84e6235c | 2,259 | py | Python | test.py | alexanderAustin/PythonGame | 9a3da340ffa426d3c6d59b5c2eb3f2a68792164f | [
"Apache-2.0"
] | null | null | null | test.py | alexanderAustin/PythonGame | 9a3da340ffa426d3c6d59b5c2eb3f2a68792164f | [
"Apache-2.0"
] | null | null | null | test.py | alexanderAustin/PythonGame | 9a3da340ffa426d3c6d59b5c2eb3f2a68792164f | [
"Apache-2.0"
] | null | null | null | # This was built from the tutorial https://www.raywenderlich.com/24252/beginning-game-programming-for-teens-with-python
import pygame, math, random
from pygame.locals import *
import pyganim
# 2 - Initialize the game
pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height))
pygame.display... | 30.945205 | 119 | 0.683046 |
b621cb59c0ed009598f40990176147fe3f91b518 | 4,522 | py | Python | python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py | Li-fAngyU/Paddle | e548f65f96697830035a28f9070b40829408ccdb | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py | Li-fAngyU/Paddle | e548f65f96697830035a28f9070b40829408ccdb | [
"Apache-2.0"
] | 1 | 2022-01-28T07:23:22.000Z | 2022-01-28T07:23:22.000Z | python/paddle/fluid/tests/unittests/xpu/test_reduce_prod_op_xpu.py | Li-fAngyU/Paddle | e548f65f96697830035a28f9070b40829408ccdb | [
"Apache-2.0"
] | 1 | 2022-03-02T11:36:03.000Z | 2022-03-02T11:36:03.000Z | # Copyright (c) 2022 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... | 30.761905 | 97 | 0.591331 |
caa406032938b7e25578bb3a27ddeba8b923fdb0 | 8,887 | py | Python | blueprint/py/bp/rules/logical.py | andrey-mishchenko/blueprint-oss | 3bad9258571a0e08c53a9a05061e8461a1e62567 | [
"MIT"
] | 7 | 2021-08-16T09:17:31.000Z | 2022-02-16T01:27:08.000Z | blueprint/py/bp/rules/logical.py | andrey-mishchenko/blueprint-oss | 3bad9258571a0e08c53a9a05061e8461a1e62567 | [
"MIT"
] | null | null | null | blueprint/py/bp/rules/logical.py | andrey-mishchenko/blueprint-oss | 3bad9258571a0e08c53a9a05061e8461a1e62567 | [
"MIT"
] | 1 | 2021-08-11T20:17:06.000Z | 2021-08-11T20:17:06.000Z | """Logic-related Blueprint rules."""
from dataclasses import dataclass, replace
from typing import Callable, Iterable, Optional, Tuple
from uuid import uuid4
from ..document import Document
from ..entity import Entity
from ..extraction import Field
from ..rule import AtomDegree, AtomScore, DegreeError, Predicate, Rul... | 28.123418 | 80 | 0.68212 |
830d38317439ee3c1af0c103232e9e3b0a93b0d7 | 12,573 | py | Python | tests/test_recs.py | datastax-labs/sperf | 934248642c4ef6b5d944153fe45628a4bc3825fb | [
"Apache-2.0"
] | 12 | 2020-05-27T20:21:10.000Z | 2021-10-14T14:39:50.000Z | tests/test_recs.py | datastax-labs/sperf | 934248642c4ef6b5d944153fe45628a4bc3825fb | [
"Apache-2.0"
] | 43 | 2020-05-02T07:11:45.000Z | 2021-10-01T15:16:17.000Z | tests/test_recs.py | datastax-labs/sperf | 934248642c4ef6b5d944153fe45628a4bc3825fb | [
"Apache-2.0"
] | 11 | 2020-05-28T16:15:07.000Z | 2021-12-03T07:58:39.000Z | # Copyright 2020 DataStax, 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 law or agreed to in writing,... | 37.198225 | 101 | 0.619502 |
13cd859d1acb8a6c02f5ae17b43725a486dc5bad | 1,058 | py | Python | exercicios_antigos/desafios/arquivos_endereco_ip.py | jfklima/prog_pratica | 72c795e3372e46f04ce0c92c05187aec651777cf | [
"MIT"
] | null | null | null | exercicios_antigos/desafios/arquivos_endereco_ip.py | jfklima/prog_pratica | 72c795e3372e46f04ce0c92c05187aec651777cf | [
"MIT"
] | null | null | null | exercicios_antigos/desafios/arquivos_endereco_ip.py | jfklima/prog_pratica | 72c795e3372e46f04ce0c92c05187aec651777cf | [
"MIT"
] | null | null | null | # arquivo de endereços ip
# arquivo de endereços ip validados
# enderecos de ip valido são aqueles que tem quatro números sepados por ponto e
# que cada número não pode ultrapassar o valor de 255 ou seja não pode ser
# maior que 255
def validar(ip):
numeros = ip.split('.')
if len(numeros) !=4:
return... | 25.190476 | 79 | 0.642722 |
a969ba7c4229c588d38e01f66824780334ab253e | 1,639 | py | Python | heat/tests/convergence/scenarios/multiple_update.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 265 | 2015-01-02T09:33:22.000Z | 2022-03-26T23:19:54.000Z | heat/tests/convergence/scenarios/multiple_update.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 8 | 2015-09-01T15:43:19.000Z | 2021-12-14T05:18:23.000Z | heat/tests/convergence/scenarios/multiple_update.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 295 | 2015-01-06T07:00:40.000Z | 2021-09-06T08:05:06.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 32.137255 | 78 | 0.61928 |
788e12b31825b6459f6b7cca6f98ec7680998208 | 7,859 | py | Python | kbr/dbase/__init__.py | brugger/kbr-tools-dbase | 0704e14c48bde6a9233b649ec12992e99a8cac73 | [
"MIT"
] | 1 | 2021-02-02T09:47:40.000Z | 2021-02-02T09:47:40.000Z | kbr/dbase/__init__.py | brugger/kbr-tools-dbase | 0704e14c48bde6a9233b649ec12992e99a8cac73 | [
"MIT"
] | 1 | 2021-08-04T13:00:00.000Z | 2021-08-04T13:00:00.000Z | kbr/db_utils.py | brugger/kbr-tools | 95c8f8274e28b986e7fd91c8404026433488c940 | [
"MIT"
] | null | null | null | """
Generica low level function for interacting with a database through the records package
"""
import sys
import os
import pprint
pp = pprint.PrettyPrinter(indent=4)
import records
class DB( object ):
def __init__( self, url:str) -> bool:
""" connects to a database instance
Args:
... | 24.107362 | 119 | 0.473088 |
2a7e9b3c03bd16bc817718fed5aa6386ae79b749 | 7,069 | py | Python | data/p3BR/R2/benchmark/startQiskit_QC302.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_QC302.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_QC302.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=61
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 31.699552 | 140 | 0.638138 |
60b6c6ead60943891b9261f5369955c994eb57de | 2,434 | py | Python | test/functional/test.py | WojciechRynczuk/vcdMaker | 9432d45164806d583016df586f515b0e335304e6 | [
"MIT"
] | 32 | 2016-02-08T13:09:58.000Z | 2021-12-22T11:50:42.000Z | test/functional/test.py | WojciechRynczuk/vcdMaker | 9432d45164806d583016df586f515b0e335304e6 | [
"MIT"
] | 46 | 2016-07-13T12:21:26.000Z | 2020-12-27T17:19:36.000Z | test/functional/test.py | WojciechRynczuk/vcdMaker | 9432d45164806d583016df586f515b0e335304e6 | [
"MIT"
] | 1 | 2018-01-05T06:15:09.000Z | 2018-01-05T06:15:09.000Z | # test.py
#
# The base test class.
#
# Copyright (c) 2019 vcdMaker team
#
# 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... | 32.891892 | 79 | 0.687346 |
aea05f79290935c6c3b81bf19b3cf6097eeac81d | 4,706 | py | Python | env/lib/python3.7/site-packages/docusign_admin/models/organization_export_request.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/docusign_admin/models/organization_export_request.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/docusign_admin/models/organization_export_request.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
DocuSign Admin API
An API for an organization administrator to manage organizations, accounts and users # noqa: E501
OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa... | 28.011905 | 102 | 0.586698 |
460ff914475ee1f4d2b8bd0d9de1408b5ac91652 | 1,874 | py | Python | tests/providers/google/cloud/operators/test_spanner_system.py | rliuamzn/airflow | 177dfbd12a42a5c229640c6c830f43f280ea5caa | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-07-30T17:29:38.000Z | 2022-03-06T08:44:23.000Z | tests/providers/google/cloud/operators/test_spanner_system.py | rliuamzn/airflow | 177dfbd12a42a5c229640c6c830f43f280ea5caa | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | tests/providers/google/cloud/operators/test_spanner_system.py | rliuamzn/airflow | 177dfbd12a42a5c229640c6c830f43f280ea5caa | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2020-06-30T02:38:17.000Z | 2022-01-19T06:14:08.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 35.358491 | 103 | 0.698506 |
c329758bd0d46b668156ac82780d503864939eb3 | 12,781 | py | Python | aiokafka/errors.py | FedirAlifirenko/aiokafka | 96159c6f74873005d0c123b07ec80fb1756f6c8a | [
"Apache-2.0"
] | null | null | null | aiokafka/errors.py | FedirAlifirenko/aiokafka | 96159c6f74873005d0c123b07ec80fb1756f6c8a | [
"Apache-2.0"
] | null | null | null | aiokafka/errors.py | FedirAlifirenko/aiokafka | 96159c6f74873005d0c123b07ec80fb1756f6c8a | [
"Apache-2.0"
] | null | null | null | import inspect
import sys
from kafka.errors import (
KafkaError,
IllegalStateError,
IllegalArgumentError,
NoBrokersAvailable,
NodeNotReadyError,
KafkaProtocolError,
CorrelationIdError,
Cancelled,
TooManyInFlightRequests,
StaleMetadata,
UnrecognizedBrokerVersion,
CommitFa... | 29.86215 | 79 | 0.720757 |
ed9046fdb3f832f4d2f80de84558d0259baf482f | 2,027 | py | Python | qiskit/converters/dag_to_circuit.py | romainfd/qiskit-terra | b5285ccc5cb1d17b7c73402833f2750b93652426 | [
"Apache-2.0"
] | null | null | null | qiskit/converters/dag_to_circuit.py | romainfd/qiskit-terra | b5285ccc5cb1d17b7c73402833f2750b93652426 | [
"Apache-2.0"
] | null | null | null | qiskit/converters/dag_to_circuit.py | romainfd/qiskit-terra | b5285ccc5cb1d17b7c73402833f2750b93652426 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 33.229508 | 84 | 0.637889 |
4a01ce0f082c4036e643a52aae0a64ca444f8803 | 15,002 | py | Python | projects/image_chat/transresnet_multimodal/transresnet_multimodal.py | harunpehlivan/ParlAI | e1f2942feb8f158964477f4a46bc2c4c741b2ccd | [
"MIT"
] | 1 | 2019-07-25T17:30:18.000Z | 2019-07-25T17:30:18.000Z | projects/image_chat/transresnet_multimodal/transresnet_multimodal.py | abisee/ParlAI | 5507d4745ca23b23af311673a6b0d1b7e72eb5cd | [
"MIT"
] | null | null | null | projects/image_chat/transresnet_multimodal/transresnet_multimodal.py | abisee/ParlAI | 5507d4745ca23b23af311673a6b0d1b7e72eb5cd | [
"MIT"
] | 1 | 2019-07-28T14:53:18.000Z | 2019-07-28T14:53:18.000Z | #!/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.
"""Transresnet Multimodal Model (https://arxiv.org/abs/1811.00945)."""
from parlai.core.dict import DictionaryAgent
from... | 35.804296 | 91 | 0.571724 |
8cc86864d54ff32def0d2c405eac9387d5e6c3d3 | 3,888 | py | Python | src/vulnpy/trigger/ssrf.py | lostsnow/vulnpy | ebdba9658b38f6282dffaf02286c3460a28a7afe | [
"MIT"
] | null | null | null | src/vulnpy/trigger/ssrf.py | lostsnow/vulnpy | ebdba9658b38f6282dffaf02286c3460a28a7afe | [
"MIT"
] | 1 | 2022-02-07T07:43:35.000Z | 2022-02-07T07:43:35.000Z | src/vulnpy/trigger/ssrf.py | lostsnow/vulnpy | ebdba9658b38f6282dffaf02286c3460a28a7afe | [
"MIT"
] | 1 | 2022-01-12T02:50:14.000Z | 2022-01-12T02:50:14.000Z | """
In PY3, urllib2 was ported mostly to urllib.request.
The original PY2 urllib module is unique to PY2.
In this module, we use urllib2 and urllib.request methods
interchangeably depending on the version of python. We refer
to the original PY2 urllib module as "legacy".
"""
import io
import mock
import os
from urll... | 26.09396 | 78 | 0.729424 |
b08a53f8f2cca5db35c0a916d013c15bb78601ae | 11,815 | py | Python | lib/rucio/client/ruleclient.py | mageirakos/rucio | d783ab74bc8d398656e98253ab2547de1f120ea9 | [
"Apache-2.0"
] | null | null | null | lib/rucio/client/ruleclient.py | mageirakos/rucio | d783ab74bc8d398656e98253ab2547de1f120ea9 | [
"Apache-2.0"
] | null | null | null | lib/rucio/client/ruleclient.py | mageirakos/rucio | d783ab74bc8d398656e98253ab2547de1f120ea9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... | 47.26 | 151 | 0.620652 |
dfb97bec15ebde74e8a91f92daea8efc241db44a | 1,410 | py | Python | parla/comps/determiter/pcg.py | rileyjmurray/parla | b1f638cb60913c98c75fd721ca002521344fc3cf | [
"BSD-3-Clause"
] | 6 | 2021-12-07T16:52:26.000Z | 2022-03-10T15:35:02.000Z | parla/comps/determiter/pcg.py | rileyjmurray/parla | b1f638cb60913c98c75fd721ca002521344fc3cf | [
"BSD-3-Clause"
] | 1 | 2022-01-12T20:30:38.000Z | 2022-01-12T23:04:34.000Z | parla/comps/determiter/pcg.py | rileyjmurray/parla | b1f638cb60913c98c75fd721ca002521344fc3cf | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy.linalg as la
def pcg(mv_mat, rhs, mv_pre, iter_lim, tol, x0):
# mv_mat is a function handle, representing mv_mat(vec) = mat @ vec
# for a positive definite matrix mat.
#
# Use PCG to solve mat @ x == rhs.
#
# mv_pre is a function handle, representing mv_pre(vec)... | 29.375 | 84 | 0.551064 |
2ebf9fa7dfb072c0f8cdd90788adbd199305d280 | 213,810 | py | Python | bpytop.py | caughtquick/bpytop | 56f80fcf3258008e302a28d7bab93fdf3238c007 | [
"Apache-2.0"
] | null | null | null | bpytop.py | caughtquick/bpytop | 56f80fcf3258008e302a28d7bab93fdf3238c007 | [
"Apache-2.0"
] | null | null | null | bpytop.py | caughtquick/bpytop | 56f80fcf3258008e302a28d7bab93fdf3238c007 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# pylint: disable=not-callable, no-member, unsubscriptable-object
# indent = tab
# tab-size = 4
# Copyright 2021 Aristocratos (jakob@qvantnet.com)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | 37.802334 | 541 | 0.632463 |
1bbeb584d661c3ceb8c4da58baca1c42906a21ca | 24,181 | py | Python | build/lib/slowfast/datasets/ptv_datasets.py | shir3bar/SlowFast | 9a234526ee2056db8b9f89845ed34f70da225ba0 | [
"Apache-2.0"
] | null | null | null | build/lib/slowfast/datasets/ptv_datasets.py | shir3bar/SlowFast | 9a234526ee2056db8b9f89845ed34f70da225ba0 | [
"Apache-2.0"
] | null | null | null | build/lib/slowfast/datasets/ptv_datasets.py | shir3bar/SlowFast | 9a234526ee2056db8b9f89845ed34f70da225ba0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import numpy
numpy.random.normal()
import functools
import os
from typing import Dict
import torch
from torch.utils.data import (
DistributedSampler,
RandomSampler,
SequentialSampler,
)
from torchvision.transforms import Comp... | 32.89932 | 117 | 0.538274 |
e4b894bf1b40aca3b88e3b9db3fe6390c3009216 | 330 | py | Python | ProjectEuler/problem_5.py | aaditkamat/competitive-programming | d0b8f30d3cb3411d2467b98363c12d75d852e245 | [
"MIT"
] | null | null | null | ProjectEuler/problem_5.py | aaditkamat/competitive-programming | d0b8f30d3cb3411d2467b98363c12d75d852e245 | [
"MIT"
] | 3 | 2019-02-24T11:42:28.000Z | 2019-06-03T14:15:46.000Z | ProjectEuler/problem_5.py | aaditkamat/online-judge-submissions | d0b8f30d3cb3411d2467b98363c12d75d852e245 | [
"MIT"
] | null | null | null | def gcd(x, y):
arr = []
for i in range(1, min(x, y) + 1):
if x % i == 0 and y % i == 0:
arr.append(i)
return arr[-1]
def lcm(x, y):
return (x * y) // gcd(x, y)
def solution(num):
result = 2
for i in range(3, num):
result = lcm(result, i)
return result
print(sol... | 19.411765 | 37 | 0.484848 |
83d45b714290133d8387d707a3aae43625fa7c53 | 2,484 | py | Python | tests/flask_app.py | renovate-tests/talisker | ba313b6e52677852560e89365c58efe7b091c6ca | [
"Apache-2.0"
] | null | null | null | tests/flask_app.py | renovate-tests/talisker | ba313b6e52677852560e89365c58efe7b091c6ca | [
"Apache-2.0"
] | null | null | null | tests/flask_app.py | renovate-tests/talisker | ba313b6e52677852560e89365c58efe7b091c6ca | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2015-2018 Canonical, Ltd.
#
# This file is part of Talisker
# (see http://github.com/canonical-ols/talisker).
#
# 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
# regardin... | 28.551724 | 75 | 0.716989 |
46459adaa9e429a94a3c24cbb9447a9f7195065d | 3,003 | py | Python | src/OTLMOW/OTLModel/Classes/PoEInjector.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/OTLModel/Classes/PoEInjector.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/OTLModel/Classes/PoEInjector.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.AIMNaamObject import AIMNaamObject
from OTLMOW.OTLModel.Datatypes.DtcDocument import DtcDocument
from OTLMOW.OTLModel.Datatypes.KlPoEInjectorMerk import KlPoEInjectorMerk
from OTLMOW.OTLModel.Datatypes.KlPoEInj... | 44.161765 | 140 | 0.602398 |
820fce50da6dd16183668d25b5ac23caaf5ea9b3 | 8,012 | py | Python | customize.py | Denaro1234/Covid-dashboard | 46d94e87b5fb68eb41290d2cd4f2a24c3e8ef381 | [
"CC-BY-4.0"
] | null | null | null | customize.py | Denaro1234/Covid-dashboard | 46d94e87b5fb68eb41290d2cd4f2a24c3e8ef381 | [
"CC-BY-4.0"
] | null | null | null | customize.py | Denaro1234/Covid-dashboard | 46d94e87b5fb68eb41290d2cd4f2a24c3e8ef381 | [
"CC-BY-4.0"
] | null | null | null | import streamlit as st
import os
PATH = os.path.abspath('')
def page_config():
'''This function is built-in streamlit function for page configuration'''
st.set_page_config(
page_title="Covid-19 Dashboard",
page_icon=PATH + os.sep + 'data/icon.png'
)
def container_map():
'''This funct... | 30.697318 | 341 | 0.593984 |
378a256524d8d02946963e6b0e4fed279f4d7678 | 14,999 | py | Python | records_mover/db/bigquery/load_job_config_options.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 36 | 2020-03-17T11:56:51.000Z | 2022-01-19T16:03:32.000Z | records_mover/db/bigquery/load_job_config_options.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 60 | 2020-03-02T23:13:29.000Z | 2021-05-19T15:05:42.000Z | records_mover/db/bigquery/load_job_config_options.py | cwegrzyn/records-mover | e3b71d6c09d99d0bcd6a956b9d09d20f8abe98d2 | [
"Apache-2.0"
] | 4 | 2020-08-11T13:17:37.000Z | 2021-11-05T21:11:52.000Z | from ...utils import quiet_remove
from ...records.delimited import cant_handle_hint
from typing import Set
from ...records.load_plan import RecordsLoadPlan
from ...records.records_format import (
DelimitedRecordsFormat, ParquetRecordsFormat, AvroRecordsFormat
)
from records_mover.records.delimited import ValidatedR... | 42.014006 | 125 | 0.688246 |
b6a324f2c022792d45551fdca822f6e706869066 | 862 | py | Python | .ci/build.py | clayne/gtirb | df9bf69537c36136d40fbff98588df37b8c5875f | [
"MIT"
] | null | null | null | .ci/build.py | clayne/gtirb | df9bf69537c36136d40fbff98588df37b8c5875f | [
"MIT"
] | null | null | null | .ci/build.py | clayne/gtirb | df9bf69537c36136d40fbff98588df37b8c5875f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import subprocess
import sys
import conanfile
def run_conan(args):
cmd = ["conan"] + args
print("running: %s" % " ".join(cmd))
sys.stdout.flush()
subprocess.check_call(cmd)
def build(argv):
props = conanfile.Properties()
run_conan(["create", ".", props.conan_ref] + arg... | 24.628571 | 73 | 0.611369 |
36176a4369f6963b7bf80bfb16357a82b77c14c5 | 1,678 | py | Python | tutorials/W1D5_Regularization/solutions/W1D5_Tutorial1_Solution_23bb8e1a.py | carsen-stringer/course-content-dl | 27749aec56a3d2a43b3890483675ad0338a2680f | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | tutorials/W1D5_Regularization/solutions/W1D5_Tutorial1_Solution_23bb8e1a.py | carsen-stringer/course-content-dl | 27749aec56a3d2a43b3890483675ad0338a2680f | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | tutorials/W1D5_Regularization/solutions/W1D5_Tutorial1_Solution_23bb8e1a.py | carsen-stringer/course-content-dl | 27749aec56a3d2a43b3890483675ad0338a2680f | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | def early_stopping_main(args, model, train_loader, val_loader):
device = args['device']
model = model.to(device)
optimizer = optim.SGD(model.parameters(),
lr=args['lr'],
momentum=args['momentum'])
best_acc = 0.0
best_epoch = 0
# Number of successive epochs t... | 26.634921 | 114 | 0.681168 |
253d8b9c58af2cb1bb477071172967e4472a9d69 | 540 | py | Python | tests/core/forms.py | marksweb/django-import-export | 26977ed44ff8f2c9769b14bc69f0b41f3524da6d | [
"BSD-2-Clause"
] | 2,020 | 2015-05-20T02:41:40.000Z | 2022-03-31T14:37:50.000Z | tests/core/forms.py | marksweb/django-import-export | 26977ed44ff8f2c9769b14bc69f0b41f3524da6d | [
"BSD-2-Clause"
] | 1,195 | 2015-05-19T15:28:11.000Z | 2022-03-31T16:56:16.000Z | tests/core/forms.py | marksweb/django-import-export | 26977ed44ff8f2c9769b14bc69f0b41f3524da6d | [
"BSD-2-Clause"
] | 680 | 2015-05-27T16:54:17.000Z | 2022-03-31T07:56:09.000Z | from django import forms
from import_export.forms import ConfirmImportForm, ImportForm
from .models import Author
class AuthorFormMixin(forms.Form):
author = forms.ModelChoiceField(queryset=Author.objects.all(),
required=True)
class CustomImportForm(AuthorFormMixin, ImportF... | 25.714286 | 66 | 0.735185 |
f5dfffa725c9ba0ee03eba0f70794b0e30ed402c | 2,379 | py | Python | kubernetes/test/test_com_coreos_monitoring_v1_prometheus_spec_probe_selector.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_com_coreos_monitoring_v1_prometheus_spec_probe_selector.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_com_coreos_monitoring_v1_prometheus_spec_probe_selector.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... | 37.761905 | 272 | 0.691047 |
2f041687f12514d436d8dca0080a7a268ffff4a1 | 16,727 | py | Python | helper_scripts/post_processing/run_all.py | chubbymaggie/difuze | f5074953014eec98954c4b50cb0db33ebd00d29e | [
"BSD-2-Clause"
] | 21 | 2018-05-28T03:08:40.000Z | 2021-12-16T09:50:48.000Z | helper_scripts/post_processing/run_all.py | JackBro/difuze | 964c8051a3bc6b04319cdc715303bb57e9e453d1 | [
"BSD-2-Clause"
] | 4 | 2019-04-23T10:14:14.000Z | 2020-05-07T08:41:00.000Z | helper_scripts/post_processing/run_all.py | JackBro/difuze | 964c8051a3bc6b04319cdc715303bb57e9e453d1 | [
"BSD-2-Clause"
] | 6 | 2018-10-25T05:04:09.000Z | 2020-12-01T08:28:25.000Z | import sys
import os
import glob
import subprocess
import md5
import argparse
out_dir = 'out/'
xml_dir = 'xml/'
generics_dir = 'generics/'
commons_dir = 'common/'
class Struct(object):
def __init__(self):
self.vals = []
def __getitem__(self, idx):
return self.vals[idx]
def add_val... | 33.655936 | 304 | 0.569857 |
a19317db99ecc5656366838a3d6783e33daac5b5 | 3,059 | py | Python | test/TempFileMunge/TEMPFILESUFFIX.py | janem-msu/scons | 40f815f687b93afa6ef4deb7293a26e869402cca | [
"MIT"
] | null | null | null | test/TempFileMunge/TEMPFILESUFFIX.py | janem-msu/scons | 40f815f687b93afa6ef4deb7293a26e869402cca | [
"MIT"
] | null | null | null | test/TempFileMunge/TEMPFILESUFFIX.py | janem-msu/scons | 40f815f687b93afa6ef4deb7293a26e869402cca | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, subl... | 27.558559 | 83 | 0.704479 |
bf61decc4a7117550ca0e7b3ed0a2a9cf1b70c6a | 3,167 | py | Python | seqcluster/libs/do.py | lpantano/seqcluster | e4ef3581e6a16a31ae1f3d2bb5a83bef3ed84e26 | [
"MIT"
] | 33 | 2015-01-26T23:18:01.000Z | 2022-01-07T21:40:49.000Z | seqcluster/libs/do.py | lpantano/seqcluster | e4ef3581e6a16a31ae1f3d2bb5a83bef3ed84e26 | [
"MIT"
] | 44 | 2015-01-21T17:43:42.000Z | 2021-08-25T15:49:18.000Z | seqcluster/libs/do.py | lpantano/seqcluster | e4ef3581e6a16a31ae1f3d2bb5a83bef3ed84e26 | [
"MIT"
] | 18 | 2015-05-18T15:34:32.000Z | 2021-02-10T17:58:24.000Z | """Centralize running of external commands, providing logging and tracking. Integrated from bcbio package with some changes.
"""
import collections
import os
import subprocess
import logging
try:
basestring
except NameError:
basestring = str
logger = logging.getLogger("run")
def run(cmd, data=None, checks=N... | 35.188889 | 124 | 0.615093 |
2482645bfe0b53a3d77a3944d0becb58a07dd6fe | 4,156 | py | Python | src/pytest_benchmark/hookspec.py | Ekultek/pytest-benchmark | cdfab1379b64fea7fa28cb868d768606e10cede2 | [
"BSD-2-Clause"
] | null | null | null | src/pytest_benchmark/hookspec.py | Ekultek/pytest-benchmark | cdfab1379b64fea7fa28cb868d768606e10cede2 | [
"BSD-2-Clause"
] | null | null | null | src/pytest_benchmark/hookspec.py | Ekultek/pytest-benchmark | cdfab1379b64fea7fa28cb868d768606e10cede2 | [
"BSD-2-Clause"
] | 1 | 2021-04-22T08:54:07.000Z | 2021-04-22T08:54:07.000Z | def pytest_benchmark_generate_machine_info(config):
"""
To completely replace the generated machine_info do something like this:
.. sourcecode:: python
def pytest_benchmark_update_machine_info(config):
return {'user': getpass.getuser()}
"""
pass
def pytest_benchmark_update_ma... | 31.725191 | 120 | 0.672522 |
f534b28874f53b5f9c467ab891cdcbb51dc8f53c | 11,033 | py | Python | plugins/modules/oci_healthchecks_http_monitor_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_healthchecks_http_monitor_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_healthchecks_http_monitor_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 32.545723 | 133 | 0.591498 |
bb670586ae5153c457ff5a88c9fad0659426cc65 | 1,244 | py | Python | tests/float/float1.py | 0x0ece/micropython | 4ee07f4883136dfbd1795dea3b04c478072d5630 | [
"MIT"
] | null | null | null | tests/float/float1.py | 0x0ece/micropython | 4ee07f4883136dfbd1795dea3b04c478072d5630 | [
"MIT"
] | null | null | null | tests/float/float1.py | 0x0ece/micropython | 4ee07f4883136dfbd1795dea3b04c478072d5630 | [
"MIT"
] | null | null | null | # test basic float capabilities
# literals
print(.12)
print(1.)
print(1.2)
# float construction
print(float(1.2))
# unary operators
print(bool(0.0))
print(bool(1.2))
print(+(1.2))
print(-(1.2))
# division of integers
x = 1 / 2
print(x)
# /= operator
a = 1
a /= 2
print(a)
# floor division
print(1.0 // 2)
print(2.0... | 17.277778 | 302 | 0.722669 |
21b59cf1f9b78bb9824798ef0bcc3ca7754aa7ec | 675 | py | Python | Leetcode/0632. Smallest Range Covering Elements from K Lists/0632.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0632. Smallest Range Covering Elements from K Lists/0632.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0632. Smallest Range Covering Elements from K Lists/0632.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | class Solution:
def smallestRange(self, nums: List[List[int]]) -> List[int]:
minHeap = [(row[0], i, 0) for i, row in enumerate(nums)]
heapq.heapify(minHeap)
maxRange = max(row[0] for row in nums)
minRange = heapq.nsmallest(1, minHeap)[0][0]
ans = [minRange, maxRange]
while len(minHeap) == le... | 33.75 | 62 | 0.580741 |
d954041a77119f7fa3df54692d23a434e8357d8e | 17,647 | py | Python | kai/reduce/slalib.py | skterry/KAI | b8ccf003bf892692bdf00f4bd112e2a7a2938a5b | [
"BSD-3-Clause"
] | 1 | 2021-07-26T18:56:24.000Z | 2021-07-26T18:56:24.000Z | kai/reduce/slalib.py | skterry/KAI | b8ccf003bf892692bdf00f4bd112e2a7a2938a5b | [
"BSD-3-Clause"
] | null | null | null | kai/reduce/slalib.py | skterry/KAI | b8ccf003bf892692bdf00f4bd112e2a7a2938a5b | [
"BSD-3-Clause"
] | 1 | 2015-11-05T07:39:11.000Z | 2015-11-05T07:39:11.000Z | import math
def refco(HM, TDK, PMB, RH, WL, PHI, TLR, EPS):
"""
Determine the constants A and B in the atmospheric refraction
model dZ = A tan Z + B tan**3 Z.
Z is the "observed" zenith distance (i.e. affected by refraction)
and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
... | 34.875494 | 81 | 0.576132 |
45adbece26d8f636297e7907914b77581dfacfad | 23,534 | py | Python | waterbutler/core/provider.py | alexschiller/waterbutler | 24014d7705aca3e99a6565fc3b9b4075ec6ec563 | [
"Apache-2.0"
] | null | null | null | waterbutler/core/provider.py | alexschiller/waterbutler | 24014d7705aca3e99a6565fc3b9b4075ec6ec563 | [
"Apache-2.0"
] | null | null | null | waterbutler/core/provider.py | alexschiller/waterbutler | 24014d7705aca3e99a6565fc3b9b4075ec6ec563 | [
"Apache-2.0"
] | null | null | null | import abc
import time
import asyncio
import logging
import weakref
import functools
import itertools
from urllib import parse
import furl
import aiohttp
from waterbutler import settings
from waterbutler.core import streams
from waterbutler.core import exceptions
from waterbutler.core.utils import ZipStreamGenerator
... | 40.091993 | 114 | 0.633849 |
4e1fac032bbf33462ef2282a0675c8904ea80a2f | 45,014 | py | Python | python-packages/sra_client/sra_client/api/default_api.py | dave4506/0x-monorepo | fdcad84cee45781a06cab6b6b17f4a48c275d713 | [
"Apache-2.0"
] | 2 | 2019-04-14T01:03:32.000Z | 2019-04-14T01:03:33.000Z | python-packages/sra_client/sra_client/api/default_api.py | Lambda07/0x-monorepo | c78a60299053f0ec825bf34dd3ea0cea7bb9365b | [
"Apache-2.0"
] | null | null | null | python-packages/sra_client/sra_client/api/default_api.py | Lambda07/0x-monorepo | c78a60299053f0ec825bf34dd3ea0cea7bb9365b | [
"Apache-2.0"
] | 1 | 2021-05-02T08:24:10.000Z | 2021-05-02T08:24:10.000Z | # coding: utf-8
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from sra_client.api_client import ApiClient
from sra_client.models.relayer_api_order_config_payload_schema import (
RelayerApiOrderConfigPayloadSchema,
)
class DefaultApi(ob... | 41.52583 | 91 | 0.630826 |
89f22eb82b36c1ca4e1014553f66004d5056e4ab | 867 | py | Python | test/test_allocator_switch.py | ntruessel/qcgc | e3ed7fc854d07aea98f5f09525ff43c867724c70 | [
"MIT"
] | 74 | 2016-05-21T17:34:20.000Z | 2021-12-23T04:28:00.000Z | test/test_allocator_switch.py | ntruessel/qcgc | e3ed7fc854d07aea98f5f09525ff43c867724c70 | [
"MIT"
] | 3 | 2017-04-03T15:18:50.000Z | 2017-04-03T15:29:55.000Z | test/test_allocator_switch.py | ntruessel/qcgc | e3ed7fc854d07aea98f5f09525ff43c867724c70 | [
"MIT"
] | 3 | 2017-01-01T05:15:06.000Z | 2020-10-07T13:37:55.000Z | from support import lib,ffi
from qcgc_test import QCGCTest
import unittest
class AllocatorSwitchTest(QCGCTest):
def test_simple_switch(self):
objs = list()
for _ in range(lib.qcgc_arena_cells_count - lib.qcgc_arena_first_cell_index - 1):
o = self.allocate(1)
self.push_root(o... | 33.346154 | 89 | 0.665513 |
a764e90b06d37cfb03189f414afa48d868159e0b | 343 | py | Python | python/ray/experimental/dag/__init__.py | dsctt/ray | 29d94a22114b02adfd3745c4991a3ce70592dd16 | [
"Apache-2.0"
] | 1 | 2022-03-22T11:17:22.000Z | 2022-03-22T11:17:22.000Z | python/ray/experimental/dag/__init__.py | dsctt/ray | 29d94a22114b02adfd3745c4991a3ce70592dd16 | [
"Apache-2.0"
] | 32 | 2021-11-06T07:11:42.000Z | 2022-03-19T07:14:00.000Z | python/ray/experimental/dag/__init__.py | dsctt/ray | 29d94a22114b02adfd3745c4991a3ce70592dd16 | [
"Apache-2.0"
] | null | null | null | from ray.experimental.dag.dag_node import DAGNode
from ray.experimental.dag.function_node import FunctionNode
from ray.experimental.dag.class_node import ClassNode, ClassMethodNode
from ray.experimental.dag.input_node import InputNode
__all__ = [
"ClassNode",
"ClassMethodNode",
"DAGNode",
"FunctionNod... | 24.5 | 70 | 0.769679 |
b14343fd25759a48f7df674a18b52b9ad1862851 | 355 | py | Python | search/linear_search/python/linear_search.py | AsociTon/hacktoberfest-2018 | 1d90736ba2ef68233019230e26a3813a7d3b85f6 | [
"MIT"
] | 26 | 2018-10-01T14:52:06.000Z | 2021-05-29T06:06:50.000Z | search/linear_search/python/linear_search.py | AsociTon/hacktoberfest-2018 | 1d90736ba2ef68233019230e26a3813a7d3b85f6 | [
"MIT"
] | 89 | 2018-10-01T14:58:36.000Z | 2019-10-07T15:30:45.000Z | search/linear_search/python/linear_search.py | AsociTon/hacktoberfest-2018 | 1d90736ba2ef68233019230e26a3813a7d3b85f6 | [
"MIT"
] | 147 | 2018-10-01T12:31:40.000Z | 2021-05-09T16:12:44.000Z | print("PROGRAM FOR LINEAR SEARCH")
array = [44,1,55,23,54,6546,234,987]
found = 0
while True:
query = int(input("Enter element to search in array:"))
for i in range(len(array)):
if array[i]==query:
print("Element found at index {}".format(i))
found = 1
if found==0:
... | 22.1875 | 59 | 0.577465 |
175cda87c4e862ebe6a4d0796d91303c1161bbbf | 1,937 | py | Python | leetcode_python/Hash_table/card-flipping-game.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Hash_table/card-flipping-game.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Hash_table/card-flipping-game.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# http://bookshadow.com/weblog/2018/04/22/leetcode-card-flipping-game/
# IDEA : GREEDY
class Solution(object):
def flipgame(self, fronts, backs):
"""
:type fronts: List[int]
:type backs: List[int]
:rtype: int
"""
numbers = set(fronts + backs)
for... | 27.671429 | 81 | 0.519876 |
dfa24d88fb0f3f9375e5185d48fde8c126c8155a | 885 | py | Python | test/test_inline_response20045.py | nrfta/python-netbox-client | 68ba6dd4d7306513dc1ad38f3ac59122ba4f70a8 | [
"MIT"
] | null | null | null | test/test_inline_response20045.py | nrfta/python-netbox-client | 68ba6dd4d7306513dc1ad38f3ac59122ba4f70a8 | [
"MIT"
] | null | null | null | test/test_inline_response20045.py | nrfta/python-netbox-client | 68ba6dd4d7306513dc1ad38f3ac59122ba4f70a8 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
NetBox API
API to access NetBox # noqa: E501
OpenAPI spec version: 2.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import netbox_client
from netbox_client.models.inline_response20045 import I... | 21.585366 | 95 | 0.709605 |
d842f8a7f8056f440f893bb3c774df5137d3126a | 8,828 | py | Python | authlete/django/web/access_token_validator.py | authlete/authlete-python-django | ccdfecbac5205a7ed7c14186b5ea4552fd390d2c | [
"Apache-2.0"
] | 6 | 2019-08-10T03:07:05.000Z | 2020-11-06T13:59:29.000Z | authlete/django/web/access_token_validator.py | authlete/authlete-python-django | ccdfecbac5205a7ed7c14186b5ea4552fd390d2c | [
"Apache-2.0"
] | null | null | null | authlete/django/web/access_token_validator.py | authlete/authlete-python-django | ccdfecbac5205a7ed7c14186b5ea4552fd390d2c | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2019 Authlete, 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 law or agreed to in ... | 38.889868 | 100 | 0.660625 |
70518292d721c752d4af7eb3883098a70522725a | 10,519 | py | Python | fixture/contact.py | MsScribe/python_training | b25593e3c17710f055d8dd48678df2a7deead4f6 | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | MsScribe/python_training | b25593e3c17710f055d8dd48678df2a7deead4f6 | [
"Apache-2.0"
] | null | null | null | fixture/contact.py | MsScribe/python_training | b25593e3c17710f055d8dd48678df2a7deead4f6 | [
"Apache-2.0"
] | null | null | null | from model.contact import ContactMainInfo
from selenium.webdriver.support.select import Select
import re
import random
class ContactHelper:
def __init__(self, app):
self.app = app
def open_contact_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/addressbook/") and len(wd... | 46.135965 | 223 | 0.667839 |
9e2073599f44298ffdd12606cb023cb625646a8d | 1,667 | py | Python | config/wsgi.py | kingsdigitallab/tvof-django | 12cb0aec4e155345a13602c7d7dfd0882ec92129 | [
"MIT"
] | null | null | null | config/wsgi.py | kingsdigitallab/tvof-django | 12cb0aec4e155345a13602c7d7dfd0882ec92129 | [
"MIT"
] | 33 | 2019-12-04T22:37:50.000Z | 2022-02-10T07:15:35.000Z | config/wsgi.py | kingsdigitallab/tvof-django | 12cb0aec4e155345a13602c7d7dfd0882ec92129 | [
"MIT"
] | null | null | null | """
WSGI config for The Values of French 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 the ``WSGI_A... | 42.74359 | 79 | 0.80144 |
7db00635d2543683eebdc9111a116ad1e0ae8d7f | 27,618 | py | Python | pybrreg/xml/generated/manifest.py | unicornis/pybrreg | ecb471065795ae4bba1d5b3466756df8e8db848e | [
"MIT"
] | null | null | null | pybrreg/xml/generated/manifest.py | unicornis/pybrreg | ecb471065795ae4bba1d5b3466756df8e8db848e | [
"MIT"
] | null | null | null | pybrreg/xml/generated/manifest.py | unicornis/pybrreg | ecb471065795ae4bba1d5b3466756df8e8db848e | [
"MIT"
] | null | null | null | # ./manifest.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:c3674a9b44a4a4edf84a5ac08485c938ac789a94
# Generated 2016-08-10 10:54:40.034890 by PyXB version 1.2.4 using Python 2.7.5.final.0
# Namespace http://schema.altinn.no/services/ServiceEngine/Broker/2015/06
from __future__ import unicode_literals
import pyxb
i... | 54.906561 | 387 | 0.765805 |
ec7ef5cf291555c32e1144675119b7c949c12d49 | 269 | py | Python | pyleanrtm/protocol/json_protocol.py | sunng87/pyleanrtm | 794c6841cd1137553d8e4defbc9191a5065984b6 | [
"BSD-3-Clause"
] | null | null | null | pyleanrtm/protocol/json_protocol.py | sunng87/pyleanrtm | 794c6841cd1137553d8e4defbc9191a5065984b6 | [
"BSD-3-Clause"
] | null | null | null | pyleanrtm/protocol/json_protocol.py | sunng87/pyleanrtm | 794c6841cd1137553d8e4defbc9191a5065984b6 | [
"BSD-3-Clause"
] | null | null | null | import json
from pyleanrtm.protocol import BaseProtocol
class JsonProtocol(BaseProtocol):
name = 'lc-json-1'
def encode(self, cmd):
return json.dumps(cmd)
def decode(self, msg):
return json.loads(str(msg))
json_protocol = JsonProtocol()
| 19.214286 | 43 | 0.687732 |
c5b084394c45cdc7271abd48c296226cdfab4243 | 21,846 | py | Python | intern_practice/ArticutAPI/Demos/PrimarySchoolMath/intentFunction.py | howardsukuan/LokiHub | eaa3cc7299b25192353ed0bfe65c14a4c4b1e082 | [
"MIT"
] | 375 | 2019-05-01T15:15:35.000Z | 2022-03-18T00:54:33.000Z | Demos/PrimarySchoolMath/intentFunction.py | lpluo54/ArticutAPI | 366dd9956d0ee3bd81b422844015101168b4bd34 | [
"MIT"
] | 1 | 2019-07-05T06:50:09.000Z | 2020-08-16T10:02:15.000Z | Demos/PrimarySchoolMath/intentFunction.py | lpluo54/ArticutAPI | 366dd9956d0ee3bd81b422844015101168b4bd34 | [
"MIT"
] | 30 | 2019-09-01T11:17:37.000Z | 2021-12-28T23:05:06.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import json
import os
import re
import requests
try:
infoPath = "{}/account.info".format(os.path.dirname(os.path.abspath(__file__)))
infoDICT = json.load(open(infoPath, "r"))
USERNAME = infoDICT["username"]
API_KEY = infoDICT["api_key"]
LOKI_KEY = info... | 43.345238 | 148 | 0.529113 |
954fa496fb0b4df23c4401a9fe2a772558cb0fae | 1,680 | py | Python | gae/apps/auth_ndb/rest_authentication.py | paulormart/gae-project-skeleton-100 | cf9f174d4209b213292fd267b241590102a74a68 | [
"MIT"
] | null | null | null | gae/apps/auth_ndb/rest_authentication.py | paulormart/gae-project-skeleton-100 | cf9f174d4209b213292fd267b241590102a74a68 | [
"MIT"
] | null | null | null | gae/apps/auth_ndb/rest_authentication.py | paulormart/gae-project-skeleton-100 | cf9f174d4209b213292fd267b241590102a74a68 | [
"MIT"
] | null | null | null |
from rest_framework.authentication import BaseAuthentication
from rest_framework.authentication import get_authorization_header
from rest_framework import exceptions
from .models import User as UserModel
class TokenAuthentication(BaseAuthentication):
"""
Simple token based authentication.
Clients should... | 31.698113 | 81 | 0.688095 |
7ce7aea5cd58ae1758788d52fd00c0540b898cea | 927 | py | Python | web200-4/poc.py | mehrdad-shokri/CTF_web | 206529603af3824fc8117166ff978af3495f5a58 | [
"MIT"
] | 664 | 2016-08-23T01:03:00.000Z | 2022-03-20T17:02:45.000Z | web200-4/poc.py | CTFshow/CTF_web | 206529603af3824fc8117166ff978af3495f5a58 | [
"MIT"
] | 12 | 2016-09-09T07:25:12.000Z | 2021-10-05T21:11:48.000Z | web200-4/poc.py | CTFshow/CTF_web | 206529603af3824fc8117166ff978af3495f5a58 | [
"MIT"
] | 203 | 2016-10-17T02:15:33.000Z | 2021-10-17T06:36:37.000Z | import requests
import threading
def test():
while True:
try:
url = "http://web7.08067.me/web7/input"
data = {'value': 'http://127.0.0.1%0d%0aCONFIG%20SET%20dir%20%2ftmp%0d%0aCONFIG%20SET%20dbfilename%20evil%0d%0aSET%20admin%20xx00%0d%0aSAVE%0d%0a:6379/foo'}
requests.post... | 28.090909 | 168 | 0.563107 |
aada2cc349d21ebcc22520568c8ccfa148b3099b | 5,418 | py | Python | workbench/invoices/views.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 15 | 2020-09-02T22:17:34.000Z | 2022-02-01T20:09:10.000Z | workbench/invoices/views.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 18 | 2020-01-08T15:28:26.000Z | 2022-02-28T02:46:41.000Z | workbench/invoices/views.py | yoshson/workbench | 701558cac3357cd82e4dc99f0fefed12ee81ddc5 | [
"MIT"
] | 8 | 2020-09-29T08:00:24.000Z | 2022-01-16T11:58:19.000Z | import datetime as dt
from collections import defaultdict
from django.contrib import messages
from django.shortcuts import redirect, render
from django.utils.translation import gettext, ngettext
from django.views.decorators.http import require_POST
from workbench import generic
from workbench.invoices.models import I... | 30.438202 | 86 | 0.547988 |
9e2907dfb6eae60c8ce313b4e2c952b6005c906d | 7,100 | py | Python | litex_boards/targets/sqrl_xcu1525.py | smunaut/litex-boards | caac75c7dbcba68d9f4fb948107cb5d6ff60e05f | [
"BSD-2-Clause"
] | 2 | 2021-06-30T22:07:37.000Z | 2022-02-02T06:10:32.000Z | litex_boards/targets/sqrl_xcu1525.py | smunaut/litex-boards | caac75c7dbcba68d9f4fb948107cb5d6ff60e05f | [
"BSD-2-Clause"
] | null | null | null | litex_boards/targets/sqrl_xcu1525.py | smunaut/litex-boards | caac75c7dbcba68d9f4fb948107cb5d6ff60e05f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex_boards.platforms import xcu1525... | 42.51497 | 128 | 0.547606 |
f4a869e817e6cb41d286746960bb532392db8df1 | 753 | py | Python | utils/Helpers.py | bdhingra/coref-gru | 9360a53cafc4f8d4f53e4fcded273ba62a68e484 | [
"BSD-2-Clause"
] | 14 | 2018-10-05T00:16:05.000Z | 2021-01-15T08:24:40.000Z | utils/Helpers.py | bdhingra/coref-gru | 9360a53cafc4f8d4f53e4fcded273ba62a68e484 | [
"BSD-2-Clause"
] | 2 | 2018-11-29T13:21:31.000Z | 2018-12-07T02:49:03.000Z | utils/Helpers.py | bdhingra/coref-gru | 9360a53cafc4f8d4f53e4fcded273ba62a68e484 | [
"BSD-2-Clause"
] | 6 | 2019-01-11T10:33:04.000Z | 2021-02-26T03:52:38.000Z | import numpy as np
EMBED_DIM=128
def load_word2vec_embeddings(dictionary, vocab_embed_file):
if vocab_embed_file is None: return None, EMBED_DIM
fp = open(vocab_embed_file)
info = fp.readline().split()
embed_dim = int(info[1])
vocab_embed = {}
for line in fp:
line = line.split()
... | 26.892857 | 84 | 0.632138 |
1bb9f76ad07c5a8dae45150e4293d491e3e7038c | 94,050 | py | Python | idler.py | aurimas13/IdleIdler | 5dc8ca50a4cb6d287742f5cd77e8504e4df5fc1c | [
"MIT"
] | null | null | null | idler.py | aurimas13/IdleIdler | 5dc8ca50a4cb6d287742f5cd77e8504e4df5fc1c | [
"MIT"
] | null | null | null | idler.py | aurimas13/IdleIdler | 5dc8ca50a4cb6d287742f5cd77e8504e4df5fc1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2021 Robert Osborne
#
# python3 idler.py --help
#
import argparse
import textwrap
import time
import sys
import os
import configparser
import datetime
import distutils
import json
import math
import glob
import shutil
import pyautogui
import pygetwindow as gw
from PIL import Im... | 36.048294 | 228 | 0.561127 |
0360303a8119a78eb7122982d841db4e8be17832 | 4,023 | py | Python | deepstomata/stomata_model.py | totti0223/deepstomata | e4f5dd5d1a65232ed13f6bea6f4d1f02d1494558 | [
"MIT"
] | 5 | 2018-07-10T00:59:59.000Z | 2021-07-02T02:39:33.000Z | deepstomata/stomata_model.py | totti0223/deepstomata | e4f5dd5d1a65232ed13f6bea6f4d1f02d1494558 | [
"MIT"
] | null | null | null | deepstomata/stomata_model.py | totti0223/deepstomata | e4f5dd5d1a65232ed13f6bea6f4d1f02d1494558 | [
"MIT"
] | 3 | 2018-12-21T20:42:02.000Z | 2019-11-02T10:26:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tensorflow as tf
from math import sqrt
MOVING_AVERAGE_DECAY = 0.9999
def tf_inference(images, BATCH_SIZE, image_size, NUM_CLASSES):
def _variable_with_weight_decay(name, shape, stddev, wd):
var = tf.get_variable(name, shape=shape, initializer=tf.trunc... | 55.109589 | 128 | 0.656724 |
82186ff702d7becb45fe10117bb47a0cfd5ddb64 | 22,737 | py | Python | sdk/python/pulumi_mongodbatlas/project_ip_access_list.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2020-04-28T19:12:30.000Z | 2022-03-22T23:04:46.000Z | sdk/python/pulumi_mongodbatlas/project_ip_access_list.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2020-06-12T12:12:52.000Z | 2022-03-28T18:14:50.000Z | sdk/python/pulumi_mongodbatlas/project_ip_access_list.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-09-25T21:22:08.000Z | 2021-08-30T20:06:18.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 49.107991 | 631 | 0.664951 |
066375348ff647f477e0db433ee4238d08535f82 | 14,770 | py | Python | algorithm_and_data_structure/easy_problems/max_profit_tutorial.py | elyor0529/Awesome-Full-Stack-Web-Developer | d7c8a48ba809832270f2061f6872df7b8550699d | [
"MIT"
] | 12 | 2017-11-15T12:48:06.000Z | 2021-12-28T02:28:24.000Z | algorithm_and_data_structure/easy_problems/max_profit_tutorial.py | Dmdv/Awesome-Full-Stack-Web-Developer | d7c8a48ba809832270f2061f6872df7b8550699d | [
"MIT"
] | null | null | null | algorithm_and_data_structure/easy_problems/max_profit_tutorial.py | Dmdv/Awesome-Full-Stack-Web-Developer | d7c8a48ba809832270f2061f6872df7b8550699d | [
"MIT"
] | 7 | 2017-07-14T15:38:32.000Z | 2022-03-25T19:53:08.000Z | # @Author: Keith Schwarz (htiek@cs.stanford.edu)
# @Date: Tue, 14th Mar 2017, T 14:43 +01:00
# @Email: me@anasaboureada.com
# @Project: awesome-full-stack-web-developer
# @Filename: max_profit_tutorial.py
# @Last modified by: anas
# @Last modified time: Tue, 14th Mar 2017, T 14:46 +01:00
# @License: MIT License
# ... | 46.740506 | 79 | 0.697427 |
ba35333c6fd444774accc2f12496509eebe77f7c | 4,150 | py | Python | observatory/dashboard/models/Screenshot.py | natestedman/Observatory | 6e810b22d844416b2a3057e99ef23baa0d122ab4 | [
"0BSD"
] | 1 | 2015-01-16T04:17:54.000Z | 2015-01-16T04:17:54.000Z | observatory/dashboard/models/Screenshot.py | natestedman/Observatory | 6e810b22d844416b2a3057e99ef23baa0d122ab4 | [
"0BSD"
] | null | null | null | observatory/dashboard/models/Screenshot.py | natestedman/Observatory | 6e810b22d844416b2a3057e99ef23baa0d122ab4 | [
"0BSD"
] | null | null | null | # Copyright (c) 2010, individual contributors (see AUTHORS file)
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" ... | 34.87395 | 79 | 0.675181 |
eb206cad622a448b6d3bfb4109bb2d6233f04bcb | 535 | py | Python | att_cybersecurity_alienvault_otx/setup.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | att_cybersecurity_alienvault_otx/setup.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | att_cybersecurity_alienvault_otx/setup.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name='att_cybersecurity_alienvault_otx-rapid7-plugin',
version='1.0.1',
description='Open Threat Exchange is the neighborhood watch of the global intelligence community',
author='rapid7',
author_email='',... | 35.666667 | 104 | 0.71215 |
b359d5f9c3478c40ddf979b07267dd5b8c989a2a | 23,912 | py | Python | tests/contrib/tornado/test_tornado_web.py | melancholy/dd-trace-py | 32d463e5465466bc876c85a45880a84824d9b47c | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | tests/contrib/tornado/test_tornado_web.py | melancholy/dd-trace-py | 32d463e5465466bc876c85a45880a84824d9b47c | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | tests/contrib/tornado/test_tornado_web.py | melancholy/dd-trace-py | 32d463e5465466bc876c85a45880a84824d9b47c | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | import pytest
import tornado
from ddtrace import config
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.constants import ORIGIN_KEY
from ddtrace.constants import SAMPLING_PRIORITY_KEY
from ddtrace.ext import http
from tests.opentracer.utils import init_tracer
from tests.utils import assert_is_meas... | 39.986622 | 117 | 0.651096 |
05099511de6d6b1e2ed0f1f5277805d66fb05665 | 27,424 | py | Python | planet/api/client.py | Godron629/planet-client-python | 6e8fcb6028ba1de9d1ca25141d1402aba4344572 | [
"Apache-2.0"
] | null | null | null | planet/api/client.py | Godron629/planet-client-python | 6e8fcb6028ba1de9d1ca25141d1402aba4344572 | [
"Apache-2.0"
] | null | null | null | planet/api/client.py | Godron629/planet-client-python | 6e8fcb6028ba1de9d1ca25141d1402aba4344572 | [
"Apache-2.0"
] | 1 | 2018-01-28T05:11:20.000Z | 2018-01-28T05:11:20.000Z | # Copyright 2015 Planet Labs, 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 law or agreed to in writ... | 40.809524 | 105 | 0.607825 |
1f8940a43a3fb6f69f1e349133c8b608d0e14bfd | 66,603 | py | Python | airflow/jobs/scheduler_job.py | ganeshsrirams/airflow | b8c02632136320b8379956411134246cd2f6eb47 | [
"Apache-2.0"
] | null | null | null | airflow/jobs/scheduler_job.py | ganeshsrirams/airflow | b8c02632136320b8379956411134246cd2f6eb47 | [
"Apache-2.0"
] | null | null | null | airflow/jobs/scheduler_job.py | ganeshsrirams/airflow | b8c02632136320b8379956411134246cd2f6eb47 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 41.862351 | 130 | 0.579599 |
7d156194a0293321df3b2191953f99c068f230c7 | 170 | py | Python | manager/admin.py | Emiliemorais/ido | 5b0c8b9a3ba006c221b7768370d2593cc38d3a17 | [
"BSD-2-Clause"
] | null | null | null | manager/admin.py | Emiliemorais/ido | 5b0c8b9a3ba006c221b7768370d2593cc38d3a17 | [
"BSD-2-Clause"
] | null | null | null | manager/admin.py | Emiliemorais/ido | 5b0c8b9a3ba006c221b7768370d2593cc38d3a17 | [
"BSD-2-Clause"
] | null | null | null | from django.contrib import admin
from manager.models import Enterprise
class EnterpriseAdmin(admin.ModelAdmin):
pass
admin.site.register(Enterprise, EnterpriseAdmin) | 28.333333 | 48 | 0.835294 |
6d6e9ef0036957b658de5520d2e68b2692fb86de | 12,794 | py | Python | src/streamlink/plugins/youtube.py | Erk-/streamlink | d240704d1237fb5878960480c3f8951e0c5023b9 | [
"BSD-2-Clause"
] | 2 | 2021-03-29T12:19:06.000Z | 2021-05-06T07:08:04.000Z | resources/lib/streamlink/plugins/youtube.py | jairoxyz/script.module.streamlink_matrix | a29afed7188590595ef06decde8bfee45202cbc0 | [
"BSD-2-Clause"
] | null | null | null | resources/lib/streamlink/plugins/youtube.py | jairoxyz/script.module.streamlink_matrix | a29afed7188590595ef06decde8bfee45202cbc0 | [
"BSD-2-Clause"
] | null | null | null | import json
import logging
import re
from html import unescape
from urllib.parse import urlparse, urlunparse
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.plugin.api import useragents, validate
from streamlink.plugin.api.utils import itertags
from streamlink.stream import HLSStream, ... | 37.300292 | 125 | 0.553619 |
20cf87c3ea8aec899dc05b715818537728bcac23 | 180 | py | Python | src/globals_consts.py | Command-Master/MCCC | a49440bfd8542002aee35d41bee093dc8b51d781 | [
"MIT"
] | 6 | 2021-01-15T03:49:01.000Z | 2021-11-02T10:43:22.000Z | src/globals_consts.py | Command-Master/MCCC | a49440bfd8542002aee35d41bee093dc8b51d781 | [
"MIT"
] | null | null | null | src/globals_consts.py | Command-Master/MCCC | a49440bfd8542002aee35d41bee093dc8b51d781 | [
"MIT"
] | null | null | null | from collections import namedtuple
NAMESPACE = 'mccc'
cname = lambda x: type(x).__name__
return_types = {}
arguments = {}
BinaryOp = namedtuple('BinaryOp', ['op', 'left', 'right']) | 30 | 58 | 0.705556 |
ed886913f87c71e5100df1dff85767a6eea7e84b | 6,465 | py | Python | citrus_pest_diseases_recognition/Bridge_VGG19.py | xingshulicc/xingshulicc | 8009b44732bf5d01cb0463146ab9f370c694af29 | [
"MIT"
] | 10 | 2018-11-27T06:38:17.000Z | 2021-10-24T02:11:58.000Z | citrus_pest_diseases_recognition/Bridge_VGG19.py | xingshulicc/xingshulicc | 8009b44732bf5d01cb0463146ab9f370c694af29 | [
"MIT"
] | 2 | 2020-04-18T06:46:11.000Z | 2021-03-04T08:00:27.000Z | citrus_pest_diseases_recognition/Bridge_VGG19.py | xingshulicc/xingshulicc | 8009b44732bf5d01cb0463146ab9f370c694af29 | [
"MIT"
] | 1 | 2020-12-29T07:41:47.000Z | 2020-12-29T07:41:47.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
"""
Created on Wed Aug 28 09:24:42 2019
@author: xingshuli
"""
from keras.layers import Conv2D
from keras.layers import Dense
from keras.layers import Activation
from keras.layers import MaxPooling2D
from keras.layers import GlobalAveragePooling2D
from ker... | 38.482143 | 122 | 0.608198 |
f2622136e6829e17834956b82caa521de6171600 | 1,546 | py | Python | huskar_api/models/infra/utils.py | mowangdk/huskar | 7692fbc5672a5ae6e2a33616c493466a7137f8cd | [
"MIT"
] | 59 | 2019-10-31T10:50:10.000Z | 2021-11-26T04:32:25.000Z | huskar_api/models/infra/utils.py | mowangdk/huskar | 7692fbc5672a5ae6e2a33616c493466a7137f8cd | [
"MIT"
] | 5 | 2019-10-31T10:37:30.000Z | 2020-03-02T06:45:46.000Z | huskar_api/models/infra/utils.py | mowangdk/huskar | 7692fbc5672a5ae6e2a33616c493466a7137f8cd | [
"MIT"
] | 9 | 2019-10-31T10:35:00.000Z | 2019-12-01T14:13:58.000Z | from __future__ import absolute_import
import re
rfc1738_pattern = re.compile(r'''
(?P<name>[\w\+]+)://
(?:
(?P<username>[^:/]*)
(?::(?P<password>.*))?
@)?
(?:
(?:
\[(?P<ipv6host>[^/]+)\] |
(?P<ipv4host>[^/:]+)
)?
(?::(?P<port>[^/]*))?
... | 26.20339 | 73 | 0.575032 |
33440ab8f41fbb88247329030ab624d4d964475b | 15,676 | py | Python | embedvm/pysrc/embedvm/runtime.py | tcr/avrvm | d356a20ac7b413f332efdc5858bc72c2483a97ee | [
"MIT"
] | 2 | 2020-05-03T07:52:35.000Z | 2021-06-22T15:51:25.000Z | embedvm/pysrc/embedvm/runtime.py | tcr/avrvm | d356a20ac7b413f332efdc5858bc72c2483a97ee | [
"MIT"
] | null | null | null | embedvm/pysrc/embedvm/runtime.py | tcr/avrvm | d356a20ac7b413f332efdc5858bc72c2483a97ee | [
"MIT"
] | null | null | null | from .bytecode import signext, assert_signexted
from . import bytecode
from .python import CodeObject, raising_int, UnboundSetter
from .asm import DataBlock
from collections import namedtuple
import ast
from math import ceil
class Importable(CodeObject):
"""All objects that are supposed to be imported into a EVM P... | 42.02681 | 174 | 0.587459 |
f1f2c7e9ef1a554f5e2227a10d8232e4894e6d98 | 645 | py | Python | ch02/command.py | PacktPublishing/Python-Networking-Cookbook | 26945c781a51fe72cc01409df6b5c5fa7df53f4c | [
"MIT"
] | 5 | 2021-06-11T11:24:04.000Z | 2022-03-22T03:22:57.000Z | ch02/command.py | PacktPublishing/Python-Networking-Cookbook | 26945c781a51fe72cc01409df6b5c5fa7df53f4c | [
"MIT"
] | null | null | null | ch02/command.py | PacktPublishing/Python-Networking-Cookbook | 26945c781a51fe72cc01409df6b5c5fa7df53f4c | [
"MIT"
] | 10 | 2021-04-18T12:31:14.000Z | 2022-03-28T07:21:16.000Z | import time
from paramiko.client import SSHClient
# Credentials here are for a always-on Sandbox from Cisco DevNet
SSH_USER = "<Insert user>"
SSH_PASSWORD = "<insert password>"
SSH_HOST = "<insert host>"
SSH_PORT = 22 # Change this if your SSH port is different
client = SSHClient()
client.load_system_host_keys()
cl... | 26.875 | 68 | 0.682171 |
ff4c17f0d7da699cd84ade4dbaebf62030f8ea3a | 12,740 | py | Python | tests/python/pants_test/backend/codegen/tasks/test_protobuf_gen.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/codegen/tasks/test_protobuf_gen.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/codegen/tasks/test_protobuf_gen.py | qma/pants | 604f58a366b66bc5cfa83e7250cb8af8130832cf | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | 34.432432 | 119 | 0.656122 |
7922abf0fad9d4030ee7bd40e11c9d852a611b37 | 1,993 | py | Python | conanfile.py | db4/conan-pccts | a42f94db9c2389d51c3d180f91c2ef82f4ab2b28 | [
"MIT"
] | null | null | null | conanfile.py | db4/conan-pccts | a42f94db9c2389d51c3d180f91c2ef82f4ab2b28 | [
"MIT"
] | null | null | null | conanfile.py | db4/conan-pccts | a42f94db9c2389d51c3d180f91c2ef82f4ab2b28 | [
"MIT"
] | null | null | null | import os, shutil
from conans import ConanFile, tools
class PcctsConan(ConanFile):
name = "pccts"
version = "1.33MR33"
settings = "os_build", "compiler", "arch_build"
generators = "gcc"
description = "PCCTS toolkit"
license = "public domain"
url = "https://github.com/db4/conan-pccts"
... | 44.288889 | 111 | 0.616658 |
9f2218ed95c32990f1e40540f92062fcd256fb81 | 673 | py | Python | doc/conf.py | otamachan2/sphinxcontrib-ros | 6155cb645e9700add0602d0812275a8a22aad962 | [
"BSD-2-Clause"
] | null | null | null | doc/conf.py | otamachan2/sphinxcontrib-ros | 6155cb645e9700add0602d0812275a8a22aad962 | [
"BSD-2-Clause"
] | null | null | null | doc/conf.py | otamachan2/sphinxcontrib-ros | 6155cb645e9700add0602d0812275a8a22aad962 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
import sphinx_rtd_theme
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
import sphinxcontrib; reload(sphinxcontrib)
extensions = ['sphinxcontrib.ros']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'sphinxcontr... | 29.26087 | 72 | 0.702823 |
d0768d0ca0c17922d391894b0a409b453b80a7f3 | 10,153 | py | Python | pycket/small_list.py | krono/pycket | 5eff3401ce5cf34b16863b669ac9e274edabbe00 | [
"MIT"
] | null | null | null | pycket/small_list.py | krono/pycket | 5eff3401ce5cf34b16863b669ac9e274edabbe00 | [
"MIT"
] | null | null | null | pycket/small_list.py | krono/pycket | 5eff3401ce5cf34b16863b669ac9e274edabbe00 | [
"MIT"
] | null | null | null | from pycket import config
from rpython.rlib import jit, debug, objectmodel
def inline_small_list(sizemax=11, sizemin=0, immutable=False, attrname="list", factoryname="make", unbox_num=False):
"""
This function is helpful if you have a class with a field storing a
list and the list is often very small. Ca... | 36.786232 | 176 | 0.571161 |
a48eb9f199eadbd142322d72558b67621c83bfb1 | 815 | py | Python | Autocoders/src/generators/visitors/TestImplVisitorBase.py | lydiaxing/fprime | f6b3e03f89e9aca1614243c9896d4a72aa0cc726 | [
"Apache-2.0"
] | 2 | 2020-09-08T05:39:05.000Z | 2021-05-04T14:58:51.000Z | Autocoders/src/generators/visitors/TestImplVisitorBase.py | JPLOpenSource/fprime-sw-Rel1.0 | 18364596c24fa369c938ef8758e5aa945ecc6a9b | [
"Apache-2.0"
] | 2 | 2019-02-27T03:17:15.000Z | 2019-03-01T22:34:30.000Z | Autocoders/src/generators/visitors/TestImplVisitorBase.py | JPLOpenSource/fprime-sw-Rel1.0 | 18364596c24fa369c938ef8758e5aa945ecc6a9b | [
"Apache-2.0"
] | 3 | 2019-02-17T20:41:15.000Z | 2019-02-26T21:06:50.000Z | #!/bin/env python
#===============================================================================
# NAME: TestImplVisitorBase.py
#
# DESCRIPTION: A base class for TestImpl visitors
#
# AUTHOR: bocchino
# EMAIL: bocchino@jpl.nasa.gov
# DATE CREATED: November 14, 2015
#
# Copyright 2015, California Institute of Technol... | 30.185185 | 80 | 0.57546 |
bbda033865b84a73a0af11697d73ea7efe95b4be | 1,234 | py | Python | generatePages/updateFooter.py | Sonalisinghal/techhelpher | 226743685d0e72a763db33f312eae2b7a8454d92 | [
"CC-BY-3.0"
] | 1 | 2020-05-30T14:24:22.000Z | 2020-05-30T14:24:22.000Z | generatePages/updateFooter.py | Sonalisinghal/techhelpher | 226743685d0e72a763db33f312eae2b7a8454d92 | [
"CC-BY-3.0"
] | 1 | 2021-03-15T06:18:03.000Z | 2021-03-15T06:18:03.000Z | generatePages/updateFooter.py | Sonalisinghal/techhelpher | 226743685d0e72a763db33f312eae2b7a8454d92 | [
"CC-BY-3.0"
] | null | null | null | import os
from pages import pagelist
startComment = "START AUTO-INSERT FOOTER"
endComment = "END AUTO-INSERT FOOTER"
tempfile = 'nav.temp'
def updatePage():
with open(pageToChange,'r') as file:
orgLines = file.readlines()
with open(pageToChange,'w') as file:
write = True
for x in orgLines:
if e... | 26.255319 | 151 | 0.583468 |
de977a5433adac539e6b00b4ffb185c559d896ce | 549 | py | Python | PBLCoders/convert.py | Tyler929/tyler929.github.io-Tyler929 | f5f0451c55bc12a668b7ad880995c96bd4c0d5ed | [
"MIT"
] | null | null | null | PBLCoders/convert.py | Tyler929/tyler929.github.io-Tyler929 | f5f0451c55bc12a668b7ad880995c96bd4c0d5ed | [
"MIT"
] | null | null | null | PBLCoders/convert.py | Tyler929/tyler929.github.io-Tyler929 | f5f0451c55bc12a668b7ad880995c96bd4c0d5ed | [
"MIT"
] | null | null | null | # asks for name and gender
def storyStart(name, gender):
pronoun = ''
if gender == 'm':
pronoun = 'He'
pronoun1 = "his"
elif gender == 'f':
pronoun = 'She'
# prints variable arguments
print('One stormy day, ' + name + ' was attempting to mine bitcoin.')
print(pronoun + ' w... | 23.869565 | 110 | 0.617486 |
4fd52550bf8badb9bf85b5194aaacd10adf033a9 | 145 | py | Python | test/regression/features/comprehensions/singleton_comprehension.py | ppelleti/berp | 30925288376a6464695341445688be64ac6b2600 | [
"BSD-3-Clause"
] | 137 | 2015-02-13T21:03:23.000Z | 2021-11-24T03:53:55.000Z | test/regression/features/comprehensions/singleton_comprehension.py | ppelleti/berp | 30925288376a6464695341445688be64ac6b2600 | [
"BSD-3-Clause"
] | 4 | 2015-04-01T13:49:13.000Z | 2019-07-09T19:28:56.000Z | test/regression/features/comprehensions/singleton_comprehension.py | bjpop/berp | 30925288376a6464695341445688be64ac6b2600 | [
"BSD-3-Clause"
] | 8 | 2015-04-25T03:47:52.000Z | 2019-07-27T06:33:56.000Z | # list
print([x for x in [1]])
# set
print({x for x in [1]})
# dict
print({x:x for x in [1]})
# gen
for item in (x for x in [1]):
print(item)
| 14.5 | 29 | 0.551724 |
d284e21bdfc81e1268e3608634db92854d9cdc1c | 1,553 | py | Python | test/test_quote.py | major/finvizfinance | f5998ce78f79baa8a63a78e831e950d48cc830c9 | [
"MIT"
] | 1 | 2022-02-12T05:56:29.000Z | 2022-02-12T05:56:29.000Z | test/test_quote.py | major/finvizfinance | f5998ce78f79baa8a63a78e831e950d48cc830c9 | [
"MIT"
] | null | null | null | test/test_quote.py | major/finvizfinance | f5998ce78f79baa8a63a78e831e950d48cc830c9 | [
"MIT"
] | null | null | null | import pytest
from finvizfinance.quote import finvizfinance, Quote, Statements
# def test_finvizfinance_quote(mocker):
# web_scrap_mock = mocker.patch('finvizfinance.quote.web_scrap', return_value={"text": 'web_scrap'})
# Quote().getCurrent('ticker')
# web_scrap_mock.assert_called_with('https://finviz.com... | 38.825 | 104 | 0.749517 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.