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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
643f7c2fdec8c6c16d3f0b194f9359447db96d42 | 180 | py | Python | conftest.py | berrondo/saec | e8063f7b75fbeec4ea4d514958c073ff97a08088 | [
"MIT"
] | null | null | null | conftest.py | berrondo/saec | e8063f7b75fbeec4ea4d514958c073ff97a08088 | [
"MIT"
] | null | null | null | conftest.py | berrondo/saec | e8063f7b75fbeec4ea4d514958c073ff97a08088 | [
"MIT"
] | null | null | null | import pytest
from rest_framework.test import APIClient
@pytest.fixture(autouse=True)
def enable_db_access(db):
pass
@pytest.fixture
def api_client():
return APIClient
| 13.846154 | 41 | 0.772222 |
b0e9862eb64ccb437af5d2d326b2f143ca46fffc | 8,137 | py | Python | tests/components/whois/test_sensor.py | WilliamTian0987/core | 814db01561393ead12c9252e0c5c0dd90be7f247 | [
"Apache-2.0"
] | 3 | 2022-01-27T17:00:51.000Z | 2022-03-09T03:49:03.000Z | tests/components/whois/test_sensor.py | WilliamTian0987/core | 814db01561393ead12c9252e0c5c0dd90be7f247 | [
"Apache-2.0"
] | 7 | 2022-03-01T06:32:03.000Z | 2022-03-31T07:19:10.000Z | tests/components/whois/test_sensor.py | WilliamTian0987/core | 814db01561393ead12c9252e0c5c0dd90be7f247 | [
"Apache-2.0"
] | null | null | null | """Tests for the sensors provided by the Whois integration."""
from unittest.mock import AsyncMock, MagicMock
import pytest
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.whois.const import DOMAIN, SCAN_INTERVAL
from homeassistant.const import (
ATTR_DEVICE_CLASS,
... | 40.083744 | 87 | 0.753349 |
957799b1a41944ce14f4ed67e0fdbdcdb65731b7 | 13,912 | py | Python | src/object_detection/builders/preprocessor_builder.py | Tobias-Fischer/ros_people_object_detection_tensorflow | 2a0af311b4eef55c053bd2349e1dff10abe1f32a | [
"Apache-2.0"
] | null | null | null | src/object_detection/builders/preprocessor_builder.py | Tobias-Fischer/ros_people_object_detection_tensorflow | 2a0af311b4eef55c053bd2349e1dff10abe1f32a | [
"Apache-2.0"
] | null | null | null | src/object_detection/builders/preprocessor_builder.py | Tobias-Fischer/ros_people_object_detection_tensorflow | 2a0af311b4eef55c053bd2349e1dff10abe1f32a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 43.071207 | 80 | 0.693502 |
fbf4f2b808e934c891fbaaf317e58e81b3fea067 | 2,862 | py | Python | app/models.py | zhazhalaila/rfid-signin-python | 33c7bd4940b0896bc0f5dce1926db9e9d5adc1ed | [
"MIT"
] | 18 | 2018-10-24T08:33:46.000Z | 2021-11-30T15:55:24.000Z | app/models.py | zhazhalaila/rfid-signin-python | 33c7bd4940b0896bc0f5dce1926db9e9d5adc1ed | [
"MIT"
] | 2 | 2019-07-01T06:12:03.000Z | 2021-06-01T22:50:37.000Z | app/models.py | zhazhalaila/rfid-signin-python | 33c7bd4940b0896bc0f5dce1926db9e9d5adc1ed | [
"MIT"
] | 2 | 2019-08-04T05:40:10.000Z | 2020-02-14T02:55:23.000Z | from app import db, login
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from hashlib import md5
from datetime import datetime
student_identifier = db.Table('student_identifier',
db.Column('class_id', db.Integer, db.ForeignKey('classes.class_id'))... | 38.16 | 86 | 0.7355 |
cb9f818ff3554de89a7486ccfd6fe098e7f47d2e | 2,230 | py | Python | bundle-workflow/src/build_workflow/builder.py | kavilla/opensearch-build | a0f2614140b8c3243609e80010f190baa1f5642b | [
"Apache-2.0"
] | null | null | null | bundle-workflow/src/build_workflow/builder.py | kavilla/opensearch-build | a0f2614140b8c3243609e80010f190baa1f5642b | [
"Apache-2.0"
] | null | null | null | bundle-workflow/src/build_workflow/builder.py | kavilla/opensearch-build | a0f2614140b8c3243609e80010f190baa1f5642b | [
"Apache-2.0"
] | null | null | null | # Copyright OpenSearch Contributors.
# SPDX-License-Identifier: Apache-2.0
import os
"""
This class is responsible for executing the build for a component and passing the results to a build recorder.
It will notify the build recorder of build information such as repository and git ref, and any artifacts generated by ... | 45.510204 | 128 | 0.678027 |
9e10e31a4f1b020322174aa1052353d8450c411f | 7,293 | py | Python | Post_NLPResult_Database.py | Feiyi-Ding/2021A | f599f0a21e05964fffce3dcf2d32ef70ddc3c75d | [
"Apache-2.0"
] | null | null | null | Post_NLPResult_Database.py | Feiyi-Ding/2021A | f599f0a21e05964fffce3dcf2d32ef70ddc3c75d | [
"Apache-2.0"
] | null | null | null | Post_NLPResult_Database.py | Feiyi-Ding/2021A | f599f0a21e05964fffce3dcf2d32ef70ddc3c75d | [
"Apache-2.0"
] | null | null | null | import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_core_components as dcc
import requests
import json
import base64
from sshtunnel import SSHTunnelForwarder
import pymysql
from pymysql.converters import escape_strin... | 33.454128 | 189 | 0.569724 |
3873bc7b26bdeb7fc50108ff031785d5b92112de | 799 | py | Python | contrib/bt/startup/gui/exportRibs.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T19:04:46.000Z | 2015-02-10T19:04:46.000Z | contrib/bt/startup/gui/exportRibs.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | contrib/bt/startup/gui/exportRibs.py | dboogert/gaffer | d2ce0eb7134a33ceee375d0a3676129a9bdcfbc6 | [
"BSD-3-Clause"
] | null | null | null | import Gaffer
import GafferScene
import GafferUI
def __exportRibs( menu ):
scriptWindow = menu.ancestor( GafferUI.ScriptWindow )
script = scriptWindow.scriptNode()
start = script['frameRange']['start'].getValue()
end = script['frameRange']['end'].getValue()
if len(script.selection()):
sel = script.selection... | 29.592593 | 108 | 0.693367 |
f45df127fa0e54c501fe848fb39cdecf77d30e0b | 247 | py | Python | Aulasatualizada/execicio_curso em video/execicio_sequencia_fibonaci.py | swellington231/AulaPaython | 7b72ddec4d85f4660c0c395de07a133993aa2c70 | [
"MIT"
] | null | null | null | Aulasatualizada/execicio_curso em video/execicio_sequencia_fibonaci.py | swellington231/AulaPaython | 7b72ddec4d85f4660c0c395de07a133993aa2c70 | [
"MIT"
] | null | null | null | Aulasatualizada/execicio_curso em video/execicio_sequencia_fibonaci.py | swellington231/AulaPaython | 7b72ddec4d85f4660c0c395de07a133993aa2c70 | [
"MIT"
] | null | null | null | n = int(input('Quantos termos você quer mostrar? '))
t1 = 0
t2 = 1
cont = 3
print('{} -> {} ->'.format(t1, t2),end=" ")
while cont <= n:
t3 = t1 + t2
print('{} ->'.format(t3), end=" ")
cont += 1
t1 = t2
t2 = t3
print('FIM')
| 15.4375 | 52 | 0.481781 |
054df4c93ec109e835e60a06c5513a946d887a66 | 7,738 | py | Python | cvpods/evaluation/evaluator.py | hanqiu-hq/cvpods | 597fa669151fdad87c250fa118a9e3a555f4fb5e | [
"Apache-2.0"
] | null | null | null | cvpods/evaluation/evaluator.py | hanqiu-hq/cvpods | 597fa669151fdad87c250fa118a9e3a555f4fb5e | [
"Apache-2.0"
] | null | null | null | cvpods/evaluation/evaluator.py | hanqiu-hq/cvpods | 597fa669151fdad87c250fa118a9e3a555f4fb5e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
# This file has been modified by Megvii ("Megvii Modifications").
# All Megvii Modifications are Copyright (C) 2019-2021 Megvii Inc. All rights reserved.
import datetime
import time
from collections impor... | 35.013575 | 99 | 0.634919 |
22dc3aaa57a0c1146184164955c347c0ad653030 | 7,358 | py | Python | utils/build_swift/tests/test_presets.py | 000james000/swift | a4fcc48fddd2d03e853728654e6ad692de75fad3 | [
"Apache-2.0"
] | null | null | null | utils/build_swift/tests/test_presets.py | 000james000/swift | a4fcc48fddd2d03e853728654e6ad692de75fad3 | [
"Apache-2.0"
] | null | null | null | utils/build_swift/tests/test_presets.py | 000james000/swift | a4fcc48fddd2d03e853728654e6ad692de75fad3 | [
"Apache-2.0"
] | null | null | null | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... | 26.467626 | 79 | 0.634547 |
3f6c9322410050f5bb93d5f0287106e17c2ec499 | 350 | py | Python | src/logs/log_writer.py | Akanni96/feng-hirst-rst-parser | 973dba0156a099ba4f1ad2dc3e18ea72530c64e0 | [
"BSD-2-Clause"
] | 1 | 2021-08-19T14:01:09.000Z | 2021-08-19T14:01:09.000Z | src/logs/log_writer.py | Akanni96/feng-hirst-rst-parser | 973dba0156a099ba4f1ad2dc3e18ea72530c64e0 | [
"BSD-2-Clause"
] | null | null | null | src/logs/log_writer.py | Akanni96/feng-hirst-rst-parser | 973dba0156a099ba4f1ad2dc3e18ea72530c64e0 | [
"BSD-2-Clause"
] | null | null | null | '''
Created on 2014-01-17
@author: Wei
'''
class LogWriter:
def __init__(self, writer):
self.writer = writer
def write(self, text):
if self.writer != None:
self.writer.write(text + '\n')
def close(self):
if self.writer:
self.writer.flush()
... | 20.588235 | 42 | 0.522857 |
0a3daa97943e9b058d264aa1773450dfc6a35fa3 | 496 | py | Python | api/serialisers.py | TIJMacLean/FlyMyPlane | 3e3f069b37482456857146383e3c5d8bbcdfdb0e | [
"Apache-2.0"
] | null | null | null | api/serialisers.py | TIJMacLean/FlyMyPlane | 3e3f069b37482456857146383e3c5d8bbcdfdb0e | [
"Apache-2.0"
] | null | null | null | api/serialisers.py | TIJMacLean/FlyMyPlane | 3e3f069b37482456857146383e3c5d8bbcdfdb0e | [
"Apache-2.0"
] | null | null | null | from rest_framework import serializers
from .models import Aircraft, Owner
class OwnerSerialiser(serializers.HyperlinkedModelSerializer):
class Meta:
model = Owner
fields = ('name', 'email_address', 'phone_number')
class AircraftSerialiser(serializers.HyperlinkedModelSerializer):
class Meta:
... | 35.428571 | 85 | 0.719758 |
03776bcb8a00e503c1b8616656cf2a290bbe52fc | 611 | py | Python | setup.py | bnbalsamo/slackbotframework | dc37d1b466e7a76be3a3edac03c9980805fb3645 | [
"Apache-2.0"
] | null | null | null | setup.py | bnbalsamo/slackbotframework | dc37d1b466e7a76be3a3edac03c9980805fb3645 | [
"Apache-2.0"
] | null | null | null | setup.py | bnbalsamo/slackbotframework | dc37d1b466e7a76be3a3edac03c9980805fb3645 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
def readme():
with open("README.md", 'r') as f:
return f.read()
setup(
name="slackbotframework",
description="A framework for building internal integration slack bots",
version="0.0.1",
long_description=readme(),
author="Brian Balsamo",
... | 21.068966 | 75 | 0.639935 |
b70fe50655f8e0742e043196b2e251e75724d983 | 9,187 | py | Python | pytrafikverket/trafikverket_ferry.py | AnderssonPeter/pytrafikverket | d7b6efc755f48805a1f67959b1745841f5b463a6 | [
"MIT"
] | 5 | 2017-05-15T15:00:33.000Z | 2018-03-17T09:51:31.000Z | pytrafikverket/trafikverket_ferry.py | AnderssonPeter/pytrafikverket | d7b6efc755f48805a1f67959b1745841f5b463a6 | [
"MIT"
] | 1 | 2018-08-20T18:56:15.000Z | 2018-08-22T17:16:33.000Z | pytrafikverket/trafikverket_ferry.py | AnderssonPeter/pytrafikverket | d7b6efc755f48805a1f67959b1745841f5b463a6 | [
"MIT"
] | 1 | 2018-08-18T14:56:07.000Z | 2018-08-18T14:56:07.000Z | """Enables retreival of ferry departure information from Trafikverket API."""
import typing
from datetime import datetime
from enum import Enum
from typing import List
import aiohttp
from pytrafikverket.trafikverket import (
FieldFilter,
FieldSort,
FilterOperation,
NodeHelper,
SortOrder,
Trafi... | 32.348592 | 84 | 0.620115 |
8c1b964476f1cc7dea393d374f81f40a03943017 | 127 | py | Python | netexec/__init__.py | dogoncouch/netexec | 3a0d675dc65058e83aa215536363054a8b9b4286 | [
"MIT"
] | null | null | null | netexec/__init__.py | dogoncouch/netexec | 3a0d675dc65058e83aa215536363054a8b9b4286 | [
"MIT"
] | null | null | null | netexec/__init__.py | dogoncouch/netexec | 3a0d675dc65058e83aa215536363054a8b9b4286 | [
"MIT"
] | null | null | null | __version__ = '0.1'
__author__ = 'Dan Persons <dpersonsdev@gmail.com>'
__license__ = 'MIT License'
import netexec.devicetypes
| 21.166667 | 50 | 0.76378 |
d461d9259cf33892898cf9399f3b37a102e05810 | 447 | py | Python | data/scripts/templates/object/draft_schematic/food/shared_dish_trimpian.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/draft_schematic/food/shared_dish_trimpian.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/draft_schematic/food/shared_dish_trimpian.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/food/shared_dish_trimpian.iff"
result.attribute_template_i... | 26.294118 | 73 | 0.727069 |
8cf81cc73b9d1f32d986864dcaf315803d21a294 | 6,205 | py | Python | sdk/python/pulumi_azure_nextgen/relay/v20170401/get_namespace.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/relay/v20170401/get_namespace.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/relay/v20170401/get_namespace.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 34.472222 | 187 | 0.641902 |
fbdcc8f41dbe0bd90c6916d045e454e414492195 | 2,515 | py | Python | backends/core/database.py | jwstafford/crmint | 925c581551157a6f2e0795ab6fe997251af1d504 | [
"Apache-2.0"
] | null | null | null | backends/core/database.py | jwstafford/crmint | 925c581551157a6f2e0795ab6fe997251af1d504 | [
"Apache-2.0"
] | null | null | null | backends/core/database.py | jwstafford/crmint | 925c581551157a6f2e0795ab6fe997251af1d504 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.533333 | 160 | 0.757455 |
0f86289cff8afdf66f7af8846378d999d60f7fbe | 32,581 | py | Python | tests/migrations/test_commands.py | doismellburning/django | 039465a6a7a18f48ea77ceadb6949990c0ec92e1 | [
"BSD-3-Clause"
] | null | null | null | tests/migrations/test_commands.py | doismellburning/django | 039465a6a7a18f48ea77ceadb6949990c0ec92e1 | [
"BSD-3-Clause"
] | null | null | null | tests/migrations/test_commands.py | doismellburning/django | 039465a6a7a18f48ea77ceadb6949990c0ec92e1 | [
"BSD-3-Clause"
] | 1 | 2020-05-25T08:55:19.000Z | 2020-05-25T08:55:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import importlib
import os
import shutil
from django.apps import apps
from django.db import connection, models
from django.core.management import call_command, CommandError
from django.db.migrations import questioner
from django.test import... | 43.325798 | 136 | 0.642798 |
1c83508f27a8e46d884ad975a58307b08a7140e7 | 6,082 | py | Python | Chapter06/02_dqn_pong.py | svenkilian/Deep-Reinforcement-Learning-Hands-On | b9ab995722bd692828ce3e6f50026fa87e5f924b | [
"MIT"
] | null | null | null | Chapter06/02_dqn_pong.py | svenkilian/Deep-Reinforcement-Learning-Hands-On | b9ab995722bd692828ce3e6f50026fa87e5f924b | [
"MIT"
] | null | null | null | Chapter06/02_dqn_pong.py | svenkilian/Deep-Reinforcement-Learning-Hands-On | b9ab995722bd692828ce3e6f50026fa87e5f924b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from lib import wrappers
from lib import dqn_model
import argparse
import time
import numpy as np
import collections
import torch
import torch.nn as nn
import torch.optim as optim
from tensorboardX import SummaryWriter
DEFAULT_ENV_NAME = "PongNoFrameskip-v4"
MEAN_REWARD_BOUND = 19.5
GAMMA =... | 33.60221 | 107 | 0.628905 |
da2814472f2891ae25416718f47be0badad333ac | 6,402 | py | Python | nnlm/nnm/lstm.py | dengliangshi/pynnlms | 1a08b12767cf028626f0368b993933092390f28d | [
"MIT"
] | 11 | 2017-06-21T08:54:03.000Z | 2019-05-07T06:54:20.000Z | nnlm/nnm/lstm.py | dengliangshi/pynnlms | 1a08b12767cf028626f0368b993933092390f28d | [
"MIT"
] | null | null | null | nnlm/nnm/lstm.py | dengliangshi/pynnlms | 1a08b12767cf028626f0368b993933092390f28d | [
"MIT"
] | null | null | null | #encoding utf-8
# ---------------------------------------------------------Libraries--------------------------------------------------------
# Standard Library
# Third-party Libraries
import numpy as np
# User Define Module
from nn import NN
from nodes import Nodes
from acfun import AcFun
# -----------------------... | 42.118421 | 124 | 0.51687 |
a3cd62b35e01e79fe23b52d5597fdca13fb953bf | 5,044 | py | Python | GetCryptoPortfolio.py | jeev20/CryptoAssetReport | 7d8b7449f4e7fcd2c46098aeb47b76bbd12e4309 | [
"MIT"
] | 1 | 2021-04-06T04:32:32.000Z | 2021-04-06T04:32:32.000Z | GetCryptoPortfolio.py | jeev20/CryptocurrencyAssetReporter | 7d8b7449f4e7fcd2c46098aeb47b76bbd12e4309 | [
"MIT"
] | null | null | null | GetCryptoPortfolio.py | jeev20/CryptocurrencyAssetReporter | 7d8b7449f4e7fcd2c46098aeb47b76bbd12e4309 | [
"MIT"
] | null | null | null | # +
import requests
import pandas as pd
import time
import json
def GetCryptoPortfolio(year, cryptoCurrencies, inFiatCurrency):
"""
This function returns the value of the crypto currency
on the first day of the year. This can help in reporting crypto portfolio in Norway.
Thanks to Coingecko for an... | 35.272727 | 140 | 0.63858 |
e268c285288c1665446d429cacd80e670edd2518 | 4,133 | py | Python | point_cloud/handcrafted_registrator.py | humanpose1/riedones3d | 53a393d7cead6daf13d477d6254db543de5b2e76 | [
"MIT"
] | 2 | 2022-02-09T16:55:43.000Z | 2022-03-26T09:44:07.000Z | point_cloud/handcrafted_registrator.py | humanpose1/riedones3d | 53a393d7cead6daf13d477d6254db543de5b2e76 | [
"MIT"
] | null | null | null | point_cloud/handcrafted_registrator.py | humanpose1/riedones3d | 53a393d7cead6daf13d477d6254db543de5b2e76 | [
"MIT"
] | null | null | null | iS_HANDCRAFT_DESC_IMPORT = True
try:
import handcrafted_descriptor as hd
except ImportError:
iS_HANDCRAFT_DESC_IMPORT = False
import open3d as o3d
import numpy as np
import torch
from point_cloud.base_registration import FeatureBasedRegistrator
from point_cloud.visu import torch2o3d
class FPFHRegistrator(F... | 35.62931 | 104 | 0.61142 |
8cdfecb6d5f509982d646f9f7bcf8126a31b38e6 | 5,499 | py | Python | host/query-agent/pathdumpapi.py | PathDump/PathDump | d7fe23f303c4d7c2a41b2870c5034a52e3024985 | [
"Apache-2.0"
] | 8 | 2018-04-11T17:06:33.000Z | 2020-03-04T07:15:53.000Z | host/query-agent/pathdumpapi.py | PathDump/PathDump | d7fe23f303c4d7c2a41b2870c5034a52e3024985 | [
"Apache-2.0"
] | null | null | null | host/query-agent/pathdumpapi.py | PathDump/PathDump | d7fe23f303c4d7c2a41b2870c5034a52e3024985 | [
"Apache-2.0"
] | 4 | 2018-04-19T05:11:54.000Z | 2019-04-01T14:03:14.000Z | from pymongo import MongoClient
import pymongo
from datetime import datetime
import helperapi as helper
import confparser as cp
import tcpmon
client=MongoClient('localhost', 27017)
database=client['PathDump']
collection=database['TIB']
def getFlows (linkID, timeRange):
link_fltr = helper.buildLinkFilter (linkID)
... | 33.944444 | 118 | 0.563557 |
3efff73c2435c6b52230eecf7fc4e4aadb242905 | 2,337 | py | Python | transifex/native/settings.py | transifex/transifex-python | d467e82bba7f0d620a021cf9e7e58c987ba2fbb5 | [
"Apache-2.0"
] | 14 | 2020-04-10T20:54:59.000Z | 2022-03-07T16:13:22.000Z | transifex/native/settings.py | transifex/transifex-python | d467e82bba7f0d620a021cf9e7e58c987ba2fbb5 | [
"Apache-2.0"
] | 60 | 2020-04-14T12:41:06.000Z | 2022-03-29T06:38:09.000Z | transifex/native/settings.py | transifex/transifex-python | d467e82bba7f0d620a021cf9e7e58c987ba2fbb5 | [
"Apache-2.0"
] | 6 | 2021-01-01T10:28:11.000Z | 2021-06-10T09:50:26.000Z | from transifex.common.utils import import_to_python
from transifex.native.cache import AbstractCache
from transifex.native.rendering import (AbstractErrorPolicy,
AbstractRenderingPolicy, ChainedPolicy)
def parse_setting_class(obj):
# obj is a tuple like (<path>, <params>)
... | 30.75 | 79 | 0.685494 |
23b737e426710356e358ac34562dffa6a0bcb315 | 666 | py | Python | fixture/session.py | AdKrajan/python_training | 1315b58c07db4d02bc46ae65e5c358fdbf78dbc0 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | AdKrajan/python_training | 1315b58c07db4d02bc46ae65e5c358fdbf78dbc0 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | AdKrajan/python_training | 1315b58c07db4d02bc46ae65e5c358fdbf78dbc0 | [
"Apache-2.0"
] | null | null | null | class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys... | 35.052632 | 76 | 0.641141 |
8fd24844733cb45fafa55db443368d908351334d | 203,695 | py | Python | tests/migrations/test_operations.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | tests/migrations/test_operations.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | tests/migrations/test_operations.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | from django.core.exceptions import FieldDoesNotExist
from django.db import (
IntegrityError,
connection,
migrations,
models,
transaction,
)
from django.db.migrations.migration import Migration
from django.db.migrations.operations.fields import FieldOperation
from django.db.migrations.state import Mo... | 42.06836 | 115 | 0.590093 |
40a3843fabb075a0af899ff3fcb45fa00017c9ee | 1,150 | py | Python | algorithm/implementation/forming_a_magic_square/forming_a_magic_square.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2017-07-02T01:35:39.000Z | 2017-07-02T01:35:39.000Z | algorithm/implementation/forming_a_magic_square/forming_a_magic_square.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | null | null | null | algorithm/implementation/forming_a_magic_square/forming_a_magic_square.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2018-04-03T15:11:56.000Z | 2018-04-03T15:11:56.000Z | #!/usr/bin/env python3
"""
Forming a Magic Square
:author: Dela Anthonio
:hackerrank: https://hackerrank.com/delaanthonio
:problem: https://www.hackerrank.com/challenges/magic-square-forming
"""
from typing import List
magic_squares = [
[[8, 1, 6], [3, 5, 7], [4, 9, 2]],
[[6, 1, 8], [7, 5, 3], [2, 9, 4]],
... | 25.555556 | 71 | 0.525217 |
aa42ff50bd29a1e7d7257a133b8d0b8f96f903f3 | 2,084 | py | Python | swig-2.0.4/Examples/test-suite/python/reference_global_vars_runme.py | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | swig-2.0.4/Examples/test-suite/python/reference_global_vars_runme.py | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | swig-2.0.4/Examples/test-suite/python/reference_global_vars_runme.py | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | from reference_global_vars import *
# const class reference variable
if getconstTC().num != 33:
raise RuntimeError
# primitive reference variables
cvar.var_bool = createref_bool(0)
if value_bool(cvar.var_bool) != 0:
raise RuntimeError
cvar.var_bool = createref_bool(1)
if value_bool(cvar.var_bool) != 1:
r... | 27.786667 | 64 | 0.786468 |
72aad9e32d91f3df966c6172f58663ca65f604db | 67,907 | py | Python | bridge/marks/test.py | lutovna/klever | 29c0e4fa60def241032a2ea2b81103d817994eef | [
"Apache-2.0"
] | 1 | 2021-01-09T08:44:37.000Z | 2021-01-09T08:44:37.000Z | bridge/marks/test.py | lutovna/klever | 29c0e4fa60def241032a2ea2b81103d817994eef | [
"Apache-2.0"
] | 3 | 2021-03-19T09:15:16.000Z | 2021-09-22T19:24:40.000Z | bridge/marks/test.py | lutovna/klever | 29c0e4fa60def241032a2ea2b81103d817994eef | [
"Apache-2.0"
] | 1 | 2020-05-22T15:53:39.000Z | 2020-05-22T15:53:39.000Z | #
# Copyright (c) 2019 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# h... | 52.845914 | 120 | 0.642555 |
c30ea2dfd401c1916572054375002b08df4e6142 | 40,848 | py | Python | test/functional/wallet_importmulti.py | acejr1337/TerryDavisCoin | 72a5c737f68042fa8f73d2879c13b0c120deb4aa | [
"MIT"
] | null | null | null | test/functional/wallet_importmulti.py | acejr1337/TerryDavisCoin | 72a5c737f68042fa8f73d2879c13b0c120deb4aa | [
"MIT"
] | 3 | 2021-09-25T19:03:51.000Z | 2021-09-27T20:27:25.000Z | test/functional/wallet_importmulti.py | acejr1337/TerryDavisCoin | 72a5c737f68042fa8f73d2879c13b0c120deb4aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importmulti RPC.
Test importmulti by generating keys on node0, importing the scriptPubKeys an... | 49.814634 | 316 | 0.551581 |
2a64fe0b181389951bcbf5bfb7b835401ef16e55 | 2,219 | py | Python | optimize.py | olaviinha/HiresNeuralStyleTransfer | ff2f742f306819796cf1ec88f6efec0a619ae2f1 | [
"Apache-2.0"
] | 15 | 2018-02-11T16:56:19.000Z | 2021-12-29T21:34:33.000Z | optimize.py | olaviinha/HiresNeuralStyleTransfer | ff2f742f306819796cf1ec88f6efec0a619ae2f1 | [
"Apache-2.0"
] | 4 | 2018-06-08T00:33:51.000Z | 2021-01-01T12:39:06.000Z | optimize.py | olaviinha/HiresNeuralStyleTransfer | ff2f742f306819796cf1ec88f6efec0a619ae2f1 | [
"Apache-2.0"
] | 3 | 2019-11-08T09:37:06.000Z | 2020-08-05T09:36:53.000Z | from lasagne.utils import floatX
import time
import scipy
import numpy as np
# this LossAndGradSimultaneousEvaluator class makes it possible
# to compute loss and gradients in one pass
# while retrieving them via two separate functions,
# "loss" and "grads". This is done because scipy.optimize
# requires separate func... | 40.345455 | 170 | 0.697161 |
cc272f56ed49ea1e4b3a76d26ade7b06c3153fb2 | 11,670 | py | Python | src/benchmarks/gc/src/analysis/gui_server.py | sandreenko/performance | 11b77ba778e8d952caee4c407c90e7c4eabfb5bc | [
"MIT"
] | 547 | 2018-11-06T21:14:57.000Z | 2022-03-31T21:14:57.000Z | src/benchmarks/gc/src/analysis/gui_server.py | sandreenko/performance | 11b77ba778e8d952caee4c407c90e7c4eabfb5bc | [
"MIT"
] | 1,572 | 2018-11-06T21:30:31.000Z | 2022-03-31T23:31:25.000Z | src/benchmarks/gc/src/analysis/gui_server.py | sandreenko/performance | 11b77ba778e8d952caee4c407c90e7c4eabfb5bc | [
"MIT"
] | 196 | 2018-11-06T20:58:21.000Z | 2022-03-29T21:04:21.000Z | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
"""
WARN: The server code is still here but the JS gui code is not in this repo
because we need to know if it's OK to i... | 35.363636 | 97 | 0.65964 |
c9c4026d7a9b3eedc1f459eab7418092a6bf4adf | 300 | py | Python | apps/relation/views.py | Palameng/Demo | f216982851ca7e024a9afebcb47c575765f51622 | [
"Apache-2.0"
] | null | null | null | apps/relation/views.py | Palameng/Demo | f216982851ca7e024a9afebcb47c575765f51622 | [
"Apache-2.0"
] | null | null | null | apps/relation/views.py | Palameng/Demo | f216982851ca7e024a9afebcb47c575765f51622 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.views import View
from .models import Departments, Staffs, Projects, Gloup, Person, Membership
class OpertionManytoManyField(View):
def post(self, request):
return render(request, 'success.html', {
})
| 21.428571 | 76 | 0.723333 |
b42ee812e233c4c53c04d4531322cbed20a74991 | 784 | py | Python | server/globalImports.py | eternalamit5/Highly-Accelerated-Life-Test-HALT-Monitoring-Tool | e04c0f3b5f446acd56de6329fbf1695792504efd | [
"MIT"
] | null | null | null | server/globalImports.py | eternalamit5/Highly-Accelerated-Life-Test-HALT-Monitoring-Tool | e04c0f3b5f446acd56de6329fbf1695792504efd | [
"MIT"
] | null | null | null | server/globalImports.py | eternalamit5/Highly-Accelerated-Life-Test-HALT-Monitoring-Tool | e04c0f3b5f446acd56de6329fbf1695792504efd | [
"MIT"
] | null | null | null | # Flask
from flask import Flask, request, session, send_file
from flask_cors import CORS
# mongo
from flask_pymongo import PyMongo
# mqtt
from flask_mqtt import Mqtt
# web sockets
from flask_sockets import Sockets
# influx
from influxdb import InfluxDBClient
# numpy
import numpy as np
import pandas as pd
# time, ... | 18.232558 | 73 | 0.818878 |
15d15e6e3ed93b34c570b5dbd756a39949b1debc | 4,673 | py | Python | saas/backend/apps/action/tasks.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 7 | 2021-08-13T03:48:16.000Z | 2021-12-20T15:31:38.000Z | saas/backend/apps/action/tasks.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 456 | 2021-08-16T02:13:57.000Z | 2022-03-30T10:02:49.000Z | saas/backend/apps/action/tasks.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | 17 | 2021-08-10T04:08:46.000Z | 2022-03-14T14:24:36.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 36.224806 | 115 | 0.707682 |
7616964ef7a2e5e8721685c2d72319df48fcd197 | 19,125 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_ref/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_ref/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/interfaces/interface/interface_ref/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 39.926931 | 352 | 0.617098 |
df1585c121fb6d02fa578d389f1f702a63360267 | 3,435 | py | Python | Python-Data-Cleaning-Cookbook-master/Visualization/violin_plots.py | Dongfang1021/Python_data_analysis_notebook | 210c8bbe1b17736e639bbdbcae19df795fb702d5 | [
"MIT"
] | 1 | 2021-05-31T03:17:00.000Z | 2021-05-31T03:17:00.000Z | Python-Data-Cleaning-Cookbook-master/Visualization/violin_plots.py | Dongfang1021/Python_data_analysis_notebook | 210c8bbe1b17736e639bbdbcae19df795fb702d5 | [
"MIT"
] | null | null | null | Python-Data-Cleaning-Cookbook-master/Visualization/violin_plots.py | Dongfang1021/Python_data_analysis_notebook | 210c8bbe1b17736e639bbdbcae19df795fb702d5 | [
"MIT"
] | null | null | null | # import pandas, numpy, and matplotlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
pd.set_option('display.width', 80)
pd.set_option('display.max_columns', 7)
pd.set_option('display.max_rows', 200)
pd.options.display.float_format = '{:,.0f}'.format
covidtotals = pd.read_p... | 44.038462 | 110 | 0.751965 |
ec354932ade8e2ec4ac7211d40027615ba515fa0 | 6,037 | py | Python | tensorflow_addons/image/tests/connected_components_test.py | leandro-gracia-gil/addons | d981b0f1d1bc23f697d159eb1510c24b3c476d28 | [
"Apache-2.0"
] | 2 | 2021-02-22T12:15:33.000Z | 2021-05-02T15:22:13.000Z | tensorflow_addons/image/tests/connected_components_test.py | Ankur3107/addons | af6866a2e6d9ddbc79d612d7cb04a8a5befe4a47 | [
"Apache-2.0"
] | null | null | null | tensorflow_addons/image/tests/connected_components_test.py | Ankur3107/addons | af6866a2e6d9ddbc79d612d7cb04a8a5befe4a47 | [
"Apache-2.0"
] | 1 | 2020-07-23T01:10:18.000Z | 2020-07-23T01:10:18.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.107345 | 88 | 0.578433 |
bd6f316bc644d0a52b0a278b7794b5ab9ef3de67 | 1,717 | py | Python | fbotics/models/request.py | pasmod/fbotics | 6ddd5d1f2396f43a90a1fb529f896d15e47f72b3 | [
"BSD-3-Clause"
] | 3 | 2018-11-16T13:20:08.000Z | 2019-04-16T16:43:25.000Z | fbotics/models/request.py | pasmod/fbotics | 6ddd5d1f2396f43a90a1fb529f896d15e47f72b3 | [
"BSD-3-Clause"
] | 1 | 2018-12-16T16:58:58.000Z | 2018-12-16T16:58:58.000Z | fbotics/models/request.py | pasmod/fbotics | 6ddd5d1f2396f43a90a1fb529f896d15e47f72b3 | [
"BSD-3-Clause"
] | 2 | 2018-12-16T16:30:18.000Z | 2021-10-03T12:43:54.000Z | from fbotics.models.message import Message
from fbotics.models.recipient import Recipient
from schematics.exceptions import ValidationError
from schematics.models import Model
from schematics.types import StringType
from schematics.types.compound import ModelType
class Request(Model):
"""Model for a request to be... | 31.796296 | 88 | 0.630169 |
69f96fa2bee6b48dbc20fdfabe7eb927ce6dde88 | 6,002 | py | Python | corehq/apps/userreports/indicators/factory.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/userreports/indicators/factory.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/userreports/indicators/factory.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
from django.utils.translation import ugettext as _
from jsonobject.exceptions import BadValueError
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userreports.expressions import ExpressionFactory
from corehq.apps... | 31.424084 | 101 | 0.686604 |
9cf78f4e10591400760d3d1d81f5c3cde7969459 | 3,891 | py | Python | test/common/json/config_schemas_test_data/test_access_log_schema.py | rishabhkumar296/envoy | 1b040ff0e029059c7aaa6816fccb2419c02675b1 | [
"Apache-2.0"
] | 27 | 2017-10-27T03:18:58.000Z | 2019-02-07T21:22:20.000Z | test/common/json/config_schemas_test_data/test_access_log_schema.py | rishabhkumar296/envoy | 1b040ff0e029059c7aaa6816fccb2419c02675b1 | [
"Apache-2.0"
] | 14 | 2018-02-16T20:47:38.000Z | 2019-01-19T23:03:01.000Z | test/common/json/config_schemas_test_data/test_access_log_schema.py | rishabhkumar296/envoy | 1b040ff0e029059c7aaa6816fccb2419c02675b1 | [
"Apache-2.0"
] | 7 | 2017-11-26T06:26:49.000Z | 2019-03-26T03:09:00.000Z | from util import get_blob
from util import true, false
ACCESS_LOG_BLOB = {
"access_log": [{
"filter": {
"type":
"logical_and",
"filters": [{
"type": "not_healthcheck"
}, {
"type": "runtime",
"key": "access_log.f... | 28.40146 | 93 | 0.457466 |
22d1f65fa4f52b866e26e4b5a5dfdef6512b255f | 11,797 | py | Python | tests/test_observers/test_mongo_observer.py | godmethium/sacred | f669382a8e5b33b674538d6c21253bdba5f52f20 | [
"MIT"
] | 16 | 2021-07-18T12:54:40.000Z | 2022-03-01T02:04:53.000Z | tests/test_observers/test_mongo_observer.py | godmethium/sacred | f669382a8e5b33b674538d6c21253bdba5f52f20 | [
"MIT"
] | 1 | 2021-08-11T09:25:13.000Z | 2021-08-23T04:38:29.000Z | tests/test_observers/test_mongo_observer.py | godmethium/sacred | f669382a8e5b33b674538d6c21253bdba5f52f20 | [
"MIT"
] | 8 | 2019-10-08T21:37:31.000Z | 2021-11-19T13:17:23.000Z | #!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
import datetime
import mock
import pytest
from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics
pymongo = pytest.importorskip("pymongo")
mongomock = pytest.importorskip("mongomock")
from sacred.... | 36.636646 | 97 | 0.653471 |
956666c69f540552e582bb7e8b4c2490dcb1a7a0 | 6,397 | py | Python | api/operators.py | DavidONeill75101/open-transport-operator-api | 9f5a0687093b18fafda8e824f8971b506ffa6f09 | [
"Apache-2.0"
] | null | null | null | api/operators.py | DavidONeill75101/open-transport-operator-api | 9f5a0687093b18fafda8e824f8971b506ffa6f09 | [
"Apache-2.0"
] | null | null | null | api/operators.py | DavidONeill75101/open-transport-operator-api | 9f5a0687093b18fafda8e824f8971b506ffa6f09 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2021 David O'Neill
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
... | 38.305389 | 144 | 0.505706 |
18d8d746db7ce25a4aa966145783929d54b50ff1 | 40,494 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/module_utils/docker/common.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-latest/lib/python2.7/site-packages/ansible/module_utils/docker/common.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-latest/lib/python2.7/site-packages/ansible/module_utils/docker/common.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #
# Copyright 2016 Red Hat | Ansible
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... | 40.252485 | 142 | 0.57653 |
3e1668a9d7d846aeb0314ea327121464cd3f8640 | 2,554 | py | Python | solarium/led.py | codingjoe/solarium | 241a833ec5e2bcd93bd3a34f5cd9e1dd6b776474 | [
"MIT"
] | 1 | 2020-11-08T20:11:03.000Z | 2020-11-08T20:11:03.000Z | solarium/led.py | codingjoe/solarium | 241a833ec5e2bcd93bd3a34f5cd9e1dd6b776474 | [
"MIT"
] | 3 | 2020-12-19T15:40:28.000Z | 2020-12-20T16:10:26.000Z | solarium/led.py | codingjoe/solarium | 241a833ec5e2bcd93bd3a34f5cd9e1dd6b776474 | [
"MIT"
] | null | null | null | import asyncio
import logging
import gpiozero
from gpiozero.pins.pigpio import PiGPIOFactory
logger = logging.getLogger(__package__)
class PWMLED(gpiozero.PWMLED):
def __init__(self, *args, **kwargs):
self.name = kwargs.pop("name")
self.power_state = kwargs.pop("power_state")
self.power_... | 29.697674 | 87 | 0.637431 |
1cdd043bc8f49a4d7fafb8378c397d1ab0db0607 | 4,492 | py | Python | entigen/readers/csv.py | Stiivi/entigen | b2b49f5e8e8a06c33f269e7effe5fae8576e26e0 | [
"MIT"
] | 5 | 2017-02-21T04:11:58.000Z | 2020-07-03T22:59:18.000Z | entigen/readers/csv.py | Stiivi/entigen | b2b49f5e8e8a06c33f269e7effe5fae8576e26e0 | [
"MIT"
] | 3 | 2017-02-20T19:17:15.000Z | 2017-02-20T23:33:22.000Z | entigen/readers/csv.py | Stiivi/entigen | b2b49f5e8e8a06c33f269e7effe5fae8576e26e0 | [
"MIT"
] | 1 | 2020-04-16T16:55:22.000Z | 2020-04-16T16:55:22.000Z | """
CSV File Reader
"""
import csv
import os.path
from collections import defaultdict
from typing import Optional, Iterable, Dict, List
from ..errors import MetadataError
from ..model import Model, Entity, Property, Enumeration, EnumValue
from ..extensible import Reader
from ..utils import to_bool
PROPERTIES_FILE ... | 30.351351 | 76 | 0.578807 |
600a4024c23bdfaa9bd96914dc541229ca7e6244 | 18,571 | py | Python | server/processeshandler.py | Modaouche/Taskmaster | 93e96d5ea320ceca011c42b3273eb40df7eee66f | [
"MIT"
] | null | null | null | server/processeshandler.py | Modaouche/Taskmaster | 93e96d5ea320ceca011c42b3273eb40df7eee66f | [
"MIT"
] | null | null | null | server/processeshandler.py | Modaouche/Taskmaster | 93e96d5ea320ceca011c42b3273eb40df7eee66f | [
"MIT"
] | null | null | null | """A module which handle processes by launching them and fetch info."""
import os
import sys
import copy
import time
import subprocess
import threading
from datetime import datetime
from subprocess import TimeoutExpired
from server_socket import Communication_S
from program import Program
from client_request import Cl... | 43.491803 | 144 | 0.543428 |
9f7de768086840af8191fd0e8c510758bfd09bc3 | 4,209 | py | Python | retail_sales_prediction/utils/run_model.py | amjadraza/retail-sales-prediction | 82af7de0383d88b51a961393b27f5d43ace372da | [
"MIT"
] | null | null | null | retail_sales_prediction/utils/run_model.py | amjadraza/retail-sales-prediction | 82af7de0383d88b51a961393b27f5d43ace372da | [
"MIT"
] | 1 | 2021-11-15T17:52:14.000Z | 2021-11-15T17:52:14.000Z | retail_sales_prediction/utils/run_model.py | amjadraza/retail-sales-prediction | 82af7de0383d88b51a961393b27f5d43ace372da | [
"MIT"
] | 1 | 2020-09-13T05:41:36.000Z | 2020-09-13T05:41:36.000Z | """
.. module:: run_model
:synopsis: Collection of Models
.. moduleauthor:: MA Raza
This modules consists of collection of various machine learning models. We start with Light GBM.
Depending on the time, we can add more
Todo:
* Add more machine learning models, such as GBM, RF and XGBoost
* Spark Compatib... | 33.141732 | 96 | 0.627465 |
2f9297153a5295b2d97bd3a0b259e116f107d57d | 22,501 | py | Python | source/models/sbi_snpe_mod/snpe_base.py | dominickeehan/bayesian-microlensing | bf95b8346019e6a6262e42e4c5c8e5b870c903b5 | [
"MIT"
] | 1 | 2021-10-13T00:41:02.000Z | 2021-10-13T00:41:02.000Z | source/models/sbi_snpe_mod/snpe_base.py | dominickeehan/bayesian-microlensing | bf95b8346019e6a6262e42e4c5c8e5b870c903b5 | [
"MIT"
] | null | null | null | source/models/sbi_snpe_mod/snpe_base.py | dominickeehan/bayesian-microlensing | bf95b8346019e6a6262e42e4c5c8e5b870c903b5 | [
"MIT"
] | null | null | null | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Affero General Public License v3, see <https://www.gnu.org/licenses/>.
import time
import logging
from abc import ABC, abstractmethod
from copy import deepcopy
from typing import Any, Callable, Dict, Optional, Union
from w... | 44.822709 | 165 | 0.611351 |
131e9d35a842489755be13c4db29e6dad60f4180 | 1,005 | py | Python | setup.py | DasyDong/python-norepeat | a05c7e0ca1ab61cc3a975bc8fcd15f9d5055ffd7 | [
"MIT"
] | 91 | 2020-01-19T03:46:44.000Z | 2020-11-21T05:58:17.000Z | setup.py | DasyDong/norepeat | a05c7e0ca1ab61cc3a975bc8fcd15f9d5055ffd7 | [
"MIT"
] | null | null | null | setup.py | DasyDong/norepeat | a05c7e0ca1ab61cc3a975bc8fcd15f9d5055ffd7 | [
"MIT"
] | 2 | 2020-01-26T10:27:22.000Z | 2020-10-09T08:11:28.000Z | """Setup script for realpython-reader"""
import os.path
from setuptools import setup, find_packages
# The directory containing this file
HERE = os.path.abspath(os.path.dirname(__file__))
# The text of the README file
with open(os.path.join(HERE, "README.md")) as fid:
README = fid.read()
# This call to setup() d... | 30.454545 | 74 | 0.696517 |
0b00b7ea8f27c142092d0c1dc45e94adea701a23 | 6,357 | py | Python | portfolios/admin.py | tkanemoto/django-portfolios | 328990d030b3509cf5aeef09c3ae605104a18564 | [
"Apache-2.0"
] | null | null | null | portfolios/admin.py | tkanemoto/django-portfolios | 328990d030b3509cf5aeef09c3ae605104a18564 | [
"Apache-2.0"
] | null | null | null | portfolios/admin.py | tkanemoto/django-portfolios | 328990d030b3509cf5aeef09c3ae605104a18564 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from ordered_model.admin import OrderedTabularInline, OrderedModelAdmin
from .models import *
class CustomSizeMixin(object):
custom_textarea_rows = 4
custom_textarea_cols = 85
custom_text_input_style = 'widt... | 31.785 | 118 | 0.64779 |
a0af06bf60a480c1ee98d41009257eafde5ae4cf | 12,942 | py | Python | debinterface/interfacesWriter.py | nMustaki/debinterface | bf42d195e91853d11168511dfc14fd2f5e695093 | [
"BSD-3-Clause"
] | 10 | 2017-05-04T22:46:06.000Z | 2021-03-22T11:19:24.000Z | debinterface/interfacesWriter.py | nMustaki/debinterface | bf42d195e91853d11168511dfc14fd2f5e695093 | [
"BSD-3-Clause"
] | 39 | 2015-06-18T21:36:26.000Z | 2021-07-05T14:43:56.000Z | debinterface/interfacesWriter.py | nMustaki/debinterface | bf42d195e91853d11168511dfc14fd2f5e695093 | [
"BSD-3-Clause"
] | 21 | 2015-06-17T19:04:47.000Z | 2019-10-28T03:11:25.000Z | # -*- coding: utf-8 -*-
# Write interface
from __future__ import print_function, with_statement, absolute_import
import shutil
from collections import defaultdict
import os
from string import Template
from . import toolutils
from .adapter import NetworkAdapter
try:
import typing as tp
except ImportError:
pass... | 37.842105 | 93 | 0.56251 |
2bce7c31e4c54c77ccc38e2fec63bae7c4359a4c | 976 | py | Python | main.py | Satokken/Kadai1 | 85c16f7d5c6f291648d6c3d282f97179254a094d | [
"MIT"
] | null | null | null | main.py | Satokken/Kadai1 | 85c16f7d5c6f291648d6c3d282f97179254a094d | [
"MIT"
] | null | null | null | main.py | Satokken/Kadai1 | 85c16f7d5c6f291648d6c3d282f97179254a094d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import subprocess
def LEDon():
"""on led"""
led_cmd = "echo 1 > /dev/myled0"
subprocess.call(led_cmd, shell=True)
def LEDoff():
"""off led"""
led_cmd = "echo 0 > /dev/myled0"
subprocess.call(led_cmd, shell=True)
def wait(self):
"""wia... | 12.512821 | 40 | 0.476434 |
b9c3c1cbc7f21b38f02d0df7a2b61c87a64ac6ea | 18,122 | py | Python | tensorflow_federated/python/aggregators/secure.py | Tensorflow-Devs/federated | 5df96d42d72fa43a050df6465271a38175a5fd7a | [
"Apache-2.0"
] | 1,918 | 2019-02-22T21:17:28.000Z | 2022-03-30T14:49:53.000Z | tensorflow_federated/python/aggregators/secure.py | Tensorflow-Devs/federated | 5df96d42d72fa43a050df6465271a38175a5fd7a | [
"Apache-2.0"
] | 999 | 2019-02-22T21:47:44.000Z | 2022-03-31T11:06:42.000Z | tensorflow_federated/python/aggregators/secure.py | Tensorflow-Devs/federated | 5df96d42d72fa43a050df6465271a38175a5fd7a | [
"Apache-2.0"
] | 498 | 2019-02-22T21:17:56.000Z | 2022-03-29T02:54:15.000Z | # Copyright 2020, The TensorFlow Federated 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... | 42.64 | 80 | 0.728672 |
4796a152237de314d26fcd5ac0e2ee0433b4ddf1 | 1,315 | py | Python | check_#2/main.py | thomasvincent/MonitoringPlugins | b7662e78fe931ea5a5156d9fe15d647db6feb404 | [
"Apache-2.0"
] | null | null | null | check_#2/main.py | thomasvincent/MonitoringPlugins | b7662e78fe931ea5a5156d9fe15d647db6feb404 | [
"Apache-2.0"
] | null | null | null | check_#2/main.py | thomasvincent/MonitoringPlugins | b7662e78fe931ea5a5156d9fe15d647db6feb404 | [
"Apache-2.0"
] | null | null | null | #!/opt/zenoss/bin/python
import os
import sys
import re
import urllib2
import time
from xml.dom.minidom import *
def help():
print "Usage:"
print "main.py YOUR_URL"
sys.exit(3)
if len(sys.argv) != 2:
help()
else:
url = sys.argv[1]
try:
if "http://" not in url:
url="http://... | 27.978723 | 89 | 0.540684 |
92fe73c25a6e55e424016d0d8c272a8b56c321d0 | 7,807 | py | Python | airflow/providers/apache/kylin/operators/kylin_cube.py | daringanitch/airflow-7-14-docker | af19b126e94876c371553f6a7cfae6b1102f79fd | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2020-02-16T18:13:54.000Z | 2021-01-01T03:22:19.000Z | airflow/providers/apache/kylin/operators/kylin_cube.py | daringanitch/airflow-7-14-docker | af19b126e94876c371553f6a7cfae6b1102f79fd | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-15T22:39:05.000Z | 2020-10-15T22:39:05.000Z | airflow/providers/apache/kylin/operators/kylin_cube.py | daringanitch/airflow-7-14-docker | af19b126e94876c371553f6a7cfae6b1102f79fd | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-27T17:17:23.000Z | 2020-12-27T17:17:23.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 40.874346 | 102 | 0.657871 |
19b2a42b709da729eb72e2a21e547c1cc18dae7a | 14,469 | py | Python | pydm/widgets/qtplugins.py | jbellister-slac/pydm | 8b8a4c638c4310cd08cfe0ebcc20da6b70f94130 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/widgets/qtplugins.py | jbellister-slac/pydm | 8b8a4c638c4310cd08cfe0ebcc20da6b70f94130 | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/widgets/qtplugins.py | jbellister-slac/pydm | 8b8a4c638c4310cd08cfe0ebcc20da6b70f94130 | [
"BSD-3-Clause-LBNL"
] | null | null | null | import logging
import os
from ..utilities.iconfont import IconFont
from .archiver_time_plot import PyDMArchiverTimePlot
from .byte import PyDMByteIndicator
from .checkbox import PyDMCheckbox
from .datetime import PyDMDateTimeEdit, PyDMDateTimeLabel
from .drawing import (PyDMDrawingArc, PyDMDrawingChord, PyDMDrawingCir... | 50.768421 | 109 | 0.532932 |
590dba3fc6d9257cecaa7ca7152a6fba1885a3fd | 14,921 | py | Python | organizations/backends/defaults.py | hlongmore/django-organizations | 6c4313057d3d38627870f560e0ac0faf7551264a | [
"BSD-2-Clause"
] | null | null | null | organizations/backends/defaults.py | hlongmore/django-organizations | 6c4313057d3d38627870f560e0ac0faf7551264a | [
"BSD-2-Clause"
] | null | null | null | organizations/backends/defaults.py | hlongmore/django-organizations | 6c4313057d3d38627870f560e0ac0faf7551264a | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2012-2018, Ben Lopatin and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright ... | 38.755844 | 91 | 0.644796 |
66246c199be872659965111c70b496d35b3546c4 | 6,428 | py | Python | resources/lib/common/misc_utils.py | kevenli/plugin.video.netflix | ed94e1ba88141ba3336d380f1e7a2e5665fa0a9a | [
"MIT"
] | null | null | null | resources/lib/common/misc_utils.py | kevenli/plugin.video.netflix | ed94e1ba88141ba3336d380f1e7a2e5665fa0a9a | [
"MIT"
] | null | null | null | resources/lib/common/misc_utils.py | kevenli/plugin.video.netflix | ed94e1ba88141ba3336d380f1e7a2e5665fa0a9a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Miscellaneous utility functions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, divisi... | 29.897674 | 116 | 0.667704 |
169ffd4564add75ebc606fb1f688d3cdff0f1873 | 5,056 | py | Python | openpeerpower/components/ring/camera.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | openpeerpower/components/ring/camera.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | openpeerpower/components/ring/camera.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """This component provides support to the Ring Door Bell camera."""
import asyncio
from datetime import timedelta
from itertools import chain
import logging
from haffmpeg.camera import CameraMjpeg
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
import requests
from openpeerpower.components.camera import Camera
from... | 30.829268 | 88 | 0.640427 |
09640b79b130f16ea5f24b7b7233d97655ce0f70 | 7,788 | py | Python | examples/cnn/main.py | codecaution/Hetu | e278732c2fe3554c8d576585f5bcbf79ade31b68 | [
"Apache-2.0"
] | null | null | null | examples/cnn/main.py | codecaution/Hetu | e278732c2fe3554c8d576585f5bcbf79ade31b68 | [
"Apache-2.0"
] | null | null | null | examples/cnn/main.py | codecaution/Hetu | e278732c2fe3554c8d576585f5bcbf79ade31b68 | [
"Apache-2.0"
] | 3 | 2021-11-29T13:47:48.000Z | 2022-03-03T02:00:43.000Z | import hetu as ht
import models
import numpy as np
import argparse
import logging
from time import time
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def print_rank0(msg):
if device_id == 0:
l... | 40.989474 | 138 | 0.598998 |
269d17e0a22b3759d231a25781b5039cbf3f1202 | 661 | py | Python | Labs/lab4/l4e1.py | felixchiasson/ITI1520 | 4208904bf7576433313524ebd1c1bdb9f49277f2 | [
"MIT"
] | null | null | null | Labs/lab4/l4e1.py | felixchiasson/ITI1520 | 4208904bf7576433313524ebd1c1bdb9f49277f2 | [
"MIT"
] | null | null | null | Labs/lab4/l4e1.py | felixchiasson/ITI1520 | 4208904bf7576433313524ebd1c1bdb9f49277f2 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
###############################################################################
# File Name : l4e1.py
# Created By : Félix Chiasson (7138723)
# Creation Date : [2015-10-06 11:30]
# Last Modified : [2015-10-06 11:35]
# Description... | 47.214286 | 80 | 0.394856 |
36c3432108cdc974d23da853df7f25ff611a469e | 1,495 | py | Python | bluebottle/bb_accounts/utils.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/bb_accounts/utils.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/bb_accounts/utils.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | import re
from django.utils.http import int_to_base36
from django.contrib.auth.tokens import default_token_generator
from bluebottle.clients import properties
from bluebottle.clients.utils import tenant_url, tenant_name
from bluebottle.members.messages import AccountActivationMessage
def send_welcome_mail(user=None... | 29.313725 | 72 | 0.683612 |
b59f5b1c622f6ad998a3822b369af4a41b794c13 | 19,772 | py | Python | pypy/rlib/test/test_libffi.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/rlib/test/test_libffi.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/rlib/test/test_libffi.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | import sys
import py
from pypy.rlib.rarithmetic import r_singlefloat, r_longlong, r_ulonglong
from pypy.rlib.test.test_clibffi import BaseFfiTest, get_libm_name, make_struct_ffitype_e
from pypy.rpython.lltypesystem import rffi, lltype
from pypy.rpython.lltypesystem.ll2ctypes import ALLOCATED
from pypy.rlib.libffi imp... | 36.614815 | 93 | 0.54471 |
0a6c577afac40b778126a7b4c69b067f62ce7723 | 16,253 | py | Python | vokenization/vokenization.py | StevenyzZhang/vokenization | 6308f2e9834c50f55fde6192588c0173d1e2d63b | [
"MIT"
] | null | null | null | vokenization/vokenization.py | StevenyzZhang/vokenization | 6308f2e9834c50f55fde6192588c0173d1e2d63b | [
"MIT"
] | null | null | null | vokenization/vokenization.py | StevenyzZhang/vokenization | 6308f2e9834c50f55fde6192588c0173d1e2d63b | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyleft 2020 project COL.
from collections import defaultdict
import math
import pickle
import os
import sys
import h5py
import numpy as np
import torch
from torch.nn.utils.rnn import pad_sequence
from transformers import BertTokenizer
import common
from indexing import TorchGPUIndexer, FaissGPUInd... | 43.573727 | 134 | 0.56648 |
8445e9dd0509d19ae17a45a49b1496f776a51197 | 53,803 | py | Python | synapse/config/server.py | appotry/synapse | 7564b8e118aa764fd0075f0d69910a5b2cd58182 | [
"Apache-2.0"
] | null | null | null | synapse/config/server.py | appotry/synapse | 7564b8e118aa764fd0075f0d69910a5b2cd58182 | [
"Apache-2.0"
] | null | null | null | synapse/config/server.py | appotry/synapse | 7564b8e118aa764fd0075f0d69910a5b2cd58182 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2021 The Matrix.org Foundation C.I.C.
#
# 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... | 39.186453 | 104 | 0.624408 |
07bf9e8b50b297ac349af993db1cb05022d7091b | 10,774 | py | Python | tests/providers/google/marketing_platform/operators/test_campaign_manager.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 1 | 2020-08-20T02:00:27.000Z | 2020-08-20T02:00:27.000Z | tests/providers/google/marketing_platform/operators/test_campaign_manager.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 9 | 2020-07-28T15:07:03.000Z | 2022-03-29T22:27:52.000Z | tests/providers/google/marketing_platform/operators/test_campaign_manager.py | vuppalli/airflow | dfe8337ca2d3ed173d9ecc112938271519792c40 | [
"Apache-2.0"
] | 2 | 2020-03-08T14:12:55.000Z | 2020-06-10T10:17:32.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 35.675497 | 109 | 0.672916 |
cfce62c2199f8e88eca5924b87fa2bf157bc5f3e | 4,366 | py | Python | chembl_core_db/db/models/abstractModel.py | thesgc/chembl_core_db | 028150e762bc5e92f49de9a40e09f205955327f9 | [
"Apache-2.0"
] | null | null | null | chembl_core_db/db/models/abstractModel.py | thesgc/chembl_core_db | 028150e762bc5e92f49de9a40e09f205955327f9 | [
"Apache-2.0"
] | null | null | null | chembl_core_db/db/models/abstractModel.py | thesgc/chembl_core_db | 028150e762bc5e92f49de9a40e09f205955327f9 | [
"Apache-2.0"
] | null | null | null | __author__ = 'mnowotka'
from django.db import models
from django.conf import settings
from django.db.models.base import ModelBase
import re
import sys
import inspect
from django.core.exceptions import ImproperlyConfigured
try:
# django >= 1.7
from django.apps import apps
get_model = apps.get_model
except I... | 35.495935 | 120 | 0.477325 |
491225dd330124d87f45f6a7e84ccbcea657ccb2 | 11,371 | py | Python | resources/Database.py | washingtonSampaioVieira/spreadsheet-migrator | e773dc3abc501dc84c11cf740e2de27abfb9491f | [
"Apache-2.0"
] | null | null | null | resources/Database.py | washingtonSampaioVieira/spreadsheet-migrator | e773dc3abc501dc84c11cf740e2de27abfb9491f | [
"Apache-2.0"
] | null | null | null | resources/Database.py | washingtonSampaioVieira/spreadsheet-migrator | e773dc3abc501dc84c11cf740e2de27abfb9491f | [
"Apache-2.0"
] | null | null | null | import os
from dotenv import load_dotenv
import mysql.connector as mysql
from . import Logger
from config import DatabaseField
class Database:
def __init__(self):
self.logger = Logger.create_logger('Database', 'database.log')
def connect(self):
connection = None
load_dotenv()
... | 33.444118 | 136 | 0.59854 |
3c9812ff3973df5b80abd078b29eaa65e3945b09 | 9,905 | py | Python | qa/rpc-tests/test_framework/equihash.py | Z-ee/Z96 | cb8022edc7c49706dfeaa393c4b1f6d5a6b945d5 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/equihash.py | Z-ee/Z96 | cb8022edc7c49706dfeaa393c4b1f6d5a6b945d5 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/equihash.py | Z-ee/Z96 | cb8022edc7c49706dfeaa393c4b1f6d5a6b945d5 | [
"MIT"
] | null | null | null | from operator import itemgetter
import struct
DEBUG = False
VERBOSE = False
word_size = 32
word_mask = (1<<word_size)-1
def expand_array(inp, out_len, bit_len, byte_pad=0):
assert bit_len >= 8 and word_size >= 7+bit_len
bit_len_mask = (1<<bit_len)-1
out_width = (bit_len+7)/8 + byte_pad
assert out_l... | 33.690476 | 99 | 0.529531 |
ea0ad09b853333aee1feca1bc8ad0d8b05735bee | 2,996 | py | Python | weather_mv/loader_pipeline/pipeline_test.py | google/weather-tools | acc630c6a7fbef91f9c7eba86219e58391462bf6 | [
"Apache-2.0"
] | 66 | 2021-12-21T00:10:02.000Z | 2022-03-31T18:45:33.000Z | weather_mv/loader_pipeline/pipeline_test.py | google/weather-tools | acc630c6a7fbef91f9c7eba86219e58391462bf6 | [
"Apache-2.0"
] | 76 | 2021-12-21T15:23:12.000Z | 2022-03-31T14:26:05.000Z | weather_mv/loader_pipeline/pipeline_test.py | google/weather-tools | acc630c6a7fbef91f9c7eba86219e58391462bf6 | [
"Apache-2.0"
] | 15 | 2021-12-21T00:10:10.000Z | 2022-03-31T18:46:28.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.410256 | 105 | 0.641522 |
ba265e6a5bc520e9dac70d65140525b368db5de1 | 4,027 | py | Python | opencensus/trace/ext/pyramid/pyramid_middleware.py | sandeep6189/opencensus-python | c7b7e0b2a9f97e1607d4fdf887baa5547278760a | [
"Apache-2.0"
] | null | null | null | opencensus/trace/ext/pyramid/pyramid_middleware.py | sandeep6189/opencensus-python | c7b7e0b2a9f97e1607d4fdf887baa5547278760a | [
"Apache-2.0"
] | null | null | null | opencensus/trace/ext/pyramid/pyramid_middleware.py | sandeep6189/opencensus-python | c7b7e0b2a9f97e1607d4fdf887baa5547278760a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017, OpenCensus 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 or agreed to in w... | 34.418803 | 94 | 0.685622 |
242c3bc55f67382e515aa806bee026e2816ef56a | 13,779 | py | Python | python/GafferSceneTest/SetAlgoTest.py | RudyCortesPearl/gaffer | 4ae48fed676e5fc920154ce39a1a9dfa4dc1f0b4 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneTest/SetAlgoTest.py | RudyCortesPearl/gaffer | 4ae48fed676e5fc920154ce39a1a9dfa4dc1f0b4 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneTest/SetAlgoTest.py | RudyCortesPearl/gaffer | 4ae48fed676e5fc920154ce39a1a9dfa4dc1f0b4 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | 44.592233 | 164 | 0.668699 |
162c82725c6bdee42f5165020575a3d8b22652e7 | 1,554 | py | Python | modules/test/test_eleda.py | amuritna/phenny | c01f409f41db125fe3f50093ed1ec3454f95a529 | [
"EFL-2.0"
] | 7 | 2018-10-29T18:01:47.000Z | 2022-01-21T04:13:46.000Z | modules/test/test_eleda.py | amuritna/phenny | c01f409f41db125fe3f50093ed1ec3454f95a529 | [
"EFL-2.0"
] | 225 | 2018-03-08T10:41:50.000Z | 2021-11-01T19:51:17.000Z | modules/test/test_eleda.py | amuritna/phenny | c01f409f41db125fe3f50093ed1ec3454f95a529 | [
"EFL-2.0"
] | 44 | 2018-03-19T15:30:15.000Z | 2020-07-29T08:47:45.000Z | """
test_eleda.py - tests for the eleda module
author: nu11us <work.willeggleston@gmail.com>
"""
import unittest
from mock import MagicMock
from modules import eleda
class TestEleda(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
self.input = MagicMock()
def test_follow(self):... | 33.06383 | 73 | 0.63964 |
5cf0f976698262788670e04d3c76ddd9da6dddd2 | 3,423 | py | Python | training_mode/swin_training/lr_scheduler.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1 | 2022-02-07T02:03:37.000Z | 2022-02-07T02:03:37.000Z | training_mode/swin_training/lr_scheduler.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | training_mode/swin_training/lr_scheduler.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | # --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu
# --------------------------------------------------------
import torch
from timm.scheduler.cosine_lr import CosineLRScheduler
from... | 33.23301 | 105 | 0.570844 |
5261499941ab96c98eb2ede5f182c68c0fc860b7 | 26,203 | py | Python | default.py | BorgesGabo/gaia | 9e9b2b57c28d92933749ab8f2070e4962e6caaf6 | [
"Unlicense"
] | null | null | null | default.py | BorgesGabo/gaia | 9e9b2b57c28d92933749ab8f2070e4962e6caaf6 | [
"Unlicense"
] | null | null | null | default.py | BorgesGabo/gaia | 9e9b2b57c28d92933749ab8f2070e4962e6caaf6 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
# -------------------------------------------------------------------------
# This is a sample controller
# - index is the default action of any application
# - user is required for authentication and authorization
... | 45.022337 | 255 | 0.607946 |
92ad2a8b3fa1fcdfb8057a128572e063f6501a9b | 3,300 | py | Python | output/models/nist_data/list_pkg/decimal/schema_instance/nistschema_sv_iv_list_decimal_enumeration_5_xsd/nistschema_sv_iv_list_decimal_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/decimal/schema_instance/nistschema_sv_iv_list_decimal_enumeration_5_xsd/nistschema_sv_iv_list_decimal_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/decimal/schema_instance/nistschema_sv_iv_list_decimal_enumeration_5_xsd/nistschema_sv_iv_list_decimal_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from decimal import Decimal
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-list-decimal-enumeration-5-NS"
class NistschemaSvIvListDecimalEnumeration5Type(Enum):
VALUE_69_3817003_806533146393_14244_7_692_24_9875727835_21_0_2724604980670... | 36.263736 | 143 | 0.597273 |
8e8df65900b38cca2dd0b143977afa835df716ec | 15,942 | py | Python | dashboard/dashboard/file_bug.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 1 | 2019-11-01T23:31:22.000Z | 2019-11-01T23:31:22.000Z | dashboard/dashboard/file_bug.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 5 | 2020-09-07T12:36:46.000Z | 2022-03-02T05:49:30.000Z | dashboard/dashboard/file_bug.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 1 | 2020-07-25T00:02:48.000Z | 2020-07-25T00:02:48.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides the web interface for filing a bug on the issue tracker."""
from __future__ import print_function
from __future__ import division
from __future__... | 35.192053 | 80 | 0.704491 |
41d7d7b990fee48b76f92ba588f90d22375d5e86 | 5,782 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.00813 | 188 | 0.656174 |
ff902390044f07e135ab70feaf6a3a1c16337c3b | 1,799 | py | Python | setup.py | CasperCL/pyramid-oauthlib | e0cd47e8326052a705624a217abc120056280759 | [
"BSD-2-Clause"
] | null | null | null | setup.py | CasperCL/pyramid-oauthlib | e0cd47e8326052a705624a217abc120056280759 | [
"BSD-2-Clause"
] | null | null | null | setup.py | CasperCL/pyramid-oauthlib | e0cd47e8326052a705624a217abc120056280759 | [
"BSD-2-Clause"
] | null | null | null | import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
class PyTest(TestCommand):
user_options = [
('cov', None, "measure coverage")
]
def initialize_options(self):
TestCommand.initialize_options(self)
self.cov = N... | 29.491803 | 62 | 0.642023 |
e373d4dc0fb43f00db4ab48fb184b5e8e7dc04d6 | 3,342 | py | Python | python/3dsmax_icon_viewer/3dsmax_icon_viewer.py | ATGH15102AFMLD/techart-staff | 8f38bb3d0c2d0f8316ddab0920a1170402a303c0 | [
"MIT"
] | null | null | null | python/3dsmax_icon_viewer/3dsmax_icon_viewer.py | ATGH15102AFMLD/techart-staff | 8f38bb3d0c2d0f8316ddab0920a1170402a303c0 | [
"MIT"
] | null | null | null | python/3dsmax_icon_viewer/3dsmax_icon_viewer.py | ATGH15102AFMLD/techart-staff | 8f38bb3d0c2d0f8316ddab0920a1170402a303c0 | [
"MIT"
] | null | null | null | import os
import MaxPlus
from PySide.QtCore import Qt
from PySide.QtCore import QDirIterator
from PySide.QtCore import QSize
from PySide.QtGui import QIcon
from PySide.QtGui import QWidget
from PySide.QtGui import QToolButton
from PySide.QtGui import QHBoxLayout
from PySide.QtGui import QVBoxLayout
from PySide.QtGui im... | 26.736 | 61 | 0.742968 |
34a22dd4ad9ab46d6938c8ba8be9e6f6b3432bf1 | 497 | py | Python | quickkart_api/auth.py | envaleed/quick-kart-api-deploy | 2b962dce3bc5ba19d4e90cb86822c016d51f65c2 | [
"MIT"
] | null | null | null | quickkart_api/auth.py | envaleed/quick-kart-api-deploy | 2b962dce3bc5ba19d4e90cb86822c016d51f65c2 | [
"MIT"
] | null | null | null | quickkart_api/auth.py | envaleed/quick-kart-api-deploy | 2b962dce3bc5ba19d4e90cb86822c016d51f65c2 | [
"MIT"
] | null | null | null | from quickkart_api import app
from quickkart_api.models import Users
from flask_jwt import JWT, jwt_required, current_identity
from flask import abort
def authenticate(username, password):
user = Users.query.filter_by(username=username).first()
if user and user.check_password(password):
return user
... | 33.133333 | 71 | 0.7666 |
c659153b82b044486d578db646bdbde83a5377c3 | 193 | py | Python | python/testData/inspections/PyRedundantParenthesesInspection/TryExcept.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/PyRedundantParenthesesInspection/TryExcept.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/PyRedundantParenthesesInspection/TryExcept.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | try:
foo()
except (<weak_warning descr="Remove redundant parentheses">(A)</weak_warning>):
pass
except <weak_warning descr="Remove redundant parentheses">(A)</weak_warning> :
pass
| 24.125 | 79 | 0.715026 |
11079142c6764f7180438174fb3f133f46e5d956 | 6,733 | py | Python | editor.py | HackerPoet/FursonaGenerator | ef2ee24774d783fe83a6c7700b9a1cdd1c434368 | [
"MIT"
] | 61 | 2019-01-25T02:47:55.000Z | 2021-11-21T21:41:32.000Z | editor.py | HackerPoet/FursonaGenerator | ef2ee24774d783fe83a6c7700b9a1cdd1c434368 | [
"MIT"
] | 1 | 2021-01-14T07:42:08.000Z | 2021-04-22T00:53:38.000Z | editor.py | HackerPoet/FursonaGenerator | ef2ee24774d783fe83a6c7700b9a1cdd1c434368 | [
"MIT"
] | 12 | 2019-02-04T20:18:29.000Z | 2021-08-28T13:27:54.000Z | import pygame
import random, sys
import numpy as np
import cv2
#User constants
device = "cpu"
model_dir = 'test24/'
is_gan = True
background_color = (210, 210, 210)
edge_color = (60, 60, 60)
slider_color = (20, 20, 20)
num_params = 80
image_scale = 3
image_padding = 10
slider_w = 15
slider_h = 100
slider_px = 5
slider... | 29.924444 | 105 | 0.713649 |
b90f167d5d81968d3e0bd828b428923552cb9765 | 2,275 | py | Python | mobilenet_supervised_cifar.py | koshian2/Pseudo-Label-Keras | bf26731980d4a31fe8ce084579ec02e8b14a6e15 | [
"MIT"
] | 39 | 2019-02-05T06:34:10.000Z | 2022-02-21T14:55:22.000Z | mobilenet_supervised_cifar.py | koshian2/Pseudo-Label-Keras | bf26731980d4a31fe8ce084579ec02e8b14a6e15 | [
"MIT"
] | null | null | null | mobilenet_supervised_cifar.py | koshian2/Pseudo-Label-Keras | bf26731980d4a31fe8ce084579ec02e8b14a6e15 | [
"MIT"
] | 11 | 2019-02-05T06:34:21.000Z | 2020-09-20T12:53:32.000Z | from keras.layers import Input, UpSampling2D, Dense, GlobalAveragePooling2D
from keras.applications import MobileNet
from keras.models import Model
from keras.utils import to_categorical
from keras.datasets import cifar10
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import numpy as np
import pick... | 31.597222 | 79 | 0.677802 |
8fb5d89b1344a66ea126f4891a7db1a591c69481 | 39,483 | py | Python | venv/Lib/site-packages/coverage/parser.py | MarcoDelMondo/python-docs-samples | 857a9c85db5b39b639747a6394e1cc776ff7ba4b | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/coverage/parser.py | MarcoDelMondo/python-docs-samples | 857a9c85db5b39b639747a6394e1cc776ff7ba4b | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/coverage/parser.py | MarcoDelMondo/python-docs-samples | 857a9c85db5b39b639747a6394e1cc776ff7ba4b | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Code parsing for coverage.py."""
import ast
import collections
import os
import re
import token
import tokenize
from coverage import env
from coverage.backward... | 38.258721 | 99 | 0.594737 |
b61696cac392ae302491877370e52e4a8be2048d | 300 | py | Python | leetcode/medium/201-bitwise_and_num_range.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | 1 | 2020-02-25T10:32:27.000Z | 2020-02-25T10:32:27.000Z | leetcode/medium/201-bitwise_and_num_range.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | leetcode/medium/201-bitwise_and_num_range.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | """
Leetcode #201
"""
class Solution:
def rangeBitwiseAnd(self, m: int, n: int) -> int:
i = 0
while m != n:
m >>= 1
n >>= 1
i += 1
return n << i
if __name__ == "__main__":
assert Solution().rangeBitwiseAnd(5, 7) == 4
| 14.285714 | 53 | 0.433333 |
0dff1489c980999791ea5bb39579caaf69e1af73 | 266 | py | Python | adventofcode/day23/test_day23.py | EikaNN/AdventOfCode2017 | 21bac909b5c586224e904803332ef2cf01fc1e16 | [
"MIT"
] | 2 | 2018-01-04T23:26:23.000Z | 2018-07-05T14:02:44.000Z | adventofcode/day23/test_day23.py | EikaNN/AdventOfCode2017 | 21bac909b5c586224e904803332ef2cf01fc1e16 | [
"MIT"
] | 1 | 2017-12-26T23:12:39.000Z | 2017-12-31T11:46:25.000Z | adventofcode/day23/test_day23.py | EikaNN/AdventOfCode2017 | 21bac909b5c586224e904803332ef2cf01fc1e16 | [
"MIT"
] | null | null | null | import unittest
class Day23Test(unittest.TestCase):
# One of the reasons this puzzle is original is that it has no tests :)
def test_part_one(self):
pass
def test_part_two(self):
pass
if __name__ == '__main__':
unittest.main()
| 15.647059 | 75 | 0.657895 |
359b96636dba7a0f409abda2e903d6dbd9e0ac49 | 11,435 | py | Python | pybind/nos/v7_1_0/brocade_ha_rpc/reload/input/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/brocade_ha_rpc/reload/input/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/brocade_ha_rpc/reload/input/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 59.248705 | 602 | 0.71596 |
2d9379de6cf7ac52998bf17a5d2181d634d25aea | 185 | py | Python | backend/instagram_utility/application_instagram_api/urls.py | Joeffison/InstagramUtility | 530572534eeed54d02d8ff24c7a59aa13239d45c | [
"MIT"
] | 1 | 2017-12-28T21:17:23.000Z | 2017-12-28T21:17:23.000Z | backend/instagram_utility/application_instagram_api/urls.py | Joeffison/InstagramUtility | 530572534eeed54d02d8ff24c7a59aa13239d45c | [
"MIT"
] | null | null | null | backend/instagram_utility/application_instagram_api/urls.py | Joeffison/InstagramUtility | 530572534eeed54d02d8ff24c7a59aa13239d45c | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^login/$', views.model_list),
url(r'^follow/$', views.follow),
url(r'^unfollow/$', views.unfollow),
]
| 18.5 | 38 | 0.664865 |
6bc79b5cd5a0030e7c7d0676d0c8ca70872755c7 | 413 | py | Python | Intermediate/30/key_handling.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | 1 | 2021-12-25T02:19:18.000Z | 2021-12-25T02:19:18.000Z | Intermediate/30/key_handling.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | null | null | null | Intermediate/30/key_handling.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | 1 | 2021-11-25T10:31:47.000Z | 2021-11-25T10:31:47.000Z | facebook_posts = [
{'Likes': 21, 'Comments': 2},
{'Likes': 13, 'Comments': 2, 'Shares': 1},
{'Likes': 33, 'Comments': 8, 'Shares': 3},
{'Comments': 4, 'Shares': 2},
{'Comments': 1, 'Shares': 1},
{'Likes': 19, 'Comments': 3}
]
total_likes = 0
for post in facebook_posts:
try:
to... | 22.944444 | 49 | 0.549637 |
c8f3e365dd613faf80318df8eb31f4d1381439aa | 656 | py | Python | Bar_Tapping_Project/Bar_tab.py | InamdarAbid/PythonTutorial | 6aaecf7bafe5b0031159187985dcd9638a1f7e28 | [
"MIT"
] | 1 | 2019-01-04T07:40:26.000Z | 2019-01-04T07:40:26.000Z | Bar_Tapping_Project/Bar_tab.py | InamdarAbid/PythonTutorial | 6aaecf7bafe5b0031159187985dcd9638a1f7e28 | [
"MIT"
] | null | null | null | Bar_Tapping_Project/Bar_tab.py | InamdarAbid/PythonTutorial | 6aaecf7bafe5b0031159187985dcd9638a1f7e28 | [
"MIT"
] | null | null | null | class Tab:
#Menu will be fixed for all tables of bar
menu ={
'Wine':5,
'Beer':3,
'Soft drink':2,
'Chicken':10,
'Mutton':15,
'Veg':8,
'Desert':6
}
def __init__(self):
self.total = 0
self.items= []
def add_item(self,item):
... | 23.428571 | 54 | 0.490854 |
a24ff8834a2d77a8637fa08c06fc3452e05e8c9e | 156 | py | Python | src/learners/__init__.py | vanstrn/LICA | 9dcc598f3b5329e2b266a319ac9552bb962c59ae | [
"MIT"
] | null | null | null | src/learners/__init__.py | vanstrn/LICA | 9dcc598f3b5329e2b266a319ac9552bb962c59ae | [
"MIT"
] | null | null | null | src/learners/__init__.py | vanstrn/LICA | 9dcc598f3b5329e2b266a319ac9552bb962c59ae | [
"MIT"
] | null | null | null | from .lica_learner import LICALearner,LICALearner_CNN
REGISTRY = {}
REGISTRY["lica_learner"] = LICALearner
REGISTRY["lica_learner_cnn"] = LICALearner_CNN
| 22.285714 | 53 | 0.807692 |
da8f70abd7643c09af4e6014a98b5dad55192eaa | 441 | py | Python | tests/admin.py | awais786/django-stdimage | 6c043a08a892b75202b96a73615588d8e16aa9e1 | [
"MIT"
] | 274 | 2015-01-13T10:31:48.000Z | 2022-02-06T16:22:03.000Z | tests/admin.py | awais786/django-stdimage | 6c043a08a892b75202b96a73615588d8e16aa9e1 | [
"MIT"
] | 167 | 2015-01-06T09:51:45.000Z | 2022-03-28T21:15:16.000Z | tests/admin.py | sunnysavera/django-stdimage | ef9a2eb4843f0de41117a5eec9ba04962181d23d | [
"MIT"
] | 76 | 2015-01-09T00:13:56.000Z | 2021-12-20T22:08:39.000Z | from django.contrib import admin
from . import models
admin.site.register(models.AdminDeleteModel)
admin.site.register(models.AdminUpdateModel)
admin.site.register(models.ResizeCropModel)
admin.site.register(models.ResizeModel)
admin.site.register(models.SimpleModel)
admin.site.register(models.ThumbnailModel)
admin.s... | 31.5 | 45 | 0.85034 |
056165ff2b030db9151acb5a13d7f838dc325dc2 | 3,210 | py | Python | utils/viz/viz_pose.py | jwen307/MLBase | 06220d058a44b97831a222153ab980e1452a167f | [
"MIT"
] | null | null | null | utils/viz/viz_pose.py | jwen307/MLBase | 06220d058a44b97831a222153ab980e1452a167f | [
"MIT"
] | null | null | null | utils/viz/viz_pose.py | jwen307/MLBase | 06220d058a44b97831a222153ab980e1452a167f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 15 12:11:20 2021
@author: jeff
"""
import sys
import os
import os.path as osp
import argparse
import numpy as np
import cv2
import math
import torch
import torchvision.transforms as transforms
import torchvision
import matplotlib.pyplot as plt
from... | 29.181818 | 109 | 0.625545 |
1aa0bc73b8dd39ec23bfa8d7af052f93e07b2e97 | 1,097 | py | Python | wheelchair_navigation/scripts/nav_joy.py | OSUrobotics/wheelchair-automation | 909f7f0ead388a6cf88efee8f0c75cd220b849e9 | [
"MIT"
] | 13 | 2015-08-13T06:14:30.000Z | 2021-11-22T22:32:24.000Z | wheelchair_navigation/scripts/nav_joy.py | OSUrobotics/wheelchair-automation | 909f7f0ead388a6cf88efee8f0c75cd220b849e9 | [
"MIT"
] | 1 | 2015-01-10T23:30:06.000Z | 2015-01-21T15:44:08.000Z | wheelchair_navigation/scripts/nav_joy.py | OSUrobotics/wheelchair-automation | 909f7f0ead388a6cf88efee8f0c75cd220b849e9 | [
"MIT"
] | 7 | 2015-03-20T05:42:03.000Z | 2020-04-19T20:58:14.000Z | #!/usr/bin/env python
import roslib
roslib.load_manifest('wheelchair_navigation')
import rospy, message_filters
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan, Joy
import numpy as np
import std_msgs.msg
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal, MoveBaseActi... | 32.264706 | 103 | 0.706472 |
e354173a1da471c880f357a322e95aeeb11ecd38 | 12,983 | py | Python | pipelines/subrefz.py | deshima-dev/qlook-pipeline | 90f520e101a58ae1dc1ffd9317ad16035e8efe0c | [
"MIT"
] | null | null | null | pipelines/subrefz.py | deshima-dev/qlook-pipeline | 90f520e101a58ae1dc1ffd9317ad16035e8efe0c | [
"MIT"
] | 3 | 2020-10-17T17:09:19.000Z | 2022-02-03T14:10:47.000Z | pipelines/subrefz.py | deshima-dev/qlook-pipeline | 90f520e101a58ae1dc1ffd9317ad16035e8efe0c | [
"MIT"
] | null | null | null | # standard libraries
import warnings
import argparse
import pathlib
import yaml
# dependent packages
import decode as dc
import numpy as np
from scipy.signal import argrelmax, argrelmin
import matplotlib.pyplot as plt
from astropy import table
from astropy.modeling import models, fitting
# original package
from utils... | 32.376559 | 88 | 0.539552 |
52ad4ba8f442a49bb2ee79b77c8b1f665c8cb186 | 55,401 | py | Python | gen_models/PixelVAE/interpolations_take_out_to_run/cifarinterpolation1_filter_3_mean_4.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | 2 | 2019-10-29T03:26:20.000Z | 2021-03-07T10:02:39.000Z | gen_models/PixelVAE/interpolations_take_out_to_run/cifarinterpolation1_filter_3_mean_4.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | gen_models/PixelVAE/interpolations_take_out_to_run/cifarinterpolation1_filter_3_mean_4.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null |
"""
PixelVAE: A Latent Variable Model for Natural Images
Ishaan Gulrajani, Kundan Kumar, Faruk Ahmed, Adrien Ali Taiga, Francesco Visin, David Vazquez, Aaron Courville
"""
import os, sys
sys.path.append(os.getcwd())
N_GPUS = 2
import random
import tflib as lib
import tflib.sampling_loop_cifar_filter_3
import tflib.... | 49.070859 | 202 | 0.604014 |
cb7a5ba3219c21bdefc2885e8a3da99626cdb606 | 9,234 | py | Python | dju_image/image.py | liminspace/dju-image | b06eb3be2069cd6cb52cf1e26c2c761883142d4e | [
"MIT"
] | 6 | 2016-01-23T18:17:06.000Z | 2017-02-23T16:22:39.000Z | dju_image/image.py | liminspace/dju-image | b06eb3be2069cd6cb52cf1e26c2c761883142d4e | [
"MIT"
] | null | null | null | dju_image/image.py | liminspace/dju-image | b06eb3be2069cd6cb52cf1e26c2c761883142d4e | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import subprocess
from cStringIO import StringIO
from PIL import Image, ImageFile
from contextlib import contextmanager
from django.core.files.uploadedfile import UploadedFile
from dju_common.file import truncate_file
from . import settings as dju_settings
def image_get_format(f):
"""
... | 37.384615 | 120 | 0.598224 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.