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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d91434d2eb3221cf812b6bc50686749baa7552a4 | 28 | py | Python | yehua/theme.py | moremoban/yehua | e90ac103ec28e1101fd845796c02083d52ddf43e | [
"MIT"
] | 19 | 2017-12-08T04:54:15.000Z | 2021-08-19T19:59:19.000Z | yehua/theme.py | moremoban/yehua | e90ac103ec28e1101fd845796c02083d52ddf43e | [
"MIT"
] | 55 | 2018-05-07T04:14:47.000Z | 2021-04-19T17:38:09.000Z | yehua/theme.py | chfw/yehua | e90ac103ec28e1101fd845796c02083d52ddf43e | [
"MIT"
] | 3 | 2017-07-01T14:53:57.000Z | 2017-07-23T02:25:05.000Z | THEME = {"info": "#F47983"}
| 14 | 27 | 0.535714 |
7b0a195737609d034dd6e2505bae558ffa494c59 | 792 | py | Python | sieve.py | msghera/Study-of-Goldbach-Conjecture | 697ef6e3399c16663f0a3a79494e71cc483d219b | [
"MIT"
] | null | null | null | sieve.py | msghera/Study-of-Goldbach-Conjecture | 697ef6e3399c16663f0a3a79494e71cc483d219b | [
"MIT"
] | null | null | null | sieve.py | msghera/Study-of-Goldbach-Conjecture | 697ef6e3399c16663f0a3a79494e71cc483d219b | [
"MIT"
] | null | null | null | class sieve :
def __init__(self, __limit = 1000002):
self.__limit = __limit
self.prime = [2]
self.bs = [1]*__limit
self.bs[0]=0
self.bs[1]=0
for i in range(4, __limit, 2) : self.bs[i] = 0
for i in range(3, __limit, 2) :
if self.bs[i] == 1 :
self.prime.append(i)
for j in range(i*i, __limit, ... | 20.307692 | 52 | 0.604798 |
29cfd576ee96a210b549cdbad3c75dd0cd5c3294 | 4,941 | py | Python | indico/modules/events/abstracts/settings.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | 1 | 2021-06-11T20:02:10.000Z | 2021-06-11T20:02:10.000Z | indico/modules/events/abstracts/settings.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | indico/modules/events/abstracts/settings.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.core.db.sqlalchemy.descriptions import RenderMode
from indico.core.settings.converters import ... | 31.877419 | 105 | 0.722931 |
7085e86a0848bd757cda739432dc4fb19bdfefab | 4,309 | py | Python | tests/linkedlists_tests/queue_test.py | warmachine028/datastax | 2898b517dee471a240a10e81bcfafee5dce615ca | [
"MIT"
] | 5 | 2021-12-25T17:08:39.000Z | 2022-03-18T16:22:57.000Z | tests/linkedlists_tests/queue_test.py | warmachine028/datastax | 2898b517dee471a240a10e81bcfafee5dce615ca | [
"MIT"
] | 1 | 2021-12-28T05:45:34.000Z | 2021-12-28T21:31:50.000Z | tests/linkedlists_tests/queue_test.py | warmachine028/datastax | 2898b517dee471a240a10e81bcfafee5dce615ca | [
"MIT"
] | null | null | null | import unittest
from typing import Optional, Any
from datastax.errors import UnderFlowError, OverFlowError
from datastax.linkedlists import Queue, LinkedList
class TestQueue(unittest.TestCase):
def setUp(self) -> None:
self.limitedQueue = Queue(2) # With fixed size Queue
self.unlimitedQueue = Q... | 38.81982 | 78 | 0.618937 |
6d03039714054beacf19069e8243e91dfce01ccd | 3,371 | py | Python | Altitude_Bot.py | Andre0512/Altitude_Bot | 7461a4d5036650a4639d65c72a9e97a808372b79 | [
"MIT"
] | null | null | null | Altitude_Bot.py | Andre0512/Altitude_Bot | 7461a4d5036650a4639d65c72a9e97a808372b79 | [
"MIT"
] | null | null | null | Altitude_Bot.py | Andre0512/Altitude_Bot | 7461a4d5036650a4639d65c72a9e97a808372b79 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
import yaml
from telegram import ReplyKeyboardMarkup, KeyboardButton, ParseMode
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from googlemaps import elevation, Client
logging.basicConfig(format='%(asctime)s - %(name)s -... | 32.104762 | 119 | 0.666864 |
1e68f0a3acd2dc33101adbf6c5a5ce1fe6af36ad | 1,165 | py | Python | conda_kapsel/plugins/test/test_network_util.py | LaudateCorpus1/kapsel | 736b95d4ef81121bfeb965b989f7c159cf470386 | [
"BSD-3-Clause"
] | 43 | 2016-07-13T19:05:06.000Z | 2021-02-18T08:17:52.000Z | conda_kapsel/plugins/test/test_network_util.py | conda-archive/kapsel | 736b95d4ef81121bfeb965b989f7c159cf470386 | [
"BSD-3-Clause"
] | 13 | 2016-08-04T18:42:27.000Z | 2017-02-21T01:07:03.000Z | conda_kapsel/plugins/test/test_network_util.py | conda-archive/kapsel | 736b95d4ef81121bfeb965b989f7c159cf470386 | [
"BSD-3-Clause"
] | 10 | 2016-07-27T00:40:52.000Z | 2021-08-23T05:42:23.000Z | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © 2016, Continuum Analytics, Inc. All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------------------------------------------------------... | 32.361111 | 78 | 0.590558 |
e4132d2b8634c9b78f9710b551fab2722e0d307a | 5,672 | py | Python | datahub/search/omis/views.py | reupen/data-hub-api | d854188f4c45da0e89075add132a15bb1227ff79 | [
"MIT"
] | null | null | null | datahub/search/omis/views.py | reupen/data-hub-api | d854188f4c45da0e89075add132a15bb1227ff79 | [
"MIT"
] | 16 | 2020-04-01T15:25:35.000Z | 2020-04-14T14:07:30.000Z | datahub/search/omis/views.py | reupen/data-hub-api | d854188f4c45da0e89075add132a15bb1227ff79 | [
"MIT"
] | null | null | null | from django.db.models import DecimalField, OuterRef, Subquery, Sum
from django.db.models.functions import Cast
from datahub.core.query_utils import (
get_choices_as_case_expression,
get_front_end_url_expression,
get_full_name_expression,
)
from datahub.metadata.query_utils import get_sector_name_subquery
f... | 35.45 | 117 | 0.645804 |
6a7865284b7165060968e883c88f1c6570c3909d | 5,772 | py | Python | src/go_bot/search_api/search_api.py | ai4eu/ai4eu-chatbot | 9504fc73206b0fdfcbd8bad9e9625bd2776887b7 | [
"Apache-2.0"
] | null | null | null | src/go_bot/search_api/search_api.py | ai4eu/ai4eu-chatbot | 9504fc73206b0fdfcbd8bad9e9625bd2776887b7 | [
"Apache-2.0"
] | null | null | null | src/go_bot/search_api/search_api.py | ai4eu/ai4eu-chatbot | 9504fc73206b0fdfcbd8bad9e9625bd2776887b7 | [
"Apache-2.0"
] | null | null | null | # FOUNDATION OF RESEARCH AND TECHNOLOGY - HELLAS (FORTH-ICS)
#
# INFORMATION SYSTEMS LABORATORY (ISL)
#
# http://www.ics.forth.gr/isl
#
# LICENCE: TO BE ADDED
#
# Copyright 2021
# The AI4EU chatbot - Class making requests to the Search-API developed by Thales
# author: Papadakos Panagiotis
# e-mail: papadako@ics.fort... | 37.23871 | 115 | 0.574498 |
fe8bb3b211820523586b6767eb03b0938b578ba4 | 9,619 | py | Python | data/map.py | kikacaty/AgentFormer | dbd0bfb3c4a7d1d0217a9aea892bb9d6c39a1ca0 | [
"MIT"
] | 105 | 2021-03-26T06:15:08.000Z | 2022-03-28T21:08:50.000Z | data/map.py | kikacaty/AgentFormer | dbd0bfb3c4a7d1d0217a9aea892bb9d6c39a1ca0 | [
"MIT"
] | 17 | 2021-04-30T09:29:38.000Z | 2022-03-31T12:29:35.000Z | data/map.py | kikacaty/AgentFormer | dbd0bfb3c4a7d1d0217a9aea892bb9d6c39a1ca0 | [
"MIT"
] | 29 | 2021-03-29T06:53:29.000Z | 2022-03-28T21:08:55.000Z | """
Code borrowed from Trajectron++: https://github.com/StanfordASL/Trajectron-plus-plus/blob/ef0165a93ee5ba8cdc14f9b999b3e00070cd8588/trajectron/environment/map.py
"""
import torch
import numpy as np
import cv2
import os
from .homography_warper import get_rotation_matrix2d, warp_affine_crop
class Map(object):
d... | 42.751111 | 160 | 0.573137 |
25c668c2a17a50072fdec397ddbe4cae00eaff28 | 1,379 | py | Python | repositories/waterfall/waterfallRepo.py | saintaardvark/glouton-satnogs-data-downloader | dc8671340f558b1a21b41b9b04bab05fc15c7809 | [
"MIT"
] | null | null | null | repositories/waterfall/waterfallRepo.py | saintaardvark/glouton-satnogs-data-downloader | dc8671340f558b1a21b41b9b04bab05fc15c7809 | [
"MIT"
] | null | null | null | repositories/waterfall/waterfallRepo.py | saintaardvark/glouton-satnogs-data-downloader | dc8671340f558b1a21b41b9b04bab05fc15c7809 | [
"MIT"
] | null | null | null | from queue import Queue
from threading import Thread
from commands.download.downloadCommandParams import DownloadCommandParams
from commands.download.waterfallDownloadCommand import WaterfallDownloadCommand
from workers.downloadWorker import DownloadWorker
from domain.interfaces.downloadable import Downloadable
class... | 40.558824 | 119 | 0.735315 |
819315bff1ede65bc2198a801161524d3796a5fd | 21,077 | py | Python | lib/clients/AwsClient.py | SAP/service-fabrik-backup-restore | 27c29444a4fdea4430da93a05c7f78b23546d603 | [
"Apache-2.0"
] | 2 | 2021-03-01T00:38:47.000Z | 2021-12-15T04:25:41.000Z | lib/clients/AwsClient.py | cloudfoundry-incubator/service-fabrik-backup-restore | 27c29444a4fdea4430da93a05c7f78b23546d603 | [
"Apache-2.0"
] | 57 | 2017-12-04T16:46:41.000Z | 2022-03-24T11:43:31.000Z | lib/clients/AwsClient.py | cloudfoundry-incubator/service-fabrik-backup-restore | 27c29444a4fdea4430da93a05c7f78b23546d603 | [
"Apache-2.0"
] | 16 | 2017-12-04T16:45:23.000Z | 2019-09-17T11:42:19.000Z | import boto3
from botocore.config import Config
from .BaseClient import BaseClient
from ..models.Snapshot import Snapshot
from ..models.Volume import Volume
from ..models.Attachment import Attachment
class AwsClient(BaseClient):
def __init__(self, operation_name, configuration, directory_persistent, directory_wor... | 41.819444 | 120 | 0.578972 |
b5e807f035b5833b59b7afc8706fb7d97db62198 | 4,270 | py | Python | users/views.py | davospots/awadz | 12ea9cfff80f8dc37f0016d53645861684812433 | [
"MIT"
] | null | null | null | users/views.py | davospots/awadz | 12ea9cfff80f8dc37f0016d53645861684812433 | [
"MIT"
] | null | null | null | users/views.py | davospots/awadz | 12ea9cfff80f8dc37f0016d53645861684812433 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth import... | 34.715447 | 117 | 0.666979 |
88aed8c3723d286f9de7efd8fe6dff61cfdbb123 | 14,543 | py | Python | lib/public/HtmlReport.py | xiaoxiaolulu/MeteorTears | 5145c126c6f330c8633ed5e2eedd02a946f7b54d | [
"MIT"
] | 19 | 2019-05-09T06:19:47.000Z | 2020-10-21T08:31:09.000Z | lib/public/HtmlReport.py | xiaoxiaolulu/MeteorTears | 5145c126c6f330c8633ed5e2eedd02a946f7b54d | [
"MIT"
] | null | null | null | lib/public/HtmlReport.py | xiaoxiaolulu/MeteorTears | 5145c126c6f330c8633ed5e2eedd02a946f7b54d | [
"MIT"
] | 15 | 2019-05-20T05:47:01.000Z | 2020-10-19T10:18:57.000Z | import os
import sys
from io import StringIO as StringIO
import time
import json
import unittest
import platform
import base64
import traceback
from functools import wraps
__all__ = ['Report']
HTML_IMG_TEMPLATE = """
<a href="data:image/png;base64, {}">
<img src="data:image/png;base64, {}" width="800px" heigh... | 30.109731 | 90 | 0.528089 |
0f611edad3d32dbff154c0fa9d0556d689ace9e9 | 1,191 | py | Python | data/train/python/0f611edad3d32dbff154c0fa9d0556d689ace9e9tictac.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/0f611edad3d32dbff154c0fa9d0556d689ace9e9tictac.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/0f611edad3d32dbff154c0fa9d0556d689ace9e9tictac.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | #!/usr/bin/python
# Copyright (c) 2014,All rights reserved.
# This shows an example of using the publish.single helper function.
import sys
import os
import time
#MQTT Initialize.=======================
try:
import paho.mqtt.publish as publish
except ImportError:
# If you have the module installed, just use "... | 24.8125 | 137 | 0.675903 |
b9c92914bc3e834f32c2d4f3daac2f736c473f00 | 8,153 | py | Python | download_rabbit.py | KellyHwong/Amiya-Is-Not-Donkey | 398fea3282436d2222c409e3fafed7c786db3ea3 | [
"MIT"
] | null | null | null | download_rabbit.py | KellyHwong/Amiya-Is-Not-Donkey | 398fea3282436d2222c409e3fafed7c786db3ea3 | [
"MIT"
] | null | null | null | download_rabbit.py | KellyHwong/Amiya-Is-Not-Donkey | 398fea3282436d2222c409e3fafed7c786db3ea3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: WuLC
# @Date: 2017-09-27 23:02:19
# @Last Modified by: LC
# @Last Modified time: 2017-09-30 10:54:36
####################################################################################################################
# Download images from google with specified keywords for sea... | 37.74537 | 123 | 0.581749 |
a95a40c0884792810faf5f07ded70536fd16f829 | 2,168 | py | Python | osp/citations/hlom_record.py | davidmcclure/open-syllabus-project | 078cfd4c5a257fbfb0901d43bfbc6350824eed4e | [
"Apache-2.0"
] | 220 | 2016-01-22T21:19:02.000Z | 2022-01-25T04:33:55.000Z | osp/citations/hlom_record.py | davidmcclure/open-syllabus-project | 078cfd4c5a257fbfb0901d43bfbc6350824eed4e | [
"Apache-2.0"
] | 14 | 2016-01-23T14:34:39.000Z | 2016-09-19T19:58:37.000Z | osp/citations/hlom_record.py | davidmcclure/open-syllabus-project | 078cfd4c5a257fbfb0901d43bfbc6350824eed4e | [
"Apache-2.0"
] | 14 | 2016-02-03T13:47:48.000Z | 2019-03-27T13:09:05.000Z |
from osp.citations.utils import clean_field, tokenize_field
class HLOM_Record:
def __init__(self, record):
"""
Set the MARC record.
Args:
record (pymarc.Record): The raw MARC record.
"""
self.record = record
@property
def control_number(self):
... | 17.483871 | 62 | 0.500923 |
1893f9ee94474e37d4f03db40d227c0eaf0c4146 | 4,172 | py | Python | image_classification/CvT/utils.py | haribhutanadhu/PaddleViT | 05319fb775606874d8d3024964f1823f1ac56134 | [
"Apache-2.0"
] | 993 | 2021-08-30T01:58:57.000Z | 2022-03-31T14:03:07.000Z | image_classification/CvT/utils.py | gdj8510/PaddleViT | 6a2c063ddbd7e1d0f271eb4699516493e3fd327f | [
"Apache-2.0"
] | 120 | 2021-09-03T13:05:32.000Z | 2022-03-29T02:08:22.000Z | image_classification/CvT/utils.py | gdj8510/PaddleViT | 6a2c063ddbd7e1d0f271eb4699516493e3fd327f | [
"Apache-2.0"
] | 253 | 2021-08-30T08:50:27.000Z | 2022-03-26T09:21:08.000Z | # Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 34.766667 | 93 | 0.639262 |
6b1c153bb2fb4a49f8f4471a3b6137efcfe26e04 | 1,769 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/subsequence-of-size-k-with-the-largest-even-sum.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/subsequence-of-size-k-with-the-largest-even-sum.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/subsequence-of-size-k-with-the-largest-even-sum.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n) on average
# Space: O(1)
import random
# quick select solution
class Solution(object):
def largestEvenSum(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
def nth_element(nums, n, compare=lambda a, b: a < b):
def tri_... | 34.019231 | 100 | 0.454494 |
e52654c14d0183704784f82d6f45bae996ace432 | 46,160 | py | Python | Lib/test/test_coroutines.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_coroutines.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_coroutines.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | import contextlib
import copy
import inspect
import pickle
import sys
import types
import unittest
import warnings
from test import support
class AsyncYieldFrom:
def __init__(self, obj):
self.obj = obj
def __await__(self):
yield from self.obj
class AsyncYield:
def __init__(self, value):... | 26.682081 | 85 | 0.50091 |
83160f8dcc593905512c5a61f7684051a25f6b5a | 20,259 | py | Python | ServidorPython/python32_web/Lib/distutils/sysconfig.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 3 | 2019-04-30T23:38:57.000Z | 2020-04-06T10:05:08.000Z | ServidorPython/python32_web/Lib/distutils/sysconfig.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 6 | 2020-09-05T02:31:22.000Z | 2022-02-26T12:14:53.000Z | Lib/distutils/sysconfig.py | koyota79/weekly-report | a9f518965d9f51e81c13711a8b0bfda336eae2a0 | [
"bzip2-1.0.6"
] | 1 | 2019-09-30T23:47:05.000Z | 2019-09-30T23:47:05.000Z | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... | 37.104396 | 94 | 0.597611 |
58726b72221d1d44b451a2a8e5b0f802779033fe | 24,199 | py | Python | Packs/MicrosoftManagementActivity/Integrations/MicrosoftManagementActivity/MicrosoftManagementActivity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftManagementActivity/Integrations/MicrosoftManagementActivity/MicrosoftManagementActivity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftManagementActivity/Integrations/MicrosoftManagementActivity/MicrosoftManagementActivity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
import jwt
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# CONSTANTS
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S'
APP_NAME = 'ms-management-api'
PUBLISHER_IDENTIFIER = 'ebac1a16-81bf-449b-8d43-5732c3c1d999' # T... | 40.807757 | 129 | 0.689326 |
5fa9bb13bd0ef6127465d705ff0720ce2eca5b92 | 23 | py | Python | plugins/pdf-img/__init__.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 13 | 2020-01-27T09:02:25.000Z | 2022-01-20T07:45:26.000Z | plugins/pdf-img/__init__.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 29 | 2020-03-22T06:57:57.000Z | 2022-01-24T22:46:42.000Z | plugins/pdf-img/__init__.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 6 | 2020-07-10T00:13:30.000Z | 2022-01-26T08:22:33.000Z | from .pdf_img import *
| 11.5 | 22 | 0.73913 |
a647c837b28e0f9c6993728a46a6efb799cc4d6a | 1,009 | py | Python | tests/helpers/helpers_compute_engine.py | around-media/jam | 9778c57594aa88992e51c7099f1afed0718574c0 | [
"MIT"
] | null | null | null | tests/helpers/helpers_compute_engine.py | around-media/jam | 9778c57594aa88992e51c7099f1afed0718574c0 | [
"MIT"
] | 94 | 2018-04-02T15:29:16.000Z | 2022-03-28T18:46:24.000Z | tests/helpers/helpers_compute_engine.py | around-media/jam | 9778c57594aa88992e51c7099f1afed0718574c0 | [
"MIT"
] | 2 | 2019-03-25T08:59:24.000Z | 2019-03-27T10:11:18.000Z | import contextlib
import datetime
import jam.libs.compute_engine
def make_info_instantly_stale(instance):
instance.info_ts -= datetime.timedelta(
milliseconds=2 * jam.libs.compute_engine.ComputeEngineInstance.DEFAULT_STALE_AFTER_MS
)
@contextlib.contextmanager
def no_pause():
saved_wait_op = ja... | 36.035714 | 93 | 0.804757 |
fdce97db6429dacd18fc254f9267d83bce1dfa2e | 6,563 | py | Python | examples/semi_lagrangian_experiments/unsteady_semi_experiment.py | dbstein/ipde | 834e16a617f47a3eabe3307ba151d5b7db527b30 | [
"Apache-2.0"
] | 2 | 2019-10-17T15:29:38.000Z | 2021-02-19T20:01:34.000Z | examples/semi_lagrangian_experiments/unsteady_semi_experiment.py | dbstein/ipde | 834e16a617f47a3eabe3307ba151d5b7db527b30 | [
"Apache-2.0"
] | null | null | null | examples/semi_lagrangian_experiments/unsteady_semi_experiment.py | dbstein/ipde | 834e16a617f47a3eabe3307ba151d5b7db527b30 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import finufftpy
import time
"""
Test semi-lagrangian solve...
"""
# max time
max_time = 1.0
# set timestep
dt = 0.01
# discretization size
n = 32
# generate a velocity field (assume steady in time)
u_function = lambda x, y, t: np.sin(x)*np.cos(y)*(1+np.cos(2*np.pi*t))
v_function = lambda x, y, t... | 26.897541 | 90 | 0.586622 |
fa113ce5d264a35c216d2944b27af330e00b22f4 | 2,009 | py | Python | Recognize/recognize_time_test.py | l976308589/cnn_captcha_copy | ebc440300b84a87df41393f5de2b97d7ff3cad26 | [
"Apache-2.0"
] | null | null | null | Recognize/recognize_time_test.py | l976308589/cnn_captcha_copy | ebc440300b84a87df41393f5de2b97d7ff3cad26 | [
"Apache-2.0"
] | null | null | null | Recognize/recognize_time_test.py | l976308589/cnn_captcha_copy | ebc440300b84a87df41393f5de2b97d7ff3cad26 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
使用自建的接口识别来自网络的验证码
需要配置参数:
remote_url = "https://www.xxxxxxx.com/getImg" 验证码链接地址
rec_times = 1 识别的次数
"""
import datetime
import requests
from io import BytesIO
import time
import json
from Config.config import sample_conf
def recognize_captcha(index, test_path, s... | 30.439394 | 110 | 0.642608 |
4682f508bc3816a27543d42f221f4ad98e503483 | 554 | py | Python | clist/migrations/0034_auto_20200503_0125.py | horacexd/clist | 9759dfea97b86514bec9825d2430abc36decacf0 | [
"Apache-2.0"
] | 166 | 2019-05-16T23:46:08.000Z | 2022-03-31T05:20:23.000Z | clist/migrations/0034_auto_20200503_0125.py | horacexd/clist | 9759dfea97b86514bec9825d2430abc36decacf0 | [
"Apache-2.0"
] | 92 | 2020-01-18T22:51:53.000Z | 2022-03-12T01:23:57.000Z | clist/migrations/0034_auto_20200503_0125.py | VadVergasov/clist | 4afcdfe88250d224043b28efa511749347cec71c | [
"Apache-2.0"
] | 23 | 2020-02-09T17:38:43.000Z | 2021-12-09T14:39:07.000Z | # Generated by Django 2.2.10 on 2020-05-03 01:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clist', '0033_remove_banner_start_time'),
]
operations = [
migrations.AddField(
model_name='resource',
name='num_ac... | 23.083333 | 51 | 0.584838 |
80f1f897d368371b3a0c31b84521ef2a8cda5a14 | 6,830 | py | Python | pipenv/vendor/vistir/contextmanagers.py | ehebert/pipenv | b771621274fcdb6980b4c9682bd2b2879e3354d1 | [
"MIT"
] | 1 | 2018-10-29T18:41:01.000Z | 2018-10-29T18:41:01.000Z | pipenv/vendor/vistir/contextmanagers.py | ehebert/pipenv | b771621274fcdb6980b4c9682bd2b2879e3354d1 | [
"MIT"
] | null | null | null | pipenv/vendor/vistir/contextmanagers.py | ehebert/pipenv | b771621274fcdb6980b4c9682bd2b2879e3354d1 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import stat
import sys
from contextlib import contextmanager
import six
from .compat import NamedTemporaryFile, Path
from .path import is_file_url, is_valid_url, path_to_url, url_to_path
__all__ = ["temp_environ", "temp_path... | 32.679426 | 273 | 0.624451 |
712b28274a10f73a4bf976e570336c0c736ea580 | 11,654 | py | Python | pythx/api/client.py | s0b0lev/pythx | c34d81421a2cbea71e60c33245d54fb19b6ad68a | [
"MIT"
] | null | null | null | pythx/api/client.py | s0b0lev/pythx | c34d81421a2cbea71e60c33245d54fb19b6ad68a | [
"MIT"
] | null | null | null | pythx/api/client.py | s0b0lev/pythx | c34d81421a2cbea71e60c33245d54fb19b6ad68a | [
"MIT"
] | null | null | null | import logging
from datetime import datetime
from typing import Dict, List
import jwt
from pythx.api.handler import APIHandler
from pythx.middleware.analysiscache import AnalysisCacheMiddleware
from pythx.middleware.base import BaseMiddleware
from pythx.middleware.toolname import ClientToolNameMiddleware
from mythx_m... | 37.960912 | 114 | 0.651279 |
fb2528da63f0a9ae863eb3b00214d7ee944b0473 | 2,088 | py | Python | extra/bsmalea-notes-1c/test.py | cookieblues/cookieblues.github.io | 9b570d83887eb2d6f92cfaa927a1adf136124a90 | [
"MIT"
] | null | null | null | extra/bsmalea-notes-1c/test.py | cookieblues/cookieblues.github.io | 9b570d83887eb2d6f92cfaa927a1adf136124a90 | [
"MIT"
] | 2 | 2020-03-30T14:58:30.000Z | 2020-12-10T15:15:06.000Z | extra/bsmalea-notes-1c/test.py | cookieblues/cookieblues.github.io | 9b570d83887eb2d6f92cfaa927a1adf136124a90 | [
"MIT"
] | null | null | null | import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from scipy.special import binom, gamma
from scipy.stats import beta
# turq 06C2AC, mag C20076, mixed 646191
# Set matplotlib font
mpl.rc("text", usetex=True)
mpl.rc("font", family="serif")
def likelihood(theta, n, k):
return binom(n, k) ... | 20.271845 | 82 | 0.543103 |
e8325857b507b994c51d3b581bae034b15b07237 | 989 | py | Python | Scripts/day20.py | HarrisonGreen/Advent-of-Code-2015 | 6a81395882c79135548eb7984bfd98c279c5f258 | [
"MIT"
] | null | null | null | Scripts/day20.py | HarrisonGreen/Advent-of-Code-2015 | 6a81395882c79135548eb7984bfd98c279c5f258 | [
"MIT"
] | null | null | null | Scripts/day20.py | HarrisonGreen/Advent-of-Code-2015 | 6a81395882c79135548eb7984bfd98c279c5f258 | [
"MIT"
] | null | null | null | from sympy.ntheory import factorint
import numpy as np
def lowest_house_num(num, step):
house = 0
while True:
house += step
factorisation = factorint(house)
factors = np.ones(1, dtype=int)
for prime, power in factorisation.items():
factors =... | 26.72973 | 94 | 0.52275 |
f2c9bed57ec57d391b5d4d17c06fdd65522449f2 | 782 | py | Python | scraping/requests/scraping_requests_idealista.py | txtbits/daw-python | 5dde1207e2791e90aa5e9ce2b6afc4116129efab | [
"MIT"
] | null | null | null | scraping/requests/scraping_requests_idealista.py | txtbits/daw-python | 5dde1207e2791e90aa5e9ce2b6afc4116129efab | [
"MIT"
] | null | null | null | scraping/requests/scraping_requests_idealista.py | txtbits/daw-python | 5dde1207e2791e90aa5e9ce2b6afc4116129efab | [
"MIT"
] | null | null | null |
import requests
from amara.bindery import html
from amara.lib import U
URL = 'http://www.idealista.com/pagina/inmueble?codigoinmueble=VP0000005600220&numInm=4&edd=list'
URL2 = 'http://www.idealista.com/pagina/inmueble?codigoinmueble=VP0000005027406&numInm=3&edd=list'
''' la x es de xpath '''
xpiso = '/html/body/div... | 34 | 98 | 0.710997 |
bbc1cf6eeb72485e00baa296363bf59f992bc515 | 2,435 | py | Python | protocols/home_assistant/serrialize_protocol.py | ReanGD/smart-home | 0d3ebe3213ad275f64490218ca3dbc0128c12339 | [
"Apache-2.0"
] | 1 | 2018-07-31T21:17:37.000Z | 2018-07-31T21:17:37.000Z | protocols/home_assistant/serrialize_protocol.py | ReanGD/smart-home | 0d3ebe3213ad275f64490218ca3dbc0128c12339 | [
"Apache-2.0"
] | null | null | null | protocols/home_assistant/serrialize_protocol.py | ReanGD/smart-home | 0d3ebe3213ad275f64490218ca3dbc0128c12339 | [
"Apache-2.0"
] | null | null | null | import asyncio
from hashlib import md5
from typing import List
from struct import pack, unpack
from google.protobuf import message as gp_message
from protocols.transport import TransportError, SerrializeProtocol
class HASerrializeProtocol(SerrializeProtocol):
def __init__(self, protobuf_types: List[object], logge... | 45.092593 | 98 | 0.664887 |
3f8ee444f62dc8f1cb713f2d571d39a1c63635ad | 11,829 | py | Python | mycroft-core-dev/mycroft/util/lang/format_hu.py | edegeyer/masterarbeit | a310de258a325faf3f4283f9db5ccf57905d3c0e | [
"Apache-2.0"
] | 5 | 2019-08-15T13:22:05.000Z | 2020-05-10T04:04:48.000Z | mycroft-core-dev/mycroft/util/lang/format_hu.py | edegeyer/masterarbeit | a310de258a325faf3f4283f9db5ccf57905d3c0e | [
"Apache-2.0"
] | 8 | 2019-08-15T16:26:51.000Z | 2021-09-08T01:05:04.000Z | mycroft/util/lang/format_hu.py | Mel1818/mycroft-changes | f3598569f452fa1514a4c4c9b33be4073f5a5d1f | [
"Apache-2.0"
] | 4 | 2018-06-09T11:58:56.000Z | 2019-02-10T07:28:58.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Mycroft AI 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 ... | 32.319672 | 79 | 0.550004 |
f836318d0ce0fe4788cfc239c2c729b0659d4e3b | 4,343 | py | Python | assignment1/dTree.py | samarth-math/machine-learning | fb25569395093d62e8013d5454ed3f1a0f7811e1 | [
"MIT"
] | null | null | null | assignment1/dTree.py | samarth-math/machine-learning | fb25569395093d62e8013d5454ed3f1a0f7811e1 | [
"MIT"
] | null | null | null | assignment1/dTree.py | samarth-math/machine-learning | fb25569395093d62e8013d5454ed3f1a0f7811e1 | [
"MIT"
] | null | null | null | import numpy as np
from math import log
import fileinput
#assumed last column to be label
# read file as a numpy array
def readFileRecs(fileName, many=None):
ticTac = []
if many!=None:
for i in range(1,7):
f=open(fileName+str(i)+".txt", 'r')
for line in f:
lineArray = line.strip('\n').split(",")
ticT... | 26.321212 | 118 | 0.728989 |
1c2d4bbb9696658238315a913f60295083292da6 | 2,835 | py | Python | tests/test_serialized_schema.py | TheBigSasha/OpenTimelineIO | 0d857086cbb4fc39c1303947c61318aa6e523ea5 | [
"Apache-2.0"
] | 5 | 2018-07-27T03:52:26.000Z | 2021-04-02T04:10:15.000Z | tests/test_serialized_schema.py | TheBigSasha/OpenTimelineIO | 0d857086cbb4fc39c1303947c61318aa6e523ea5 | [
"Apache-2.0"
] | 1 | 2019-06-20T04:02:54.000Z | 2019-06-20T04:02:54.000Z | tests/test_serialized_schema.py | TheBigSasha/OpenTimelineIO | 0d857086cbb4fc39c1303947c61318aa6e523ea5 | [
"Apache-2.0"
] | 1 | 2019-11-15T21:20:24.000Z | 2019-11-15T21:20:24.000Z | #
# Copyright Contributors to the OpenTimelineIO project
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and rep... | 36.346154 | 81 | 0.687478 |
91ada965ebd3c920c908612db56d0b51a1212583 | 5,177 | py | Python | kdl_wagtail/core/migrations/0017_add_show_in_menus.py | kingsdigitallab/django-kdl-wagtail | 457623a35057f88ee575397ac2c68797f35085e1 | [
"MIT"
] | 3 | 2020-02-18T07:19:13.000Z | 2021-06-14T20:35:08.000Z | kdl_wagtail/core/migrations/0017_add_show_in_menus.py | kingsdigitallab/django-kdl-wagtail | 457623a35057f88ee575397ac2c68797f35085e1 | [
"MIT"
] | 16 | 2019-02-08T19:39:27.000Z | 2020-07-30T20:01:38.000Z | kdl_wagtail/core/migrations/0017_add_show_in_menus.py | kingsdigitallab/django-kdl-wagtail | 457623a35057f88ee575397ac2c68797f35085e1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-15 16:32
from django.db import migrations
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
depend... | 207.08 | 4,652 | 0.745026 |
0fbb8dea07d7ecb2f2f0ff9216cce6d08df8659a | 2,631 | py | Python | catkin_ws/src/60-templates/pkg_name/src/talker.py | spadma3/duck | d4763cd49b00733278d394fc7399e920fb2990a8 | [
"CC-BY-2.0"
] | 1 | 2021-04-27T13:20:55.000Z | 2021-04-27T13:20:55.000Z | catkin_ws/src/60-templates/pkg_name/src/talker.py | spadma3/duck | d4763cd49b00733278d394fc7399e920fb2990a8 | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/60-templates/pkg_name/src/talker.py | spadma3/duck | d4763cd49b00733278d394fc7399e920fb2990a8 | [
"CC-BY-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
from pkg_name.util import HelloGoodbye #Imports module. Not limited to modules in this pkg.
from std_msgs.msg import String #Imports msg
#from sensor_msgs.msg import CameraInfo, CompressedImage, Image
#from duckietown_utils.jpg import image_cv_from_jpg
#from cv_bridge import CvBridge... | 37.056338 | 92 | 0.660965 |
63d293ef9814622d4c6a3ecb1b4753ed22294b6c | 3,579 | py | Python | var/spack/repos/builtin/packages/yaml-cpp/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | var/spack/repos/builtin/packages/yaml-cpp/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 18 | 2021-03-12T16:22:58.000Z | 2022-03-02T17:07:08.000Z | var/spack/repos/builtin/packages/yaml-cpp/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-06-28T04:48:37.000Z | 2021-06-28T04:48:37.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.spec import ConflictsInSpecError
yaml_cpp_tests_libcxx_error_msg = 'yaml-cpp tests incompatible with libc++'
... | 45.303797 | 97 | 0.64627 |
9a8f4e349e16715008447a1a57faf74e9b4edf35 | 771 | py | Python | dj_audit/settings.py | Miftaudeen/django-audit | d159869f46bbc73ec002b95ade78e399b08cfa56 | [
"Apache-2.0"
] | null | null | null | dj_audit/settings.py | Miftaudeen/django-audit | d159869f46bbc73ec002b95ade78e399b08cfa56 | [
"Apache-2.0"
] | null | null | null | dj_audit/settings.py | Miftaudeen/django-audit | d159869f46bbc73ec002b95ade78e399b08cfa56 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings as global_settings
AUDIT_LOG_DJ_EXTRA_CONDITIONS_FOR_200 = getattr(
global_settings, 'AUDIT_LOG_DJ_EXTRA_CONDITIONS_FOR_200', False)
AUDIT_LOG_DJ_EXTRA_CONDITIONS = getattr(
global_settings, 'AUDIT_LOG_DJ_EXTRA_CONDITIONS', [])
AUDIT_LOG_DJ_REST_CONTENT_TYPES = getattr(
g... | 38.55 | 96 | 0.785992 |
5134a0474b246f6c04482d2aee8b39469e8662b1 | 3,424 | py | Python | project/old/ACTPol/reproduce_choi_rotation.py | simonsobs/ps_py | fd34612f6756f693df92e01912fd71b291f1774a | [
"BSD-3-Clause"
] | 12 | 2019-01-25T13:42:52.000Z | 2022-03-30T22:07:33.000Z | project/old/ACTPol/reproduce_choi_rotation.py | simonsobs/ps_py | fd34612f6756f693df92e01912fd71b291f1774a | [
"BSD-3-Clause"
] | 20 | 2018-11-22T06:51:44.000Z | 2022-03-22T19:31:14.000Z | project/old/ACTPol/reproduce_choi_rotation.py | sgiardie/PSpipe | 046c1d68c06fd3e8b7f0d9c068d0ff999bf95a0b | [
"BSD-3-Clause"
] | 10 | 2019-04-19T09:32:11.000Z | 2022-01-21T10:26:09.000Z | #import matplotlib
#matplotlib.use('Agg')
import numpy as np
import pylab as plt
from pspy import so_dict, so_map,so_mcm,sph_tools,so_spectra,pspy_utils, so_map_preprocessing,so_mpi
import os,sys
from pixell import enmap
import time,os
d = so_dict.so_dict()
d.read_from_file(sys.argv[1])
spectraDir='spectra'
mcmDir='m... | 31.703704 | 154 | 0.69889 |
b0dbfd1ed87d39bb2f75db5297c972fab1bc9de2 | 2,416 | py | Python | interview/traxn/chef_ingredients.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | null | null | null | interview/traxn/chef_ingredients.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | 5 | 2021-03-10T11:49:39.000Z | 2022-02-27T01:35:59.000Z | interview/traxn/chef_ingredients.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | null | null | null | # number_of_days = int(input())
ingredients_cat = {
'fat': [],
'fiber': [],
'carb': []
}
# number_of_days = int(input())
arra = ["CARBBeetroot", "FIBERCarrot", "FATOlive", "CARBCorn",
"CARBPotato", "FIBERBroccoli", "FATEgg", "FIBERBeans", "FATCheese",
"CARBRice", "FIBERSpinach", "FATOil"]
#... | 31.376623 | 123 | 0.501242 |
89b87bab76e7011fa634a37c9041d62ca4ba4c34 | 576 | py | Python | libs/PrettyOutput.py | DD-MB-PISS/spoofcheck | d62b99ab642d22411ee462659c3d79e301d9a591 | [
"MIT"
] | null | null | null | libs/PrettyOutput.py | DD-MB-PISS/spoofcheck | d62b99ab642d22411ee462659c3d79e301d9a591 | [
"MIT"
] | null | null | null | libs/PrettyOutput.py | DD-MB-PISS/spoofcheck | d62b99ab642d22411ee462659c3d79e301d9a591 | [
"MIT"
] | null | null | null | from colorama import Fore, Back, Style
from colorama import init as color_init
def output_good(line):
print(Fore.GREEN + Style.BRIGHT + "[+]" + Style.RESET_ALL + line)
def output_indifferent(line):
print(Fore.BLUE + Style.BRIGHT + "[*]" + Style.RESET_ALL + line)
def output_error(line):
print(Fore.RED + S... | 32 | 92 | 0.659722 |
63843705b13af76f49c89380ac88583d632713e6 | 678 | py | Python | www/src/Lib/test/test_openpty.py | stefanhoelzl/brython | 433d272e7bb0e3c0994392f8f265bc39e87854f7 | [
"BSD-3-Clause"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | www/src/Lib/test/test_openpty.py | SungBeom/BBAM_Brython | 107036ad20a94af1d43e5ce5bd7c73e6a470d687 | [
"BSD-3-Clause"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | check-python33-manual/samples/standard_library_337/Lib/test/test_openpty.py | DaveKaretnyk/parsing-utils2 | 40085bbd399fa605f2f2a4708d385a64ffc907de | [
"MIT"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | # Test to see if openpty works. (But don't worry if it isn't available.)
import os, unittest
from test.support import run_unittest
if not hasattr(os, "openpty"):
raise unittest.SkipTest("No openpty() available.")
class OpenptyTest(unittest.TestCase):
def test(self):
master, slave = os.openpty()
... | 26.076923 | 72 | 0.656342 |
c52ff42c1460ef0f5731b062571c8635671be0e4 | 423 | py | Python | shiSock-0.3.0/test/test_one_unsecure/s.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | null | null | null | shiSock-0.3.0/test/test_one_unsecure/s.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | null | null | null | shiSock-0.3.0/test/test_one_unsecure/s.py | AnanyaRamanA/shiSock | 51efb0eba17eb106b9480598d278536ddd7732c3 | [
"MIT"
] | 1 | 2021-10-31T13:47:42.000Z | 2021-10-31T13:47:42.000Z | from PySock import server
def client_msg(data):
print(f"Message From : {data['sender_name']} => {data['data']}")
s = server(secure = False,debug = True)
s.SERVER("localhost",8888,10)
s.CREATE_CHANNEL("test")
new_client = []
while True:
for d in s.conClients:
if d not in new_client:
s.SEN... | 21.15 | 68 | 0.624113 |
509e18d3c4db7bd49ceb779604f3829253072e1c | 16,012 | py | Python | yolo_tiny.py | dicastro/tfm | af875dd099288494a1f02a831e42d900d6cac29b | [
"MIT"
] | null | null | null | yolo_tiny.py | dicastro/tfm | af875dd099288494a1f02a831e42d900d6cac29b | [
"MIT"
] | null | null | null | yolo_tiny.py | dicastro/tfm | af875dd099288494a1f02a831e42d900d6cac29b | [
"MIT"
] | null | null | null | from keras.layers import Conv2D, Input, BatchNormalization, LeakyReLU, ZeroPadding2D, UpSampling2D, Lambda, MaxPooling2D
from keras.layers.merge import add, concatenate
from keras.models import Model
from keras.engine.topology import Layer
import tensorflow as tf
class YoloLayer(Layer):
def __init__(self, anchors,... | 51.15655 | 188 | 0.561329 |
ffff876ebd6f1babef82734804b0c8dfccc68d06 | 539 | py | Python | webServer/sample/migrations/0002_auto_20190411_0132.py | getCurrentThread/KITBigMountain | 1537c6f995212044e87d3ee3c8079e3deabfea1f | [
"MIT"
] | null | null | null | webServer/sample/migrations/0002_auto_20190411_0132.py | getCurrentThread/KITBigMountain | 1537c6f995212044e87d3ee3c8079e3deabfea1f | [
"MIT"
] | null | null | null | webServer/sample/migrations/0002_auto_20190411_0132.py | getCurrentThread/KITBigMountain | 1537c6f995212044e87d3ee3c8079e3deabfea1f | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-04-10 16:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sample', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='samplemodel',
name='memo',
f... | 22.458333 | 61 | 0.564007 |
eabad39b08835dc91072b93266f5fe4841082ad5 | 1,498 | py | Python | tests/conftest.py | molodoj88/mainfluxpy | 7895b2b76dabe232effe8a1350ca8c1a31bf050e | [
"MIT"
] | 1 | 2020-04-23T17:32:45.000Z | 2020-04-23T17:32:45.000Z | tests/conftest.py | molodoj88/mainfluxpy | 7895b2b76dabe232effe8a1350ca8c1a31bf050e | [
"MIT"
] | 1 | 2020-06-09T17:56:30.000Z | 2020-06-09T17:56:30.000Z | tests/conftest.py | molodoj88/mainfluxpy | 7895b2b76dabe232effe8a1350ca8c1a31bf050e | [
"MIT"
] | 1 | 2021-06-30T05:54:31.000Z | 2021-06-30T05:54:31.000Z | from mainflux.app import MainfluxApp
import pytest
import uuid
import httpx
from .conf import APP_KWARGS
"""
You should create file named conf.py in same directory where tests run
and create dictionary APP_KWARGS with following content:
APP_KWARGS = {
'url': "ip-to-mainflux",
'port': "80",
'user': "usern... | 22.69697 | 70 | 0.642857 |
e7d20835f710ea53d2f57ba7d7c875a2d45a34ab | 5,095 | py | Python | spams/views.py | 6ba/bbgo | dfa9b55b8d40c53940105333c2e03a3c6abddb88 | [
"MIT"
] | 22 | 2017-07-13T04:07:03.000Z | 2021-06-10T05:39:29.000Z | spams/views.py | genonfire/bbgo | 5f374f0b620f4dc3e106de5969f26f4585044605 | [
"MIT"
] | 7 | 2017-08-25T06:33:45.000Z | 2019-10-14T05:49:32.000Z | spams/views.py | 6ba/bbgo | dfa9b55b8d40c53940105333c2e03a3c6abddb88 | [
"MIT"
] | 9 | 2017-12-31T02:45:58.000Z | 2021-01-22T03:09:02.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from core.utils import error_to_response, get_referrer, get_useragent
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_... | 27.245989 | 74 | 0.569774 |
9d77fc12bd4a14d51f2e7eb321fdbc0702edb288 | 16,264 | py | Python | anki_vector/nav_map.py | rmcolbert/vector-python-sdk | 7e29e81578bd862b6462d7f7502c4aa67de29fb5 | [
"Apache-2.0"
] | 516 | 2018-12-12T06:05:03.000Z | 2022-03-30T10:00:20.000Z | anki_vector/nav_map.py | rmcolbert/vector-python-sdk | 7e29e81578bd862b6462d7f7502c4aa67de29fb5 | [
"Apache-2.0"
] | 37 | 2018-12-12T09:41:46.000Z | 2022-03-06T13:42:24.000Z | anki_vector/nav_map.py | rmcolbert/vector-python-sdk | 7e29e81578bd862b6462d7f7502c4aa67de29fb5 | [
"Apache-2.0"
] | 350 | 2018-12-11T23:24:01.000Z | 2022-03-16T12:57:33.000Z | # Copyright (c) 2018 Anki, 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 in the file LICENSE.txt or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 39.668293 | 124 | 0.653099 |
c860ecd79e3876954349470b41bb984b31a816d4 | 29,767 | py | Python | ambari-server/src/main/python/ambari_server/setupSecurity.py | nexr/ambari | 8452f207d7b9343a162698f2a2b79bf2c512e9d3 | [
"Apache-2.0"
] | 1 | 2015-05-04T12:19:05.000Z | 2015-05-04T12:19:05.000Z | ambari-server/src/main/python/ambari_server/setupSecurity.py | nexr/ambari | 8452f207d7b9343a162698f2a2b79bf2c512e9d3 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/python/ambari_server/setupSecurity.py | nexr/ambari | 8452f207d7b9343a162698f2a2b79bf2c512e9d3 | [
"Apache-2.0"
] | 1 | 2021-01-07T08:55:01.000Z | 2021-01-07T08:55:01.000Z | #!/usr/bin/env python
'''
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")... | 43.968981 | 145 | 0.716599 |
8a892997ba5b77ea886ba495e7dd42dbd3696d35 | 3,102 | py | Python | ch07/im2col.py | lemolatoon/DeepLearningFromZero | 6d45410ff25f971fe856643967688023fd10f4bc | [
"MIT"
] | null | null | null | ch07/im2col.py | lemolatoon/DeepLearningFromZero | 6d45410ff25f971fe856643967688023fd10f4bc | [
"MIT"
] | null | null | null | ch07/im2col.py | lemolatoon/DeepLearningFromZero | 6d45410ff25f971fe856643967688023fd10f4bc | [
"MIT"
] | null | null | null |
def im2col(input_data, filter_h, filter_w, stride=1, pad=0):
"""
Parameters
----------
input_data : (データ数, チャンネル, 高さ, 幅)の4次元配列からなる入力データ
filter_h : フィルターの高さ
filter_w : フィルターの幅
stride : ストライド
pad : パディング
Returns
-------
col : 2次元配列
"""
N, C, H, W = in... | 28.2 | 120 | 0.503868 |
f77b598a6f188797a170afad66055404d3eef009 | 5,432 | py | Python | tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py | ZhiqingXiao/probability | 06a2ca643792c0cf8f047fab7971ba6784dec1c4 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py | ZhiqingXiao/probability | 06a2ca643792c0cf8f047fab7971ba6784dec1c4 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/covariance_reducer_test.py | ZhiqingXiao/probability | 06a2ca643792c0cf8f047fab7971ba6784dec1c4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Probability 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 o... | 37.986014 | 79 | 0.665133 |
b220b6aaf903223df1f8727084059528397ca9cc | 21,470 | py | Python | trac/test.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/test.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/test.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2020 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have ... | 35.196721 | 79 | 0.626409 |
b7df58eee6272289c672a7267df4fc4cd0f43b84 | 2,466 | py | Python | example_base.py | shadim/eg-01-python-jwt | efe9f686f091754a54428502a456eac4f51c7ee3 | [
"MIT"
] | 1 | 2020-10-27T02:15:44.000Z | 2020-10-27T02:15:44.000Z | example_base.py | shadim/eg-01-python-jwt | efe9f686f091754a54428502a456eac4f51c7ee3 | [
"MIT"
] | null | null | null | example_base.py | shadim/eg-01-python-jwt | efe9f686f091754a54428502a456eac4f51c7ee3 | [
"MIT"
] | 1 | 2020-10-27T02:15:48.000Z | 2020-10-27T02:15:48.000Z | import time
from ds_config import DSConfig
from ds_helper import DSHelper
TOKEN_REPLACEMENT_IN_SECONDS = 10 * 60
TOKEN_EXPIRATION_IN_SECONDS = 3600
class ExampleBase:
"""
Example Base class
"""
accountID = None
api_client = None
_token_received = False
account = None
expiresTimestamp... | 32.88 | 111 | 0.612733 |
6b9ddf7a220fa0230531c8e4b6ddb56347be68cc | 120 | py | Python | interfaces/typing.py | lig/python-interfaces | cf8c5419a827ed74732b938db82e293ea7c9f43f | [
"MIT"
] | 15 | 2019-04-29T05:35:04.000Z | 2021-07-17T01:35:19.000Z | interfaces/typing.py | lig/python-interfaces | cf8c5419a827ed74732b938db82e293ea7c9f43f | [
"MIT"
] | 2 | 2019-05-04T20:51:46.000Z | 2019-05-06T07:09:32.000Z | interfaces/typing.py | lig/python-interfaces | cf8c5419a827ed74732b938db82e293ea7c9f43f | [
"MIT"
] | 1 | 2020-12-04T07:37:45.000Z | 2020-12-04T07:37:45.000Z | import typing
if typing.TYPE_CHECKING:
import interfaces.base
InterfaceType = interfaces.base._InterfaceMeta
| 15 | 50 | 0.783333 |
6e90b8e54bc50f734eab44a55ad1e20efb957a08 | 11,416 | py | Python | tools/gengl.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 15 | 2015-01-21T12:29:01.000Z | 2018-12-09T09:17:33.000Z | tools/gengl.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | null | null | null | tools/gengl.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 9 | 2015-12-12T09:12:46.000Z | 2021-12-26T13:29:14.000Z | #!/usr/bin/env python
"""Generate files in pyglet.gl and pyglet/GLU
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import marshal
import optparse
import os.path
import urllib.request
import urllib.error
import urllib.parse
import sys
import textwrap
from wraptypes.wrap import CtypesWrapper
script_dir ... | 43.406844 | 106 | 0.413805 |
ff6993dffc70b3c76ef8b7cd25b6e70e56d469ee | 4,319 | py | Python | instana/util/__init__.py | tirkarthi/python-sensor | 9872d146ac00baff2673fde5ba97fdbe596869a4 | [
"MIT"
] | 61 | 2017-09-27T02:50:17.000Z | 2022-03-22T12:13:37.000Z | instana/util/__init__.py | tirkarthi/python-sensor | 9872d146ac00baff2673fde5ba97fdbe596869a4 | [
"MIT"
] | 82 | 2017-07-11T13:47:33.000Z | 2022-03-22T10:10:38.000Z | instana/util/__init__.py | takeaway/python-sensor | 52d6eaa2d6a8e625201bad36ac2448201c4bd63d | [
"MIT"
] | 27 | 2017-09-11T16:22:32.000Z | 2022-03-11T17:21:49.000Z | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
import json
import sys
import time
from collections import defaultdict
import pkg_resources
try:
from urllib import parse
except ImportError:
import urlparse as parse
import urllib
from ..log import logger
if sys.version_info.major == 2:
... | 27.864516 | 111 | 0.613568 |
8d5a9614421edff7570959281d675317872af547 | 3,148 | py | Python | xknx/remote_value/remote_value_updown.py | spacegaier/xknx | 2c2420670da88fea386d573f78a78c5a342186e9 | [
"MIT"
] | null | null | null | xknx/remote_value/remote_value_updown.py | spacegaier/xknx | 2c2420670da88fea386d573f78a78c5a342186e9 | [
"MIT"
] | null | null | null | xknx/remote_value/remote_value_updown.py | spacegaier/xknx | 2c2420670da88fea386d573f78a78c5a342186e9 | [
"MIT"
] | null | null | null | """
Module for managing an DPT Up/Down remote value.
DPT 1.008.
"""
from enum import Enum
from typing import TYPE_CHECKING, List, Optional, Union
from xknx.dpt import DPTArray, DPTBinary
from xknx.exceptions import ConversionError, CouldNotParseTelegram
from .remote_value import AsyncCallbackType, RemoteValue
if TY... | 33.489362 | 79 | 0.635642 |
be564d83e8f14f86629475e8cfb6e175fb213938 | 2,431 | py | Python | data/p4VQE/R4/benchmark/startQiskit_noisy719.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_noisy719.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_noisy719.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=13
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.011111 | 118 | 0.63225 |
9cad75434880076b8e7e090c24d18deff32a8257 | 5,259 | py | Python | big-fish/big-fish-scripts/merge_df_features.py | Henley13/paper_translation_factories_2020 | 77558ed70467cf91062abf62e46c794bfbc08e4a | [
"BSD-3-Clause"
] | 2 | 2020-09-03T20:50:53.000Z | 2020-10-02T14:39:31.000Z | big-fish/big-fish-scripts/merge_df_features.py | Henley13/paper_translation_factories_2020 | 77558ed70467cf91062abf62e46c794bfbc08e4a | [
"BSD-3-Clause"
] | 4 | 2020-01-15T10:26:14.000Z | 2020-10-01T18:36:39.000Z | big-fish/big-fish-scripts/merge_df_features.py | Henley13/paper_translation_factories_2020 | 77558ed70467cf91062abf62e46c794bfbc08e4a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Merge dataframe returned from each experience during the step of features
computation.
"""
import os
import argparse
import time
import datetime
import sys
import bigfish.classification as classification
import pandas as pd
from utils import Logger
from loader import (get_experiences, ge... | 34.827815 | 76 | 0.628256 |
97e0beaa2ece04a63bff34b08cc88701ab658e57 | 4,177 | py | Python | git_fortune/database.py | sirosen/git-fortune | 69ef3e18506aa67fdc812854f1588828ea4e7448 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | git_fortune/database.py | sirosen/git-fortune | 69ef3e18506aa67fdc812854f1588828ea4e7448 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | git_fortune/database.py | sirosen/git-fortune | 69ef3e18506aa67fdc812854f1588828ea4e7448 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
A simple "database" of tips which we can identify by
- ID (number)
- Category (string)
"""
# globals (don't freak out, this is fine)
TIPS_BY_ID = {}
TIPS_BY_CATEGORY = {}
class Tip(object):
_tipid = 0
def __init__(self, tipstr, category="general"):
self.tipid = Tip._tipid
Tip._tipid += 1... | 18.900452 | 79 | 0.665071 |
78b6cca69eaa99d5c2692db1f964622ce3194837 | 5,557 | py | Python | google/cloud/gaming/v1/gaming-v1-py/google/cloud/gaming_v1/services/realms_service/pagers.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/gaming/v1/gaming-v1-py/google/cloud/gaming_v1/services/realms_service/pagers.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/gaming/v1/gaming-v1-py/google/cloud/gaming_v1/services/realms_service/pagers.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.411348 | 95 | 0.666367 |
e836b19a158d5d99d3f87d314ec95ba77df130ad | 9,483 | py | Python | tools/webdriver/webdriver/transport.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 1 | 2021-12-19T09:30:55.000Z | 2021-12-19T09:30:55.000Z | tools/webdriver/webdriver/transport.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 6 | 2021-03-31T20:00:14.000Z | 2022-03-12T00:50:17.000Z | tools/webdriver/webdriver/transport.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 1 | 2020-11-09T05:05:06.000Z | 2020-11-09T05:05:06.000Z | import json
import select
from six import text_type, PY3
from six.moves.collections_abc import Mapping
from six.moves.http_client import HTTPConnection
from six.moves.urllib import parse as urlparse
from . import error
"""Implements HTTP transport for the WebDriver wire protocol."""
missing = object()
class Resp... | 35.516854 | 96 | 0.621322 |
4a19b00ac0b8c2d8e450aa66fa2bcbbafcf0bafb | 25,852 | py | Python | build/fbcode_builder/getdeps.py | xiaosumay/fizz | 5fe89e57526a977bd420a8269c860654c8021c54 | [
"BSD-3-Clause"
] | null | null | null | build/fbcode_builder/getdeps.py | xiaosumay/fizz | 5fe89e57526a977bd420a8269c860654c8021c54 | [
"BSD-3-Clause"
] | null | null | null | build/fbcode_builder/getdeps.py | xiaosumay/fizz | 5fe89e57526a977bd420a8269c860654c8021c54 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
f... | 35.077341 | 88 | 0.585255 |
ce416348bbbb763f731938249f740822e0f32cdf | 6,795 | py | Python | omas/machine_mappings/profiles_db_ccfe.py | gafusion/omas | 8e9b725483655db0ccbf9a4f7aa9eba7c6c04864 | [
"MIT"
] | 20 | 2017-11-07T14:36:21.000Z | 2021-03-27T19:14:17.000Z | omas/machine_mappings/profiles_db_ccfe.py | Reksoatr/omas | 6740fd040d6af59e0aec54f977637b221733bd07 | [
"MIT"
] | 170 | 2017-11-09T06:40:11.000Z | 2022-03-29T17:33:26.000Z | omas/machine_mappings/profiles_db_ccfe.py | Reksoatr/omas | 6740fd040d6af59e0aec54f977637b221733bd07 | [
"MIT"
] | 6 | 2017-11-22T14:44:54.000Z | 2022-01-10T19:52:47.000Z | import os
import numpy as np
from inspect import unwrap
from omas import *
from omas.omas_utils import printd, printe, unumpy
from omas.machine_mappings._common import *
__all__ = []
__regression_arguments__ = {'__all__': __all__}
"""
Connects to tokamak-profiledb.ccfe.ac.uk and generates an ODS with core profiles an... | 47.517483 | 134 | 0.621781 |
395bf59ac440fa7a3f2977319552b01b682ee49e | 4,921 | py | Python | Download.py | Morasiu/VideoDownloader | 626a1a9f83218066834f0aae6fa37e57aa777e71 | [
"MIT"
] | null | null | null | Download.py | Morasiu/VideoDownloader | 626a1a9f83218066834f0aae6fa37e57aa777e71 | [
"MIT"
] | null | null | null | Download.py | Morasiu/VideoDownloader | 626a1a9f83218066834f0aae6fa37e57aa777e71 | [
"MIT"
] | null | null | null | from EpisodeType import EpisodeType
from urllib.parse import urlparse
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from requests import get
from tqdm import tqdm
from tkinter import *
import urllib3, os, time
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning... | 39.368 | 138 | 0.595001 |
f8db80526c3a50ddcf8e079cfc580628d6382177 | 584 | py | Python | 2019/day04/day04_part2.py | boffman/adventofcode | 077e727b9b050c1fc5cb99ed7fbd64c5a69d9605 | [
"MIT"
] | null | null | null | 2019/day04/day04_part2.py | boffman/adventofcode | 077e727b9b050c1fc5cb99ed7fbd64c5a69d9605 | [
"MIT"
] | null | null | null | 2019/day04/day04_part2.py | boffman/adventofcode | 077e727b9b050c1fc5cb99ed7fbd64c5a69d9605 | [
"MIT"
] | null | null | null | from collections import defaultdict
def is_valid(input):
sinp = str(input)
slen = len(sinp)
if slen != 6:
return False
dupes = defaultdict(int)
for ix in range(slen-1):
if sinp[ix] > sinp[ix+1]:
return False
if sinp[ix] == sinp[ix+1]:
dupe... | 22.461538 | 36 | 0.508562 |
be5307f2a6c8481a46d9bfaeea66fd2c6d364951 | 837 | py | Python | src/map_renderer/offscreen_window.py | XiaoJake/range-mcl | b6ff92c7299ff3d01f1a8e41c11bc0191746084d | [
"MIT"
] | 141 | 2021-03-31T02:05:03.000Z | 2022-03-24T18:14:18.000Z | src/map_renderer/offscreen_window.py | JasonSun623/range-mcl | bd3cc2b9efa1172fcf547938501e3a7e0b687c50 | [
"MIT"
] | 6 | 2021-06-18T03:19:19.000Z | 2022-01-23T09:58:39.000Z | src/map_renderer/offscreen_window.py | JasonSun623/range-mcl | bd3cc2b9efa1172fcf547938501e3a7e0b687c50 | [
"MIT"
] | 48 | 2021-04-05T09:06:34.000Z | 2022-03-24T03:08:38.000Z | #!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
# Brief: Representation of an off-screen Window using glfw.
import glfw
class OffscreenWindow:
""" Representation of an off-screen Window using glfw. """
def __init__(self, init_glfw: bool = True, show: bool = False... | 31 | 74 | 0.702509 |
2abcbfa3c74e769f820f22b5d37acc97bfa9f30d | 26,988 | py | Python | venv/lib/python3.7/site-packages/sklearn/utils/tests/test_extmath.py | sohiai/ur5 | 4101e0a0ec219dfdffda40650dd0867d00d821a8 | [
"MIT"
] | 1 | 2020-01-31T19:20:20.000Z | 2020-01-31T19:20:20.000Z | venv/lib/python3.7/site-packages/sklearn/utils/tests/test_extmath.py | sohiai/ur5 | 4101e0a0ec219dfdffda40650dd0867d00d821a8 | [
"MIT"
] | 23 | 2020-03-13T18:03:04.000Z | 2020-05-16T13:10:33.000Z | venv/lib/python3.7/site-packages/sklearn/utils/tests/test_extmath.py | sohiai/ur5 | 4101e0a0ec219dfdffda40650dd0867d00d821a8 | [
"MIT"
] | 3 | 2020-02-22T18:55:36.000Z | 2020-05-09T01:54:11.000Z | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis Engemann <denis-alexander.engemann@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from scipy import stats
from scipy.special import expit
im... | 37.327801 | 90 | 0.629317 |
5e08900e8835b33b23f0bca24a4e42802ac8ff4d | 1,483 | py | Python | decoy/stub_store.py | mcous/decoy | 0d5345ecbd3cacee795ac644530048a282c2ba20 | [
"MIT"
] | 8 | 2020-11-30T23:35:54.000Z | 2022-01-18T17:53:15.000Z | decoy/stub_store.py | mcous/decoy | 0d5345ecbd3cacee795ac644530048a282c2ba20 | [
"MIT"
] | 96 | 2020-12-02T17:01:41.000Z | 2022-03-27T05:10:46.000Z | decoy/stub_store.py | mcous/decoy | 0d5345ecbd3cacee795ac644530048a282c2ba20 | [
"MIT"
] | null | null | null | """Stub creation and storage."""
from typing import Any, Callable, List, NamedTuple, Optional
from .spy_calls import SpyCall, WhenRehearsal, match_call
class StubBehavior(NamedTuple):
"""A recorded stub behavior."""
return_value: Optional[Any] = None
error: Optional[Exception] = None
action: Optiona... | 28.519231 | 77 | 0.63857 |
1e69eac7f702c6e7a7154f325a4420a2931378a8 | 62,278 | py | Python | python/mxnet/ndarray/sparse.py | harshp8l/incubator-mxnet | 119897d927cfce49d6cad97e474a16d2beaf8091 | [
"Apache-2.0"
] | 1 | 2019-01-17T12:51:59.000Z | 2019-01-17T12:51:59.000Z | python/mxnet/ndarray/sparse.py | hcxiong/incubator-mxnet | f5ba2678f077b58d31d31029f680f93b313e1cea | [
"Apache-2.0"
] | 14 | 2018-10-15T16:38:27.000Z | 2018-12-12T00:11:03.000Z | python/mxnet/ndarray/sparse.py | harshp8l/incubator-mxnet | 119897d927cfce49d6cad97e474a16d2beaf8091 | [
"Apache-2.0"
] | null | null | null | # 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 u... | 38.020757 | 100 | 0.586467 |
3f60150b202369d70de19a21c4bed48f8e20de08 | 394 | py | Python | AlphaCodeServer/contest/migrations/0004_auto_20200501_0830.py | RoranBlackfire/Alpha-Code | d2dcae2bf6f6b705ad577c92172f143e213a6c3d | [
"MIT"
] | null | null | null | AlphaCodeServer/contest/migrations/0004_auto_20200501_0830.py | RoranBlackfire/Alpha-Code | d2dcae2bf6f6b705ad577c92172f143e213a6c3d | [
"MIT"
] | null | null | null | AlphaCodeServer/contest/migrations/0004_auto_20200501_0830.py | RoranBlackfire/Alpha-Code | d2dcae2bf6f6b705ad577c92172f143e213a6c3d | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-05-01 08:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contest', '0003_auto_20200501_0828'),
]
operations = [
migrations.AlterField(
model_name='participant',
name='rank',... | 20.736842 | 55 | 0.606599 |
4e4e5233c38431377e0749dbb39e3205b877dc9d | 6,501 | py | Python | keras/models/sharpness_aware_minimization.py | RakeshJarupula/keras | 2ac6638e91d5aff77c22b45e9c8c84fb05a9e477 | [
"Apache-2.0"
] | null | null | null | keras/models/sharpness_aware_minimization.py | RakeshJarupula/keras | 2ac6638e91d5aff77c22b45e9c8c84fb05a9e477 | [
"Apache-2.0"
] | null | null | null | keras/models/sharpness_aware_minimization.py | RakeshJarupula/keras | 2ac6638e91d5aff77c22b45e9c8c84fb05a9e477 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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... | 37.796512 | 80 | 0.690817 |
d1e7e70dd2ac946fbfec36e47b3a4e65092f1eb8 | 3,925 | py | Python | Code/all-starter-code/bases.py | stark276/CS-1.3-Core-Data-Structure | dabf3b1a3301a2edbf0ae084c8febdcf48145aee | [
"MIT"
] | null | null | null | Code/all-starter-code/bases.py | stark276/CS-1.3-Core-Data-Structure | dabf3b1a3301a2edbf0ae084c8febdcf48145aee | [
"MIT"
] | null | null | null | Code/all-starter-code/bases.py | stark276/CS-1.3-Core-Data-Structure | dabf3b1a3301a2edbf0ae084c8febdcf48145aee | [
"MIT"
] | null | null | null | #!python
import string
# Hint: Use these string constants to encode/decode hexadecimal digits and more
# string.digits is '0123456789'
# string.hexdigits is '0123456789abcdefABCDEF'
# string.ascii_lowercase is 'abcdefghijklmnopqrstuvwxyz'
# string.ascii_uppercase is 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
# string.ascii_letters ... | 37.380952 | 124 | 0.649172 |
314a041a7eb19b1b5e2e65a3ff0cd5ff1c9aaab7 | 492 | py | Python | alurareceita/apps/receitas/urls.py | Jefferson472/apredendo-django | c01817d93493f588c1a3462c6e153cbbc3230508 | [
"MIT"
] | null | null | null | alurareceita/apps/receitas/urls.py | Jefferson472/apredendo-django | c01817d93493f588c1a3462c6e153cbbc3230508 | [
"MIT"
] | null | null | null | alurareceita/apps/receitas/urls.py | Jefferson472/apredendo-django | c01817d93493f588c1a3462c6e153cbbc3230508 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import *
urlpatterns = [
path('', index, name='index'),
path('<int:receita_id>', receita, name='receita'),
path('busca', buscar, name='buscar'),
path('cria_receita', cria_receita, name='cria_receita'),
path('deleta/<int:receita_id>', deleta_receita, name='d... | 35.142857 | 80 | 0.697154 |
5231b15ab9e05c410736b7478773f9f1d0148853 | 7,408 | py | Python | xlsxwriter/test/worksheet/test_cond_format08.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/worksheet/test_cond_format08.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/worksheet/test_cond_format08.py | hugovk/XlsxWriter | e97cc66637d9895480ee32cfb5e561d652d3787b | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
import unittest
from io import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import... | 44.626506 | 171 | 0.401863 |
4b2cf451c7a9002eba2e505aa00f559d8218a11b | 9,328 | py | Python | pydatastructs/miscellaneous_data_structures/queue.py | Aimaanhasan/pydatastructs | be07fdf45cde1a37f004b920cb2b4bc1e294c12b | [
"BSD-3-Clause"
] | 1 | 2020-04-13T11:24:43.000Z | 2020-04-13T11:24:43.000Z | pydatastructs/miscellaneous_data_structures/queue.py | Aimaanhasan/pydatastructs | be07fdf45cde1a37f004b920cb2b4bc1e294c12b | [
"BSD-3-Clause"
] | null | null | null | pydatastructs/miscellaneous_data_structures/queue.py | Aimaanhasan/pydatastructs | be07fdf45cde1a37f004b920cb2b4bc1e294c12b | [
"BSD-3-Clause"
] | null | null | null | from pydatastructs.linear_data_structures import DynamicOneDimensionalArray, SinglyLinkedList
from pydatastructs.utils.misc_util import NoneType, LinkedListNode, _check_type
from pydatastructs.trees.heaps import BinaryHeap, BinomialHeap
from copy import deepcopy as dc
__all__ = [
'Queue',
'PriorityQueue'
]
cl... | 25.416894 | 93 | 0.5744 |
a32108cbf7bb2a3c537acb3c3884dcb04616d0b5 | 8,872 | py | Python | nxted/pycheck.py | xlcteam/nxtIDE | 659ace68b060682aeeb6d789d88a7b6899a56f9a | [
"MIT"
] | 8 | 2015-02-16T23:11:30.000Z | 2021-01-16T00:15:25.000Z | nxted/pycheck.py | xlcteam/nxtIDE | 659ace68b060682aeeb6d789d88a7b6899a56f9a | [
"MIT"
] | 3 | 2016-07-16T20:47:48.000Z | 2021-03-25T21:27:11.000Z | nxted/pycheck.py | xlcteam/nxtIDE | 659ace68b060682aeeb6d789d88a7b6899a56f9a | [
"MIT"
] | 3 | 2015-08-30T18:23:51.000Z | 2016-10-28T15:07:59.000Z | #!/usr/bin/env python
import sys, re, os
import compiler.ast
from compiler.visitor import ASTVisitor
from compiler import parse, walk
from compiler.consts import *
class Visitor(ASTVisitor):
def __init__(self, stream=sys.stdout, parent=None, debug=False):
self.parent = parent
self.v = l... | 27.638629 | 80 | 0.491885 |
965d7091520c20f6374c83cbbd8045a6f0602308 | 1,143 | py | Python | decodeshapes.py | aycock/mh | 72cc39619a6978a923a30c47652b06444239b884 | [
"MIT"
] | null | null | null | decodeshapes.py | aycock/mh | 72cc39619a6978a923a30c47652b06444239b884 | [
"MIT"
] | null | null | null | decodeshapes.py | aycock/mh | 72cc39619a6978a923a30c47652b06444239b884 | [
"MIT"
] | null | null | null | # Python < 3
# see LICENSE file for licensing information
# Shape table reconstruction using turtle graphics based on info from the
# Applesoft BASIC Programming Reference Manual.
# Takes binary memory dump from emulator as input. For Mystery House, dump
# $5700-$5a00 and $5500-$5700.
import sys
import turtle
DOTS... | 16.808824 | 75 | 0.621172 |
fe4a13e20e6d4043a1f462271ece5e39a66becc3 | 138 | py | Python | src/concurrency/__init__.py | technicaltitch/django-concurrency | 9a289dc007b1cdf609b7dfb77a6d2868abc8097f | [
"MIT"
] | null | null | null | src/concurrency/__init__.py | technicaltitch/django-concurrency | 9a289dc007b1cdf609b7dfb77a6d2868abc8097f | [
"MIT"
] | null | null | null | src/concurrency/__init__.py | technicaltitch/django-concurrency | 9a289dc007b1cdf609b7dfb77a6d2868abc8097f | [
"MIT"
] | null | null | null | __author__ = 'sax'
default_app_config = 'concurrency.apps.ConcurrencyConfig'
VERSION = __version__ = "2.1a0"
NAME = 'django-concurrency'
| 23 | 57 | 0.768116 |
139221ad3457a6198031eb603002ff19ddae16b9 | 11,095 | py | Python | synapse/app/federation_sender.py | cgarwood82/synapse | e2cce15af16cd85d5379e8d961680028bfc9e754 | [
"Apache-2.0"
] | 1 | 2020-03-05T12:58:46.000Z | 2020-03-05T12:58:46.000Z | synapse/app/federation_sender.py | cgarwood82/synapse | e2cce15af16cd85d5379e8d961680028bfc9e754 | [
"Apache-2.0"
] | null | null | null | synapse/app/federation_sender.py | cgarwood82/synapse | e2cce15af16cd85d5379e8d961680028bfc9e754 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 37.107023 | 86 | 0.666877 |
0ca1477bed55aa59161c4a30087de2a03251a696 | 12,232 | py | Python | predictionaglorithmimplementation.py | keemsisi/keras-unemployment-prediction | 78a57a67be6e30baa0aad688a417a7c320222026 | [
"MIT"
] | 3 | 2018-12-31T02:03:48.000Z | 2021-02-02T07:59:59.000Z | predictionaglorithmimplementation.py | keemsisi/keras-unemployment-prediction | 78a57a67be6e30baa0aad688a417a7c320222026 | [
"MIT"
] | null | null | null | predictionaglorithmimplementation.py | keemsisi/keras-unemployment-prediction | 78a57a67be6e30baa0aad688a417a7c320222026 | [
"MIT"
] | null | null | null | from keras import models
import numpy as np
import h5py
from keras.layers import Dense, Dropout
from numpy import typename
from keras import activations
from keras import Sequential
from sklearn.model_selection import train_test_split
from sklearn.ensemble import GradientBoostingRegressor
import pandas as pd
from kera... | 33.512329 | 222 | 0.693754 |
7df6b71d2c7ed3d28ec3022e28c31051dc5a74b6 | 893 | py | Python | python-examples/python-heatmap-chapt-3/analysis_OLD.py | jhudsl/Reproducibility_in_Cancer_Informatics | 2aacc8b04ac9d367962c0141ef9a2b2acb24aefa | [
"MIT"
] | null | null | null | python-examples/python-heatmap-chapt-3/analysis_OLD.py | jhudsl/Reproducibility_in_Cancer_Informatics | 2aacc8b04ac9d367962c0141ef9a2b2acb24aefa | [
"MIT"
] | 71 | 2021-09-30T12:24:21.000Z | 2022-03-23T17:23:14.000Z | python-examples/python-heatmap-chapt-3/analysis_OLD.py | jhudsl/Reproducibility_in_Cancer_Informatics | 2aacc8b04ac9d367962c0141ef9a2b2acb24aefa | [
"MIT"
] | null | null | null | import os
from pathlib import Path
import pyrefinebio
import statistics
import pandas as pd
import numpy as np
import seaborn as sns; sns.set_theme(color_codes=True)
import IPython
df1=pd.read_csv('a/file/path/only/I/have/SRP070849.tsv', sep='\t')
mdf=pd.read_csv('a/file/path/only/I/have/SRP070849_metadata.tsv', sep='\... | 35.72 | 124 | 0.733483 |
c892950fe1144054eca14a8980934199b8b094b2 | 18,891 | py | Python | kolibri/auth/test/test_api.py | rtibbles/kolibri | 7efdf0497738c793f281013f9913f8ecc1a55f10 | [
"MIT"
] | null | null | null | kolibri/auth/test/test_api.py | rtibbles/kolibri | 7efdf0497738c793f281013f9913f8ecc1a55f10 | [
"MIT"
] | 7 | 2016-06-23T16:01:02.000Z | 2018-12-01T22:15:13.000Z | kolibri/auth/test/test_api.py | MingDai/kolibri | e4719b7d41a40e0cc9fc4150bc137017643fea62 | [
"MIT"
] | 1 | 2021-06-01T23:15:26.000Z | 2021-06-01T23:15:26.000Z | from __future__ import absolute_import, print_function, unicode_literals
import collections
import factory
import sys
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase as BaseTestCase
from django.contrib.sessions.models import Session
from .. ... | 47.825316 | 146 | 0.70118 |
95ada14c27bc684f0a9517617607d3fab4a27ee1 | 5,153 | py | Python | pytchat/processors/html_archiver.py | mandark321/pytchat | 39d99ad4afdf9387e207c3b646642c27dcd0a365 | [
"MIT"
] | null | null | null | pytchat/processors/html_archiver.py | mandark321/pytchat | 39d99ad4afdf9387e207c3b646642c27dcd0a365 | [
"MIT"
] | null | null | null | pytchat/processors/html_archiver.py | mandark321/pytchat | 39d99ad4afdf9387e207c3b646642c27dcd0a365 | [
"MIT"
] | null | null | null | import httpx
import os
import re
import time
from base64 import standard_b64encode
from httpx import NetworkError, ReadTimeout
from .chat_processor import ChatProcessor
from .default.processor import DefaultProcessor
from ..exceptions import UnknownConnectionError
PATTERN = re.compile(r"(.*)\(([0-9]+)\)$")
fmt_heade... | 33.032051 | 117 | 0.540074 |
f7f3713d8e21b003b4dc406f37eadf5be5e080e3 | 7,933 | py | Python | documentstore_migracao/utils/xylose_converter.py | joffilyfe/document-store-migracao | b5125b7aedec56f0e8787900bdfd124aaf65e3e3 | [
"BSD-2-Clause"
] | null | null | null | documentstore_migracao/utils/xylose_converter.py | joffilyfe/document-store-migracao | b5125b7aedec56f0e8787900bdfd124aaf65e3e3 | [
"BSD-2-Clause"
] | 14 | 2019-03-13T12:19:12.000Z | 2019-03-19T17:37:08.000Z | documentstore_migracao/utils/xylose_converter.py | joffilyfe/document-store-migracao | b5125b7aedec56f0e8787900bdfd124aaf65e3e3 | [
"BSD-2-Clause"
] | 3 | 2019-03-12T18:55:55.000Z | 2019-03-20T18:38:02.000Z | import logging
from typing import List
from datetime import datetime
from documentstore_migracao.utils import scielo_ids_generator
from xylose.scielodocument import Journal, Issue
logger = logging.getLogger(__name__)
def date_to_datetime(date: str) -> datetime:
"""Transforma datas no formato ISO em objetos datet... | 30.163498 | 88 | 0.651708 |
1ab87cd7ac4ac9cebb01cbd4ea33b5e3828e8fd8 | 4,174 | py | Python | backend/api/tests/test_serializers.py | jenhaoyang/Disfactory | 40f9e14044f0e457489164745095f24cd1e923dd | [
"MIT"
] | null | null | null | backend/api/tests/test_serializers.py | jenhaoyang/Disfactory | 40f9e14044f0e457489164745095f24cd1e923dd | [
"MIT"
] | null | null | null | backend/api/tests/test_serializers.py | jenhaoyang/Disfactory | 40f9e14044f0e457489164745095f24cd1e923dd | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from django.test import TestCase
from ..serializers import FactorySerializer, ImageSerializer
from ..models import Factory, ReportRecord, Image
class FactorySerializersTestCase(TestCase):
def setUp(self):
self.im1 = Image.objects.create(image_path="https://i.img... | 36.295652 | 88 | 0.623622 |
1bdc58645e3ee563e389e5c6472b4ef2d8470073 | 3,263 | py | Python | mr_reports/utils.py | hlongmore/django-mr_reports | 249bdd57ec6fb122cd538ad60432ab899d0f7c72 | [
"BSD-3-Clause"
] | null | null | null | mr_reports/utils.py | hlongmore/django-mr_reports | 249bdd57ec6fb122cd538ad60432ab899d0f7c72 | [
"BSD-3-Clause"
] | null | null | null | mr_reports/utils.py | hlongmore/django-mr_reports | 249bdd57ec6fb122cd538ad60432ab899d0f7c72 | [
"BSD-3-Clause"
] | null | null | null |
"""
Re-usable generic functions, and handling special tasks like emailing reports
"""
import datetime
import re
from django.test.client import Client
from django.core.mail import EmailMultiAlternatives
from django.http import QueryDict, HttpRequest
from django.db import transaction
from django.utils import timezone
... | 40.283951 | 149 | 0.734907 |
f0471f036aa5c4b43b1b73a7d3a215337b4f980c | 8,953 | py | Python | forecast/views/view_forecast/forecast_summary.py | uktrade/fadmin2 | 0f774400fb816c9ca30e30b25ae542135966e185 | [
"MIT"
] | 3 | 2020-01-05T16:46:42.000Z | 2021-08-02T08:08:39.000Z | forecast/views/view_forecast/forecast_summary.py | uktrade/fadmin2 | 0f774400fb816c9ca30e30b25ae542135966e185 | [
"MIT"
] | 30 | 2019-11-28T15:16:35.000Z | 2021-08-16T14:49:58.000Z | forecast/views/view_forecast/forecast_summary.py | uktrade/fadmin2 | 0f774400fb816c9ca30e30b25ae542135966e185 | [
"MIT"
] | null | null | null | from django.http import Http404
from django.http.response import HttpResponseRedirect
from django.shortcuts import reverse
from costcentre.forms import DirectorateCostCentresForm
from forecast.forms import ForecastPeriodForm
from forecast.tables import (
ForecastSubTotalTable,
ForecastWithLinkTable,
)
from f... | 34.171756 | 86 | 0.606501 |
d9093c01e9a6486e0d4936455a093edc8d5319f0 | 2,374 | py | Python | data_map.py | Rupt/which_is_real | 84d59afb7161418763a26d2dd30f07ad93664809 | [
"MIT"
] | 1 | 2021-12-03T06:09:02.000Z | 2021-12-03T06:09:02.000Z | data_map.py | Rupt/which_is_real | 84d59afb7161418763a26d2dd30f07ad93664809 | [
"MIT"
] | 1 | 2022-01-29T15:21:47.000Z | 2022-01-29T15:21:47.000Z | data_map.py | Rupt/which_is_real | 84d59afb7161418763a26d2dd30f07ad93664809 | [
"MIT"
] | 1 | 2022-01-29T15:18:40.000Z | 2022-01-29T15:18:40.000Z | """
Prepare data for the 2d map example.
"""
import os
import numba
import numpy
from PIL import Image
BASE_MAP = "images/mapdraw_poster.png"
FOLDER = "data_map"
def main():
img = imload(BASE_MAP)
unique = numpy.unique(img)
for x in unique:
blobs = find_isolated(img, x)
for i, mask in ... | 21.779817 | 67 | 0.538332 |
82cd40dde852df34836dae9c52391c6b167143c0 | 6,223 | py | Python | jina/__init__.py | Virus2466/jina | 9ca715bf73558c9a63aeb43205073a4404011a47 | [
"Apache-2.0"
] | 1 | 2022-02-11T07:19:59.000Z | 2022-02-11T07:19:59.000Z | jina/__init__.py | Sangwan5688/jina | ecd810543e19f91af80e91df11afb03ff96b1ec6 | [
"Apache-2.0"
] | null | null | null | jina/__init__.py | Sangwan5688/jina | ecd810543e19f91af80e91df11afb03ff96b1ec6 | [
"Apache-2.0"
] | null | null | null | """
Top-level module of Jina.
The primary function of this module is to import all of the public Jina
interfaces into a single place. The interfaces themselves are located in
sub-modules, as described below.
"""
import datetime as _datetime
import os as _os
import platform as _platform
import signal as _signal
impor... | 29.633333 | 122 | 0.712839 |
fca440f5462e933e0fc6a749f2b5e5ccff8ab61a | 474 | py | Python | src/python/WMCore/WMBS/Oracle/Fileset/BulkNewReturn.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WMBS/Oracle/Fileset/BulkNewReturn.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WMBS/Oracle/Fileset/BulkNewReturn.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_BulkNewReturn_
Oracle implementation of Fileset.BulkNewReturn
"""
__all__ = []
from WMCore.WMBS.MySQL.Fileset.BulkNewReturn import BulkNewReturn as MySQLBulkNewReturn
class BulkNewReturn(MySQLBulkNewReturn):
"""
Does a bulk commit of Fileset, followed by returning their IDs
... | 21.545455 | 87 | 0.71308 |
9603ea94d5a2d93867c135f64e134fee81ec8185 | 376 | py | Python | Textbook/Chapter 2/addListElements3.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | 16 | 2019-01-10T18:54:13.000Z | 2022-01-28T20:07:20.000Z | Textbook/Chapter 2/addListElements3.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | null | null | null | Textbook/Chapter 2/addListElements3.py | hunterluepke/Learn-Python-for-Stats-and-Econ | d580a8e27ba937fc8401ac6d0714b6488ac8bbb6 | [
"MIT"
] | 15 | 2019-01-24T17:11:20.000Z | 2021-12-11T01:53:57.000Z | #addListElements3.py
list1 = [5, 4, 9, 10, 3, 5]
list2 = [6, 3, 2, 1, 5, 3]
print("list1 elements:", list1[0], list1[1], list1[2], list1[3], list1[4])
print("list2 elements:", list2[0], list2[1], list2[2], list2[3], list2[4])
list3 = []
j = len(list1)
if j == len(list2):
for i in range(0, len(list2)):
list... | 26.857143 | 74 | 0.587766 |
ebc4ba93918b2ca0d1859037cf5c2415d582b199 | 1,263 | py | Python | main.py | tikismoke/mqtt-screen-power | 9712c6993c2f573dc4e6a28020e337f45e030a1b | [
"MIT"
] | null | null | null | main.py | tikismoke/mqtt-screen-power | 9712c6993c2f573dc4e6a28020e337f45e030a1b | [
"MIT"
] | null | null | null | main.py | tikismoke/mqtt-screen-power | 9712c6993c2f573dc4e6a28020e337f45e030a1b | [
"MIT"
] | null | null | null | import paho.mqtt.client as mqtt
import subprocess
import config
def on_connect(client, userdata, flags, rc):
# The callback for when the client receives a CONNACK response from the server.
print("Connected with result code "+str(rc))
# Subscribing in on_connect() means that if we lose the connection and
... | 33.236842 | 83 | 0.730008 |
e47d3136f19178ad8c1d1b483f3e3bb0078c93d2 | 1,459 | py | Python | python_modules/dagster/dagster_tests/core_tests/types_tests/test_dagster_type_decorator.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/types_tests/test_dagster_type_decorator.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/types_tests/test_dagster_type_decorator.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
from dagster.core.types.decorator import (
as_dagster_type,
dagster_type,
get_runtime_type_on_decorated_klass,
)
def test_dagster_type_decorator():
@dagster_type(name=None)
class Foo(object):
pass
@dagster_type()
class Bar(object):
pass
... | 30.395833 | 100 | 0.74366 |
dddc76ec356bdd2a48c99998e14dba74880e626f | 599 | py | Python | Mundo 2/File 071.py | PedroHenriqueSimoes/Exercicios-Python | 702a819d508dd7878b88fb676559d899237ac761 | [
"MIT"
] | 1 | 2020-04-30T21:32:01.000Z | 2020-04-30T21:32:01.000Z | Mundo 2/File 071.py | PedroHenriqueSimoes/Exercicios-Python | 702a819d508dd7878b88fb676559d899237ac761 | [
"MIT"
] | 1 | 2021-10-05T02:00:04.000Z | 2021-10-05T02:00:04.000Z | Mundo 2/File 071.py | PedroHenriqueSimoes/Exercicios-Python | 702a819d508dd7878b88fb676559d899237ac761 | [
"MIT"
] | null | null | null | sed50 = sed20 = sed10 = sed1 = div = 0
print('=' * 40)
print('{:^40}'.format('Caixa Eletrônico'))
print('=' * 40)
vs = (int(input('Quanto deseja sacar? R$: ')))
while True:
sed50 = vs // 50
s = vs % 50
sed20 = s // 20
s = s % 20
sed10 = s // 10
s = s % 10
sed1 = s // 1
s = s % 1
if s... | 22.185185 | 46 | 0.512521 |
e1df0256d36da8aed1c1a949a8425a529f2ac481 | 151 | py | Python | server/featherlight/resolvers/query/network.py | FeatherLightApp/FeatherLight-API | 1543cc4532f9a8ec1bae51374d4e5d88546c8d15 | [
"MIT"
] | 3 | 2020-06-28T17:30:57.000Z | 2022-01-25T18:03:38.000Z | server/featherlight/resolvers/query/network.py | FeatherLightApp/FeatherLight-API | 1543cc4532f9a8ec1bae51374d4e5d88546c8d15 | [
"MIT"
] | null | null | null | server/featherlight/resolvers/query/network.py | FeatherLightApp/FeatherLight-API | 1543cc4532f9a8ec1bae51374d4e5d88546c8d15 | [
"MIT"
] | 1 | 2021-02-04T07:14:08.000Z | 2021-02-04T07:14:08.000Z | import os
from ariadne import QueryType
QUERY = QueryType()
@QUERY.field("network")
def r_network(*_):
return os.environ.get("NETWORK").upper()
| 15.1 | 44 | 0.715232 |
a93253baddf4796a1d3be3c80ef0f0979cf95d54 | 5,507 | py | Python | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/pbr/core.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/pbr/core.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/pbr/core.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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... | 40.792593 | 78 | 0.692936 |
fc7a8af7c59b377c12cea6acdabace89366fc01a | 7,969 | py | Python | drivers/sdcard/sdcard.py | agners/micropython | 49167722a5595385f58e3ada647d96eae87eb8c9 | [
"MIT"
] | 4 | 2016-12-09T17:45:32.000Z | 2019-05-02T19:59:59.000Z | drivers/sdcard/sdcard.py | agners/micropython | 49167722a5595385f58e3ada647d96eae87eb8c9 | [
"MIT"
] | null | null | null | drivers/sdcard/sdcard.py | agners/micropython | 49167722a5595385f58e3ada647d96eae87eb8c9 | [
"MIT"
] | 3 | 2018-07-21T15:57:16.000Z | 2019-11-29T03:02:35.000Z | """
Micro Python driver for SD cards using SPI bus.
Requires an SPI bus and a CS pin. Provides readblocks and writeblocks
methods so the device can be mounted as a filesystem.
Example usage on pyboard:
import pyb, sdcard, os
sd = sdcard.SDCard(pyb.SPI(1), pyb.Pin.board.X5)
pyb.mount(sd, '/sd2')
os.l... | 29.297794 | 77 | 0.527544 |
1162c4868396f3d5eeb7a0d6ad38e1686a8269ef | 145 | py | Python | scripts/load_bleurt.py | MaratSaidov/artificial-text-detection | 74b2100294232ec361db84fdc3a24fdeba1fce49 | [
"MIT"
] | 12 | 2021-11-15T08:59:46.000Z | 2022-03-06T15:42:24.000Z | scripts/load_bleurt.py | MaratSaidov/artificial-text-detection | 74b2100294232ec361db84fdc3a24fdeba1fce49 | [
"MIT"
] | 2 | 2021-11-14T15:50:00.000Z | 2021-11-20T12:17:29.000Z | scripts/load_bleurt.py | MaratSaidov/artificial-text-detection | 74b2100294232ec361db84fdc3a24fdeba1fce49 | [
"MIT"
] | null | null | null | from datasets import load_metric
bleurt = load_metric("bleurt", "BLEURT-20")
print(bleurt)
# $HOME/.cache/huggingface/metrics/bleurt/BLEURT-20
| 20.714286 | 51 | 0.772414 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.