hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a0ec0692089769b77692fbc84bee5d321e8bade | 7,739 | py | Python | docx/document.py | AllianceSoftware/python-docx | baa8bb7787856ce2f884ce7dec4faf28207b861b | [
"MIT"
] | null | null | null | docx/document.py | AllianceSoftware/python-docx | baa8bb7787856ce2f884ce7dec4faf28207b861b | [
"MIT"
] | null | null | null | docx/document.py | AllianceSoftware/python-docx | baa8bb7787856ce2f884ce7dec4faf28207b861b | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
|Document| and closely related objects
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from .blkcntnr import BlockItemContainer
from .enum.section import WD_SECTION
from .enum.text import WD_BREAK
from .section import Section, Sections
from .shared... | 34.86036 | 80 | 0.632511 |
4a0ec0cb22d3176fa728c0113b48a78f2995883e | 3,779 | py | Python | tests/test_stream.py | unduli-attacked/camelot | f53ed24d2f657968753cdce15cfcc64929c0a546 | [
"MIT"
] | null | null | null | tests/test_stream.py | unduli-attacked/camelot | f53ed24d2f657968753cdce15cfcc64929c0a546 | [
"MIT"
] | null | null | null | tests/test_stream.py | unduli-attacked/camelot | f53ed24d2f657968753cdce15cfcc64929c0a546 | [
"MIT"
] | 1 | 2022-01-24T03:52:41.000Z | 2022-01-24T03:52:41.000Z | # -*- coding: utf-8 -*-
import os
import pandas as pd
from pandas.testing import assert_frame_equal
import camelot
from camelot.core import Table, TableList
from camelot.__version__ import generate_version
from .data import *
testdir = os.path.dirname(os.path.abspath(__file__))
testdir = os.path.join(testdir, "fil... | 28.413534 | 77 | 0.708918 |
4a0ec1fa87f4aa9e486da9585d36e4f3e34783e8 | 11,492 | py | Python | homeassistant/components/media_player/gpmdp.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | homeassistant/components/media_player/gpmdp.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2021-09-08T03:06:43.000Z | 2022-03-12T00:56:04.000Z | homeassistant/components/media_player/gpmdp.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2018-10-09T08:37:48.000Z | 2019-11-16T08:32:27.000Z | """
Support for Google Play Music Desktop Player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.gpmdp/
"""
import logging
import json
import socket
import time
import voluptuous as vol
from homeassistant.components.media_player import (
... | 35.578947 | 79 | 0.594501 |
4a0ec260782d984623b969327771e8afbf92abc0 | 2,991 | py | Python | backend/workout/models.py | Soobian/Project_IO | a420a05deace219e1edb582cc47c533aa48ca41b | [
"BSD-3-Clause"
] | null | null | null | backend/workout/models.py | Soobian/Project_IO | a420a05deace219e1edb582cc47c533aa48ca41b | [
"BSD-3-Clause"
] | null | null | null | backend/workout/models.py | Soobian/Project_IO | a420a05deace219e1edb582cc47c533aa48ca41b | [
"BSD-3-Clause"
] | 3 | 2021-11-12T09:57:46.000Z | 2022-01-18T21:08:04.000Z | """
Plik zawiera klasy reprezentujące utworzone tabele w bazie danych z odpowiednimi atrybutami
- MuscleGroup: Tabela reprezentująca grupy mięśni
- Exercise: Tabela przechowująca informacje na temat ćwiczeń
- WorkoutPlan: Tabela zawierająca informacje na temat dostępnych planów ćwiczeniowych
- WorkoutPlanDay: Tabela z... | 37.3875 | 139 | 0.755934 |
4a0ec41dd9d36edaa0c893302277ddaa0dfe7339 | 1,349 | py | Python | price_monitoring.py | happysms/opensource_turtle_bot | 612d3780f4de8d5c58916e73b1c6468e9737eed0 | [
"Apache-2.0"
] | 1 | 2021-11-16T08:59:01.000Z | 2021-11-16T08:59:01.000Z | price_monitoring.py | happysms/opensource_turtle_bot | 612d3780f4de8d5c58916e73b1c6468e9737eed0 | [
"Apache-2.0"
] | null | null | null | price_monitoring.py | happysms/opensource_turtle_bot | 612d3780f4de8d5c58916e73b1c6468e9737eed0 | [
"Apache-2.0"
] | null | null | null | import ccxt
import pandas as pd
import time
import logger
from monitoring_util import check_trading_condition, request_order, get_trade_list, get_price_info
import json
import requests
binance = ccxt.binance()
logger = logger.make_logger("mylogger")
trade_list = get_trade_list()
while True:
try:
for trad... | 33.725 | 104 | 0.636027 |
4a0ec466c0d467acb93d3bafe28a43e59720e169 | 983 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/sub_resource_read_only.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/sub_resource_read_only.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/sub_resource_read_only.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.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 ... | 27.305556 | 76 | 0.562564 |
4a0ec46c649a2b2a756b62156ae70a594bdb1110 | 196 | py | Python | {{cookiecutter.project_slug}}/src/models/__init__.py | ardydedase/cookiecutter-flask-postgres-api | e6a9095a31d54f024a30a44e368f4a0a8f15829b | [
"MIT"
] | 20 | 2020-05-24T15:07:27.000Z | 2021-08-24T04:58:06.000Z | src/models/__init__.py | ardydedase/flask-postgres-api | d9edb69988f89f480d595a8b111fafeb7ae81234 | [
"MIT"
] | null | null | null | src/models/__init__.py | ardydedase/flask-postgres-api | d9edb69988f89f480d595a8b111fafeb7ae81234 | [
"MIT"
] | 6 | 2020-08-11T10:58:30.000Z | 2021-09-09T03:57:37.000Z | # flake8: noqa
# TODO: check if there is a better way
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from .abc import BaseModel
from .user import User
__all__ = ['BaseModel', 'User']
| 19.6 | 39 | 0.744898 |
4a0ec5a9bd60fcecb8258d44c1b88eb6b63378d8 | 10,349 | py | Python | jinja2/testsuite/api.py | prasenjit/ffbird | 057873a500738383612ed21e93348dfb9ee19af2 | [
"Apache-2.0"
] | 4 | 2016-02-18T15:11:58.000Z | 2020-01-16T11:07:50.000Z | jinja2/testsuite/api.py | prasenjit/ffbird | 057873a500738383612ed21e93348dfb9ee19af2 | [
"Apache-2.0"
] | 6 | 2018-06-21T19:45:01.000Z | 2018-06-21T19:45:02.000Z | jinja2/testsuite/api.py | prasenjit/ffbird | 057873a500738383612ed21e93348dfb9ee19af2 | [
"Apache-2.0"
] | 5 | 2018-11-24T11:19:49.000Z | 2022-03-25T00:23:03.000Z | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.api
~~~~~~~~~~~~~~~~~~~~
Tests the public API and related stuff.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
import os
import tempfile
import shutil
from jinja2.testsuite import JinjaTestCase... | 39.651341 | 104 | 0.578413 |
4a0ec67db2b8e8566b8a4fc59f59e4331c5df77b | 4,469 | py | Python | cltk/text_reuse/comparison.py | Akash-Pardasani/cltk | 2a430e9407452b06f44847202ebce8446007d96b | [
"MIT"
] | null | null | null | cltk/text_reuse/comparison.py | Akash-Pardasani/cltk | 2a430e9407452b06f44847202ebce8446007d96b | [
"MIT"
] | null | null | null | cltk/text_reuse/comparison.py | Akash-Pardasani/cltk | 2a430e9407452b06f44847202ebce8446007d96b | [
"MIT"
] | 1 | 2019-06-16T06:41:47.000Z | 2019-06-16T06:41:47.000Z |
"""
A comparison class to help with tracking string comparison values
"""
from cltk.utils.cltk_logger import logger
__author__ = 'Luke Hollis <lukehollis@gmail.com>'
__license__ = 'MIT License. See LICENSE.'
class Comparison:
"""A class to increase ease of working with text reuse data."""
def __init__(s... | 31.921429 | 160 | 0.582009 |
4a0ec6dc7067b5801df6be35e0d52b8f89263b56 | 728 | py | Python | djcdek/serialize.py | raxers/django-cdek | 3b06f32f6937266035d49fc0c1bd50e64311c356 | [
"MIT"
] | null | null | null | djcdek/serialize.py | raxers/django-cdek | 3b06f32f6937266035d49fc0c1bd50e64311c356 | [
"MIT"
] | null | null | null | djcdek/serialize.py | raxers/django-cdek | 3b06f32f6937266035d49fc0c1bd50e64311c356 | [
"MIT"
] | null | null | null | import json
import datetime
class CDEKSerializable:
@property
def fields(self):
return self.__dict__
class CDEKEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, CDEKSerializable):
return self._filter_none(o.fields)
elif isinstance(o, datetime):
... | 26 | 70 | 0.592033 |
4a0ec7647deec0eebe4985b3fef0ec5227553588 | 1,853 | py | Python | desktop/core/ext-py/Django-1.11/tests/gis_tests/geoapp/feeds.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | tests/gis_tests/geoapp/feeds.py | 287977288/test | 142e3626ab3c676574631383ae6b5a4eced5a10e | [
"PSF-2.0",
"BSD-3-Clause"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | tests/gis_tests/geoapp/feeds.py | 287977288/test | 142e3626ab3c676574631383ae6b5a4eced5a10e | [
"PSF-2.0",
"BSD-3-Clause"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from __future__ import unicode_literals
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... | 25.040541 | 77 | 0.66163 |
4a0ec7cf2b0065bead55c6adb250b165b85f329a | 758 | py | Python | main/home/migrations/0003_auto_20200912_0031.py | Shriya-Padhi/Plasma-Donation-Database-System | 6f5a6f1fc77647cc2faaecbe55efd0e04da33437 | [
"Apache-2.0"
] | null | null | null | main/home/migrations/0003_auto_20200912_0031.py | Shriya-Padhi/Plasma-Donation-Database-System | 6f5a6f1fc77647cc2faaecbe55efd0e04da33437 | [
"Apache-2.0"
] | null | null | null | main/home/migrations/0003_auto_20200912_0031.py | Shriya-Padhi/Plasma-Donation-Database-System | 6f5a6f1fc77647cc2faaecbe55efd0e04da33437 | [
"Apache-2.0"
] | 2 | 2021-04-26T10:27:31.000Z | 2021-12-02T12:38:21.000Z | # Generated by Django 3.0.6 on 2020-09-11 19:01
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('home', '0002_auto_202009... | 28.074074 | 110 | 0.654354 |
4a0ec976ca19937c77fdc690d4f1affa7a4c4be7 | 2,836 | py | Python | aleat3/output/colored.py | DiddiLeija/aleat3 | 1267570a719bf40211245a290d70e7d4d710cf82 | [
"MIT"
] | 2 | 2021-05-04T14:15:18.000Z | 2021-05-04T14:15:21.000Z | aleat3/output/colored.py | DiddiLeija/aleat3 | 1267570a719bf40211245a290d70e7d4d710cf82 | [
"MIT"
] | 17 | 2021-05-06T18:40:00.000Z | 2021-06-16T13:33:03.000Z | aleat3/output/colored.py | DiddiLeija/aleat3 | 1267570a719bf40211245a290d70e7d4d710cf82 | [
"MIT"
] | null | null | null | """
New since 0.0.9: Use console-colored functions.
This file uses Colorama (http://pypi.org/project/colorama) for colored output.
"""
__all__ = ["UNABLE",
"output_red",
"output_green",
"output_yellow",
"output_blue",
"output_magenta",
"out... | 31.865169 | 140 | 0.583921 |
4a0eca0e1ac5f2a2df9ade6549f58fe0f14de6a7 | 4,113 | py | Python | test/functional/rpc_net.py | MichaelHDesigns/HodlCash | c3ca85c436ba40afadfda11db207068a16527379 | [
"MIT"
] | null | null | null | test/functional/rpc_net.py | MichaelHDesigns/HodlCash | c3ca85c436ba40afadfda11db207068a16527379 | [
"MIT"
] | null | null | null | test/functional/rpc_net.py | MichaelHDesigns/HodlCash | c3ca85c436ba40afadfda11db207068a16527379 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 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 RPC calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
from test_framework.test_frame... | 43.294737 | 134 | 0.693411 |
4a0eca40f0ddad7f1f3562a9fa77e7e0b9248146 | 2,115 | py | Python | rpython/jit/backend/ppc/field.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/jit/backend/ppc/field.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/jit/backend/ppc/field.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | # only a small file, but there's some hairy stuff in here!
"""
>>> f = Field('test', 16, 31)
>>> f
<Field 'test'>
>>> f.encode(65535)
65535
>>> f.encode(65536)
Traceback (most recent call last):
File \"<stdin>\", line 1, in ?
File \"field.py\", line 25, in encode
raise ValueError(\"field '%s' can't accept value... | 33.571429 | 89 | 0.547991 |
4a0ecb16413a686ebb6d03d70a5dafa6a3349eaf | 618 | py | Python | openprocurement/auctions/core/interfaces.py | EBRD-ProzorroSale/openprocurement.auctions.core | 52bd59f193f25e4997612fca0f87291decf06966 | [
"Apache-2.0"
] | 2 | 2016-09-15T20:17:43.000Z | 2017-01-08T03:32:43.000Z | openprocurement/auctions/core/interfaces.py | EBRD-ProzorroSale/openprocurement.auctions.core | 52bd59f193f25e4997612fca0f87291decf06966 | [
"Apache-2.0"
] | 183 | 2017-12-21T11:04:37.000Z | 2019-03-27T08:14:34.000Z | openprocurement/auctions/core/interfaces.py | EBRD-ProzorroSale/openprocurement.auctions.core | 52bd59f193f25e4997612fca0f87291decf06966 | [
"Apache-2.0"
] | 12 | 2016-09-05T12:07:48.000Z | 2019-02-26T09:24:17.000Z | # -*- coding: utf-8 -*-
from zope.interface import (
Interface,
Attribute
)
from openprocurement.api.interfaces import (
IAuction as BaseIAuction,
IContentConfigurator # noqa forwarded import
)
# Auction interfaces
class IAuction(BaseIAuction):
"""Interface for auctions"""
# Question interf... | 15.45 | 51 | 0.700647 |
4a0ecb63c0aeae91991d9a9b2c7fae5de1f696ac | 25,953 | py | Python | sympy/core/symbol.py | risubaba/sympy | 3c872145ca2a444f597c9d57b0e12fc16da7b17a | [
"BSD-3-Clause"
] | 1 | 2021-06-22T23:27:55.000Z | 2021-06-22T23:27:55.000Z | sympy/core/symbol.py | QuantumNovice/sympy | 8a7dc8ef786cccbd7dc0fe0b0e6beec4dd1f7b49 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/symbol.py | QuantumNovice/sympy | 8a7dc8ef786cccbd7dc0fe0b0e6beec4dd1f7b49 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from sympy.core.assumptions import StdFactKB, _assume_defined
from sympy.core.compatibility import is_sequence, ordered
from .basic import Basic
from .sympify import sympify
from .singleton import S
from .expr import Expr, AtomicExpr
from .cache import cacheit
from .func... | 30.713609 | 98 | 0.567449 |
4a0ecd4da18f0ecff244dbd7d62216e62af7b69b | 5,263 | py | Python | keras_bert/loader.py | Jie-Yuan/keras-bert | c3181db8fb292691335e38610628ff75f3762b54 | [
"MIT"
] | null | null | null | keras_bert/loader.py | Jie-Yuan/keras-bert | c3181db8fb292691335e38610628ff75f3762b54 | [
"MIT"
] | null | null | null | keras_bert/loader.py | Jie-Yuan/keras-bert | c3181db8fb292691335e38610628ff75f3762b54 | [
"MIT"
] | null | null | null | import json
import keras
import numpy as np
import tensorflow as tf
from .bert import get_model
def load_trained_model_from_checkpoint(config_file, checkpoint_file, training=False):
with open(config_file, 'r') as reader:
config = json.loads(reader.read())
model = get_model(
token_num=config['v... | 58.477778 | 114 | 0.687631 |
4a0ecd7e0e380de9f8fb54f6ea86bb1818eda3ca | 877 | py | Python | pynecone/pynecone.py | markolaban/pycli | e9c7b660a0ceb2ed61a6d3f87558a164bb0d2792 | [
"BSD-3-Clause"
] | null | null | null | pynecone/pynecone.py | markolaban/pycli | e9c7b660a0ceb2ed61a6d3f87558a164bb0d2792 | [
"BSD-3-Clause"
] | null | null | null | pynecone/pynecone.py | markolaban/pycli | e9c7b660a0ceb2ed61a6d3f87558a164bb0d2792 | [
"BSD-3-Clause"
] | null | null | null | from .shell import Shell
from .gen import Gen
from .env import Env
from .broker import Broker
from .folder import Folder
from .job import Job
from .mount import Mount
from .task import Task
from .topic import Topic
from .repl import Repl
from .api import Api
from .rest import Rest
from .config import Config
from .test ... | 21.925 | 55 | 0.54504 |
4a0ecddb44135185b16de1464509c22c6d937d52 | 2,401 | py | Python | photo/migrations/0001_initial.py | Mukantwarivirginie/Instagram | 91cf561e696638ec0ef410cc6410b844cf9bc2e7 | [
"MIT"
] | null | null | null | photo/migrations/0001_initial.py | Mukantwarivirginie/Instagram | 91cf561e696638ec0ef410cc6410b844cf9bc2e7 | [
"MIT"
] | null | null | null | photo/migrations/0001_initial.py | Mukantwarivirginie/Instagram | 91cf561e696638ec0ef410cc6410b844cf9bc2e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-28 16:03
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | 37.515625 | 120 | 0.558934 |
4a0ece2d14b9cdbfdde6aa3123d6e56ebe08a4ff | 1,100 | py | Python | sources/openjpeg/large_image_source_openjpeg/girder_source.py | naglepuff/large_image | 4e928166f228fe894c38e4b01af5370e72f7229c | [
"Apache-2.0"
] | 85 | 2017-03-10T09:48:17.000Z | 2022-03-31T18:55:58.000Z | sources/openjpeg/large_image_source_openjpeg/girder_source.py | naglepuff/large_image | 4e928166f228fe894c38e4b01af5370e72f7229c | [
"Apache-2.0"
] | 248 | 2017-01-27T16:11:13.000Z | 2022-03-31T14:05:18.000Z | sources/openjpeg/large_image_source_openjpeg/girder_source.py | naglepuff/large_image | 4e928166f228fe894c38e4b01af5370e72f7229c | [
"Apache-2.0"
] | 33 | 2017-03-10T14:06:35.000Z | 2022-03-19T08:32:06.000Z | ##############################################################################
# Copyright Kitware 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/lice... | 36.666667 | 78 | 0.645455 |
4a0eceedf6c81081432c6bdf1999c850ed516591 | 632 | py | Python | tests/const.py | dbarvik/thermal_comfort | d09c72d1b23ed6e1f5079212a20b1c8002b6237b | [
"MIT"
] | null | null | null | tests/const.py | dbarvik/thermal_comfort | d09c72d1b23ed6e1f5079212a20b1c8002b6237b | [
"MIT"
] | null | null | null | tests/const.py | dbarvik/thermal_comfort | d09c72d1b23ed6e1f5079212a20b1c8002b6237b | [
"MIT"
] | null | null | null | """General test constants."""
from homeassistant.const import CONF_NAME
from custom_components.thermal_comfort.const import (
CONF_HUMIDITY_SENSOR,
CONF_POLL,
CONF_TEMPERATURE_SENSOR,
)
from custom_components.thermal_comfort.sensor import CONF_CUSTOM_ICONS, SensorType
USER_INPUT = {
CONF_NAME: "test_t... | 26.333333 | 82 | 0.780063 |
4a0ecf0a3c965578a76e4e3a0693cd2857cd266e | 2,042 | py | Python | privacy/tests/test_settings.py | bitlabstudio/django-privacy | 2dda89b411794d35c623ef060c18f45faba32986 | [
"MIT"
] | 2 | 2017-11-06T21:52:07.000Z | 2019-07-15T19:18:05.000Z | privacy/tests/test_settings.py | bitlabstudio/django-privacy | 2dda89b411794d35c623ef060c18f45faba32986 | [
"MIT"
] | null | null | null | privacy/tests/test_settings.py | bitlabstudio/django-privacy | 2dda89b411794d35c623ef060c18f45faba32986 | [
"MIT"
] | null | null | null | """Settings that need to be set in order to run the tests."""
import os
DEBUG = True
PRIVACY_CLEARANCE_LEVEL_FUNCTION = \
'test_app.privacy_settings.get_clearance_level'
SITE_ID = 1
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}
ROOT_URLCONF =... | 24.309524 | 65 | 0.703722 |
4a0ed0070c39853c8024c8eb85dfa31e3d9d7f24 | 3,015 | py | Python | tools/perry.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | tools/perry.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | tools/perry.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python
# Copyright 2017 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.
"""Runs all permutations of pairs of tests in a gtest binary to attempt to
detect state leakage between tests.
Example invocation:
gn... | 27.409091 | 79 | 0.658375 |
4a0ed1db0e99ef1b9ba19ea3e9a8fb4bf695a907 | 920 | py | Python | moviepy/video/fx/freeze_at_end.py | theContentMint/moviepy | a2f74d1152563b4a6dafc6c9cdb688c7a5244965 | [
"MIT"
] | 1 | 2019-10-08T23:12:16.000Z | 2019-10-08T23:12:16.000Z | moviepy/video/fx/freeze_at_end.py | theContentMint/moviepy | a2f74d1152563b4a6dafc6c9cdb688c7a5244965 | [
"MIT"
] | null | null | null | moviepy/video/fx/freeze_at_end.py | theContentMint/moviepy | a2f74d1152563b4a6dafc6c9cdb688c7a5244965 | [
"MIT"
] | null | null | null | from moviepy.decorators import requires_duration
from moviepy.video.VideoClip import ImageClip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
@requires_duration
def freeze_at_end(clip, freeze_duration=None, total_duration=None):
"""
Makes the clip freeze on its last frame. With `... | 40 | 75 | 0.757609 |
4a0ed20b783a9b75dbe57dd4d55c6ac7b4a41da2 | 1,500 | py | Python | filter_events.py | maua-maua-maua/RAVE | c5a2bdf45970994150b2b723afa0d869cbf21b45 | [
"MIT"
] | null | null | null | filter_events.py | maua-maua-maua/RAVE | c5a2bdf45970994150b2b723afa0d869cbf21b45 | [
"MIT"
] | null | null | null | filter_events.py | maua-maua-maua/RAVE | c5a2bdf45970994150b2b723afa0d869cbf21b45 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import sys
import tensorflow as tf
from tensorflow.compat.v1.summary import FileWriter
from tensorflow.python.summary.summary_iterator import summary_iterator
from tqdm import tqdm
def parse_arguments():
parser = argparse.Ar... | 28.301887 | 110 | 0.638 |
4a0ed286229b0d3a1e0b329dfb4131f6c65c0d37 | 2,382 | py | Python | imageops/imageops-deform.py | martinmcbride/python-imaging-book-examples | 37e4ccf9b7b2fc3ff75b1fdb9f772de452a843b2 | [
"MIT"
] | 1 | 2021-08-22T17:09:44.000Z | 2021-08-22T17:09:44.000Z | imageops/imageops-deform.py | sthagen/python-imaging-book-examples | 2a079c5271f9849bc90a33bed6f3288142035ea7 | [
"MIT"
] | null | null | null | imageops/imageops-deform.py | sthagen/python-imaging-book-examples | 2a079c5271f9849bc90a33bed6f3288142035ea7 | [
"MIT"
] | 1 | 2021-08-22T17:09:48.000Z | 2021-08-22T17:09:48.000Z | # Author: Martin McBride
# Created: 2021-07-19
# Copyright (C) 2021, Martin McBride
# License: MIT
# deform an image
from PIL import Image, ImageOps, ImageDraw
import math
class SingleDeformer:
def getmesh(self, img):
w, h = img.size
#Map whole image rectangle onto whole image rectangle
... | 30.151899 | 79 | 0.584803 |
4a0ed2b4af045b5d8054d22e357a8889352e7c83 | 2,317 | py | Python | apps/volontulo/tests/models/test_userprofile.py | fredfalcon/owasp-volunteer-portal | 9b90455deb7817e0b537a39b43533e384ce51a6f | [
"MIT"
] | 4 | 2018-05-19T23:34:08.000Z | 2022-03-31T23:26:41.000Z | apps/volontulo/tests/models/test_userprofile.py | fredfalcon/owasp-volunteer-portal | 9b90455deb7817e0b537a39b43533e384ce51a6f | [
"MIT"
] | null | null | null | apps/volontulo/tests/models/test_userprofile.py | fredfalcon/owasp-volunteer-portal | 9b90455deb7817e0b537a39b43533e384ce51a6f | [
"MIT"
] | 1 | 2021-01-28T12:12:28.000Z | 2021-01-28T12:12:28.000Z | # -*- coding: utf-8 -*-
u"""
.. module:: test_userprofile
"""
from __future__ import unicode_literals
from django.test import TestCase
from apps.volontulo.models import Organization
from apps.volontulo.models import User
from apps.volontulo.models import UserProfile
class TestUserProfile(TestCase):
u"""Class re... | 31.310811 | 78 | 0.617609 |
4a0ed2bb155cf8e9b4c234239ece0f4c510e92d8 | 768 | py | Python | vdaoGovToken/scripts/py/includes/config.py | harmony-one-vdao/vdao-gov-token | dd1adebab7e2d2e8dfcdcbebcace0d0431df4d8b | [
"MIT"
] | null | null | null | vdaoGovToken/scripts/py/includes/config.py | harmony-one-vdao/vdao-gov-token | dd1adebab7e2d2e8dfcdcbebcace0d0431df4d8b | [
"MIT"
] | null | null | null | vdaoGovToken/scripts/py/includes/config.py | harmony-one-vdao/vdao-gov-token | dd1adebab7e2d2e8dfcdcbebcace0d0431df4d8b | [
"MIT"
] | null | null | null | import logging, os, sys
import pathlib
file_path = pathlib.Path(__file__).parent.resolve()
places = 1000000000000000000
pages = 10
harmony_api = "https://rpc.hermesdefi.io/"
def create_data_path(pth: str, data_path: str = "data") -> os.path:
p = os.path.join(file_path, '..', data_path, pth)
if not os.pat... | 26.482759 | 67 | 0.670573 |
4a0ed313aff7c7a8c004922cb0e995c82fd49097 | 525 | py | Python | fastest/file_handler/ignore_paths.py | ltbringer/fastest | 4026cfbe055baa07f462dc90b23d4368c5aaea7f | [
"MIT"
] | 1 | 2020-04-25T10:44:03.000Z | 2020-04-25T10:44:03.000Z | fastest/file_handler/ignore_paths.py | ltbringer/fastest | 4026cfbe055baa07f462dc90b23d4368c5aaea7f | [
"MIT"
] | null | null | null | fastest/file_handler/ignore_paths.py | ltbringer/fastest | 4026cfbe055baa07f462dc90b23d4368c5aaea7f | [
"MIT"
] | null | null | null | import fnmatch
def is_path_to_be_ignored(event_path, report_path, ignore_patterns):
"""
answers: Is event_path one among the ignore_patterns?
strips report path from the event_path
:param event_path: str
:param report_path: str
:param ignore_patterns: list
:return: bool
"""
for ign... | 29.166667 | 68 | 0.704762 |
4a0ed38b7df4fa5f905b075bdd460992b3825943 | 22 | py | Python | python/testData/inspections/PyRedeclarationInspection/qualifiedTarget.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/PyRedeclarationInspection/qualifiedTarget.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/inspections/PyRedeclarationInspection/qualifiedTarget.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | a = 10
b = 10
a.b = 10 | 7.333333 | 8 | 0.454545 |
4a0ed543b6daab88212714641ffb3d4152ea31ef | 5,337 | py | Python | examples/benchmark_quality/hetero_sbt/fate-sbt.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | examples/benchmark_quality/hetero_sbt/fate-sbt.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | examples/benchmark_quality/hetero_sbt/fate-sbt.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The FATE 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 appli... | 46.408696 | 117 | 0.691587 |
4a0ed680c39c4c74a6dda7b89e479eb836a9c798 | 12,620 | py | Python | federatedml/feature/one_hot_encoder.py | fqiang/FATE | 36a5a41848f78df7be1e520ae804e64bc67d72fb | [
"Apache-2.0"
] | 1 | 2019-12-11T06:27:09.000Z | 2019-12-11T06:27:09.000Z | federatedml/feature/one_hot_encoder.py | fqiang/FATE | 36a5a41848f78df7be1e520ae804e64bc67d72fb | [
"Apache-2.0"
] | null | null | null | federatedml/feature/one_hot_encoder.py | fqiang/FATE | 36a5a41848f78df7be1e520ae804e64bc67d72fb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 The FATE 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/licens... | 37.337278 | 111 | 0.626307 |
4a0ed77e730ad96c8d97b9e9d3b39a5017f6a06f | 12,290 | py | Python | preprocessing/data_type_detector.py | KI-labs/ML-Navigator | c5371da7411e1522a5f423757ae6bd99135e9dbf | [
"Apache-2.0"
] | 18 | 2019-09-13T11:34:38.000Z | 2020-12-09T01:48:07.000Z | preprocessing/data_type_detector.py | KI-labs/ML-Navigator | c5371da7411e1522a5f423757ae6bd99135e9dbf | [
"Apache-2.0"
] | 25 | 2019-09-18T07:49:05.000Z | 2022-03-12T00:03:56.000Z | preprocessing/data_type_detector.py | KI-labs/ML-Navigator | c5371da7411e1522a5f423757ae6bd99135e9dbf | [
"Apache-2.0"
] | 3 | 2019-10-07T14:13:17.000Z | 2021-01-07T02:25:23.000Z | import logging
import os
from IPython.display import display
import pandas as pd
from preprocessing.json_preprocessor import feature_with_json_detector
from preprocessing.data_explorer import outliers_detector
logger = logging.getLogger(__name__)
formatting = (
"%(asctime)s: %(levelname)s: File:%(filename)s Func... | 41.380471 | 235 | 0.668023 |
4a0ed82bb32a77af4ab6cff4ea5959397085a32d | 6,637 | py | Python | bindings/python/ensmallen_graph/datasets/string/halomonassptd01.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/halomonassptd01.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/halomonassptd01.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Halomonas sp. TD01.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02-... | 35.116402 | 223 | 0.700015 |
4a0ed8e4fc51373fea48956443be2732cce699b4 | 1,832 | py | Python | tests/test_misc.py | WeiWeic6222848/PyRep | 231a1ac6b0a179cff53c1d403d379260b9f05f2f | [
"MIT"
] | 505 | 2019-06-26T17:02:44.000Z | 2022-03-31T04:03:23.000Z | tests/test_misc.py | WeiWeic6222848/PyRep | 231a1ac6b0a179cff53c1d403d379260b9f05f2f | [
"MIT"
] | 255 | 2019-06-27T07:04:17.000Z | 2022-03-29T18:25:48.000Z | tests/test_misc.py | WeiWeic6222848/PyRep | 231a1ac6b0a179cff53c1d403d379260b9f05f2f | [
"MIT"
] | 171 | 2019-06-27T05:33:50.000Z | 2022-03-30T03:34:24.000Z | import unittest
from pyrep.errors import PyRepError
from tests.core import TestCore
from pyrep.misc.distance import Distance
from pyrep.misc.signals import IntegerSignal, FloatSignal
from pyrep.misc.signals import DoubleSignal, StringSignal
# TODO: These tests will be re-enabled once bug has been fixed in CoppeliaSim... | 31.050847 | 78 | 0.620633 |
4a0ed9c94d287440d2a0d4237c2779a9ee952295 | 16,634 | py | Python | POVME/packages/clustering/binding_site_overlap.py | guochaoxu2019/POVME3.0 | 717f2764a0a33989f935ef99d48f4afba4bc0fc5 | [
"MIT"
] | 25 | 2016-07-05T21:54:26.000Z | 2021-12-09T09:14:36.000Z | POVME/packages/clustering/binding_site_overlap.py | guochaoxu2019/POVME3.0 | 717f2764a0a33989f935ef99d48f4afba4bc0fc5 | [
"MIT"
] | 41 | 2016-06-27T17:54:15.000Z | 2022-03-24T09:09:39.000Z | POVME/packages/clustering/binding_site_overlap.py | guochaoxu2019/POVME3.0 | 717f2764a0a33989f935ef99d48f4afba4bc0fc5 | [
"MIT"
] | 10 | 2016-06-27T16:25:06.000Z | 2022-02-17T02:04:54.000Z | #!python
# Calculates the binding site overlap between sets of POVME outputs.
# Started July 9th, 2014
# Celia Wong
# Advised by Jeff Wagner
# Amaro Lab, UCSD
import numpy
import sys
import re
import os
import csv
from optparse import OptionParser
class Trajectory():
def __init__(self):
self.coordinates... | 47.121813 | 179 | 0.633401 |
4a0eda06cf695b5840c4e0adfbdcc58f31f1c23f | 2,792 | py | Python | tests/scripts/task_build.py | 666vulcan/tvm | ffd5f70370642c909222f9a4cae8400023dacbdc | [
"Apache-2.0"
] | 1 | 2022-03-08T03:03:53.000Z | 2022-03-08T03:03:53.000Z | tests/scripts/task_build.py | 666vulcan/tvm | ffd5f70370642c909222f9a4cae8400023dacbdc | [
"Apache-2.0"
] | null | null | null | tests/scripts/task_build.py | 666vulcan/tvm | ffd5f70370642c909222f9a4cae8400023dacbdc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# 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
# "L... | 35.794872 | 93 | 0.686605 |
4a0eda5698396e2e5952b971b52fdfe747fcd42a | 5,393 | py | Python | src/packages/database/database_manager.py | beepbeat/pipsqueak3 | 1663875ab21dbb6bb63a424e480db70f0948d9a4 | [
"BSD-3-Clause"
] | null | null | null | src/packages/database/database_manager.py | beepbeat/pipsqueak3 | 1663875ab21dbb6bb63a424e480db70f0948d9a4 | [
"BSD-3-Clause"
] | null | null | null | src/packages/database/database_manager.py | beepbeat/pipsqueak3 | 1663875ab21dbb6bb63a424e480db70f0948d9a4 | [
"BSD-3-Clause"
] | 1 | 2018-06-24T22:53:03.000Z | 2018-06-24T22:53:03.000Z | """
database_manager.py - allows connections to SQL databases.
Provides postgreSQL connectivity for mechasqueak3.
Copyright (c) 2018 The Fuel Rat Mischief,
All rights reserved.
Licensed under the BSD 3-Clause License.
See LICENSE.md
"""
import logging
from typing import Union, Tuple, List, Dict
import psycopg2
from ps... | 39.07971 | 100 | 0.590024 |
4a0edab191f7b25bec98e18a9a2ba8f37342bde7 | 19,277 | py | Python | pontoon/administration/views.py | Henikilan/pontoon | 30d8c3d3dd0630d79dce8a75208f9778d6218864 | [
"BSD-3-Clause"
] | null | null | null | pontoon/administration/views.py | Henikilan/pontoon | 30d8c3d3dd0630d79dce8a75208f9778d6218864 | [
"BSD-3-Clause"
] | 4 | 2018-05-25T13:38:07.000Z | 2021-12-13T20:47:16.000Z | pontoon/administration/views.py | Henikilan/pontoon | 30d8c3d3dd0630d79dce8a75208f9778d6218864 | [
"BSD-3-Clause"
] | 1 | 2019-10-07T17:46:36.000Z | 2019-10-07T17:46:36.000Z | from __future__ import absolute_import
import logging
from backports import csv
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.db import transaction, IntegrityError
from django.db.models import Max
from django... | 36.234962 | 96 | 0.628677 |
4a0edbc22bc61d19f555e6315492e76f85b6a2fa | 10,395 | py | Python | docs/source/conf.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 351 | 2016-01-27T19:15:27.000Z | 2022-03-09T15:40:56.000Z | docs/source/conf.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 37 | 2016-03-16T03:57:59.000Z | 2021-06-26T14:02:33.000Z | docs/source/conf.py | edublancas/sklearn-model-evaluation | 1f35d5bcc689a5f4d54c14fde60abf09af9fc374 | [
"MIT"
] | 30 | 2016-01-27T19:27:08.000Z | 2022-03-31T06:09:59.000Z | # -*- coding: utf-8 -*-
#
# sklearn-evaluation documentation build configuration file, created by
# sphinx-quickstart on Fri May 27 12:43:49 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... | 32.791798 | 80 | 0.717364 |
4a0edbca19b3aedaa3edd590f836257780176efa | 3,398 | py | Python | fibratus/output/amqp.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | null | null | null | fibratus/output/amqp.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | null | null | null | fibratus/output/amqp.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | 1 | 2022-03-07T08:05:34.000Z | 2022-03-07T08:05:34.000Z | # Copyright 2016 by Nedim Sabic (RabbitStack)
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 32.361905 | 83 | 0.598293 |
4a0edbdc7458512256a1959f00e2bcf01351f6fb | 18,194 | py | Python | doc/source/notebooks/intro_to_gpflow2.pct.py | yiwei-prowler/GPflow | de08879228e4077f4476279d208fd23634508a8b | [
"Apache-2.0"
] | 1 | 2020-05-07T12:25:40.000Z | 2020-05-07T12:25:40.000Z | doc/source/notebooks/intro_to_gpflow2.pct.py | yiwei-prowler/GPflow | de08879228e4077f4476279d208fd23634508a8b | [
"Apache-2.0"
] | null | null | null | doc/source/notebooks/intro_to_gpflow2.pct.py | yiwei-prowler/GPflow | de08879228e4077f4476279d208fd23634508a8b | [
"Apache-2.0"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,.pct.py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
... | 32.088183 | 419 | 0.732989 |
4a0edc79aae76e182b6e5b09f855e8b59860c533 | 14,683 | py | Python | examples/entity_disambiguation/main.py | techthiyanes/luke | aa234d934527eda96a9a4c3bd9c7999c05c3fd58 | [
"Apache-2.0"
] | null | null | null | examples/entity_disambiguation/main.py | techthiyanes/luke | aa234d934527eda96a9a4c3bd9c7999c05c3fd58 | [
"Apache-2.0"
] | null | null | null | examples/entity_disambiguation/main.py | techthiyanes/luke | aa234d934527eda96a9a4c3bd9c7999c05c3fd58 | [
"Apache-2.0"
] | null | null | null | import functools
import json
import logging
import os
import random
from argparse import Namespace
import click
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tqdm import tqdm
from transformers import WEIGHTS_NAME
from wikipedia2vec.dump_db import DumpDB
from luke.utils.enti... | 41.713068 | 120 | 0.640469 |
4a0edce1db4cf3722a50b30ad570a5f5c148b1fe | 1,371 | py | Python | tatami/client.py | ayemos/tatami | 431c1fb3cd1614731083db1436d9021efe6c0a1b | [
"MIT"
] | null | null | null | tatami/client.py | ayemos/tatami | 431c1fb3cd1614731083db1436d9021efe6c0a1b | [
"MIT"
] | null | null | null | tatami/client.py | ayemos/tatami | 431c1fb3cd1614731083db1436d9021efe6c0a1b | [
"MIT"
] | null | null | null | import six
import os
import json
from six.moves.urllib.request import urlopen
from tatami.downloaders import *
class Client(object):
def __init__(self, tatami_host,
data_directory_path="%s/.tatami/datasets" % os.environ.get("HOME")):
self.__tatami_host = tatami_host
self.__data_direct... | 35.153846 | 89 | 0.690737 |
4a0edd2dca30db164395440319ae9e2370a2d7b9 | 541 | py | Python | zfs3backup/get.py | Anglelengyug/mmontagnan | e5d17749d0d7f23d3746637f86e17465d88bdbd7 | [
"Apache-2.0"
] | 7 | 2019-09-21T23:07:46.000Z | 2021-05-08T07:04:24.000Z | zfs3backup/get.py | Anglelengyug/mmontagnan | e5d17749d0d7f23d3746637f86e17465d88bdbd7 | [
"Apache-2.0"
] | 2 | 2020-10-06T20:03:46.000Z | 2020-10-07T16:14:50.000Z | zfs3backup/get.py | Anglelengyug/mmontagnan | e5d17749d0d7f23d3746637f86e17465d88bdbd7 | [
"Apache-2.0"
] | 2 | 2019-12-18T03:16:04.000Z | 2021-05-08T07:04:28.000Z | import argparse
import sys
import boto3
from zfs3backup.config import get_config
def download(bucket, name):
bucket.download_fileobj(name, sys.stdout)
def main():
cfg = get_config()
parser = argparse.ArgumentParser(
description='Read a key from s3 and write the content to stdout',
)
pa... | 19.321429 | 73 | 0.676525 |
4a0edde5f7f4a5695f9f3845d024a988fcaf3081 | 470 | py | Python | bibclean/updating/general.py | Svdvoort/BibClean | 0d891d0dc0d0b335afdf3a09f4df6103d1e96215 | [
"MIT"
] | null | null | null | bibclean/updating/general.py | Svdvoort/BibClean | 0d891d0dc0d0b335afdf3a09f4df6103d1e96215 | [
"MIT"
] | 218 | 2020-11-20T08:20:01.000Z | 2022-03-28T19:21:18.000Z | bibclean/updating/general.py | Svdvoort/BibClean | 0d891d0dc0d0b335afdf3a09f4df6103d1e96215 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
def update_field(bib_entry, field_name, value):
if field_name not in bib_entry or bib_entry[field_name] != value:
logger.info("Changed field {} for {}".format(field_name, bib_entry["ID"]))
if field_name == "author" and len(value) < len(bib_entry... | 36.153846 | 82 | 0.680851 |
4a0edf458280743cb7ab99a91914158128a62a4d | 3,793 | py | Python | src/Products/ZCatalog/CatalogBrains.py | zopefoundation/Products.ZCatalog | d4fd9fe28d27e8ff43e911025c1258f1e8d50ad5 | [
"ZPL-2.1"
] | 4 | 2018-09-13T22:10:22.000Z | 2019-06-15T08:26:52.000Z | src/Products/ZCatalog/CatalogBrains.py | zopefoundation/Products.ZCatalog | d4fd9fe28d27e8ff43e911025c1258f1e8d50ad5 | [
"ZPL-2.1"
] | 97 | 2015-02-05T11:58:41.000Z | 2022-02-08T21:34:11.000Z | src/Products/ZCatalog/CatalogBrains.py | zopefoundation/Products.ZCatalog | d4fd9fe28d27e8ff43e911025c1258f1e8d50ad5 | [
"ZPL-2.1"
] | 12 | 2015-04-03T05:30:24.000Z | 2019-08-12T21:50:21.000Z | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 37.554455 | 79 | 0.64619 |
4a0ee27e5582993b808f664973edfefb02150dfd | 753 | py | Python | learning_logs/migrations/0003_entry.py | davidbezerra405/learning_log | e540fcc843d387f3484fab1db0a3b2e198ebf167 | [
"MIT"
] | null | null | null | learning_logs/migrations/0003_entry.py | davidbezerra405/learning_log | e540fcc843d387f3484fab1db0a3b2e198ebf167 | [
"MIT"
] | null | null | null | learning_logs/migrations/0003_entry.py | davidbezerra405/learning_log | e540fcc843d387f3484fab1db0a3b2e198ebf167 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('learning_logs', '0002_auto_20210726_1831'),
]
operations = [
migrations.CreateModel(
name='Entry',
f... | 27.888889 | 114 | 0.559097 |
4a0ee2b8e2012806add4f3b5abd195c75792dab7 | 77,646 | py | Python | torch/overrides.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | 1 | 2021-05-11T11:53:47.000Z | 2021-05-11T11:53:47.000Z | torch/overrides.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | 1 | 2021-05-10T01:18:33.000Z | 2021-05-10T01:18:33.000Z | torch/overrides.py | sigmunjr/pytorch | 526e12029274cf0257954616d5cd5260b1021f52 | [
"Intel"
] | null | null | null | """
Python implementation of ``__torch_function__``
While most of the torch API and handling for ``__torch_function__`` happens
at the C++ level, some of the torch API is written in Python so we need
python-level handling for ``__torch_function__`` overrides as well. The main
developer-facing functionality in this fil... | 54.259958 | 173 | 0.64409 |
4a0ee39b1774a3a42e8da462a7dc3684265b73a6 | 6,367 | py | Python | IMS/product/migrations/0001_initial.py | AyushPaudel/Inventory-Management-System | 04e57b0d02b1b7cade992b959569e750ca339c8e | [
"MIT"
] | 2 | 2021-09-01T13:00:24.000Z | 2021-11-19T12:16:52.000Z | IMS/product/migrations/0001_initial.py | aadarshadhakalg/Inventory-Management-System-1 | 075ec49b9d4abebb7d9a0b150a6cb70f6cbf5144 | [
"MIT"
] | null | null | null | IMS/product/migrations/0001_initial.py | aadarshadhakalg/Inventory-Management-System-1 | 075ec49b9d4abebb7d9a0b150a6cb70f6cbf5144 | [
"MIT"
] | 1 | 2021-12-23T23:41:20.000Z | 2021-12-23T23:41:20.000Z | # Generated by Django 3.2 on 2021-08-01 06:01
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | 49.356589 | 124 | 0.578923 |
4a0ee3a2335531106153b88527f017ad4bad7dff | 3,804 | py | Python | utils_crunchy.py | enricoros/vc-analysis-tools | 5137b5202c570d07f20aa25a71a538edff26a5d0 | [
"BSD-3-Clause"
] | null | null | null | utils_crunchy.py | enricoros/vc-analysis-tools | 5137b5202c570d07f20aa25a71a538edff26a5d0 | [
"BSD-3-Clause"
] | null | null | null | utils_crunchy.py | enricoros/vc-analysis-tools | 5137b5202c570d07f20aa25a71a538edff26a5d0 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
# uniform arrangement of the data frame
COL_NAME = 'Name'
COL_TITLE = 'Title'
COL_SERIES = 'Series'
COL_MONEY = 'Money'
COL_FUND_DATE = 'Funds Date'
COL_FUND_YEAR = 'Funds Year'
COL_LABEL = 'Label'
COL_DESCRIPTION = 'Description'
COL_INDUSTRIES = 'Industries'
_TSV_HEADERS = [COL_NAME, COL_TITLE, COL... | 37.663366 | 168 | 0.619085 |
4a0ee5a0910b2fbfb50695d9d3279887b7a1cf20 | 8,205 | py | Python | advertools/urlytics.py | maximrus23/advertools | f6a392cea9075f49d50751f1b51cb0bc15b48647 | [
"MIT"
] | 1 | 2021-03-18T15:19:16.000Z | 2021-03-18T15:19:16.000Z | advertools/urlytics.py | imne-hh/advertools | 3f71bc5d96b0f8b91bcf24a0699267b8af75472c | [
"MIT"
] | null | null | null | advertools/urlytics.py | imne-hh/advertools | 3f71bc5d96b0f8b91bcf24a0699267b8af75472c | [
"MIT"
] | null | null | null | """
.. _urlytics:
Split, Parse, and Analyze URLs
==============================
Extracting information from URLs can be a little tedious, yet very important.
Using the standard for URLs we can extract a lot of information in a fairly
structured manner.
There are many situations in which you have many URLs that you w... | 48.550296 | 179 | 0.704814 |
4a0ee7cdc8cdff5e01d424a1e1ddc1e87c5d081d | 4,327 | py | Python | contrib/seeds/generate-seeds.py | dalijolijo/Bitcloud | 54fc01a6b882234f4e7cae15fa453e1e670282a1 | [
"MIT"
] | 49 | 2017-08-31T04:28:33.000Z | 2022-03-06T15:19:20.000Z | contrib/seeds/generate-seeds.py | dalijolijo/Bitcloud | 54fc01a6b882234f4e7cae15fa453e1e670282a1 | [
"MIT"
] | 15 | 2017-08-28T03:39:37.000Z | 2021-06-05T07:48:06.000Z | contrib/seeds/generate-seeds.py | dalijolijo/Bitcloud | 54fc01a6b882234f4e7cae15fa453e1e670282a1 | [
"MIT"
] | 35 | 2017-08-16T12:52:36.000Z | 2022-03-17T09:30:09.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.355072 | 98 | 0.581465 |
4a0ee7da015995b60c12b003f590b428fc4d6f5c | 6,867 | py | Python | backend/glamourhaven/models.py | njeveh/GlamourHaven | 5cc72f4ad430df96667f1ca7141b1e2481ad3c97 | [
"MIT"
] | 3 | 2022-02-05T22:52:02.000Z | 2022-02-08T08:40:12.000Z | backend/glamourhaven/models.py | njeveh/GlamourHaven | 5cc72f4ad430df96667f1ca7141b1e2481ad3c97 | [
"MIT"
] | 23 | 2022-02-19T00:03:45.000Z | 2022-03-04T10:11:32.000Z | backend/glamourhaven/models.py | njeveh/GlamourHaven | 5cc72f4ad430df96667f1ca7141b1e2481ad3c97 | [
"MIT"
] | 6 | 2022-01-27T10:08:46.000Z | 2022-03-02T17:52:08.000Z | from django.db import models
from django.db.models.deletion import CASCADE, SET_NULL, PROTECT
from datetime import datetime, timezone
from django.contrib.auth.models import User
from django.db.models.fields.related import ForeignKey
# make email in User a mandatory field
User._meta.get_field('email')._unique = True
Us... | 43.738854 | 121 | 0.72113 |
4a0ee992cb0d4d084ddfc102d74533c2bd4a7071 | 2,254 | py | Python | gen/generate.py | jasonliang-dev/elm-heroicons | 2ce1815bd7e136d845f38965f5293e5dac9e4e2a | [
"MIT"
] | 1 | 2021-06-14T06:39:48.000Z | 2021-06-14T06:39:48.000Z | gen/generate.py | jasonliang-dev/elm-heroicons | 2ce1815bd7e136d845f38965f5293e5dac9e4e2a | [
"MIT"
] | 1 | 2020-09-18T14:34:15.000Z | 2020-09-19T15:37:44.000Z | gen/generate.py | jasonliang-dev/elm-heroicons | 2ce1815bd7e136d845f38965f5293e5dac9e4e2a | [
"MIT"
] | null | null | null | import base64
import os.path
import sys
import copy
import xml.etree.ElementTree as ET
from attr_lookup import svg_attrs
def strip_namespace(xml_tag):
uri, tag = xml_tag[1:].split("}")
return tag
def to_attr(xml_attr):
name, value = xml_attr
attr = svg_attrs.get(name, name)
# function name col... | 21.673077 | 76 | 0.636202 |
4a0eea685e016dba2c2cf35f7ae4f267c093f5d1 | 305 | py | Python | app2_geomap/read_info.py | lasupernova/Random-Apps | 488b187ae6a4f32d9f6c2bbfdfd4718150863f36 | [
"MIT"
] | null | null | null | app2_geomap/read_info.py | lasupernova/Random-Apps | 488b187ae6a4f32d9f6c2bbfdfd4718150863f36 | [
"MIT"
] | null | null | null | app2_geomap/read_info.py | lasupernova/Random-Apps | 488b187ae6a4f32d9f6c2bbfdfd4718150863f36 | [
"MIT"
] | null | null | null | import pandas as pd
class InfoFile():
def __init__(self, path, engine):
self.file = pd.read_excel(path, engine=engine).set_index('Name')
def get_info(self):
return self.file.loc['Kate Sheppard','Text']
if __name__ == "__main__":
InfoFile('media/texts.ods', 'odf').get_info()
| 27.727273 | 72 | 0.659016 |
4a0eeb5f95023dd2bdfb50263b1f7d0a19550f22 | 74 | py | Python | tests/models/__init__.py | osanwe/Open-Vocabulary-Learning-on-Source-Code-with-a-Graph-Structured-Cache | d0d6e2b2414e6774dd6c78b0c48c2a9db6c3e181 | [
"MIT"
] | 26 | 2018-10-11T22:06:31.000Z | 2021-07-22T09:02:45.000Z | tests/models/__init__.py | osanwe/Open-Vocabulary-Learning-on-Source-Code-with-a-Graph-Structured-Cache | d0d6e2b2414e6774dd6c78b0c48c2a9db6c3e181 | [
"MIT"
] | 3 | 2018-10-22T15:54:54.000Z | 2021-06-22T11:06:54.000Z | tests/models/__init__.py | osanwe/Open-Vocabulary-Learning-on-Source-Code-with-a-Graph-Structured-Cache | d0d6e2b2414e6774dd6c78b0c48c2a9db6c3e181 | [
"MIT"
] | 9 | 2018-12-06T09:43:15.000Z | 2021-06-15T18:43:37.000Z | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
| 37 | 73 | 0.77027 |
4a0eeb71b15ae97aee399553d2cc607af865220f | 7,599 | py | Python | pennylane/templates/embeddings/amplitude.py | ryanlevy/pennylane | fb03b09d17267ebd0b9050432f9eeb84b5dff200 | [
"Apache-2.0"
] | null | null | null | pennylane/templates/embeddings/amplitude.py | ryanlevy/pennylane | fb03b09d17267ebd0b9050432f9eeb84b5dff200 | [
"Apache-2.0"
] | 1 | 2021-05-27T05:36:41.000Z | 2021-05-27T05:36:41.000Z | pennylane/templates/embeddings/amplitude.py | ryanlevy/pennylane | fb03b09d17267ebd0b9050432f9eeb84b5dff200 | [
"Apache-2.0"
] | 1 | 2021-05-15T03:25:40.000Z | 2021-05-15T03:25:40.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies 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... | 36.533654 | 121 | 0.630872 |
4a0eec11839523f9defa006d41446a19018bf9ad | 3,244 | py | Python | example/layers/attention.py | Achazwl/BMTrain | 776c10b21886f12137641c56b12ebf8d601aa9e0 | [
"Apache-2.0"
] | 19 | 2022-03-14T12:30:23.000Z | 2022-03-31T11:52:29.000Z | example/layers/attention.py | Achazwl/BMTrain | 776c10b21886f12137641c56b12ebf8d601aa9e0 | [
"Apache-2.0"
] | 1 | 2022-03-24T02:11:32.000Z | 2022-03-24T02:14:17.000Z | example/layers/attention.py | Achazwl/BMTrain | 776c10b21886f12137641c56b12ebf8d601aa9e0 | [
"Apache-2.0"
] | 5 | 2022-03-18T02:03:02.000Z | 2022-03-29T13:19:09.000Z | from typing import Optional
import torch
import bmtrain as bmt
from layers import Linear
import math
class Attention(bmt.DistributedModule):
def __init__(self,
dim_model : int, dim_head : int,
num_heads : int, bias : bool = True,
dtype = None
) -> None:
super().... | 36.449438 | 96 | 0.610049 |
4a0eecb9ae857dd5a0d40f879741b87fe2afb18c | 1,978 | py | Python | google-cloud-sdk/lib/surface/compute/target_ssl_proxies/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/compute/target_ssl_proxies/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/compute/target_ssl_proxies/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2014 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... | 34.701754 | 80 | 0.749242 |
4a0eed132a649b0797f936007f5dfc38c8f7bdff | 3,808 | py | Python | tests/logsim.py | valodzka/tailon | 7b690cf47c2d2ff26d1eead86aebf7e00ea02e82 | [
"Apache-2.0"
] | 1 | 2018-09-25T15:58:37.000Z | 2018-09-25T15:58:37.000Z | tests/logsim.py | ahmed-musallam/tailon | 2aa5313e1447ccb8250a5e7989f05b4927134981 | [
"Apache-2.0"
] | null | null | null | tests/logsim.py | ahmed-musallam/tailon | 2aa5313e1447ccb8250a5e7989f05b4927134981 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''Writes log-file-looking lines to files.'''
import os
import time
import argparse
import asyncio
from random import choice, randint, seed
from datetime import datetime as dt
agents = (
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari... | 30.709677 | 126 | 0.616071 |
4a0eeda4c8bf79d27ad4ae11e98470b9e4ed3a76 | 251 | py | Python | genocide/slg.py | bthate/genocide | 8de7a2cccee7315ae6cf5661738ba1335e30a5ba | [
"DOC"
] | null | null | null | genocide/slg.py | bthate/genocide | 8de7a2cccee7315ae6cf5661738ba1335e30a5ba | [
"DOC"
] | null | null | null | genocide/slg.py | bthate/genocide | 8de7a2cccee7315ae6cf5661738ba1335e30a5ba | [
"DOC"
] | null | null | null | # This file is placed in the Public Domain.
#
# EM_T04_OTP-CR-117_19 otp.informationdesk@icc-cpi.int https://genocide.rtfd.io
txt = "EM_T04_OTP-CR-117_19 otp.informationdesk@icc-cpi.int https://genocide.rtfd.io"
def slg(event):
event.reply(txt)
| 27.888889 | 85 | 0.749004 |
4a0eee88b9e944ef32ccc85474172409aed5bed1 | 16,531 | py | Python | main_analysis/50.construct_figure3.py | thodk/proteostasis_imprinting_across_evolution | e6e414b36bbfaf2f4c4ac6fc80a31c6c13c3902e | [
"MIT"
] | null | null | null | main_analysis/50.construct_figure3.py | thodk/proteostasis_imprinting_across_evolution | e6e414b36bbfaf2f4c4ac6fc80a31c6c13c3902e | [
"MIT"
] | null | null | null | main_analysis/50.construct_figure3.py | thodk/proteostasis_imprinting_across_evolution | e6e414b36bbfaf2f4c4ac6fc80a31c6c13c3902e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pandas
import os
import sys
import numpy
import json
import operator
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.lines import Line2D
from matplotlib import pyplot as plt
from matplotlib.gridspec import GridSpec
from sklearn.manifold import MDS
sys.path.append('.... | 43.274869 | 119 | 0.669711 |
4a0eeeb1005ae7b4b14b03157eefd674d553686f | 13,211 | py | Python | mitmproxy/flowfilter.py | caputomarcos/mitmproxy | d24f76c98e9673d4c66121c007080a62a0998569 | [
"MIT"
] | null | null | null | mitmproxy/flowfilter.py | caputomarcos/mitmproxy | d24f76c98e9673d4c66121c007080a62a0998569 | [
"MIT"
] | null | null | null | mitmproxy/flowfilter.py | caputomarcos/mitmproxy | d24f76c98e9673d4c66121c007080a62a0998569 | [
"MIT"
] | 1 | 2020-11-07T08:54:29.000Z | 2020-11-07T08:54:29.000Z | """
The following operators are understood:
~q Request
~s Response
Headers:
Patterns are matched against "name: value" strings. Field names are
all-lowercase.
~a Asset content-type in response. Asset content types are:
... | 23.976407 | 84 | 0.561426 |
4a0ef55e528d9c2c2d6a85bb42af8ab186ac0247 | 726 | py | Python | test/command_line/test_convert_to_cbf.py | TiankunZhou/dials | bd5c95b73c442cceb1c61b1690fd4562acf4e337 | [
"BSD-3-Clause"
] | 2 | 2021-03-17T11:25:46.000Z | 2021-11-18T04:20:54.000Z | test/command_line/test_convert_to_cbf.py | TiankunZhou/dials | bd5c95b73c442cceb1c61b1690fd4562acf4e337 | [
"BSD-3-Clause"
] | 2 | 2020-07-31T22:37:30.000Z | 2020-07-31T23:08:55.000Z | test/command_line/test_convert_to_cbf.py | TiankunZhou/dials | bd5c95b73c442cceb1c61b1690fd4562acf4e337 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
import procrunner
import pytest
@pytest.mark.parametrize("filename", ["image_15799_master.h5", "image_15799.nxs"])
def test_convert_to_cbf(dials_data, filename, tmpdir):
result = procrunner.run(
["dials.import", dials_data("vmxi_thaumatin")... | 30.25 | 86 | 0.714876 |
4a0ef59812a1ab82d1ab3631f338e25633aaff9a | 2,024 | py | Python | saleor/graphql/core/types/meta.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 8 | 2018-07-17T13:13:21.000Z | 2022-03-01T17:02:34.000Z | saleor/graphql/core/types/meta.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 3 | 2021-03-09T16:28:16.000Z | 2022-02-10T19:08:00.000Z | saleor/graphql/core/types/meta.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 1 | 2021-04-15T07:16:34.000Z | 2021-04-15T07:16:34.000Z | from operator import itemgetter
import graphene
class MetaItem(graphene.ObjectType):
key = graphene.String(required=True, description="Key for stored data.")
value = graphene.String(required=True, description="Stored metadata value.")
class MetaClientStore(graphene.ObjectType):
name = graphene.String(r... | 29.333333 | 86 | 0.652668 |
4a0ef70f77dadaf8e16a9180a6b04e4a805f540d | 12,042 | py | Python | samcli/commands/local/lib/sam_function_provider.py | trenton/aws-sam-cli | 11db934d3584c17fb5ba94d0e92e291c2c91d7c9 | [
"Apache-2.0"
] | 1 | 2019-12-24T17:27:09.000Z | 2019-12-24T17:27:09.000Z | samcli/commands/local/lib/sam_function_provider.py | ShreyaGangishetty/aws-sam-cli | f896920468770f3407a3035b9c8e04902578d556 | [
"Apache-2.0"
] | 1 | 2021-06-02T02:44:08.000Z | 2021-06-02T02:44:08.000Z | samcli/commands/local/lib/sam_function_provider.py | CavHack/aws-sam-cli | 9355b7b613af907055b9ea5fb199f5d6d501c490 | [
"Apache-2.0"
] | null | null | null | """
Class that provides functions from a given SAM template
"""
import logging
import six
from samcli.commands.local.cli_common.user_exceptions import InvalidLayerVersionArn
from .exceptions import InvalidLayerReference
from .provider import FunctionProvider, Function, LayerVersion
from .sam_base_provider import SamB... | 42.104895 | 134 | 0.659193 |
4a0ef71d7b59d774727e176d9ffff747269edb3f | 1,236 | py | Python | python/setup.py | mazhurin/spark-iforest | cde82cad838cdafde66108afcadbafe773530303 | [
"Apache-2.0"
] | null | null | null | python/setup.py | mazhurin/spark-iforest | cde82cad838cdafde66108afcadbafe773530303 | [
"Apache-2.0"
] | null | null | null | python/setup.py | mazhurin/spark-iforest | cde82cad838cdafde66108afcadbafe773530303 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from setuptools import setup, find_packages
import sys
import io
setup(
name="pyspark-iforest",
version="2.4.0.99",
author="Titicaca",
author_email="lake_titicaca@outlook.com",
description="PySpark Wrapper for Spark-IForest",
long_description=io.open("READM... | 30.146341 | 71 | 0.59466 |
4a0ef7441e3e3dfe63aa0808a80bc11a3e1a7e37 | 6,995 | py | Python | src/pythae/pipelines/training.py | eknag/benchmark_VAE | 8b727f29a68aff7771c4c97aff15f75f88320e1f | [
"Apache-2.0"
] | 1 | 2022-03-20T20:23:59.000Z | 2022-03-20T20:23:59.000Z | src/pythae/pipelines/training.py | eknag/benchmark_VAE | 8b727f29a68aff7771c4c97aff15f75f88320e1f | [
"Apache-2.0"
] | null | null | null | src/pythae/pipelines/training.py | eknag/benchmark_VAE | 8b727f29a68aff7771c4c97aff15f75f88320e1f | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Union
import logging
import numpy as np
import torch
from torch.optim import Optimizer
from ..customexception import LoadError
from ..data.preprocessors import DataProcessor
from ..models import BaseAE, VAE, VAEConfig
from ..trainers import *
from .base_pipeline import Pipeline
logger =... | 36.432292 | 98 | 0.622302 |
4a0ef81bd16c08e8952ff40e4654d32b362d5a12 | 3,150 | py | Python | packages/mbed-greentea/setup.py | noralsydmp/mbed-os-tools | 5a14958aa49eb5764afba8e1dc3208cae2955cd7 | [
"Apache-2.0"
] | null | null | null | packages/mbed-greentea/setup.py | noralsydmp/mbed-os-tools | 5a14958aa49eb5764afba8e1dc3208cae2955cd7 | [
"Apache-2.0"
] | null | null | null | packages/mbed-greentea/setup.py | noralsydmp/mbed-os-tools | 5a14958aa49eb5764afba8e1dc3208cae2955cd7 | [
"Apache-2.0"
] | null | null | null | """
This module defines the attributes of the
PyPI package for the mbed SDK test suite
"""
"""
mbed SDK
Copyright (c) 2011-2019 ARM Limited
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... | 35 | 159 | 0.68127 |
4a0ef832cfa9e37aad7c6c51fbd40b16109f9d92 | 5,022 | py | Python | tests/pkb_test.py | robfrut135/PerfKitBenchmarker | ccaf81b47ed5e3f27065e8f8d9fc42d071bfc22c | [
"Apache-2.0"
] | null | null | null | tests/pkb_test.py | robfrut135/PerfKitBenchmarker | ccaf81b47ed5e3f27065e8f8d9fc42d071bfc22c | [
"Apache-2.0"
] | null | null | null | tests/pkb_test.py | robfrut135/PerfKitBenchmarker | ccaf81b47ed5e3f27065e8f8d9fc42d071bfc22c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 PerfKitBenchmarker 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 appli... | 35.366197 | 77 | 0.7501 |
4a0ef90859a28975cc3f6ee9da4a3ad21b773b25 | 786 | py | Python | gvsoc/gvsoc/models/pulp/chips/vivosoc3_1/apb_soc.py | knmcguire/gap_sdk | 7b0a09a353ab6f0550793d40bd46e98051f4a3d7 | [
"Apache-2.0"
] | null | null | null | gvsoc/gvsoc/models/pulp/chips/vivosoc3_1/apb_soc.py | knmcguire/gap_sdk | 7b0a09a353ab6f0550793d40bd46e98051f4a3d7 | [
"Apache-2.0"
] | null | null | null | gvsoc/gvsoc/models/pulp/chips/vivosoc3_1/apb_soc.py | knmcguire/gap_sdk | 7b0a09a353ab6f0550793d40bd46e98051f4a3d7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2018 ETH Zurich and University of Bologna
#
# 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 applicabl... | 32.75 | 74 | 0.756997 |
4a0ef9e265c4d9de39e870d3d11cb3779cea9f03 | 2,101 | py | Python | logger.py | bitmarker/rpi_i2c | e56989e8a451d01fc756d3ccf3d7f8ffa590ccce | [
"MIT"
] | 1 | 2016-10-18T16:27:28.000Z | 2016-10-18T16:27:28.000Z | logger.py | bitmarker/rpi_i2c | e56989e8a451d01fc756d3ccf3d7f8ffa590ccce | [
"MIT"
] | null | null | null | logger.py | bitmarker/rpi_i2c | e56989e8a451d01fc756d3ccf3d7f8ffa590ccce | [
"MIT"
] | null | null | null | import threading
import time
import csv
from datetime import datetime
from sensors.MC9808 import MC9808
from sensors.Dummy import DummySensor
class Logger(threading.Thread):
sensor_list = []
cycle = 1
def __init__(self, filename):
threading.Thread.__init__(self)
self.kill_me = False
... | 28.013333 | 76 | 0.548786 |
4a0efb0dc85c03f358eeb517ac50cdef3b4427e3 | 105 | py | Python | OP-GAN/box_generation/seq2seq/models/__init__.py | ts170/OP-GAN | b9a6227aaa7befa2025ea1f07e62e7a7e9c7ce1e | [
"MIT"
] | 1 | 2021-08-25T02:36:02.000Z | 2021-08-25T02:36:02.000Z | OP-GAN/box_generation/seq2seq/models/__init__.py | ts170/OP-GAN | b9a6227aaa7befa2025ea1f07e62e7a7e9c7ce1e | [
"MIT"
] | null | null | null | OP-GAN/box_generation/seq2seq/models/__init__.py | ts170/OP-GAN | b9a6227aaa7befa2025ea1f07e62e7a7e9c7ce1e | [
"MIT"
] | null | null | null | from .PreEncoderRNN import PreEncoderRNN
from .DecoderRNN import DecoderRNN
from .seq2seq import Seq2seq
| 26.25 | 40 | 0.857143 |
4a0efbc86701f16a8e8aa4c4412839e7e00ece7e | 4,026 | py | Python | stratatools/crypto.py | bvanheu/stratasys | a67797f5b5dad066dd93fec0d7cd9e2992c2c452 | [
"BSD-3-Clause"
] | 38 | 2015-01-02T09:23:11.000Z | 2018-01-12T11:33:03.000Z | stratatools/crypto.py | bvanheu/stratasys | a67797f5b5dad066dd93fec0d7cd9e2992c2c452 | [
"BSD-3-Clause"
] | 45 | 2015-01-04T06:14:32.000Z | 2017-12-06T10:44:44.000Z | stratatools/crypto.py | bvanheu/stratasys | a67797f5b5dad066dd93fec0d7cd9e2992c2c452 | [
"BSD-3-Clause"
] | 26 | 2015-02-20T17:58:32.000Z | 2017-11-30T07:40:00.000Z | #
# See the LICENSE file
#
import binascii
from Crypto.Cipher import DES
from Crypto.Util.strxor import strxor
class Crypto():
def __init__(self):
pass
def encrypt(self, key, plaintext):
pass
def decrypt(self, key, ciphertext):
pass
class Desx_Crypto(Crypto):
def __init__(se... | 41.081633 | 136 | 0.616741 |
4a0efc388bb3d2b256b90765ad1b89f62e4413bf | 2,130 | py | Python | logic/menu_info_logic.py | wuxh123/my_bottle | 06cd7cda43b5d7db7522f76e65631510dada1329 | [
"Apache-2.0"
] | 3 | 2019-02-28T06:44:56.000Z | 2022-03-23T12:26:42.000Z | code/logic/menu_info_logic.py | kadycui/BottleAdmin | 427a0fa8a63680b49565d131f3f4f6aac228efad | [
"MIT"
] | null | null | null | code/logic/menu_info_logic.py | kadycui/BottleAdmin | 427a0fa8a63680b49565d131f3f4f6aac228efad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from logic import _logic_base
from config import db_config
from common import encrypt_helper, cache_helper
class MenuInfoLogic(_logic_base.LogicBase):
"""菜单管理表逻辑类"""
def __init__(self):
# 表名称
self.__table_name = 'menu_info'
# 初始化
_logic_ba... | 32.769231 | 102 | 0.603756 |
4a0efcc6fa3dded907138a64f3cf750ed758ce63 | 5,962 | py | Python | dags/email_to_bigquery_dag.py | Ressmann/starthinker | 301c5cf17e382afee346871974ca2f4ae905a94a | [
"Apache-2.0"
] | 138 | 2018-11-28T21:42:44.000Z | 2022-03-30T17:26:35.000Z | dags/email_to_bigquery_dag.py | Ressmann/starthinker | 301c5cf17e382afee346871974ca2f4ae905a94a | [
"Apache-2.0"
] | 36 | 2019-02-19T18:33:20.000Z | 2022-01-24T18:02:44.000Z | dags/email_to_bigquery_dag.py | Ressmann/starthinker | 301c5cf17e382afee346871974ca2f4ae905a94a | [
"Apache-2.0"
] | 54 | 2018-12-06T05:47:32.000Z | 2022-02-21T22:01:01.000Z | ###########################################################################
#
# 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
#
# https://www.apache.org/l... | 44.827068 | 199 | 0.618752 |
4a0efcf875b3b168efcd45a64564485a78987ba7 | 3,788 | py | Python | jetengine/query_builder/field_list.py | kpdemetriou/jetengine | 1b931efb4a4b0ad7a473773aa6fcf0677c71f122 | [
"BSD-3-Clause"
] | 5 | 2019-06-24T08:57:42.000Z | 2021-12-17T22:58:08.000Z | jetengine/query_builder/field_list.py | kpdemetriou/jetengine | 1b931efb4a4b0ad7a473773aa6fcf0677c71f122 | [
"BSD-3-Clause"
] | 1 | 2020-02-24T15:04:13.000Z | 2020-07-31T11:47:44.000Z | jetengine/query_builder/field_list.py | kpdemetriou/jetengine | 1b931efb4a4b0ad7a473773aa6fcf0677c71f122 | [
"BSD-3-Clause"
] | 3 | 2019-11-07T13:57:40.000Z | 2021-12-17T22:58:00.000Z | from jetengine.query_builder.transform import transform_field_list_query
__all__ = ("QueryFieldList",)
class QueryFieldList(object):
"""Object that handles combinations of .only() and .exclude() calls"""
ONLY = 1
EXCLUDE = 0
def __init__(self, fields=None, value=ONLY, always_include=None, _only_cal... | 33.821429 | 89 | 0.585005 |
4a0eff45f4483c183b95c8dfa5afb699cab805f8 | 4,774 | py | Python | mosse2.py | mintaka33/visual-object-tracking | d7583881dc21140b9cbc200a68ef6be3f306aaa4 | [
"MIT"
] | 1 | 2022-01-21T02:10:47.000Z | 2022-01-21T02:10:47.000Z | mosse2.py | mintaka33/gpu-object-tracking | d7583881dc21140b9cbc200a68ef6be3f306aaa4 | [
"MIT"
] | null | null | null | mosse2.py | mintaka33/gpu-object-tracking | d7583881dc21140b9cbc200a68ef6be3f306aaa4 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import cv2
def rnd_warp(a):
h, w = a.shape[:2]
T = np.zeros((2, 3))
coef = 0.2
ang = (np.random.rand()-0.5)*coef
c, s = np.cos(ang), np.sin(ang)
T[:2, :2] = [[c,-s], [s, c]]
T[:2, :2] += (np.random.rand(2, 2) - 0.5)*coef
c = (w/2, h/2)
T[:,2] = c - np.d... | 33.619718 | 95 | 0.52367 |
4a0eff93a066787b937cfd616b95b4a146b4ae3d | 26,667 | py | Python | tests/integration/test_lambda.py | anghami/localstack | 6113d9f588b145a3b3ac3bf4da64f73b8529dd76 | [
"Apache-2.0"
] | 4 | 2019-01-12T22:48:24.000Z | 2019-12-10T06:56:17.000Z | tests/integration/test_lambda.py | anghami/localstack | 6113d9f588b145a3b3ac3bf4da64f73b8529dd76 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_lambda.py | anghami/localstack | 6113d9f588b145a3b3ac3bf4da64f73b8529dd76 | [
"Apache-2.0"
] | 1 | 2021-08-24T21:23:22.000Z | 2021-08-24T21:23:22.000Z | import re
import os
import json
import time
import unittest
from io import BytesIO
from requests.models import Response
from localstack import config
from localstack.constants import LOCALSTACK_ROOT_FOLDER, LOCALSTACK_MAVEN_VERSION
from localstack.utils import testutil
from localstack.utils.aws import aws_stack
from lo... | 38.204871 | 108 | 0.665354 |
4a0f002191d74bb50bea698bd5937724a5cff101 | 1,648 | py | Python | gamer_registration_system/con/tests/test_models.py | splummer/gamer_reg | 7cccbbf8e6e52e46594c8128a7e7a523b8202f03 | [
"MIT"
] | null | null | null | gamer_registration_system/con/tests/test_models.py | splummer/gamer_reg | 7cccbbf8e6e52e46594c8128a7e7a523b8202f03 | [
"MIT"
] | null | null | null | gamer_registration_system/con/tests/test_models.py | splummer/gamer_reg | 7cccbbf8e6e52e46594c8128a7e7a523b8202f03 | [
"MIT"
] | null | null | null | import pytest
import datetime
from django.test import TestCase
from django.utils import timezone
from gamer_registration_system.con.models import Convention, Event, EventSchedule
# Create your tests here.
class EventScheduleModelTests(TestCase):
new_con = Convention(convention_name='Test Future Con')
new_eve... | 43.368421 | 95 | 0.723908 |
4a0f00f6b661a2359cb63e23fdb1b3a23f2bf818 | 15,409 | py | Python | aioesphomeapi/client.py | bdraco/aioesphomeapi | d285c26b16b7a9996f3cfd3d32e0e4516afb454a | [
"MIT"
] | null | null | null | aioesphomeapi/client.py | bdraco/aioesphomeapi | d285c26b16b7a9996f3cfd3d32e0e4516afb454a | [
"MIT"
] | 6 | 2021-11-26T12:15:29.000Z | 2022-03-31T12:20:03.000Z | aioesphomeapi/client.py | bdraco/aioesphomeapi | d285c26b16b7a9996f3cfd3d32e0e4516afb454a | [
"MIT"
] | null | null | null | import logging
from typing import Any, Callable, Optional, Tuple
import aioesphomeapi.api_pb2 as pb
from aioesphomeapi.connection import APIConnection, ConnectionParams
from aioesphomeapi.core import APIConnectionError
from aioesphomeapi.model import *
_LOGGER = logging.getLogger(__name__)
class APIClient:
def ... | 37.309927 | 113 | 0.564735 |
4a0f0178d5d2c991ea2eafe0fd2464101571a550 | 2,548 | py | Python | easilyb/terminal.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | easilyb/terminal.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | easilyb/terminal.py | xaled/easilyb | cdb5f738205f700b37e03c50d04061a2d1e730cc | [
"MIT"
] | null | null | null | import sys
COLORS = {
'blue': '\033[94m',
'green': '\033[92m',
'yellow': '\033[93m',
'red': '\033[91m',
}
END_COLOR = '\033[0m'
def cprint(*args, sep=' ', end='\n', file=None, color=None):
file = file or sys.stdout
if color is not None and color in COLORS:
args = list(args)
arg... | 32.666667 | 117 | 0.598901 |
4a0f0282b864c599c95b7425264e389867317025 | 1,520 | py | Python | tests/implementation/testsuites/smoke_tests/edentest_smoke.py | whanderley/eden | 08ced3be3d52352c54cbd412ed86128fbb68b1d2 | [
"MIT"
] | 205 | 2015-01-20T08:26:09.000Z | 2022-03-27T19:59:33.000Z | tests/implementation/testsuites/smoke_tests/edentest_smoke.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | 249 | 2015-02-10T09:56:35.000Z | 2022-03-23T19:54:36.000Z | tests/implementation/testsuites/smoke_tests/edentest_smoke.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | 231 | 2015-02-10T09:33:17.000Z | 2022-02-18T19:56:05.000Z | # -*- coding: utf-8 -*-
SKIP_PROTOCOLS = ("javascript",
"ftp",
)
class edentest_smoke(object):
""" Smoke Test, visit every link it can find and report on the outcome """
def __init__(self, base_url, do_not_follow, ext_links):
self.base_url = base_url
self.d... | 24.516129 | 80 | 0.574342 |
4a0f04a34a488f856a6ca6637628226bdea93a6d | 24 | py | Python | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Rounding and clipping/clip Clip (limit) the values in an array.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Rounding and clipping/clip Clip (limit) the values in an array.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/NumPy/Vectorized (universal) functions/Rounding and clipping/clip Clip (limit) the values in an array.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | np.clip(a, a_min, a_max) | 24 | 24 | 0.708333 |
4a0f054a29b2817babcfacd2adf72084869d07d4 | 4,012 | py | Python | sauron/__init__.py | bantini/Sauron | 131079fe66ea184ae3add4ea8124b2e0f0e8937e | [
"Apache-2.0"
] | null | null | null | sauron/__init__.py | bantini/Sauron | 131079fe66ea184ae3add4ea8124b2e0f0e8937e | [
"Apache-2.0"
] | null | null | null | sauron/__init__.py | bantini/Sauron | 131079fe66ea184ae3add4ea8124b2e0f0e8937e | [
"Apache-2.0"
] | null | null | null |
from sauron.machine_monitor import MachineMonitor
from sauron.ping_monitor import PingMonitor
from sauron.process_monitor import ProcessMonitor
from sauron.stat_aggregator import machine_stat_aggregator, ping_stat_aggregator, process_stat_aggregator
from sauron.machine_warning_generator import *
from sauron.ping_warn... | 38.951456 | 105 | 0.671236 |
4a0f05a856b6171880167cb4358f828104143672 | 484 | py | Python | wtforms_widgets/base_form.py | agdsn/wtforms-widgets | 60db4a00376dffa359e8e9e8ff0c9828363b9c4c | [
"Apache-2.0"
] | 2 | 2021-03-21T07:11:47.000Z | 2021-04-26T22:54:44.000Z | wtforms_widgets/base_form.py | agdsn/wtforms-widgets | 60db4a00376dffa359e8e9e8ff0c9828363b9c4c | [
"Apache-2.0"
] | 4 | 2020-06-07T21:29:42.000Z | 2021-08-24T02:48:18.000Z | wtforms_widgets/base_form.py | agdsn/wtforms-widgets | 60db4a00376dffa359e8e9e8ff0c9828363b9c4c | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from flask_wtf import FlaskForm as Form
class BaseForm(Form):
def __iter__(self):
field_order = getattr(self, '_order', [])
if field_order:
ordered_fields = OrderedDict()
for name in field_order:
ordered_fields[name] = ... | 23.047619 | 61 | 0.634298 |
4a0f067fb82846b91860009d2a5b771a40d9f2e9 | 219 | py | Python | core/model/search_result_model.py | averak/google-results-extractor | 9585a8836d3169db6537a420df22a441692381f2 | [
"MIT"
] | null | null | null | core/model/search_result_model.py | averak/google-results-extractor | 9585a8836d3169db6537a420df22a441692381f2 | [
"MIT"
] | null | null | null | core/model/search_result_model.py | averak/google-results-extractor | 9585a8836d3169db6537a420df22a441692381f2 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
class SearchResultModel(BaseModel):
title: str
url: str
def __eq__(self, other):
return self.url == other.url
def __hash__(self):
return hash(self.url)
| 16.846154 | 36 | 0.652968 |
4a0f0824a76d7a8d2282d7e498bd8706cea0caa4 | 2,191 | py | Python | pontoon/tags/utils/translations.py | timvisee/pontoon | aec1ef7b5c5d56c3be28fecf1147945d2622bbad | [
"BSD-3-Clause"
] | null | null | null | pontoon/tags/utils/translations.py | timvisee/pontoon | aec1ef7b5c5d56c3be28fecf1147945d2622bbad | [
"BSD-3-Clause"
] | 4 | 2021-01-12T12:00:43.000Z | 2021-12-13T20:49:04.000Z | pontoon/tags/utils/translations.py | sa-tasche/pontoon | f02cb9e92add6c035b1cbe66c301afcd95ae0489 | [
"BSD-3-Clause"
] | 3 | 2017-10-15T13:15:47.000Z | 2018-10-10T09:03:19.000Z | from django.db.models import Max, Q
from .base import TagsTRTool
class TagsLatestTranslationsTool(TagsTRTool):
"""For given filters this tool will find the latest ``Translations``
for a ``Tag``. It uses TranslatedResources to find the translations
but returns translations.
"""
filter_methods = (... | 32.220588 | 84 | 0.582382 |
4a0f08a367f80c2130959f95b84825c704caee49 | 2,419 | py | Python | sdk/scheduler/azure-mgmt-scheduler/tests/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/scheduler/azure-mgmt-scheduler/tests/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/scheduler/azure-mgmt-scheduler/tests/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 47.431373 | 101 | 0.733774 |
4a0f08d3f9574c6c21fb445481ca0fca0fcd514f | 15,376 | py | Python | wiji/worker.py | komuw/xyzabc | 80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0 | [
"MIT"
] | 4 | 2019-07-23T20:40:46.000Z | 2019-08-16T15:30:54.000Z | wiji/worker.py | komuw/wiji | 80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0 | [
"MIT"
] | 73 | 2019-02-28T10:16:12.000Z | 2019-07-25T00:53:38.000Z | wiji/worker.py | komuw/xyzabc | 80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0 | [
"MIT"
] | 1 | 2019-08-16T15:31:06.000Z | 2019-08-16T15:31:06.000Z | import os
import json
import time
import random
import string
import typing
import logging
import asyncio
import datetime
from . import task
from . import protocol
from . import watchdog
from . import ratelimiter
class Worker:
"""
The only time this worker coroutine should ever raise an Exception is either:
... | 38.536341 | 105 | 0.524129 |
4a0f094a46dd62973c6ab900b9a819d17409fd21 | 2,579 | py | Python | docs/conf.py | mkurop/kmeanspp | 7944372b14a24c7b7c1a99839cf8d35aedd21dbb | [
"MIT"
] | null | null | null | docs/conf.py | mkurop/kmeanspp | 7944372b14a24c7b7c1a99839cf8d35aedd21dbb | [
"MIT"
] | null | null | null | docs/conf.py | mkurop/kmeanspp | 7944372b14a24c7b7c1a99839cf8d35aedd21dbb | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.934211 | 139 | 0.633191 |
4a0f0b4421291fdd5cc8eebdeeeb8430e0e96b30 | 4,027 | py | Python | vendor/tweepy/cursor.py | aragilar/NewsBlur | 64ecd83bf4cea175f1bdeeb6e475fd5cadb679c9 | [
"MIT"
] | 18 | 2015-07-29T07:14:41.000Z | 2021-05-31T16:10:49.000Z | tweepy/cursor.py | Kudo/tweepy | bda2cf3c42013bfa5061bf44c37ec44689ab5d28 | [
"MIT"
] | null | null | null | tweepy/cursor.py | Kudo/tweepy | bda2cf3c42013bfa5061bf44c37ec44689ab5d28 | [
"MIT"
] | 8 | 2016-02-05T10:13:40.000Z | 2020-11-10T14:36:31.000Z | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from tweepy.error import TweepError
class Cursor(object):
"""Pagination helper class"""
def __init__(self, method, *args, **kargs):
if hasattr(method, 'pagination_mode'):
if method.pagination_mode == 'cursor':
... | 31.217054 | 86 | 0.599702 |
4a0f0b61c3fdc9e43d8973c8eabd399136060715 | 1,747 | py | Python | samples/core/loop_parameter/loop_parameter_test.py | algs/pipelines | ab63956f3a61d4d11b27ac26f097e1784588fed9 | [
"Apache-2.0"
] | 1 | 2020-12-20T11:26:00.000Z | 2020-12-20T11:26:00.000Z | samples/core/loop_parameter/loop_parameter_test.py | algs/pipelines | ab63956f3a61d4d11b27ac26f097e1784588fed9 | [
"Apache-2.0"
] | null | null | null | samples/core/loop_parameter/loop_parameter_test.py | algs/pipelines | ab63956f3a61d4d11b27ac26f097e1784588fed9 | [
"Apache-2.0"
] | 1 | 2022-01-11T17:02:22.000Z | 2022-01-11T17:02:22.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.978261 | 161 | 0.709788 |
4a0f0c0f3a5d4bd1e047c4b5f6488516b3dddcf1 | 1,395 | py | Python | mqtt_client.py | AngelLiang/RabbitMQ-MQTT-Consumer-Demo | 161e1622af5379776e6408a6f1bceb4bf57d40ea | [
"MIT"
] | null | null | null | mqtt_client.py | AngelLiang/RabbitMQ-MQTT-Consumer-Demo | 161e1622af5379776e6408a6f1bceb4bf57d40ea | [
"MIT"
] | null | null | null | mqtt_client.py | AngelLiang/RabbitMQ-MQTT-Consumer-Demo | 161e1622af5379776e6408a6f1bceb4bf57d40ea | [
"MIT"
] | null | null | null | # coding=utf-8
try:
import paho.mqtt.client as mqtt
except Exception:
print('Please install paho-mqtt')
print('pip install paho-mqtt')
exit(0)
MQTT_HOST = "127.0.0.1"
MQTT_PORT = 1883
MQTT_CLIENT_ID = 'python_mqtt_client'
MQTT_USERNAME = 'guest'
MQTT_PASSWORD = 'guest'
MQTT_KEEPALIVE = 120
MQTT_SUB_... | 22.142857 | 55 | 0.637993 |
4a0f0d3b9109eed3c3036e6bad35261f86ea105f | 11,848 | py | Python | pymc3/tests/test_examples.py | acolombi/pymc3 | 3cb45700156b63e786eb70909d3e1d6e1f21703a | [
"Apache-2.0"
] | 1 | 2018-06-11T03:13:00.000Z | 2018-06-11T03:13:00.000Z | pymc3/tests/test_examples.py | shunanzhang/pymc3 | fde52a4a69be1b0887a2f7861801fb48c941bbe6 | [
"Apache-2.0"
] | 2 | 2017-03-02T05:56:13.000Z | 2019-12-06T19:15:42.000Z | pymc3/tests/test_examples.py | shunanzhang/pymc3 | fde52a4a69be1b0887a2f7861801fb48c941bbe6 | [
"Apache-2.0"
] | 1 | 2018-10-08T10:27:35.000Z | 2018-10-08T10:27:35.000Z | import matplotlib
import numpy as np
import pandas as pd
import pymc3 as pm
import theano.tensor as tt
import pytest
import theano
from pymc3.theanof import floatX
from .helpers import SeededTest
matplotlib.use('Agg', warn=False)
def get_city_data():
"""Helper to get city data"""
data = pd.read_csv(pm.get_d... | 38.592834 | 129 | 0.582799 |
4a0f0e7d7176225d45bc8b8cb8e200f71fa45283 | 289 | py | Python | iris_sdk/models/maps/lnpchecker_response.py | NumberAI/python-bandwidth-iris | 0e05f79d68b244812afb97e00fd65b3f46d00aa3 | [
"MIT"
] | 2 | 2020-04-13T13:47:59.000Z | 2022-02-23T20:32:41.000Z | iris_sdk/models/maps/lnpchecker_response.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2020-09-18T20:59:24.000Z | 2021-08-25T16:51:42.000Z | iris_sdk/models/maps/lnpchecker_response.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2018-12-12T14:39:50.000Z | 2020-11-17T21:42:29.000Z | #!/usr/bin/env python
from iris_sdk.models.maps.base_map import BaseMap
class LnpCheckerResponseMap(BaseMap):
partner_supported_rate_centers = None
portable_numbers = None
supported_losing_carriers = None
supported_rate_centers = None
unsupported_rate_centers = None | 26.272727 | 49 | 0.788927 |
4a0f0e9c4ab7a2bda70baf84112d05bd5e2d90b4 | 1,780 | py | Python | src/dr_data/utilities/db.py | sunnysidesounds/dr-data | 764e577a3a97144ad73ea1ada2ead9cbfebe5a37 | [
"MIT"
] | 4 | 2022-01-05T22:53:16.000Z | 2022-01-25T23:52:42.000Z | src/dr_data/utilities/db.py | sunnysidesounds/dr_data | 764e577a3a97144ad73ea1ada2ead9cbfebe5a37 | [
"MIT"
] | null | null | null | src/dr_data/utilities/db.py | sunnysidesounds/dr_data | 764e577a3a97144ad73ea1ada2ead9cbfebe5a37 | [
"MIT"
] | null | null | null | import logging
import sys
import psycopg2
from dr_data.static_strings import *
__author__ = AUTHOR
__copyright__ = COPYRIGHT
__license__ = LICENSE
_logger = logging.getLogger(__name__)
logging.basicConfig(format='%(message)s', stream=sys.stdout, level=logging.INFO)
class DatabaseUtility:
"""
Database utilit... | 31.22807 | 94 | 0.582584 |
4a0f0ebebcb2129d3fa0adcfb270f332acaa9bd0 | 6,750 | py | Python | steam/errors.py | smtp639/steam.py | bd67e8d91ac17984ef0657fa4625eb2fca81fb68 | [
"MIT"
] | null | null | null | steam/errors.py | smtp639/steam.py | bd67e8d91ac17984ef0657fa4625eb2fca81fb68 | [
"MIT"
] | null | null | null | steam/errors.py | smtp639/steam.py | bd67e8d91ac17984ef0657fa4625eb2fca81fb68 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2020 James
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 29.735683 | 114 | 0.645778 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.