hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11d67f4baf9c05183860cc4be58638ad7cdfbb3a | 536 | py | Python | src/nanobind/__init__.py | clayne/nanobind | 865a8cfcd6df1a9092bf9ce431eb3be404fb49aa | [
"BSD-3-Clause"
] | null | null | null | src/nanobind/__init__.py | clayne/nanobind | 865a8cfcd6df1a9092bf9ce431eb3be404fb49aa | [
"BSD-3-Clause"
] | null | null | null | src/nanobind/__init__.py | clayne/nanobind | 865a8cfcd6df1a9092bf9ce431eb3be404fb49aa | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
if sys.version_info < (3, 8):
raise ImportError("nanobind does not support Python < 3.8.")
def include_dir() -> str:
"Return the path to the nanobind include directory"
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "include")
def cmake_dir() -> str:
"Return the ... | 24.363636 | 78 | 0.682836 |
f810531bffd2cd5ac508de61c7bf7b85450e6dbd | 715 | py | Python | tests/regressiontests/model_inheritance_select_related/models.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | 3 | 2015-10-14T09:13:48.000Z | 2021-01-01T06:31:25.000Z | tests/regressiontests/model_inheritance_select_related/models.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | null | null | null | tests/regressiontests/model_inheritance_select_related/models.py | graingert/django | 784d0c261c76535dc760bc8d76793d92f35c1513 | [
"BSD-3-Clause"
] | 1 | 2019-07-15T02:35:16.000Z | 2019-07-15T02:35:16.000Z | """
Regression tests for the interaction between model inheritance and
select_related().
"""
from __future__ import unicode_literals
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
class Meta:
ordering = ('name',)
def __unicode__(self):
ret... | 22.34375 | 66 | 0.702098 |
08ba558893839d07ffbcb39159f8bff12fcd7f89 | 2,320 | py | Python | photorename/photorename.py | LehmRob/photorename | b499b08f225264e5c7be3b51988d8e8fcbeb088f | [
"MIT"
] | null | null | null | photorename/photorename.py | LehmRob/photorename | b499b08f225264e5c7be3b51988d8e8fcbeb088f | [
"MIT"
] | null | null | null | photorename/photorename.py | LehmRob/photorename | b499b08f225264e5c7be3b51988d8e8fcbeb088f | [
"MIT"
] | null | null | null | from pathlib import Path, PurePath
from typing import List
from exif import Image
from shutil import copy2
class Photo():
def __init__(self, path: Path, suffix: str) -> None:
with open(path, 'rb') as f:
self.image = Image(f)
self.path = path
self.suffix = suffix
def __r... | 32.222222 | 104 | 0.599138 |
bc1934657a00cc8699cafd750822cb46410a9e6d | 5,308 | py | Python | python-client/cloudera/director/v12/models/validation_result.py | daanknoope/director-sdk | a099fedd5afe365aedbb50daa75de048ef6f7ab4 | [
"Apache-2.0"
] | 24 | 2015-03-04T01:39:36.000Z | 2020-06-30T13:34:27.000Z | python-client/cloudera/director/v12/models/validation_result.py | daanknoope/director-sdk | a099fedd5afe365aedbb50daa75de048ef6f7ab4 | [
"Apache-2.0"
] | 5 | 2015-11-04T08:18:47.000Z | 2019-01-05T11:12:19.000Z | python-client/cloudera/director/v12/models/validation_result.py | daanknoope/director-sdk | a099fedd5afe365aedbb50daa75de048ef6f7ab4 | [
"Apache-2.0"
] | 26 | 2015-02-24T21:13:53.000Z | 2020-12-15T06:01:46.000Z | # coding: utf-8
"""
Licensed to Cloudera, Inc. under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. Cloudera, Inc. licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use thi... | 29.653631 | 91 | 0.610211 |
b0b4c6459c20fbbc7744f962b8f54ba7b201e20d | 3,691 | py | Python | gen_anchors.py | foamliu/YOLO-Face-Detection | 2efbbf1982203c9f3ba3e46fc588b03a5429ff45 | [
"Apache-2.0"
] | 4 | 2018-08-17T06:01:58.000Z | 2020-03-27T17:19:06.000Z | gen_anchors.py | foamliu/YOLO-Face-Detection | 2efbbf1982203c9f3ba3e46fc588b03a5429ff45 | [
"Apache-2.0"
] | null | null | null | gen_anchors.py | foamliu/YOLO-Face-Detection | 2efbbf1982203c9f3ba3e46fc588b03a5429ff45 | [
"Apache-2.0"
] | 4 | 2018-08-17T10:41:55.000Z | 2020-03-27T17:19:08.000Z | import os
import random
import cv2 as cv
import numpy as np
from config import grid_h, grid_w, train_annot_file, train_image_folder, num_box
from utils import parse_annot
def IOU(ann, centroids):
w, h = ann
similarities = []
for centroid in centroids:
c_w, c_h = centroid
if c_w >= w an... | 29.528 | 102 | 0.611758 |
a4c0382af6f552602cb46b948c566d08bc1002a1 | 4,654 | py | Python | useful_methods.py | nimish15shah/PSDD_reader | bec4aa7663d2c2a16dc0656451cb643720c30181 | [
"MIT"
] | null | null | null | useful_methods.py | nimish15shah/PSDD_reader | bec4aa7663d2c2a16dc0656451cb643720c30181 | [
"MIT"
] | null | null | null | useful_methods.py | nimish15shah/PSDD_reader | bec4aa7663d2c2a16dc0656451cb643720c30181 | [
"MIT"
] | null | null | null | import inspect
import networkx as nx
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
black = '\u001b[30m'
red = '\u001b[31m'
green = '\u001b[32m'
yellow = '\u001b[33m'
blue = '\u... | 23.624365 | 96 | 0.554147 |
150e37056cb1b15a21ae8d3d4cef85e7b38b9414 | 611 | py | Python | temboo/core/Library/Facebook/Actions/Fitness/Walks/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Facebook/Actions/Fitness/Walks/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Facebook/Actions/Fitness/Walks/__init__.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | from temboo.Library.Facebook.Actions.Fitness.Walks.CreateWalk import CreateWalk, CreateWalkInputSet, CreateWalkResultSet, CreateWalkChoreographyExecution
from temboo.Library.Facebook.Actions.Fitness.Walks.DeleteWalk import DeleteWalk, DeleteWalkInputSet, DeleteWalkResultSet, DeleteWalkChoreographyExecution
from temboo.... | 122.2 | 153 | 0.895254 |
3be8bd6de9401af23bd3cdf16e6d3ddd22ba138c | 857 | py | Python | .history/ClassFiles/deluxe_ice_cream_truck_20210617185802.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/deluxe_ice_cream_truck_20210617185802.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/deluxe_ice_cream_truck_20210617185802.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null |
from sympy import real_root
class Icecream:
max_scoops = 3
def __init__(self):
self.scoops = 0
def eat(self, scoops):
if self.scoops < scoops:
print("Not enough bites left!")
else:
self.scoops -= scoops
def add(self, scoops):
self.scoops +... | 18.630435 | 56 | 0.581097 |
e16f80c58050c7bc111d77fd4150fc44bd5624e4 | 336 | py | Python | algo-c-to-_/examples/dayweek_.py | nobi56/aRepo | 4d444647ceedd239a1bc37bfa31ba8f204fca0ef | [
"CC0-1.0"
] | null | null | null | algo-c-to-_/examples/dayweek_.py | nobi56/aRepo | 4d444647ceedd239a1bc37bfa31ba8f204fca0ef | [
"CC0-1.0"
] | null | null | null | algo-c-to-_/examples/dayweek_.py | nobi56/aRepo | 4d444647ceedd239a1bc37bfa31ba8f204fca0ef | [
"CC0-1.0"
] | null | null | null | #
# from src/dayweek.c
#
# a part of main to dayweek, initArray
#
from dayweek import dayweek, initArray
a = initArray()
for i in range(21, 32):
print("{0:4d}/{1:02d}/{2:02d} {3}".format(2019, 12, i, a[dayweek(2019,12,i)]))
for i in range(1, 12):
print("{0:4d}/{1:02d}/{2:02d} {3}".format(2020, 1, i, a[daywe... | 21 | 82 | 0.607143 |
936da8fc079142380ba838ac7fc1b254ea19cb83 | 89 | py | Python | face_tracking/variables.py | caixhstrive/Mini_Xception | 0cf7ce88d9cbe56f0dc20b0ef2850a499c033ce3 | [
"MIT"
] | 3 | 2018-11-21T06:51:57.000Z | 2018-11-21T08:20:53.000Z | face_tracking/variables.py | caixhstrive/Mini_Xception | 0cf7ce88d9cbe56f0dc20b0ef2850a499c033ce3 | [
"MIT"
] | null | null | null | face_tracking/variables.py | caixhstrive/Mini_Xception | 0cf7ce88d9cbe56f0dc20b0ef2850a499c033ce3 | [
"MIT"
] | null | null | null | start_pos = [0, 0]
end_pos = [0, 0]
select_done = False
last_face_x = 0
last_face_y = 0
| 12.714286 | 19 | 0.674157 |
a08eb91f3f8a91532356b3a24f29e63b05bfc8e9 | 13,898 | py | Python | tests/test_errors.py | wanderindev/udacity-casting-agency | a123ff26ffc565bfff4f4f829ae7613a6ccb366d | [
"MIT"
] | 1 | 2021-01-10T19:34:24.000Z | 2021-01-10T19:34:24.000Z | tests/test_errors.py | wanderindev/udacity-casting-agency | a123ff26ffc565bfff4f4f829ae7613a6ccb366d | [
"MIT"
] | 1 | 2021-04-30T21:07:42.000Z | 2021-04-30T21:07:42.000Z | tests/test_errors.py | wanderindev/udacity-casting-agency | a123ff26ffc565bfff4f4f829ae7613a6ccb366d | [
"MIT"
] | null | null | null | import json
import unittest
from tests.base_test import BaseTest
class TestErrors(BaseTest):
"""Test all error conditions"""
def setUp(self):
super(TestErrors, self).setUp()
with self.app_context:
self.actor = {
"name": "John Doe",
"d... | 33.328537 | 80 | 0.465894 |
7787248cdc7fda85982240e6c19401b7c4eaa6f4 | 136 | py | Python | python-core/src/filterEvenOdd.py | NSnietol/python-core-and-advanced | 85d03894d5430bcdd62b0ae35371356f26d9374a | [
"MIT"
] | 2 | 2019-04-13T14:10:38.000Z | 2021-01-17T00:57:51.000Z | python-core/src/filterEvenOdd.py | NSnietol/python-core-and-advanced | 85d03894d5430bcdd62b0ae35371356f26d9374a | [
"MIT"
] | null | null | null | python-core/src/filterEvenOdd.py | NSnietol/python-core-and-advanced | 85d03894d5430bcdd62b0ae35371356f26d9374a | [
"MIT"
] | 1 | 2020-02-20T15:44:36.000Z | 2020-02-20T15:44:36.000Z | '''
Created on Nov 11, 2018
@author: nilson.nieto
'''
lst = [1,4,431,24,1,4,234,2,1,128]
print(list(filter(lambda a : a%2==0,lst))) | 12.363636 | 42 | 0.610294 |
c531d71db6f4fa1ca0035e07fc2278a2d0e051b4 | 2,432 | py | Python | lib/googlecloudsdk/api_lib/test/exit_code.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | lib/googlecloudsdk/api_lib/test/exit_code.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/test/exit_code.py | bopopescu/SDK | e6d9aaee2456f706d1d86e8ec2a41d146e33550d | [
"Apache-2.0"
] | 2 | 2020-11-04T03:08:21.000Z | 2020-11-05T08:14:41.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 40.533333 | 80 | 0.763158 |
7506527023d27d199751b09fb116829106ec8e9d | 3,050 | py | Python | aries_cloudagent/commands/start.py | ankitkr1606/aries-cloudagent-python | fa3a4c44501b96597061897c1d529507cdf45acf | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/commands/start.py | ankitkr1606/aries-cloudagent-python | fa3a4c44501b96597061897c1d529507cdf45acf | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/commands/start.py | ankitkr1606/aries-cloudagent-python | fa3a4c44501b96597061897c1d529507cdf45acf | [
"Apache-2.0"
] | null | null | null | """Entrypoint."""
import asyncio
import functools
import logging
import os
import signal
from configargparse import ArgumentParser
from typing import Coroutine, Sequence
try:
import uvloop
except ImportError:
uvloop = None
from ..core.conductor import Conductor
from ..config import argparse as arg
from ..con... | 27.981651 | 85 | 0.685246 |
e289bb95b9fbf6918c8d51ac1f07d8a0962c3aba | 1,494 | py | Python | srfnef/base/barrier_single.py | twj2417/srf | 63365cfd75199d70eea2273214a4fa580a9fdf2a | [
"Apache-2.0"
] | null | null | null | srfnef/base/barrier_single.py | twj2417/srf | 63365cfd75199d70eea2273214a4fa580a9fdf2a | [
"Apache-2.0"
] | null | null | null | srfnef/base/barrier_single.py | twj2417/srf | 63365cfd75199d70eea2273214a4fa580a9fdf2a | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from doufo import tagfunc
from dxl.learn.backend import TensorFlowBackend
@tagfunc()
def no_op():
return no_op[TensorFlowBackend]()
def barrier_single(name, nb_signal, nb_join, task = None, id_join = None):
"""
`name`: global unique name of barrier.
`task`: for signal hosts o... | 30.489796 | 85 | 0.544846 |
4e5eabac8b17c1783b63e5c6d38b97238af11a1a | 3,106 | py | Python | submit_tas.py | docprofsky/asu_TAS_helper | 8057d3eced013e96be7f6850b78d7aba395819b9 | [
"BSD-3-Clause"
] | null | null | null | submit_tas.py | docprofsky/asu_TAS_helper | 8057d3eced013e96be7f6850b78d7aba395819b9 | [
"BSD-3-Clause"
] | 1 | 2020-04-03T00:46:58.000Z | 2020-04-03T00:46:58.000Z | submit_tas.py | docprofsky/asu_TAS_helper | 8057d3eced013e96be7f6850b78d7aba395819b9 | [
"BSD-3-Clause"
] | 1 | 2019-10-16T03:03:06.000Z | 2019-10-16T03:03:06.000Z | #! /usr/bin/env python3
# coding: utf-8
from pycookiecheat import chrome_cookies
import requests
from datetime import date, datetime, time, timedelta as td
def make_request_data(start_datetime, end_datetime):
# captured from the form on tas.asu.edu
data = {
'bConfirm': '0',
'mode': 'new',
... | 36.541176 | 102 | 0.66613 |
7fe549e92532e95aab976877d024fc1657a0b3e1 | 12,771 | py | Python | zerver/views/realm.py | mehant-kr/zulip | acd34e27627b227c66c4a3dce64d38563600852f | [
"Apache-2.0"
] | 3 | 2019-02-03T20:46:55.000Z | 2019-03-04T15:44:28.000Z | zerver/views/realm.py | mehant-kr/zulip | acd34e27627b227c66c4a3dce64d38563600852f | [
"Apache-2.0"
] | 1 | 2022-01-24T09:38:09.000Z | 2022-01-24T09:38:09.000Z | zerver/views/realm.py | mehant-kr/zulip | acd34e27627b227c66c4a3dce64d38563600852f | [
"Apache-2.0"
] | 2 | 2021-07-02T14:15:24.000Z | 2021-08-16T12:31:49.000Z | from typing import Any, Dict, Optional, Union
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.utils.translation import gettext as _
from django.views.decorators.http import require_safe
from confirmation.models import... | 46.78022 | 100 | 0.733537 |
dd3c2594949cc3ad747612b0fc51384ee0353eb1 | 5,390 | py | Python | levels/05_uts_namespace/rd.py | sat0ken/rubber-docker | ab0b4b5e600fe4244e08fa81f092d589260ce325 | [
"MIT"
] | null | null | null | levels/05_uts_namespace/rd.py | sat0ken/rubber-docker | ab0b4b5e600fe4244e08fa81f092d589260ce325 | [
"MIT"
] | null | null | null | levels/05_uts_namespace/rd.py | sat0ken/rubber-docker | ab0b4b5e600fe4244e08fa81f092d589260ce325 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
"""Docker From Scratch Workshop - Level 5: Add UTS namespace.
Goal: Have your own private hostname!
"""
from __future__ import print_function
import linux
import tarfile
import uuid
import click
import os
import stat
import traceback
def _get_image_path(image_name, image_dir, image_suffix... | 35.695364 | 80 | 0.665677 |
04d4a0d0403cc682e167109d526d0965af180363 | 1,667 | py | Python | Start_interface.py | StormInside/Simple-Face-Recognition-Program | c7b8adab6ffba2195fd7fc3fae9b22a10e3be4f4 | [
"MIT"
] | 1 | 2020-10-06T09:02:24.000Z | 2020-10-06T09:02:24.000Z | Start_interface.py | StormInside/Simple-Face-Recognition-Program | c7b8adab6ffba2195fd7fc3fae9b22a10e3be4f4 | [
"MIT"
] | null | null | null | Start_interface.py | StormInside/Simple-Face-Recognition-Program | c7b8adab6ffba2195fd7fc3fae9b22a10e3be4f4 | [
"MIT"
] | null | null | null | import eel
import os
from FaceRecogniser import FaceRecogniser
sr = None
@eel.expose
def set_known_folder(folder):
if folder:
try:
global sr
sr = FaceRecogniser(folder)
if sr:
return "Success initializing"
except Exception as ex:
retu... | 26.887097 | 79 | 0.573485 |
5fb3222aeda4422d3930ef53d2e1b9a61b1cb317 | 6,072 | py | Python | tests/services/events/test_request_events_service.py | inveniosoftware/invenio-requests | 1814e8c68285ac4979530e43a1f8b56381ad3155 | [
"MIT"
] | null | null | null | tests/services/events/test_request_events_service.py | inveniosoftware/invenio-requests | 1814e8c68285ac4979530e43a1f8b56381ad3155 | [
"MIT"
] | 87 | 2021-11-08T12:58:56.000Z | 2022-03-29T08:52:48.000Z | tests/services/events/test_request_events_service.py | inveniosoftware/invenio-requests | 1814e8c68285ac4979530e43a1f8b56381ad3155 | [
"MIT"
] | 10 | 2021-11-04T19:15:37.000Z | 2022-02-21T09:27:07.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021 Northwestern University.
#
# Invenio-Requests is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Service tests."""
import copy
import pytest
from invenio_acce... | 33.921788 | 88 | 0.707181 |
8678c1a4a77cb486a36d8ef60269a31d57c5b890 | 189 | py | Python | supermarket/urls.py | mallimuondu/supermarket | c24dc3e7352427c2fee97622ac68093434759058 | [
"MIT"
] | null | null | null | supermarket/urls.py | mallimuondu/supermarket | c24dc3e7352427c2fee97622ac68093434759058 | [
"MIT"
] | null | null | null | supermarket/urls.py | mallimuondu/supermarket | c24dc3e7352427c2fee97622ac68093434759058 | [
"MIT"
] | null | null | null | from Django.contrib import admin
from Django.URLs import path
from fire app import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.index, name='index'),
] | 21 | 40 | 0.687831 |
91f025ca98b35c681798d1dda0109f86192cbfa0 | 731 | py | Python | test/test_calibration.py | joemoorhouse/quantum-mc | 1696e589fc3cd5fe12ecd4483ca2b8567a4addea | [
"MIT"
] | 1 | 2021-08-10T17:56:36.000Z | 2021-08-10T17:56:36.000Z | test/test_calibration.py | joemoorhouse/quantum-mc | 1696e589fc3cd5fe12ecd4483ca2b8567a4addea | [
"MIT"
] | null | null | null | test/test_calibration.py | joemoorhouse/quantum-mc | 1696e589fc3cd5fe12ecd4483ca2b8567a4addea | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from qiskit.test.base import QiskitTestCase
import quantum_mc.calibration.fitting as ft
import quantum_mc.calibration.time_series as ts
class TestCalibration(QiskitTestCase):
def test_from_series(self):
"""Simple end-to-end test of the (semi-classical) multiply and add b... | 33.227273 | 93 | 0.667579 |
f5dc0fa60c9216363f98974c436114cb1050b857 | 4,174 | py | Python | cloudera-integration/parcel/make_manifest.py | afoerster/pulse | 78f0645051d7da574604f2db0c1e07a4804d3de4 | [
"Apache-2.0"
] | 14 | 2018-06-13T01:15:10.000Z | 2019-11-18T13:11:40.000Z | cloudera-integration/parcel/make_manifest.py | afoerster/pulse | 78f0645051d7da574604f2db0c1e07a4804d3de4 | [
"Apache-2.0"
] | 62 | 2018-06-04T15:54:45.000Z | 2020-04-06T16:46:49.000Z | cloudera-integration/parcel/make_manifest.py | afoerster/pulse | 78f0645051d7da574604f2db0c1e07a4804d3de4 | [
"Apache-2.0"
] | 23 | 2018-05-23T22:14:46.000Z | 2019-10-22T13:21:09.000Z | #!/usr/bin/env python
#
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ... | 35.675214 | 101 | 0.626258 |
04accded45d9cfee82752c2661bc2f9884e29608 | 2,762 | py | Python | server.py | ONSdigital/edcdi | 9fa67d83aa03ed7c030e615b7e96ad04423aeda5 | [
"MIT"
] | null | null | null | server.py | ONSdigital/edcdi | 9fa67d83aa03ed7c030e615b7e96ad04423aeda5 | [
"MIT"
] | 39 | 2016-05-19T08:59:56.000Z | 2019-06-04T12:45:23.000Z | server.py | ONSdigital/posie | 9fa67d83aa03ed7c030e615b7e96ad04423aeda5 | [
"MIT"
] | 2 | 2017-08-14T10:18:05.000Z | 2021-04-11T07:50:02.000Z | import binascii
import logging
import os
from cryptography import exceptions
from flask import current_app, request, jsonify
from sdc.crypto.decrypter import decrypt as sdc_decrypt
from sdc.crypto.exceptions import InvalidTokenException
from structlog import wrap_logger
from application import create_app, KEY_PURPOSE... | 25.33945 | 77 | 0.661477 |
3ff12df73345a42f8a5f282c84418801b5616012 | 120 | py | Python | crnn/to_lmdb/__init__.py | EuphoriaYan/ctpn-crnn | 320ca79c5a86e95bb1278f9f71d16269cfe5490f | [
"MIT"
] | 44 | 2019-06-19T08:56:27.000Z | 2022-03-27T01:54:52.000Z | crnn/to_lmdb/__init__.py | EuphoriaYan/ctpn-crnn | 320ca79c5a86e95bb1278f9f71d16269cfe5490f | [
"MIT"
] | 6 | 2019-07-18T04:25:12.000Z | 2021-06-04T02:49:33.000Z | crnn/to_lmdb/__init__.py | EuphoriaYan/ctpn-crnn | 320ca79c5a86e95bb1278f9f71d16269cfe5490f | [
"MIT"
] | 12 | 2019-07-01T03:55:37.000Z | 2021-12-06T08:34:39.000Z | #!/usr/bin/env python3
# -*-coding:utf8 -*-
# @TIME :2019/3/27 下午12:09
# @Author :hwwu
# @File :__init__.py.py | 24 | 30 | 0.575 |
8fd3d1a57f6c8df3ddc04986e405f1bfec5533e0 | 8,037 | py | Python | pandas/tests/extension/decimal/test_decimal.py | uds5501/pandas | ec356fa62241750a227c1bafb4c0c396bde1c293 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/extension/decimal/test_decimal.py | uds5501/pandas | ec356fa62241750a227c1bafb4c0c396bde1c293 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/extension/decimal/test_decimal.py | uds5501/pandas | ec356fa62241750a227c1bafb4c0c396bde1c293 | [
"BSD-3-Clause"
] | null | null | null | import decimal
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from pandas.tests.extension import base
from .array import DecimalDtype, DecimalArray, make_data
@pytest.fixture
def dtype():
return DecimalDtype()
@pytest.fixture
def data():
return DecimalArray(make_dat... | 30.328302 | 77 | 0.647381 |
1f2240d185ab16ed8fedcb34b49f3a3ad9ca9909 | 870 | py | Python | Series.py | sad786/Python | 738198bbab5abfa1d521e83291eed7026a4f6f12 | [
"Apache-2.0"
] | null | null | null | Series.py | sad786/Python | 738198bbab5abfa1d521e83291eed7026a4f6f12 | [
"Apache-2.0"
] | null | null | null | Series.py | sad786/Python | 738198bbab5abfa1d521e83291eed7026a4f6f12 | [
"Apache-2.0"
] | null | null | null | import math
# to get nth prime number
# O(n*m) where n is the input and m is sqare root of the input
def getNPrime(n):
if n<=0:
return -1
pr = 2
count =0
while n>1:
pr +=1
sq = int(math.sqrt(pr))
is_prime = True
for i in range(2,sq+1):
count +=1
if pr%i==0:
is_prime = False
break
... | 15 | 62 | 0.616092 |
766d6eb72dbba59f7303f59dcac52a96e9e9e2a0 | 789 | py | Python | Algorithms/5_Searching/6.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/5_Searching/6.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/5_Searching/6.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/sherlock-and-array/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'balancedSums' function below.
#
# The function is expected to return a STRING.
# The function accepts INTEGER_ARRAY arr as parameter.
#
def balancedSums(n, arr... | 20.230769 | 66 | 0.609632 |
2174cd8f2600670fd60f7640203447417452430d | 488 | py | Python | rhtml/rhtml.py | dricottone/docker-moin | d66dadc51cfff2e909b39b7d5e8b55648e6cc273 | [
"BSD-3-Clause"
] | null | null | null | rhtml/rhtml.py | dricottone/docker-moin | d66dadc51cfff2e909b39b7d5e8b55648e6cc273 | [
"BSD-3-Clause"
] | null | null | null | rhtml/rhtml.py | dricottone/docker-moin | d66dadc51cfff2e909b39b7d5e8b55648e6cc273 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - Raw HTML Parser
@copyright: 2010 by Chris Martino <chris@console.org>
@license: GNU GPL.
"""
from MoinMoin.parser._ParserBase import ParserBase
Dependencies = ['user']
class Parser(ParserBase):
parsername = "RawHTML"
Dependencies = []
def __init__(self... | 19.52 | 55 | 0.64959 |
f4fd5494f4e935b6baea303b61890501b698f688 | 2,773 | py | Python | app/__init__.py | herereadthis/ffring | f5809b6631ced108ba64dec140cfc58d4737a703 | [
"MIT"
] | null | null | null | app/__init__.py | herereadthis/ffring | f5809b6631ced108ba64dec140cfc58d4737a703 | [
"MIT"
] | null | null | null | app/__init__.py | herereadthis/ffring | f5809b6631ced108ba64dec140cfc58d4737a703 | [
"MIT"
] | null | null | null | '''
__init__.py file is a package, and defines what symbols the package exposes to
the outside world.
'''
from flask import Flask
# lowercase c is the file, uppercase C is the class name
from config import Config
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlch... | 39.614286 | 80 | 0.716552 |
80d28a1f6bba0359d7548d707960a3bb74b31922 | 3,000 | py | Python | behavior_layers/social_compliance_layer/scripts/mock_annotations.py | makokal/socially_normative_navigation | aeb6bfbb709f0f495e9314f740f652975cf216f0 | [
"MIT"
] | 21 | 2016-05-10T16:25:37.000Z | 2022-03-10T01:15:26.000Z | behavior_layers/social_compliance_layer/scripts/mock_annotations.py | CodeToPoem/socially_normative_navigation | aeb6bfbb709f0f495e9314f740f652975cf216f0 | [
"MIT"
] | 3 | 2016-06-20T05:17:12.000Z | 2020-07-08T09:22:35.000Z | behavior_layers/social_compliance_layer/scripts/mock_annotations.py | CodeToPoem/socially_normative_navigation | aeb6bfbb709f0f495e9314f740f652975cf216f0 | [
"MIT"
] | 12 | 2017-05-02T12:17:03.000Z | 2022-03-19T09:57:15.000Z | #!/usr/bin/env python
#
# Publishes fake annotations for blow out tests
import rospy
from spencer_mapping_msgs.msg import Annotation, Annotations
from geometry_msgs.msg import Pose2D, Point
from visualization_msgs.msg import Marker, MarkerArray
from math import sin, cos
def visualize_annotations(all_annotations, p... | 28.301887 | 78 | 0.609 |
d48828793199701d8207eaf351a946d955995b9d | 3,084 | py | Python | pyrrd/backend/tests/test_external.py | karikoskinen/pyrrd | 0a0603792545e1ef0b561e353f8818d7bf61a58f | [
"BSD-3-Clause"
] | null | null | null | pyrrd/backend/tests/test_external.py | karikoskinen/pyrrd | 0a0603792545e1ef0b561e353f8818d7bf61a58f | [
"BSD-3-Clause"
] | null | null | null | pyrrd/backend/tests/test_external.py | karikoskinen/pyrrd | 0a0603792545e1ef0b561e353f8818d7bf61a58f | [
"BSD-3-Clause"
] | null | null | null | from cStringIO import StringIO
import os
import sys
import tempfile
from unittest import TestCase
from pyrrd.exceptions import ExternalCommandError
from pyrrd.rrd import DataSource, RRA, RRD
class ExternalBackendTestCase(TestCase):
def setUp(self):
ds = [
DataSource(dsName="speed", dsType="C... | 43.43662 | 518 | 0.566796 |
d891302d16f8170f3eb20fe5aa510a9cefdd59ff | 2,521 | py | Python | serverless/notification.py | glaucius/iot-event-aws-serverless-nodered | a3e446b9d50e1d3c6b4f0565efd3430591f89f90 | [
"MIT"
] | 2 | 2020-08-26T23:14:49.000Z | 2021-06-04T23:00:39.000Z | serverless/notification.py | glaucius/iot-event-aws-serverless-nodered | a3e446b9d50e1d3c6b4f0565efd3430591f89f90 | [
"MIT"
] | null | null | null | serverless/notification.py | glaucius/iot-event-aws-serverless-nodered | a3e446b9d50e1d3c6b4f0565efd3430591f89f90 | [
"MIT"
] | 3 | 2020-08-26T23:20:02.000Z | 2020-08-30T13:56:32.000Z | import json
import telegram
import os
import logging
# Logging is cool!
logger = logging.getLogger()
if logger.handlers:
for handler in logger.handlers:
logger.removeHandler(handler)
logging.basicConfig(level=logging.INFO)
def configure_telegram():
"""
Configures the bot with a Telegram Token.
... | 38.19697 | 168 | 0.681079 |
0a89176aa2b468dc08d68b6516885482fa07522a | 7,273 | py | Python | FusionIIIT/Fusion/settings/common.py | krish-1409/Fusion | 8b456417bada6f120cfd05a8f99e74b94ecb9fd4 | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/Fusion/settings/common.py | krish-1409/Fusion | 8b456417bada6f120cfd05a8f99e74b94ecb9fd4 | [
"bzip2-1.0.6"
] | null | null | null | FusionIIIT/Fusion/settings/common.py | krish-1409/Fusion | 8b456417bada6f120cfd05a8f99e74b94ecb9fd4 | [
"bzip2-1.0.6"
] | null | null | null | '''
Django settings for Fusion project.
Generated by 'django-admin startproject' using Django 1.11.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
'''
import os
... | 27.549242 | 91 | 0.705349 |
de2c2eff068039c852bc52774c8f9df54e38b45b | 150 | py | Python | python/oddvoices/utils.py | oddvoices/oddvoices | 824592478f4b805afff4d6da2728de5aa93d0575 | [
"Apache-2.0"
] | 25 | 2021-03-11T17:31:31.000Z | 2022-03-23T07:24:34.000Z | python/oddvoices/utils.py | oddvoices/oddvoices | 824592478f4b805afff4d6da2728de5aa93d0575 | [
"Apache-2.0"
] | 60 | 2021-03-04T03:16:05.000Z | 2022-01-21T05:36:46.000Z | python/oddvoices/utils.py | oddvoices/oddvoices | 824592478f4b805afff4d6da2728de5aa93d0575 | [
"Apache-2.0"
] | null | null | null | import pathlib
BASE_DIR = pathlib.Path(__file__).resolve().parent
def midi_note_to_hertz(midi_note):
return 440 * 2 ** ((midi_note - 69) / 12)
| 18.75 | 50 | 0.706667 |
04ef584e7c7ddc8790ba3dc0e9b1ad83fa982bae | 49,042 | py | Python | tests/test_models/test_heads.py | jiangrongatrobo/mmdetection | 76ccf891f98f5df526146560773f1fedf5607bdd | [
"Apache-2.0"
] | 278 | 2021-05-09T10:29:55.000Z | 2022-03-30T01:06:03.000Z | tests/test_models/test_heads.py | jiangrongatrobo/mmdetection | 76ccf891f98f5df526146560773f1fedf5607bdd | [
"Apache-2.0"
] | 24 | 2021-07-05T07:00:04.000Z | 2022-03-22T13:16:16.000Z | tests/test_models/test_heads.py | jiangrongatrobo/mmdetection | 76ccf891f98f5df526146560773f1fedf5607bdd | [
"Apache-2.0"
] | 49 | 2021-05-12T05:27:28.000Z | 2022-03-14T04:02:40.000Z | import mmcv
import numpy as np
import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
from mmdet.models.dense_heads import (AnchorHead, CornerHead, FCOSHead,
FSAFHead, GuidedAnchorHead, PAAHead,
... | 37.379573 | 79 | 0.591677 |
2ac2c859e443376cc1b0a4c70168be020d2efa62 | 3,016 | py | Python | official/utils/flags/_device.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 15 | 2018-08-15T19:29:39.000Z | 2021-11-05T02:14:59.000Z | official/utils/flags/_device.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 5 | 2020-10-01T09:02:34.000Z | 2021-02-21T12:50:11.000Z | official/utils/flags/_device.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 8 | 2019-06-06T20:37:15.000Z | 2022-03-04T13:54:38.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.747368 | 80 | 0.660477 |
400b575a91585879c93042ba10532d2759b36ee8 | 5,423 | py | Python | python/proton/_io.py | NS-SlaFleur/qpid-proton | a3d1ef482c3a5d8cd06775ad4e52be11d50c578c | [
"Apache-2.0"
] | null | null | null | python/proton/_io.py | NS-SlaFleur/qpid-proton | a3d1ef482c3a5d8cd06775ad4e52be11d50c578c | [
"Apache-2.0"
] | null | null | null | python/proton/_io.py | NS-SlaFleur/qpid-proton | a3d1ef482c3a5d8cd06775ad4e52be11d50c578c | [
"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... | 31.346821 | 106 | 0.562051 |
85a57f1711275ff4d2b85919f43c0c995d8ff179 | 530 | py | Python | cors/constants.py | optimizely/cors-python | d3fd6ff20b5c1a05ede0950ce817e584bb969d81 | [
"MIT"
] | null | null | null | cors/constants.py | optimizely/cors-python | d3fd6ff20b5c1a05ede0950ce817e584bb969d81 | [
"MIT"
] | null | null | null | cors/constants.py | optimizely/cors-python | d3fd6ff20b5c1a05ede0950ce817e584bb969d81 | [
"MIT"
] | 1 | 2021-02-14T11:58:36.000Z | 2021-02-14T11:58:36.000Z | ORIGIN = 'Origin'
VARY = 'Vary'
ACCESS_CONTROL_REQUEST_METHOD = 'Access-Control-Request-Method'
ACCESS_CONTROL_REQUEST_HEADERS = 'Access-Control-Request-Headers'
ACCESS_CONTROL_ALLOW_ORIGIN = 'Access-Control-Allow-Origin'
ACCESS_CONTROL_ALLOW_CREDENTIALS = 'Access-Control-Allow-Credentials'
ACCESS_CONTROL_ALLOW_METHODS... | 48.181818 | 69 | 0.841509 |
aefc7dc90d1934cab6f701c620e0ba73573a43d3 | 375 | py | Python | EventGridTriggerDemo/__init__.py | dongheeHwang/functions-docs-python | 9a645bceaefb9a96f722ac7778d6c4ca750ef28a | [
"MIT"
] | 3 | 2021-08-12T07:58:38.000Z | 2022-02-12T21:28:06.000Z | EventGridTriggerDemo/__init__.py | dongheeHwang/functions-docs-python | 9a645bceaefb9a96f722ac7778d6c4ca750ef28a | [
"MIT"
] | null | null | null | EventGridTriggerDemo/__init__.py | dongheeHwang/functions-docs-python | 9a645bceaefb9a96f722ac7778d6c4ca750ef28a | [
"MIT"
] | 9 | 2020-02-18T18:07:50.000Z | 2022-02-10T10:51:01.000Z | import json
import logging
import azure.functions as func
def main(event: func.EventGridEvent):
result = json.dumps({
'id': event.id,
'data': event.get_json(),
'topic': event.topic,
'subject': event.subject,
'event_type': event.event_type,
})
logging.info('Pyt... | 22.058824 | 75 | 0.626667 |
12f7fe3b8bee95e7525d1eed26742631dcc66fb2 | 3,291 | py | Python | datastore/tests/unit/bdkd/datastore/util/test_copy_move.py | sirca/bdkd_datastore | 2fc4f3d7976d326c0c8ae46d72475aaaa1fdf78d | [
"Apache-2.0"
] | 3 | 2016-03-12T03:09:18.000Z | 2017-04-23T12:47:49.000Z | datastore/tests/unit/bdkd/datastore/util/test_copy_move.py | sirca/bdkd_datastore | 2fc4f3d7976d326c0c8ae46d72475aaaa1fdf78d | [
"Apache-2.0"
] | 3 | 2015-12-03T00:32:55.000Z | 2016-02-03T23:31:07.000Z | datastore/tests/unit/bdkd/datastore/util/test_copy_move.py | sirca/bdkd_datastore | 2fc4f3d7976d326c0c8ae46d72475aaaa1fdf78d | [
"Apache-2.0"
] | 1 | 2019-04-08T07:43:17.000Z | 2019-04-08T07:43:17.000Z | # Copyright 2015 Nicta
#
# 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, softwa... | 41.1375 | 83 | 0.70161 |
d80ffcc789c9663279fe4ac7df42602fbf84053a | 1,209 | py | Python | cronus/test_timeout.py | priestoferis/cronus | 070ef1fc0db8437dd54f9d74e33910e399389251 | [
"BSD-3-Clause"
] | null | null | null | cronus/test_timeout.py | priestoferis/cronus | 070ef1fc0db8437dd54f9d74e33910e399389251 | [
"BSD-3-Clause"
] | null | null | null | cronus/test_timeout.py | priestoferis/cronus | 070ef1fc0db8437dd54f9d74e33910e399389251 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for @timeout decorator
Date created: 8th June 2014
"""
from timeout import timeout, TimeoutError
import time
from nose.tools import assert_raises, assert_equals
class TestTimeout:
def setup(self):
pass
def teardown(self):
pass
def test_timeout_with_timeout_error(self):
... | 25.723404 | 81 | 0.61373 |
e78121c42c6b9133d1aed4bbe2211786f7cc2777 | 2,277 | py | Python | data_structures/linked_list/python/Singly_linked_list.py | avi-pal/al-go-rithms | 5167a20f1db7b366ff19f2962c1746a02e4f5067 | [
"CC0-1.0"
] | 1,253 | 2017-06-06T07:19:25.000Z | 2022-03-30T17:07:58.000Z | data_structures/linked_list/python/Singly_linked_list.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 554 | 2017-09-29T18:56:01.000Z | 2022-02-21T15:48:13.000Z | data_structures/linked_list/python/Singly_linked_list.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 2,226 | 2017-09-29T19:59:59.000Z | 2022-03-25T08:59:55.000Z | # creating a node
class node:
def __init__(self, data):
self.data = data
self.next = None
class linkedlist:
def __init__(self):
self.head = None #creating a header
#inserting a new node at the beginning
def push(self, new_data):
new_node = node(new_data)... | 25.021978 | 69 | 0.54238 |
f70a06d2005dcef3d0954fa546eda9fa99fac2cb | 4,394 | py | Python | tests/test_malquery.py | kra-ts/falconpy | c7c4ed93cb3b56cdfd86757f573fde57e4ccf857 | [
"Unlicense"
] | null | null | null | tests/test_malquery.py | kra-ts/falconpy | c7c4ed93cb3b56cdfd86757f573fde57e4ccf857 | [
"Unlicense"
] | null | null | null | tests/test_malquery.py | kra-ts/falconpy | c7c4ed93cb3b56cdfd86757f573fde57e4ccf857 | [
"Unlicense"
] | null | null | null | # test_malquery.py
# This class tests the malquery service class
import os
import sys
import pytest
# Authentication via test_authorization.py
from tests import test_authorization as Authorization
# Import our sibling src folder into the path
sys.path.append(os.path.abspath('src'))
# Classes to test - manually imported... | 48.285714 | 94 | 0.382795 |
ebb1634054f7627f2eba9c1f3ae6562290517a6f | 1,783 | py | Python | pydantic_odm/types.py | antipooh/pydantic-odm | acc6bdae3b2c472ee53824d03b709e99950939db | [
"MIT"
] | 41 | 2019-12-23T03:35:10.000Z | 2021-05-18T23:47:57.000Z | pydantic_odm/types.py | antipooh/pydantic-odm | acc6bdae3b2c472ee53824d03b709e99950939db | [
"MIT"
] | 26 | 2019-12-03T21:48:36.000Z | 2021-01-15T04:36:29.000Z | pydantic_odm/types.py | antipooh/pydantic-odm | acc6bdae3b2c472ee53824d03b709e99950939db | [
"MIT"
] | 11 | 2019-12-23T11:04:51.000Z | 2020-09-28T06:13:57.000Z | """Types for pydantic models"""
from __future__ import annotations
from bson import ObjectId
from bson.errors import InvalidId
from datetime import datetime
from pydantic import BaseModel
from typing import TYPE_CHECKING, Any, Callable, Generator, List, Union
from .errors import DatetimeBorderCrossing
if TYPE_CHECKI... | 25.471429 | 79 | 0.608525 |
dc0fc458c4a9a262ce918956d8e2659b55bda013 | 16,847 | py | Python | selfdrive/car/honda/carstate.py | max9952001/ArnePilot | 98668d3c352f82f747649d2973d90099e02951bb | [
"MIT"
] | 1 | 2020-12-03T13:52:27.000Z | 2020-12-03T13:52:27.000Z | selfdrive/car/honda/carstate.py | max9952001/ArnePilot | 98668d3c352f82f747649d2973d90099e02951bb | [
"MIT"
] | null | null | null | selfdrive/car/honda/carstate.py | max9952001/ArnePilot | 98668d3c352f82f747649d2973d90099e02951bb | [
"MIT"
] | null | null | null | from cereal import car
from collections import defaultdict
from common.numpy_fast import interp
from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from selfdrive.config import Conversions as CV
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.honda.values import CA... | 46.410468 | 182 | 0.653885 |
2078c2f1ce3d5a66fa86b5a9b5254462bbeaa4c4 | 3,377 | py | Python | bnbtutorial/spiders/vayablespider.py | castaway2000/comp_scrawler | 12286e7d0822aa783a7630886fdb508487796a95 | [
"MIT"
] | null | null | null | bnbtutorial/spiders/vayablespider.py | castaway2000/comp_scrawler | 12286e7d0822aa783a7630886fdb508487796a95 | [
"MIT"
] | null | null | null | bnbtutorial/spiders/vayablespider.py | castaway2000/comp_scrawler | 12286e7d0822aa783a7630886fdb508487796a95 | [
"MIT"
] | null | null | null | import re
import os
import optparse
from selenium import webdriver
from selenium.common import exceptions
def get_links(driver, links):
email_url = []
driver.get(links)
href = driver.find_elements_by_partial_link_text('Email')
for h in href:
email_url.append(h.get_attribute('href'))
return... | 43.294872 | 125 | 0.620669 |
8055a28176e89be6554b91107fb95998f68bb16b | 1,820 | py | Python | Code/Testing/file_compare.py | jaspertaylor-projects/QuantumLatticeGasAlgorithm | a7fb8da08e0bd41c5b7fda96f2d5cb50a95cb0ca | [
"MIT"
] | 1 | 2020-05-21T19:34:20.000Z | 2020-05-21T19:34:20.000Z | Code/Testing/file_compare.py | jaspertaylor-projects/QuantumLatticeGasAlgorithm | a7fb8da08e0bd41c5b7fda96f2d5cb50a95cb0ca | [
"MIT"
] | null | null | null | Code/Testing/file_compare.py | jaspertaylor-projects/QuantumLatticeGasAlgorithm | a7fb8da08e0bd41c5b7fda96f2d5cb50a95cb0ca | [
"MIT"
] | null | null | null | import numpy as np
import os
directory = '/Volumes/Simulations/QuantumLatticeGas/Experiments/charmonium/SimVersion_2.0/spin_2_BEC_1D_test/default/kink_states/state1_12/XSize_2048_YSize_1_ZSize_1/G0_1.0_G1_1.0_G2_1.0_MU_1.0_Scaling_50.0_Step_1000/Data/Frame_00002000.npy'
directory2 = '/Volumes/Simulations/QuantumLatti... | 52 | 241 | 0.691758 |
b9c6f62faab467d683d49fb2f9c9d9eb277201f4 | 5,425 | py | Python | venv/lib/python3.8/site-packages/hass_nabucasa/iot.py | vsevolodpohvalenko/home-assistant | 4ae19b7d5d843c65ba700922c1814755257eb4e0 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/hass_nabucasa/iot.py | vsevolodpohvalenko/home-assistant | 4ae19b7d5d843c65ba700922c1814755257eb4e0 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/hass_nabucasa/iot.py | vsevolodpohvalenko/home-assistant | 4ae19b7d5d843c65ba700922c1814755257eb4e0 | [
"Apache-2.0"
] | null | null | null | """Module to handle messages from Home Assistant cloud."""
import asyncio
import logging
import pprint
import uuid
import random
from . import iot_base
from .utils import Registry
HANDLERS = Registry()
_LOGGER = logging.getLogger(__name__)
class UnknownHandler(Exception):
"""Exception raised when trying to hand... | 30.823864 | 87 | 0.644608 |
f8bd41e0d47b5fb937e2fa0a2d4ffe5512f0b4d9 | 253 | py | Python | tech_project/lib/python2.7/site-packages/aldryn_boilerplates/conf.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 6 | 2015-12-05T03:50:10.000Z | 2018-10-02T05:04:24.000Z | tech_project/lib/python2.7/site-packages/aldryn_boilerplates/conf.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 26 | 2015-01-28T10:04:29.000Z | 2018-11-23T08:32:21.000Z | tech_project/lib/python2.7/site-packages/aldryn_boilerplates/conf.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 10 | 2015-04-14T21:23:45.000Z | 2018-11-21T13:11:34.000Z | # -*- coding: utf-8 -*-
from appconf import AppConf
from django.conf import settings
class AldrynBoilerplatesAppConf(AppConf):
pass
class AldrynBoilerplateAppConf(AppConf):
NAME = None
class Meta:
prefix = 'ALDRYN_BOILERPLATE'
| 15.8125 | 41 | 0.711462 |
bc5457cfc9d70936c905c00e73da9589c0c29f10 | 336 | py | Python | alembic/versions/2016041812_remove_bundle_contents_index_1c2c255e6a01.py | kl-chou/codalab-worksheets | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | [
"Apache-2.0"
] | 236 | 2015-12-29T22:50:03.000Z | 2022-03-28T21:12:34.000Z | alembic/versions/2016041812_remove_bundle_contents_index_1c2c255e6a01.py | kl-chou/codalab-worksheets | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | [
"Apache-2.0"
] | 2,628 | 2015-12-27T09:45:13.000Z | 2022-03-30T16:18:25.000Z | alembic/versions/2016041812_remove_bundle_contents_index_1c2c255e6a01.py | kl-chou/codalab-worksheets | 101d1d9f86d3f7b8dae3b4fc3e2335fcf8d7c3d7 | [
"Apache-2.0"
] | 87 | 2015-12-30T01:36:46.000Z | 2022-03-08T15:21:30.000Z | """Remove bundle contents index
Revision ID: 1c2c255e6a01
Revises: 3fe0e77de7a4
Create Date: 2016-04-18 12:54:43.729203
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '1c2c255e6a01'
down_revision = '3fe0e77de7a4'
def upgrade():
op.drop_table('bundle_contents_index')
def downgr... | 16 | 42 | 0.747024 |
767008b10b028710f5423b1c145bf29cb353a67f | 1,503 | py | Python | setup.py | ghrcdaac/cumulus-process-py | 281017a68b06aed6bde34d47d0a67866a77fe3b7 | [
"Apache-2.0"
] | null | null | null | setup.py | ghrcdaac/cumulus-process-py | 281017a68b06aed6bde34d47d0a67866a77fe3b7 | [
"Apache-2.0"
] | null | null | null | setup.py | ghrcdaac/cumulus-process-py | 281017a68b06aed6bde34d47d0a67866a77fe3b7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from codecs import open
from setuptools import setup, find_packages
import imp
__version__ = imp.load_source('ghrc_process.version', 'ghrc_process/version.py').__version__
# get dependencies
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'requirements.tx... | 36.658537 | 92 | 0.679308 |
f162a4dd922e6fbf305790d7276df6e1aa413bd6 | 94,747 | py | Python | mne/io/base.py | libertyh/mne-python | bf03e17f323341a877dea62963c86cf140757896 | [
"BSD-3-Clause"
] | null | null | null | mne/io/base.py | libertyh/mne-python | bf03e17f323341a877dea62963c86cf140757896 | [
"BSD-3-Clause"
] | null | null | null | mne/io/base.py | libertyh/mne-python | bf03e17f323341a877dea62963c86cf140757896 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
# Mari... | 40.892102 | 92 | 0.571786 |
5bebe6b3d82f3ef8bac765599cb1e4e1e07ac2e9 | 2,294 | py | Python | src/renault_api/renault_client.py | PaoloTo/renault-api | 66976aa23dee1b4790363a610193b990acd0a345 | [
"MIT"
] | null | null | null | src/renault_api/renault_client.py | PaoloTo/renault-api | 66976aa23dee1b4790363a610193b990acd0a345 | [
"MIT"
] | null | null | null | src/renault_api/renault_client.py | PaoloTo/renault-api | 66976aa23dee1b4790363a610193b990acd0a345 | [
"MIT"
] | null | null | null | """Client for Renault API."""
import logging
from typing import Dict
from typing import List
from typing import Optional
import aiohttp
from .credential_store import CredentialStore
from .exceptions import RenaultException
from .kamereon import models
from .renault_account import RenaultAccount
from .renault_session ... | 32.309859 | 82 | 0.631212 |
98ca221dfa5a560709b21e3157a246114f5e6785 | 18,652 | py | Python | utils/dataset.py | neoh1/weaver | 08fc7f05a457e85ef652981c7efc93c3d5abcfbc | [
"MIT"
] | null | null | null | utils/dataset.py | neoh1/weaver | 08fc7f05a457e85ef652981c7efc93c3d5abcfbc | [
"MIT"
] | null | null | null | utils/dataset.py | neoh1/weaver | 08fc7f05a457e85ef652981c7efc93c3d5abcfbc | [
"MIT"
] | null | null | null | import os
import copy
import json
import numpy as np
import torch.utils.data
from itertools import chain
from functools import partial
from concurrent.futures.thread import ThreadPoolExecutor
from .logger import _logger, warn_once
from .data.tools import _pad, _repeat_pad, _clip
from .data.fileio import _read_files
fr... | 47.581633 | 178 | 0.631729 |
40e0533e5298e2a884f13d7eeff445c7de5ec7b8 | 2,408 | py | Python | forms.py | louxfaure/alma_utils | 2221a1610f56d1d17202c09de8b89a1c24697269 | [
"MIT"
] | null | null | null | forms.py | louxfaure/alma_utils | 2221a1610f56d1d17202c09de8b89a1c24697269 | [
"MIT"
] | null | null | null | forms.py | louxfaure/alma_utils | 2221a1610f56d1d17202c09de8b89a1c24697269 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.forms import ModelForm, FileField
from .models import ProcessUpdateItem
from .validators import csv_content_validator
from django.core.exceptions import ValidationError
from .services import Alma_Apis
from django.conf import settings
import logging
#Initialisation des logs
logger = ... | 53.511111 | 261 | 0.696013 |
282cc759ed0c5b73da59857f3b178346630e6057 | 585 | py | Python | school/migrations/0001_initial.py | theplue/djangoApp | cf6c7ae9d70aafdf26e474c6cb58036fe3f39703 | [
"MIT"
] | null | null | null | school/migrations/0001_initial.py | theplue/djangoApp | cf6c7ae9d70aafdf26e474c6cb58036fe3f39703 | [
"MIT"
] | null | null | null | school/migrations/0001_initial.py | theplue/djangoApp | cf6c7ae9d70aafdf26e474c6cb58036fe3f39703 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(verbose... | 25.434783 | 114 | 0.562393 |
d2a62b2d1605d2a8841777e2a3d74b71ae35c046 | 1,259 | py | Python | benchmarks/ACAS_Xu/properties/property_9.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | 1 | 2022-03-01T08:59:32.000Z | 2022-03-01T08:59:32.000Z | benchmarks/ACAS_Xu/properties/property_9.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | null | null | null | benchmarks/ACAS_Xu/properties/property_9.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | null | null | null | """
Property $\phi_9$.
- Description: Even if the previous advisory was ``weak right'', the presence of a nearby intruder will cause the network to output a ``strong left'' advisory instead.
- Tested on: $N_{3,3}$.
- Input constraints: $2000 \le \rho \le 7000$, $-0.4 \le \theta \le -0.14$, $-3.141592 \le \psi \le... | 39.34375 | 172 | 0.642573 |
745cc4111977364b71da530ea43946bbcecae505 | 691 | py | Python | docs/source/conf.py | darvid/sphinx_md_theme | 0f14287d915a87378af1ebea80e05204db8f5bba | [
"MIT"
] | 8 | 2016-12-13T04:35:27.000Z | 2018-08-01T14:39:16.000Z | docs/source/conf.py | darvid/sphinx_md_theme | 0f14287d915a87378af1ebea80e05204db8f5bba | [
"MIT"
] | null | null | null | docs/source/conf.py | darvid/sphinx_md_theme | 0f14287d915a87378af1ebea80e05204db8f5bba | [
"MIT"
] | 1 | 2018-09-25T10:05:57.000Z | 2018-09-25T10:05:57.000Z | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('../../src'))
from sphinx_md_theme import __version__ as version
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'sphinx_md_theme'
copyright = u'2016, David Gidwani'
author = u'Dav... | 22.290323 | 52 | 0.725036 |
f0960e9945d0ce1c07ba9d376060836e70a38ee1 | 259 | py | Python | Data Preparetion/1.3 Metrics Module/A.3.5.2.accuracy_score_ex.py | mosalaheg/sklearn | d275bdfaf0db4b01f45231889a37a8e004e2f77c | [
"MIT"
] | null | null | null | Data Preparetion/1.3 Metrics Module/A.3.5.2.accuracy_score_ex.py | mosalaheg/sklearn | d275bdfaf0db4b01f45231889a37a8e004e2f77c | [
"MIT"
] | null | null | null | Data Preparetion/1.3 Metrics Module/A.3.5.2.accuracy_score_ex.py | mosalaheg/sklearn | d275bdfaf0db4b01f45231889a37a8e004e2f77c | [
"MIT"
] | null | null | null | from sklearn.metrics import accuracy_score
y_pred = [0, 2, 1, 3,5,3]
y_true = [0, 1, 2, 3,5,3]
print(accuracy_score(y_true, y_pred)) # devide True values over all
print(accuracy_score(y_true, y_pred, normalize=False)) # number of all Trues
| 43.166667 | 85 | 0.683398 |
539616023dd1c18fb12c5f635645a7c8c2050dd5 | 773 | py | Python | google/cloud/aiplatform/v1/aiplatform-v1-py/google/cloud/aiplatform_v1/services/pipeline_service/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/aiplatform/v1beta1/aiplatform-v1beta1-py/google/cloud/aiplatform_v1beta1/services/pipeline_service/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/aiplatform/v1/aiplatform-v1-py/google/cloud/aiplatform_v1/services/pipeline_service/__init__.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... | 33.608696 | 74 | 0.759379 |
41bbd36c4887e36f80e4fa650c7ca98c504bb175 | 268 | py | Python | md-envs/md_envs/envs/__init__.py | IBM/logical-agent-driven-polymer-discovery | 9f2040ca0b19a2bc149ff840aa98a3f122606c32 | [
"Apache-2.0"
] | null | null | null | md-envs/md_envs/envs/__init__.py | IBM/logical-agent-driven-polymer-discovery | 9f2040ca0b19a2bc149ff840aa98a3f122606c32 | [
"Apache-2.0"
] | null | null | null | md-envs/md_envs/envs/__init__.py | IBM/logical-agent-driven-polymer-discovery | 9f2040ca0b19a2bc149ff840aa98a3f122606c32 | [
"Apache-2.0"
] | null | null | null | from md_envs.envs.AgentDrivenPolymerDiscovery import AgentDrivenPolymerDiscovery
from md_envs.envs.LogicalAgentDrivenPolymerDiscovery import LogicalAgentDrivenPolymerDiscovery
from md_envs.envs.DirectAgentDrivenPolymerDiscovery import DirectAgentDrivenPolymerDiscovery | 89.333333 | 94 | 0.936567 |
3a3f9008c5fc97915958ab08b2ab52b5ad54bca6 | 960 | py | Python | util/data-augmentation/brightness.py | henriquesimoes/humpback | ba687a71f95ef9c9c30426eefae11a69efd6f942 | [
"BSD-3-Clause"
] | null | null | null | util/data-augmentation/brightness.py | henriquesimoes/humpback | ba687a71f95ef9c9c30426eefae11a69efd6f942 | [
"BSD-3-Clause"
] | null | null | null | util/data-augmentation/brightness.py | henriquesimoes/humpback | ba687a71f95ef9c9c30426eefae11a69efd6f942 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import numpy as np
from PIL import Image
def do_brightness_shift(image, alpha=0.125):
image = image.astype(np.float32)
image = image + alpha * 255
image = np.clip(image, 0, 255).astype(np.uint8)
return image
def do_brightness_multiply(image, alpha=1):
image = image.astype(n... | 24 | 76 | 0.654167 |
6a877d87829250f0f5fc788ad8de85b19b98d960 | 428 | py | Python | back/api/serializers.py | ndenisj/ndenisj.dev | 9fff412614e5ef0a09723073d1ab89b0c08c6378 | [
"MIT"
] | null | null | null | back/api/serializers.py | ndenisj/ndenisj.dev | 9fff412614e5ef0a09723073d1ab89b0c08c6378 | [
"MIT"
] | 10 | 2020-02-12T03:26:20.000Z | 2022-03-12T00:11:43.000Z | back/api/serializers.py | ndenisj/ndenisj.dev | 9fff412614e5ef0a09723073d1ab89b0c08c6378 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from blog.models import *
from contact.models import *
class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
fields = ['id', 'title', 'body', 'summary', 'cover', 'pub_date_pretty', 'pub_date']
# fields = "__all__"
class Contact... | 25.176471 | 91 | 0.672897 |
2c37a7ddf8dd35896fd97f6e4914b2d8bddf8b2f | 4,755 | py | Python | softlearning/samplers/utils.py | kevintli/mural | e18e7d1a72b561fab1b5da026806e3417a9c63db | [
"MIT"
] | 5 | 2021-09-23T07:35:58.000Z | 2022-01-07T21:23:06.000Z | MTRF/algorithms/softlearning/samplers/utils.py | facebookresearch/MTRF | 2fee8f3f1c2150fcecc2db2fa9e122a664a72d72 | [
"Apache-2.0"
] | null | null | null | MTRF/algorithms/softlearning/samplers/utils.py | facebookresearch/MTRF | 2fee8f3f1c2150fcecc2db2fa9e122a664a72d72 | [
"Apache-2.0"
] | 1 | 2021-12-10T20:01:16.000Z | 2021-12-10T20:01:16.000Z | from collections import defaultdict
import numpy as np
from softlearning import replay_pools
from . import (
dummy_sampler,
remote_sampler,
base_sampler,
simple_sampler,
active_sampler,
goal_sampler,
pool_sampler,
nn_sampler,
classifier_sampler)
def get_sampler_from_variant(varia... | 29.534161 | 91 | 0.583176 |
d5ee3a93c913fe592a4c81812dcf04e97594bd33 | 3,275 | py | Python | kubernetes/client/models/v1_namespace_status.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_namespace_status.py | TomasTomecek/kubernetes-python | c37c074303a13c72662b9201ccc023fb0ca45755 | [
"Apache-2.0"
] | 1 | 2021-04-30T20:41:19.000Z | 2021-04-30T20:41:19.000Z | venv/lib/python2.7/site-packages/kubernetes/client/models/v1_namespace_status.py | 784134748/kubernetes-install | 5df59632c2619632e422948b667fb68eab9ff5be | [
"MIT"
] | 1 | 2020-05-09T07:16:55.000Z | 2020-05-09T07:16:55.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 25.787402 | 137 | 0.552672 |
f0d0e0facd16efe2afe2070ac45bacee1e1bffa0 | 1,662 | py | Python | setup.py | jrake-revelant/zmon-aws-agent | 67ed3d0230f3bec9b3a3950c3eefa48404ee9d6b | [
"Apache-2.0"
] | 9 | 2016-07-28T09:28:20.000Z | 2022-02-27T23:40:09.000Z | setup.py | jrake-revelant/zmon-aws-agent | 67ed3d0230f3bec9b3a3950c3eefa48404ee9d6b | [
"Apache-2.0"
] | 146 | 2016-05-23T13:43:42.000Z | 2020-03-10T09:47:07.000Z | setup.py | jrake-revelant/zmon-aws-agent | 67ed3d0230f3bec9b3a3950c3eefa48404ee9d6b | [
"Apache-2.0"
] | 11 | 2017-02-18T12:46:27.000Z | 2020-01-22T13:13:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for ZMON AWS agent
"""
import os
from setuptools import setup, find_packages
def read_version(package):
data = {}
with open(os.path.join(package, '__init__.py'), 'r') as fd:
exec(fd.read(), data)
return data['__version__']
def get_re... | 27.7 | 70 | 0.629362 |
b6dd49c5a3a09b98ce2d52aa16a8c5b49d0ba507 | 14,994 | py | Python | generate.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | generate.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | generate.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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.ap... | 34.154897 | 158 | 0.618647 |
9a108c056549df2723c9026561c23841cbd213e5 | 2,079 | py | Python | pynapl/APL.py | Dyalog/pynapl | 8b17bceda64b182cf89f4c9b7b77580ec9daf2ed | [
"MIT"
] | 38 | 2017-12-26T08:21:46.000Z | 2022-03-24T21:30:23.000Z | pynapl/APL.py | Dyalog/pynapl | 8b17bceda64b182cf89f4c9b7b77580ec9daf2ed | [
"MIT"
] | 15 | 2018-02-18T08:03:15.000Z | 2022-03-13T17:38:19.000Z | pynapl/APL.py | Dyalog/pynapl | 8b17bceda64b182cf89f4c9b7b77580ec9daf2ed | [
"MIT"
] | 10 | 2018-02-18T07:53:09.000Z | 2022-03-11T13:40:35.000Z | # -*- coding: utf-8 -*-
"""Dyalog APL <> Python interface"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from . import Array
from . import APLPyConnect
from . import IPC
import socket, threading, sys, types
if ... | 26.653846 | 91 | 0.657528 |
a8ba4a2dfc0535cf8857bda7d0d3af180082f993 | 3,021 | py | Python | Simulation GNSS Sensor Code.py | VEDANTGHODKE/Swayatta-Autonomous-Driver-Assistance-System-ADAS-For-Indian-Environments | 7f0361c0f52e4e7623d975725497648cf582f36f | [
"MIT"
] | 2 | 2020-12-30T02:11:40.000Z | 2020-12-30T06:40:58.000Z | Simulation GNSS Sensor Code.py | VEDANTGHODKE/Swayatta---Autonomous-Driver-Assistance-System-ADAS-For-Indian-Environments | 7f0361c0f52e4e7623d975725497648cf582f36f | [
"MIT"
] | null | null | null | Simulation GNSS Sensor Code.py | VEDANTGHODKE/Swayatta---Autonomous-Driver-Assistance-System-ADAS-For-Indian-Environments | 7f0361c0f52e4e7623d975725497648cf582f36f | [
"MIT"
] | 1 | 2021-03-03T05:42:02.000Z | 2021-03-03T05:42:02.000Z |
from __future__ import print_function
# ==============================================================================
# -- find carla module ---------------------------------------------------------
# ==============================================================================
import glob
import os
... | 32.483871 | 81 | 0.555445 |
2a0e4d03ee5b0fa436361c90505070c7dec11193 | 394 | py | Python | backend/users/migrations/0002_auto_20210806_1412.py | crowdbotics-apps/template3-29560 | 0b942a3b78487809b2ec92c50d0575d659bf57e7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/migrations/0002_auto_20210806_1412.py | crowdbotics-apps/template3-29560 | 0b942a3b78487809b2ec92c50d0575d659bf57e7 | [
"FTL",
"AML",
"RSA-MD"
] | 25 | 2021-08-08T20:44:57.000Z | 2021-09-28T02:38:20.000Z | backend/users/migrations/0002_auto_20210806_1412.py | crowdbotics-apps/template3-29560 | 0b942a3b78487809b2ec92c50d0575d659bf57e7 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.24 on 2021-08-06 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='name',
field=... | 20.736842 | 74 | 0.591371 |
829b81d7f69f86cafbb02be8edf0b711df815c15 | 9,561 | py | Python | scraper1830/scraper1830.py | SiddharthNVenkatesh/1830-game-log-scraper | 5b446bec0715e8d7954bf6c0ff2e3f8619be9213 | [
"MIT"
] | null | null | null | scraper1830/scraper1830.py | SiddharthNVenkatesh/1830-game-log-scraper | 5b446bec0715e8d7954bf6c0ff2e3f8619be9213 | [
"MIT"
] | null | null | null | scraper1830/scraper1830.py | SiddharthNVenkatesh/1830-game-log-scraper | 5b446bec0715e8d7954bf6c0ff2e3f8619be9213 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 25 15:22:10 2021
@author: siddharthvenkatesh
This script aims to construct a class with methods for scraping and storing data from the 18xx.games api for 1830 games.
"""
import requests
import bs4
import pandas as pd
from matplotlib import pyplot... | 34.024911 | 136 | 0.609978 |
7e0d8eec1d55340ef44cc67edc9763f3f2f748ea | 403 | py | Python | inventory_app/wsgi.py | ishika261/Inventory-App | 8f78ced3f4701e111085cdd67a3fd42c9136ff40 | [
"MIT"
] | null | null | null | inventory_app/wsgi.py | ishika261/Inventory-App | 8f78ced3f4701e111085cdd67a3fd42c9136ff40 | [
"MIT"
] | null | null | null | inventory_app/wsgi.py | ishika261/Inventory-App | 8f78ced3f4701e111085cdd67a3fd42c9136ff40 | [
"MIT"
] | null | null | null | """
WSGI config for inventory_app project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
bea7fa86f333ded55dc842dfedada60a76997d5b | 6,176 | py | Python | DC-MT/utils/visualizer.py | King-HAW/DC-MT | 16678dd8284d074527fe1f7ddd042739aece4ed1 | [
"MIT"
] | 1 | 2022-02-17T07:26:18.000Z | 2022-02-17T07:26:18.000Z | DC-MT/utils/visualizer.py | King-HAW/DC-MT | 16678dd8284d074527fe1f7ddd042739aece4ed1 | [
"MIT"
] | null | null | null | DC-MT/utils/visualizer.py | King-HAW/DC-MT | 16678dd8284d074527fe1f7ddd042739aece4ed1 | [
"MIT"
] | null | null | null | import numpy as np
import os
import sys
import ntpath
import time
from . import vis_util as util
from . import html
from .config import outputs_path
import logging
if sys.version_info[0] == 2:
VisdomExceptionBase = Exception
else:
VisdomExceptionBase = ConnectionError
class Visualizer():
def __init__(sel... | 46.089552 | 320 | 0.538536 |
93de72a7c9892f1aabfdbdb77c280235fad84558 | 7,560 | py | Python | PythonLinearNonlinearControl/configs/two_wheeled.py | cilence/PythonLinearNonlinearControl | 969fee7e732ed72a5c0c82a1a2967279d5e8134a | [
"MIT"
] | 1 | 2021-02-01T06:17:32.000Z | 2021-02-01T06:17:32.000Z | PythonLinearNonlinearControl/configs/two_wheeled.py | cilence/PythonLinearNonlinearControl | 969fee7e732ed72a5c0c82a1a2967279d5e8134a | [
"MIT"
] | null | null | null | PythonLinearNonlinearControl/configs/two_wheeled.py | cilence/PythonLinearNonlinearControl | 969fee7e732ed72a5c0c82a1a2967279d5e8134a | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib.axes import Axes
from ..plotters.plot_objs import square_with_angle, square
from ..common.utils import fit_angle_in_range
class TwoWheeledConfigModule():
# parameters
ENV_NAME = "TwoWheeled-v0"
TYPE = "Nonlinear"
N_AHEAD = 1
TASK_HORIZON = 1000
PRED_LEN = 20
... | 32.446352 | 88 | 0.524206 |
b2dd50ea68b76eb26570befecedf4f2cea8e37f1 | 735 | py | Python | profiles_api/permissions.py | Z1ngyr/profiles-rest-api | a85902e18d6ba8c0978def0fc9b497ad071ca006 | [
"MIT"
] | null | null | null | profiles_api/permissions.py | Z1ngyr/profiles-rest-api | a85902e18d6ba8c0978def0fc9b497ad071ca006 | [
"MIT"
] | null | null | null | profiles_api/permissions.py | Z1ngyr/profiles-rest-api | a85902e18d6ba8c0978def0fc9b497ad071ca006 | [
"MIT"
] | null | null | null | from rest_framework import permissions
class UpdateOwnProfile(permissions.BasePermission):
"""Allow user to edit their own profile"""
def has_object_permission(self,request,view,obj):
"""Check user is trying to edit their own profile"""
if request.method in permissions.SAFE_METHODS:
... | 24.5 | 65 | 0.689796 |
ca8ea541194665441334c3929c754081e74d3771 | 39,038 | py | Python | lib/translations.py | isagasti/wttr.in | 1adc5e2064577c418325a5529d289c29ceeae3a2 | [
"Apache-2.0"
] | null | null | null | lib/translations.py | isagasti/wttr.in | 1adc5e2064577c418325a5529d289c29ceeae3a2 | [
"Apache-2.0"
] | null | null | null | lib/translations.py | isagasti/wttr.in | 1adc5e2064577c418325a5529d289c29ceeae3a2 | [
"Apache-2.0"
] | null | null | null | # vim: fileencoding=utf-8
"""
Translation of almost everything.
"""
FULL_TRANSLATION = [
"ar", "af", "be", "ca", "da", "de", "el", "et",
"fr", "fa", "hu", "ia", "id", "it",
"nb", "nl", "pl", "pt-br", "ro",
"ru", "tr", "th", "uk", "vi", "zh-cn", "zh-tw"
]
PARTIAL_TRANSLATION = [
"az", "bg", "bs", ... | 48.919799 | 236 | 0.62621 |
62fe34865b7bdddc1b4317efbbf0c09ab9c3c37c | 1,074 | py | Python | zmon_worker_monitor/web_server/rest_api/commons.py | heroldus/zmon-worker | 458f8bacb5a00f7fd93d59db406a2c80870519d1 | [
"Apache-2.0"
] | 17 | 2016-06-03T14:59:21.000Z | 2020-11-06T13:12:18.000Z | zmon_worker_monitor/web_server/rest_api/commons.py | heroldus/zmon-worker | 458f8bacb5a00f7fd93d59db406a2c80870519d1 | [
"Apache-2.0"
] | 394 | 2016-06-03T14:47:37.000Z | 2020-04-21T09:31:23.000Z | zmon_worker_monitor/web_server/rest_api/commons.py | heroldus/zmon-worker | 458f8bacb5a00f7fd93d59db406a2c80870519d1 | [
"Apache-2.0"
] | 55 | 2016-08-15T12:42:28.000Z | 2021-04-06T10:49:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from flask import current_app
from flask_restful import Api
from .errors import BaseError
from zmon_worker_monitor.rpc_client import get_rpc_client_plus as __get_rpc_client_plus
#
# Extended Api
#
class ApiExtended(Api):
"""
Extend flask-rest ap... | 22.375 | 116 | 0.689013 |
45015ab65ba47ab53a4b7a2143e97d493ab5ea28 | 278 | py | Python | scripts/python/routines/plot/violin.py | GillianGrayson/dnamvae | 3956a019f0e9aab5732fa215c5e28448b556de47 | [
"MIT"
] | 1 | 2021-07-24T13:43:41.000Z | 2021-07-24T13:43:41.000Z | scripts/python/routines/plot/violin.py | GillianGrayson/dnamvae | 3956a019f0e9aab5732fa215c5e28448b556de47 | [
"MIT"
] | null | null | null | scripts/python/routines/plot/violin.py | GillianGrayson/dnamvae | 3956a019f0e9aab5732fa215c5e28448b556de47 | [
"MIT"
] | null | null | null | import plotly.graph_objects as go
def add_violin_trace(fig, y, name):
showlegend = False if name == "" else True
fig.add_trace(
go.Violin(
y=y,
name=name,
box_visible=True,
showlegend=showlegend,
)
)
| 19.857143 | 46 | 0.539568 |
ff484153dc87e5f7423c5b6ef0690d0e65953891 | 6,895 | py | Python | programl/models/model.py | drakesvoboda/ProGraML | df5636b0e2bdf7e3c285b7fa0050cf8b697aaf0a | [
"Apache-2.0"
] | 71 | 2020-12-04T02:18:13.000Z | 2022-03-30T15:19:50.000Z | programl/models/model.py | drakesvoboda/ProGraML | df5636b0e2bdf7e3c285b7fa0050cf8b697aaf0a | [
"Apache-2.0"
] | 4 | 2021-03-10T17:48:50.000Z | 2022-03-13T10:42:22.000Z | programl/models/model.py | drakesvoboda/ProGraML | df5636b0e2bdf7e3c285b7fa0050cf8b697aaf0a | [
"Apache-2.0"
] | 11 | 2020-12-09T12:17:44.000Z | 2022-03-30T09:02:13.000Z | # Copyright 2019-2020 the ProGraML authors.
#
# Contact Chris Cummins <chrisc.101@gmail.com>.
#
# 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... | 36.481481 | 87 | 0.64409 |
95c7bb4b931b9fd7c60e13c4114d4e437e66376c | 1,708 | py | Python | tests/test-live-addons.py | neswork-z/microk8s | c0042ffc8aafba6e8f99904f4f809ddf4c888865 | [
"Apache-2.0"
] | 1 | 2021-09-16T09:13:16.000Z | 2021-09-16T09:13:16.000Z | tests/test-live-addons.py | neswork-z/microk8s | c0042ffc8aafba6e8f99904f4f809ddf4c888865 | [
"Apache-2.0"
] | null | null | null | tests/test-live-addons.py | neswork-z/microk8s | c0042ffc8aafba6e8f99904f4f809ddf4c888865 | [
"Apache-2.0"
] | null | null | null | from validators import (
validate_dns_dashboard,
validate_storage,
validate_ingress,
validate_istio,
validate_knative,
validate_registry,
validate_forward,
validate_metrics_server,
validate_prometheus,
validate_fluentd,
validate_jaeger,
validate_cilium,
)
from utils impor... | 18.565217 | 82 | 0.571429 |
bed48680fc1dead33c741e4edcde5df3ac6f44cd | 2,591 | py | Python | flink-python/pyflink/fn_execution/utils/output_factory.py | tamirsagi/flink | 778483a0a387251bc8b78f23b41352a1fbf146a2 | [
"Apache-2.0"
] | 9 | 2016-09-22T22:53:13.000Z | 2019-11-30T03:07:29.000Z | flink-python/pyflink/fn_execution/utils/output_factory.py | tamirsagi/flink | 778483a0a387251bc8b78f23b41352a1fbf146a2 | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/fn_execution/utils/output_factory.py | tamirsagi/flink | 778483a0a387251bc8b78f23b41352a1fbf146a2 | [
"Apache-2.0"
] | 2 | 2022-02-15T07:05:13.000Z | 2022-03-18T07:08:20.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... | 40.484375 | 97 | 0.684678 |
307befd3266db725636bbda7ad36971f48b1c892 | 43,296 | py | Python | tests/api_connexion/endpoints/test_task_instance_endpoint.py | ianstanton/airflow | 019241be0c839ba32361679ffecd178c0506d10d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-04-12T09:41:18.000Z | 2021-04-12T09:41:18.000Z | tests/api_connexion/endpoints/test_task_instance_endpoint.py | ianstanton/airflow | 019241be0c839ba32361679ffecd178c0506d10d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/api_connexion/endpoints/test_task_instance_endpoint.py | ianstanton/airflow | 019241be0c839ba32361679ffecd178c0506d10d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 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... | 37.227859 | 108 | 0.501039 |
c61ab8c95d38efacc10209b027db57865b101e44 | 1,147 | py | Python | tests/unit/vega/front_end/test_parser.py | philippwiesner/compiler | 52c00221ace2cb56b9fba91b3949c14a6f0e4f68 | [
"MIT"
] | null | null | null | tests/unit/vega/front_end/test_parser.py | philippwiesner/compiler | 52c00221ace2cb56b9fba91b3949c14a6f0e4f68 | [
"MIT"
] | 8 | 2020-05-15T14:50:59.000Z | 2020-06-05T11:44:33.000Z | tests/unit/vega/front_end/test_parser.py | philippwiesner/compiler | 52c00221ace2cb56b9fba91b3949c14a6f0e4f68 | [
"MIT"
] | null | null | null | # pylint: skip-file
from unittest.mock import mock_open
from unittest.mock import patch
import pytest
from vega.front_end.parser import Parser
def describe_parser():
@pytest.fixture
def parser(code):
with patch('builtins.open', mock_open(read_data=code)):
with open('foo') as code_file:
... | 21.641509 | 63 | 0.489974 |
d4b19c194b21dda68cd548d2cde52ba5b99348dd | 4,876 | py | Python | src/diff_drive/goal_controller.py | Timple/diff_drive | 9f05d77609e272d4a1287c44416ee2d1b88532a9 | [
"BSD-3-Clause"
] | 119 | 2017-03-06T00:14:38.000Z | 2022-03-28T08:16:01.000Z | src/diff_drive/goal_controller.py | Timple/diff_drive | 9f05d77609e272d4a1287c44416ee2d1b88532a9 | [
"BSD-3-Clause"
] | 13 | 2018-03-20T14:40:32.000Z | 2020-11-19T00:25:06.000Z | src/diff_drive/goal_controller.py | Timple/diff_drive | 9f05d77609e272d4a1287c44416ee2d1b88532a9 | [
"BSD-3-Clause"
] | 60 | 2017-08-25T18:37:06.000Z | 2022-03-18T06:29:48.000Z | from __future__ import division, print_function
from math import pi, sqrt, sin, cos, atan2
from diff_drive.pose import Pose
#import rospy
class GoalController:
"""Finds linear and angular velocities necessary to drive toward
a goal pose.
"""
def __init__(self):
self.kP = 3
self.kA = 8
... | 31.869281 | 80 | 0.602133 |
8ffded771fe13903cafefc547e59caf3bf608e67 | 1,944 | py | Python | alipay/aop/api/domain/FulfillmentInfo.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/FulfillmentInfo.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/FulfillmentInfo.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class FulfillmentInfo(object):
def __init__(self):
self._biz_ext_param = None
self._biz_time = None
self._out_order_no = None
@property
def biz_ext_param(... | 27.380282 | 77 | 0.598765 |
f3611cd0db938b9038f099105b9a1f5edd39dded | 365 | py | Python | manifold/communicationData.py | Ligcox/SUES_Birdiebot_gcxl | 9ed28ff1ffac950f9def11b7b9d439d6b4eaaa8c | [
"Apache-2.0"
] | null | null | null | manifold/communicationData.py | Ligcox/SUES_Birdiebot_gcxl | 9ed28ff1ffac950f9def11b7b9d439d6b4eaaa8c | [
"Apache-2.0"
] | null | null | null | manifold/communicationData.py | Ligcox/SUES_Birdiebot_gcxl | 9ed28ff1ffac950f9def11b7b9d439d6b4eaaa8c | [
"Apache-2.0"
] | null | null | null | # 通讯协议相关配置
# Author by ligcox
# 2020.12
D_INFO = {
"HEAD": 0xAA,
"D_ADDR": None,
"ID": None,
"LEN": None,
"DATA": bytearray(),
"SUM_CHECK": None,
"ADD_CHECK": None
}
'''
通讯协议
'''
unlock = (0xff, 0xe0, [0x10, 0x00, 0x01])
set_high = (0xff, 0xe0, [0x10, 0, 0x05... | 16.590909 | 46 | 0.50137 |
066c224bd95fb443ec3d6f2b2ac984bbf9f6bee6 | 783 | py | Python | ingestion/src/metadata/generated/schema/type/collectionDescriptor.py | avignd/OpenMetadata | f81fb3d5e8ec391928afba57868cf0f9d7dc0f74 | [
"Apache-2.0"
] | null | null | null | ingestion/src/metadata/generated/schema/type/collectionDescriptor.py | avignd/OpenMetadata | f81fb3d5e8ec391928afba57868cf0f9d7dc0f74 | [
"Apache-2.0"
] | null | null | null | ingestion/src/metadata/generated/schema/type/collectionDescriptor.py | avignd/OpenMetadata | f81fb3d5e8ec391928afba57868cf0f9d7dc0f74 | [
"Apache-2.0"
] | null | null | null | # generated by datamodel-codegen:
# filename: schema/type/collectionDescriptor.json
# timestamp: 2021-11-11T08:56:06+00:00
from __future__ import annotations
from typing import Optional
from pydantic import AnyUrl, BaseModel, Field
from . import profile
class CollectionInfo(BaseModel):
name: Optional[str... | 27.964286 | 88 | 0.734355 |
030a9ea2f4a36ffd3fea12b467bddec0609f263f | 2,422 | py | Python | doc/source/conf.py | pabelanger/ansible-role-iptables | 1533906b616cb9700064a058d51f348bd354cb66 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | pabelanger/ansible-role-iptables | 1533906b616cb9700064a058d51f348bd354cb66 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | pabelanger/ansible-role-iptables | 1533906b616cb9700064a058d51f348bd354cb66 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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.72973 | 79 | 0.698596 |
579703c6b481554cf421b2de4ae0257194642646 | 582 | py | Python | Modulo 1/Aula06_Exercicios/exercicios06.py | icarogoggin/BlueEdtech | 3915e14b76623c6e5c507ab4246f8cdac660764f | [
"MIT"
] | null | null | null | Modulo 1/Aula06_Exercicios/exercicios06.py | icarogoggin/BlueEdtech | 3915e14b76623c6e5c507ab4246f8cdac660764f | [
"MIT"
] | null | null | null | Modulo 1/Aula06_Exercicios/exercicios06.py | icarogoggin/BlueEdtech | 3915e14b76623c6e5c507ab4246f8cdac660764f | [
"MIT"
] | null | null | null | '''6. Escreva uma função que, dado um número nota representando a nota de um estudante,
converte o valor de nota para um conceito (A, B, C, D, E e F).'''
def fnota (nota):
if nota >=9:
print("SUA NOTA FOI: A")
elif nota >=8:
print("SUA NOTA FOI: B")
elif nota >=7:
print("SUA NOTA F... | 30.631579 | 88 | 0.570447 |
22b9598f3733302944c71c6a09a6b3d7646b03c6 | 1,181 | py | Python | Linux/Linux_with_ARM_A9/PyDE/include/audio.py | fpgacademy/Tutorials | d2c352472bc3dfab88a3497efd259f5fabbf3952 | [
"MIT"
] | null | null | null | Linux/Linux_with_ARM_A9/PyDE/include/audio.py | fpgacademy/Tutorials | d2c352472bc3dfab88a3497efd259f5fabbf3952 | [
"MIT"
] | null | null | null | Linux/Linux_with_ARM_A9/PyDE/include/audio.py | fpgacademy/Tutorials | d2c352472bc3dfab88a3497efd259f5fabbf3952 | [
"MIT"
] | null | null | null | MAX_VOLUME = 0x7FFFFFFF
MAX_SAMPLING_RATE, MID_SAMPLING_RATE, MIN_SAMPLING_RATE = 48000, 32000, 8000
def open_dev( ):
''' Opens the digital audio device
:return: 1 on success, else 0
'''
def read( ):
''' Reads the audio device
:return: two integers: left-channel data, right-channel data
'''... | 16.871429 | 82 | 0.632515 |
b50e9feb1fdb5ccfd803542f057009b98d272cba | 79 | py | Python | CodeWars/7 Kyu/Find the capitals.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Find the capitals.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Find the capitals.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def capitals(word):
return [i for (i, c) in enumerate(word) if c.isupper()] | 39.5 | 59 | 0.658228 |
420ba28a8f816bb786b86ef709614afbdd559e54 | 340 | py | Python | ABC/abc051-abc100/abc051/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc051-abc100/abc051/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc051-abc100/abc051/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | '''input
2 2
6
5 15
1
'''
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == '__main__':
k, s = list(map(int, input().split()))
count = 0
for x in range(k + 1):
for y in range(k + 1):
z = s - (x + y)
if 0 <= z <= k:
count += ... | 12.142857 | 42 | 0.438235 |
1de0980b8e66a0955fd6c96b95ea7b7f6f274502 | 993 | py | Python | deviceadvisor/tests/da_test_utils.py | awslabs/aws-iot-device-sdk-python-v2 | b2f035c0dc17b0a719695f22137688ceae742436 | [
"Apache-2.0"
] | 4 | 2019-05-08T08:27:49.000Z | 2019-10-17T00:26:58.000Z | deviceadvisor/tests/da_test_utils.py | awslabs/aws-iot-device-sdk-python-v2 | b2f035c0dc17b0a719695f22137688ceae742436 | [
"Apache-2.0"
] | 1 | 2019-10-16T17:08:58.000Z | 2019-10-23T22:13:56.000Z | deviceadvisor/tests/da_test_utils.py | awslabs/aws-iot-device-sdk-python-v2 | b2f035c0dc17b0a719695f22137688ceae742436 | [
"Apache-2.0"
] | 2 | 2019-05-27T18:39:42.000Z | 2019-09-06T09:06:56.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
import os
from enum import Enum
from uuid import uuid4
class TestType(Enum):
CONNECT = 1
SUB_PUB = 1
SHADOW = 1
class DATestUtils:
endpoint = os.getenv('DA_ENDPOINT')
certificatePath = os.ge... | 29.205882 | 110 | 0.662638 |
ecfe06e7aa40920b937ff11901a5e973c1774731 | 6,418 | py | Python | nova/api/openstack/compute/plugins/v3/security_groups.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 1 | 2019-05-11T22:40:48.000Z | 2019-05-11T22:40:48.000Z | nova/api/openstack/compute/plugins/v3/security_groups.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 9 | 2015-05-20T11:20:17.000Z | 2017-07-27T08:21:33.000Z | nova/api/openstack/compute/plugins/v3/security_groups.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 13 | 2015-05-05T09:34:04.000Z | 2017-11-08T02:03:46.000Z | # Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# 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/l... | 37.313953 | 79 | 0.651449 |
0dad580c2ba1ba2188de04b29c6695350c5254b4 | 908 | py | Python | cmws/examples/csg/test.py | tuananhle7/hmws | 175f77a2b386ce5a9598b61c982e053e7ecff8a2 | [
"MIT"
] | null | null | null | cmws/examples/csg/test.py | tuananhle7/hmws | 175f77a2b386ce5a9598b61c982e053e7ecff8a2 | [
"MIT"
] | null | null | null | cmws/examples/csg/test.py | tuananhle7/hmws | 175f77a2b386ce5a9598b61c982e053e7ecff8a2 | [
"MIT"
] | null | null | null | from cmws import util
import models.hearts
if __name__ == "__main__":
# Sample
device = "cuda"
batch_size = 13
true_generative_model = models.hearts.TrueGenerativeModel().to(device)
latent, obs = true_generative_model.sample((batch_size,))
# Plot
import matplotlib.pyplot as plt
fig, ... | 32.428571 | 97 | 0.69163 |
c8772accf0a194817f20e99cbbf11ea4ab9471be | 13,964 | py | Python | umi_tools/dedup.py | martenj/UMI-tools | b3d04590c9aa893ac9a146f16e1dec934c31ac80 | [
"MIT"
] | 1 | 2018-04-14T01:26:04.000Z | 2018-04-14T01:26:04.000Z | umi_tools/dedup.py | martenj/UMI-tools | b3d04590c9aa893ac9a146f16e1dec934c31ac80 | [
"MIT"
] | null | null | null | umi_tools/dedup.py | martenj/UMI-tools | b3d04590c9aa893ac9a146f16e1dec934c31ac80 | [
"MIT"
] | null | null | null | '''
dedup.py - Deduplicate reads that are coded with a UMI
=========================================================
:Author: Ian Sudbery, Tom Smith
:Release: $Id$
:Date: |today|
:Tags: Python UMI
Purpose
-------
The purpose of this command is to deduplicate BAM files based
on the first mapping co-ordinate and the U... | 34.564356 | 90 | 0.620524 |
2460a6fc7404a2d4d6b7987a05f0651d84435d54 | 1,209 | py | Python | test/test.phones.py | Navuhudonosor/Python_Training | a5db029e9e8b3f6ed79567df2fb8bc33ab304d00 | [
"Apache-2.0"
] | null | null | null | test/test.phones.py | Navuhudonosor/Python_Training | a5db029e9e8b3f6ed79567df2fb8bc33ab304d00 | [
"Apache-2.0"
] | null | null | null | test/test.phones.py | Navuhudonosor/Python_Training | a5db029e9e8b3f6ed79567df2fb8bc33ab304d00 | [
"Apache-2.0"
] | null | null | null |
import re
def test_phone_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get.contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
def test_phones_... | 41.689655 | 125 | 0.734491 |
24dd1dc199c5c19ecfc8f12e1bc52890b4bc1f35 | 3,729 | py | Python | tests/rbac/common/role/reject_task_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/rbac/common/role/reject_task_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/rbac/common/role/reject_task_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 33.294643 | 88 | 0.709574 |
249c6daf470b361c08adc6ca7d11d7dc3758811a | 14,179 | py | Python | scripts/imagetransfer.py | CCXXXI/pywikibot | 917867fbaa8b1d17b2e0e96fc650907e1df9656c | [
"MIT"
] | 2 | 2021-02-17T11:25:53.000Z | 2021-06-17T19:15:35.000Z | scripts/imagetransfer.py | CCXXXI/pywikibot | 917867fbaa8b1d17b2e0e96fc650907e1df9656c | [
"MIT"
] | 1 | 2021-06-21T03:59:14.000Z | 2021-06-21T07:37:50.000Z | scripts/imagetransfer.py | CCXXXI/pywikibot | 917867fbaa8b1d17b2e0e96fc650907e1df9656c | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Script to copy images to Wikimedia Commons, or to another wiki.
Syntax:
python pwb.py imagetransfer {<pagename>|<generator>} [<options>]
The following parameters are supported:
-interwiki Look for images in pages found through interwiki links.
-keepname Keep the filenam... | 37.313158 | 79 | 0.544256 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.