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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4b886e49621f6e4b1aa79d7b17936a6913a207bf | 6,750 | py | Python | plugins/callback.py | NickxFury/MusicPlayer | d40c0a7110c9e79450066e0611a32b2c88bef065 | [
"MIT"
] | null | null | null | plugins/callback.py | NickxFury/MusicPlayer | d40c0a7110c9e79450066e0611a32b2c88bef065 | [
"MIT"
] | null | null | null | plugins/callback.py | NickxFury/MusicPlayer | d40c0a7110c9e79450066e0611a32b2c88bef065 | [
"MIT"
] | 3 | 2021-06-24T10:48:40.000Z | 2021-06-27T08:17:06.000Z | #MIT License
#Copyright (c) 2021 SUBIN
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distr... | 35.904255 | 98 | 0.538222 |
cabfb786ec4450c304662067813870013472a327 | 2,060 | py | Python | utils/wifi_hd_detector.py | lanfis/WiFi_Monitor | e3426b5cae1113a8ea769bb0171318fc7f0cf051 | [
"MIT"
] | null | null | null | utils/wifi_hd_detector.py | lanfis/WiFi_Monitor | e3426b5cae1113a8ea769bb0171318fc7f0cf051 | [
"MIT"
] | null | null | null | utils/wifi_hd_detector.py | lanfis/WiFi_Monitor | e3426b5cae1113a8ea769bb0171318fc7f0cf051 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# license removed for brevity
import os
import sys
current_folder = os.path.dirname(os.path.realpath(__file__))
sys.path.append(current_folder)
import numpy as np
from sys_utils import SYS_UTILS
from console_formatter import Console_Formatter
class WIFI_HD_DETECTOR:
sys_util = SY... | 34.915254 | 157 | 0.566019 |
a9b9c2bc1c890be6da275476c479b91c2f2d01e0 | 1,855 | py | Python | migrations/versions/7f26a631305e_initial_migration.py | Charles-Ndugire/personal-blog | a56a80ea7602b713d08724d33636bf4e69fc9b06 | [
"MIT"
] | null | null | null | migrations/versions/7f26a631305e_initial_migration.py | Charles-Ndugire/personal-blog | a56a80ea7602b713d08724d33636bf4e69fc9b06 | [
"MIT"
] | 1 | 2021-06-02T00:27:22.000Z | 2021-06-02T00:27:22.000Z | migrations/versions/7f26a631305e_initial_migration.py | Charles-Ndugire/personal-blog | a56a80ea7602b713d08724d33636bf4e69fc9b06 | [
"MIT"
] | null | null | null | """initial migration
Revision ID: 7f26a631305e
Revises:
Create Date: 2019-09-23 09:55:08.493546
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7f26a631305e'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... | 31.982759 | 65 | 0.663073 |
14afa56ed0ba08d9655447b62aeba29eb146274d | 22,166 | py | Python | lib/python/pyflyby/_file.py | rsaim/pyflyby | eb7c1ea938de3f48c508c921553d85c3b3648587 | [
"BSD-3-Clause"
] | null | null | null | lib/python/pyflyby/_file.py | rsaim/pyflyby | eb7c1ea938de3f48c508c921553d85c3b3648587 | [
"BSD-3-Clause"
] | null | null | null | lib/python/pyflyby/_file.py | rsaim/pyflyby | eb7c1ea938de3f48c508c921553d85c3b3648587 | [
"BSD-3-Clause"
] | null | null | null | # pyflyby/_file.py.
# Copyright (C) 2011, 2012, 2013, 2014, 2015 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT
from __future__ import absolute_import, division, with_statement
import os
import re
import sys
from pyflyby._util import cached_attribute, memoize
class UnsafeFilenameError(Val... | 31.620542 | 84 | 0.565957 |
d4662dbc197fd4e89d89a342e0ad3c7ab25628cb | 1,161 | py | Python | src/lexer/tokens.py | tetrica/compiladores_1 | 85bf37798054f406d144368e1984fd9804bf8891 | [
"MIT"
] | 2 | 2019-04-17T17:48:25.000Z | 2019-06-07T23:46:55.000Z | src/lexer/tokens.py | tetrica/compiladores_1 | 85bf37798054f406d144368e1984fd9804bf8891 | [
"MIT"
] | 2 | 2019-04-17T17:49:58.000Z | 2019-09-10T12:28:30.000Z | src/lexer/tokens.py | tetrica/compiladores_1 | 85bf37798054f406d144368e1984fd9804bf8891 | [
"MIT"
] | null | null | null | from collections import namedtuple
from enum import Enum, auto
from .global_vars import *
_token = namedtuple('Token', [
'content',
'token_type',
'line'
])
def __token_to_string(obj):
return f"T<'{obj.content}', {obj.token_type}>"
def __token_equals(token, toke_other):
same_content = toke_other.c... | 23.22 | 57 | 0.665805 |
30d02834b92a228b9fd97b7afd233b63c7dbd162 | 109 | py | Python | tests/cv/__init__.py | stateoftheartai/sotaai | 1d01a385f115c567ad55eb10bdae16c1437978a1 | [
"MIT"
] | 23 | 2021-05-23T09:32:36.000Z | 2021-12-22T16:44:21.000Z | tests/cv/__init__.py | stateoftheartai/sotaai | 1d01a385f115c567ad55eb10bdae16c1437978a1 | [
"MIT"
] | null | null | null | tests/cv/__init__.py | stateoftheartai/sotaai | 1d01a385f115c567ad55eb10bdae16c1437978a1 | [
"MIT"
] | 1 | 2021-08-19T22:37:18.000Z | 2021-08-19T22:37:18.000Z | # -*- coding: utf-8 -*-
# Author: Hugo Ochoa <hugo@stateoftheart.ai>
# Copyright: Stateoftheart AI PBC 2020.
| 27.25 | 44 | 0.688073 |
d9ea34232877ccdb856acc8cc671bf8330955353 | 804 | py | Python | demo2/webapp/app.py | dinara92/python-grpc-demo | 9a8776c39a938591cd0ee56173450b65c19bebba | [
"MIT"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | demo2/webapp/app.py | belajarqywok/python-grpc-demo | 1e64fa6438c7f997edf9f82de8e855772d86fba8 | [
"MIT"
] | null | null | null | demo2/webapp/app.py | belajarqywok/python-grpc-demo | 1e64fa6438c7f997edf9f82de8e855772d86fba8 | [
"MIT"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | from flask import Flask, Response
import sys
from google.protobuf.json_format import MessageToJson
from client_wrapper import ServiceClient
import users_pb2_grpc as users_service
import users_types_pb2 as users_messages
app = Flask(__name__)
app.config['users'] = ServiceClient(users_service, 'UsersStub', 'localhost'... | 29.777778 | 83 | 0.720149 |
22ca3460adff11bf359c7353bb8ec2aea5d2f73b | 4,117 | py | Python | stackinabox/util/responses/decorator.py | BenjamenMeyer/stackInABox | 005a3e3f40ae7b7f14fae24d07768731e0ac948e | [
"Apache-2.0"
] | 5 | 2015-02-02T22:02:55.000Z | 2016-02-03T21:58:12.000Z | stackinabox/util/responses/decorator.py | TestInABox/stackInABox | 15586e61a2013b6f4997c652e8412a1784f8fc93 | [
"Apache-2.0"
] | 43 | 2016-05-07T04:08:52.000Z | 2022-03-16T23:43:36.000Z | stackinabox/util/responses/decorator.py | TestInABox/stackInABox | 15586e61a2013b6f4997c652e8412a1784f8fc93 | [
"Apache-2.0"
] | 3 | 2016-05-05T18:05:36.000Z | 2022-03-23T17:41:41.000Z | """
Stack-In-A-Box: Responses Support via decorator
"""
try:
import collections.abc as collections
except ImportError:
# Py2.7 Support
import collections
import functools
import logging
import re
import types
import responses
import six
from stackinabox.services.service import StackInABoxService
from sta... | 30.723881 | 76 | 0.616468 |
bb423d0a8ccfaa6581a60ffb17a7eccf81943e01 | 5,253 | py | Python | venv/lib/python3.8/site-packages/azure/mgmt/recoveryservicesbackup/operations/_backup_jobs_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azure/mgmt/recoveryservicesbackup/operations/_backup_jobs_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azure/mgmt/recoveryservicesbackup/operations/_backup_jobs_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 ... | 43.057377 | 164 | 0.636018 |
fe438ea6aea7482ba0181c0bb35aa4b627081ea1 | 17,870 | py | Python | homeassistant/components/number/__init__.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | homeassistant/components/number/__init__.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | homeassistant/components/number/__init__.py | mib1185/core | b17d4ac65cde9a27ff6032d70b148792e5eba8df | [
"Apache-2.0"
] | null | null | null | """Component to allow numeric input for platforms."""
from __future__ import annotations
from collections.abc import Callable
from contextlib import suppress
import dataclasses
from datetime import timedelta
import inspect
import logging
from math import ceil, floor
from typing import Any, Final, final
import voluptu... | 34.431599 | 109 | 0.64113 |
a7f0b4ad074338453d91c738269e543602e44bfe | 8,157 | py | Python | src/tools/telemetry/telemetry/core/browser_options.py | jxjnjjn/chromium | 435c1d02fd1b99001dc9e1e831632c894523580d | [
"Apache-2.0"
] | 9 | 2018-09-21T05:36:12.000Z | 2021-11-15T15:14:36.000Z | src/tools/telemetry/telemetry/core/browser_options.py | jxjnjjn/chromium | 435c1d02fd1b99001dc9e1e831632c894523580d | [
"Apache-2.0"
] | null | null | null | src/tools/telemetry/telemetry/core/browser_options.py | jxjnjjn/chromium | 435c1d02fd1b99001dc9e1e831632c894523580d | [
"Apache-2.0"
] | 3 | 2018-11-28T14:54:13.000Z | 2020-07-02T07:36:07.000Z | # Copyright (c) 2012 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.
import optparse
import sys
import shlex
import logging
import copy
from telemetry.core import browser_finder
from telemetry.core import profile_types
fro... | 39.985294 | 80 | 0.66777 |
dc71f03a0a38890683b9c048d8fba75303cdd983 | 5,017 | py | Python | apns_clerk/backends/dummy.py | razor-1/apns-clerk | 807c1166d463d9be022eedf69ce9be0bf776f096 | [
"Apache-2.0"
] | null | null | null | apns_clerk/backends/dummy.py | razor-1/apns-clerk | 807c1166d463d9be022eedf69ce9be0bf776f096 | [
"Apache-2.0"
] | null | null | null | apns_clerk/backends/dummy.py | razor-1/apns-clerk | 807c1166d463d9be022eedf69ce9be0bf776f096 | [
"Apache-2.0"
] | 1 | 2019-12-17T18:45:13.000Z | 2019-12-17T18:45:13.000Z | # Author Aleksi Hoffman
# Based on apns-client implementation by Sardar Yumatov
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 33.671141 | 110 | 0.631852 |
06889b42d54bdf04c4f4cb8bc3f5e6a1c2228a53 | 2,220 | py | Python | MRCVolume_viewer.py | dzyla/MRCVolume_viewer | 1e4c364360ecef94a0b351cde5951e7efe6db033 | [
"MIT"
] | null | null | null | MRCVolume_viewer.py | dzyla/MRCVolume_viewer | 1e4c364360ecef94a0b351cde5951e7efe6db033 | [
"MIT"
] | null | null | null | MRCVolume_viewer.py | dzyla/MRCVolume_viewer | 1e4c364360ecef94a0b351cde5951e7efe6db033 | [
"MIT"
] | null | null | null | import numpy as np
from vtkplotter import *
import mrcfile
import argparse
def open_mrcs_file(file_path):
with mrcfile.open(file_path) as mrc_stack:
return mrc_stack.data
def slider(widget, event):
# get the slider position and calculate the value based on the volume scalar data
val... | 33.134328 | 94 | 0.703153 |
1582454e8e282c35ad383ddfde6066cfe5360743 | 17,784 | py | Python | extern_tools/mmd_tools_local/operators/model.py | FoxyTheKing/cats-blender-plugin | 1d795007fed1d1c176be93d57187d8d797579951 | [
"MIT"
] | 3 | 2021-11-03T15:14:35.000Z | 2021-12-10T05:35:38.000Z | extern_tools/mmd_tools_local/operators/model.py | Vapey/cats-blender-plugin | bbc081c504e4fbb28b89e4d0d3b8a716b00bc334 | [
"MIT"
] | null | null | null | extern_tools/mmd_tools_local/operators/model.py | Vapey/cats-blender-plugin | bbc081c504e4fbb28b89e4d0d3b8a716b00bc334 | [
"MIT"
] | 1 | 2020-10-26T23:01:58.000Z | 2020-10-26T23:01:58.000Z | # -*- coding: utf-8 -*-
import bpy
from bpy.types import Operator
from mmd_tools_local import register_wrap
from mmd_tools_local.bpyutils import SceneOp
from mmd_tools_local.core.bone import FnBone
from mmd_tools_local.translations import DictionaryEnum
import mmd_tools_local.core.model as mmd_model
@register_wrap
... | 36.896266 | 127 | 0.616678 |
3fe537543b76f0325353e51f67ba74f178cbe7eb | 4,902 | py | Python | supervisor/store/git.py | carver7/supervisor-master | e9802f92c9f77481276ed3c0d524427cc03e4271 | [
"Apache-2.0"
] | null | null | null | supervisor/store/git.py | carver7/supervisor-master | e9802f92c9f77481276ed3c0d524427cc03e4271 | [
"Apache-2.0"
] | null | null | null | supervisor/store/git.py | carver7/supervisor-master | e9802f92c9f77481276ed3c0d524427cc03e4271 | [
"Apache-2.0"
] | null | null | null | """Init file for Supervisor add-on Git."""
import asyncio
import functools as ft
import logging
from pathlib import Path
import shutil
import git
from ..const import ATTR_BRANCH, ATTR_URL, URL_HASSIO_ADDONS
from ..coresys import CoreSysAttributes
from ..validate import RE_REPOSITORY
from .utils import get_hash_from_r... | 29.890244 | 87 | 0.537536 |
77897cdc3e2c134000eab8657886bdde184c4c27 | 183 | py | Python | app/config/prod.py | david-ellinger/todo-api-python | 4de61dce4213f64514da5f5f06dd9e7e53d3dbdc | [
"MIT"
] | null | null | null | app/config/prod.py | david-ellinger/todo-api-python | 4de61dce4213f64514da5f5f06dd9e7e53d3dbdc | [
"MIT"
] | null | null | null | app/config/prod.py | david-ellinger/todo-api-python | 4de61dce4213f64514da5f5f06dd9e7e53d3dbdc | [
"MIT"
] | null | null | null | from app.config.base import Config as BaseConfig
class Config(BaseConfig):
DEBUG = False
SQLALCHEMY_DATABASE_URI = "postgresql+psycopg2://sa:password@postgres:5432/todo_db"
| 26.142857 | 87 | 0.775956 |
8bf857573457e9ddd2ba9c4e66e680a0ace73c27 | 41,992 | py | Python | net/views/image.py | bretmckee/astrometry.net | 49d083c46919e8f8fa00b3315fea76fe5b099228 | [
"Net-SNMP",
"Xnet"
] | null | null | null | net/views/image.py | bretmckee/astrometry.net | 49d083c46919e8f8fa00b3315fea76fe5b099228 | [
"Net-SNMP",
"Xnet"
] | null | null | null | net/views/image.py | bretmckee/astrometry.net | 49d083c46919e8f8fa00b3315fea76fe5b099228 | [
"Net-SNMP",
"Xnet"
] | 1 | 2021-03-28T07:52:40.000Z | 2021-03-28T07:52:40.000Z | from __future__ import print_function
import os
import math
import stat
import time
from datetime import datetime, timedelta
try:
# py3
from urllib.parse import urlencode
# from urllib.request import urlretrieve
except ImportError:
# py2
from urllib import urlencode
# from urllib import urlenco... | 35.556308 | 361 | 0.588588 |
152ab154bcc7233b46d915a9ccf8cc32792ecd7a | 2,497 | py | Python | src/prefect/utilities/aws.py | andykawabata/prefect | a11061c19847beeea26616ccaf4b404ad939676b | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-09-28T16:24:02.000Z | 2020-10-08T17:08:19.000Z | src/prefect/utilities/aws.py | andykawabata/prefect | a11061c19847beeea26616ccaf4b404ad939676b | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2021-06-28T20:33:49.000Z | 2022-02-27T10:58:04.000Z | src/prefect/utilities/aws.py | yalaudah/prefect | 2f7f92c39a4575119c3268b0415841c6aca5df60 | [
"Apache-2.0"
] | 2 | 2021-03-03T17:46:43.000Z | 2021-03-05T15:39:35.000Z | """
Utility functions for interacting with AWS.
"""
import prefect
import boto3
from typing import Any
def get_boto_client(
resource: str, credentials: dict = None, use_session: bool = False, **kwargs: Any
) -> "boto3.client":
"""
Utility function for loading boto3 client objects from a given set of cred... | 39.015625 | 130 | 0.671205 |
5fc329cbe9ccad077c54b1d0d7f069c1860e130f | 18,056 | py | Python | google/cloud/sql/v1/sql-v1-py/google/cloud/sql/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/sql/v1/sql-v1-py/google/cloud/sql/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/sql/v1/sql-v1-py/google/cloud/sql/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 54.715152 | 115 | 0.852847 |
d7fc502988b5bbc7543d990d08e7629334a29637 | 23,846 | py | Python | sdk/python/pulumi_azure/frontdoor/firewall_policy.py | davidobrien1985/pulumi-azure | 811beeea473bd798d77354521266a87a2fac5888 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/frontdoor/firewall_policy.py | davidobrien1985/pulumi-azure | 811beeea473bd798d77354521266a87a2fac5888 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/frontdoor/firewall_policy.py | davidobrien1985/pulumi-azure | 811beeea473bd798d77354521266a87a2fac5888 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Firewa... | 81.385666 | 303 | 0.68393 |
fe5804e8a5e3d01144b44b57782c5fea5b13dd95 | 8,697 | py | Python | data_tests/models.py | andrewbird2/django-data-tests | 9cc187d094e5e9ac18a41913861544a424c1eb9a | [
"MIT"
] | 2 | 2019-12-11T14:16:59.000Z | 2020-03-24T20:16:39.000Z | data_tests/models.py | andrewbird2/django-data-tests | 9cc187d094e5e9ac18a41913861544a424c1eb9a | [
"MIT"
] | null | null | null | data_tests/models.py | andrewbird2/django-data-tests | 9cc187d094e5e9ac18a41913861544a424c1eb9a | [
"MIT"
] | 1 | 2020-03-24T20:17:02.000Z | 2020-03-24T20:17:02.000Z | # -*- coding: utf-8 -*-
from functools import lru_cache
import logging
from django.apps import apps
from django.contrib.contenttypes import fields
from django.contrib.contenttypes.models import ContentType
from django.db import models, router
from django.urls import reverse
from model_utils.models import TimeStampedM... | 40.078341 | 121 | 0.655398 |
fe5365ef750c75eae7654c5bc4be7e2d71092ee7 | 6,277 | py | Python | test_pyconvcli_internal_cli/test_pyconvcli.py | jlepinski/pyconvcli | 1b7c0f0ef44be6675b03f82ee9ba36ec38220473 | [
"Apache-2.0"
] | 4 | 2020-12-08T20:49:38.000Z | 2022-03-20T09:48:03.000Z | test_pyconvcli_internal_cli/test_pyconvcli.py | jlepinski/pyconvcli | 1b7c0f0ef44be6675b03f82ee9ba36ec38220473 | [
"Apache-2.0"
] | 1 | 2021-01-01T01:04:28.000Z | 2021-01-01T01:04:28.000Z | test_pyconvcli_internal_cli/test_pyconvcli.py | jlepinski/pyconvcli | 1b7c0f0ef44be6675b03f82ee9ba36ec38220473 | [
"Apache-2.0"
] | 1 | 2022-03-20T09:48:41.000Z | 2022-03-20T09:48:41.000Z | import unittest
from pyconvcli import PyConvCli
import os
import sys
from contextlib import redirect_stdout
from io import StringIO
import pkg_resources
from argparse import ArgumentError
class TestPyConvCli(unittest.TestCase):
def test_update_parser_for_functions(self):
sys.argv = ['test_pyconvcli_inter... | 49.425197 | 131 | 0.665764 |
7ea5a587c89620d3eb45b1e977408b0414c80524 | 3,036 | py | Python | model/python/util/blocks.py | poojahira/nlu-winograd | 6ce7003b4cd800a4cdc4d75d4c577d1398f6c114 | [
"MIT"
] | 1 | 2018-12-22T08:34:02.000Z | 2018-12-22T08:34:02.000Z | model/python/util/blocks.py | poojahira/nlu-winograd | 6ce7003b4cd800a4cdc4d75d4c577d1398f6c114 | [
"MIT"
] | null | null | null | model/python/util/blocks.py | poojahira/nlu-winograd | 6ce7003b4cd800a4cdc4d75d4c577d1398f6c114 | [
"MIT"
] | 2 | 2018-04-18T04:13:43.000Z | 2020-01-30T23:33:15.000Z | """
Functions and components that can be slotted into tensorflow models.
TODO: Write functions for various types of attention.
"""
import tensorflow as tf
def length(sequence):
"""
Get true length of sequences (without padding), and mask for true-length in max-length.
Input of shape: (batch_size, max... | 35.717647 | 174 | 0.708827 |
89a632749236c852dbd4a86c99ec662957c4f851 | 12,380 | py | Python | research/RetrievalRE/models/gpt2/tokenization_gpt2.py | zjunlp/PromptKG | 791bf82390eeadc30876d9f95e8dd26cd05de3dc | [
"MIT"
] | 11 | 2022-02-04T12:32:37.000Z | 2022-03-25T11:49:48.000Z | research/RetrievalRE/models/gpt2/tokenization_gpt2.py | zjunlp/PromptKG | 791bf82390eeadc30876d9f95e8dd26cd05de3dc | [
"MIT"
] | null | null | null | research/RetrievalRE/models/gpt2/tokenization_gpt2.py | zjunlp/PromptKG | 791bf82390eeadc30876d9f95e8dd26cd05de3dc | [
"MIT"
] | 4 | 2022-02-04T05:08:23.000Z | 2022-03-16T02:07:52.000Z | # coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.
#
# 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
#
# ... | 39.935484 | 119 | 0.622859 |
cf329e5f66247bbca95e4bf363db6bddf61b921c | 1,046 | py | Python | DataAggregator/FIPS_Reference.py | Trigition/Village | bf22077f54e87be2dda1bf8984d0a62914e8e70f | [
"Apache-2.0"
] | 1 | 2017-05-17T15:28:52.000Z | 2017-05-17T15:28:52.000Z | DataAggregator/FIPS_Reference.py | Trigition/Village | bf22077f54e87be2dda1bf8984d0a62914e8e70f | [
"Apache-2.0"
] | null | null | null | DataAggregator/FIPS_Reference.py | Trigition/Village | bf22077f54e87be2dda1bf8984d0a62914e8e70f | [
"Apache-2.0"
] | null | null | null | FIPS_Reference = {
"AL":"01",
"AK":"02",
"AZ":"04",
"AR":"05",
"AS":"60",
"CA":"06",
"CO":"08",
"CT":"09",
"DE":"10",
"FL":"12",
"GA":"13",
"GU":"66",
"HI":"15",
"ID":"16",
"IL":"17",
"IN":"18... | 18.350877 | 18 | 0.219885 |
21a202c23d1794f48aa97e31838a01e2dc2f489f | 26,346 | py | Python | hphp/hack/test/verify.py | the-storm/hhvm | 8c173160bb6b8e56277a04d00efe4c1a234b605c | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | hphp/hack/test/verify.py | the-storm/hhvm | 8c173160bb6b8e56277a04d00efe4c1a234b605c | [
"PHP-3.01",
"Zend-2.0"
] | 1 | 2021-04-19T09:53:42.000Z | 2021-04-19T09:53:42.000Z | hphp/hack/test/verify.py | isabella232/hhvm | 6345684c993c575db92cbe18cd739147bfa0296f | [
"PHP-3.01",
"Zend-2.0"
] | null | null | null | #!/usr/bin/env python3
# pyre-strict
import argparse
import difflib
import os
import os.path
import re
import shlex
import subprocess
import sys
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Tuple
from hphp.hack.test.parse_errors... | 32.051095 | 88 | 0.620132 |
280612f1aebc0b511d88320c518a08e5b52d4333 | 1,979 | py | Python | spiderGUI.py | ConnorDFlynn/Group1PySpider | 8f2b8f161a544f59dcbdc3fbb572f4eb2b3be3b7 | [
"Apache-2.0"
] | null | null | null | spiderGUI.py | ConnorDFlynn/Group1PySpider | 8f2b8f161a544f59dcbdc3fbb572f4eb2b3be3b7 | [
"Apache-2.0"
] | null | null | null | spiderGUI.py | ConnorDFlynn/Group1PySpider | 8f2b8f161a544f59dcbdc3fbb572f4eb2b3be3b7 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Connor'
__author__ = 'Alex'
import webbrowser
import subprocess
from tkinter import * #Importing Tkinter package
class spiderGUI:
def __init__(self, master):
url = "http://localhost:5000" #WebUI Local Host Address
url2 = "http://pyspider.readthedocs.org/en/master/tutorial... | 42.106383 | 139 | 0.632137 |
1e0d268323b32c2c1ca8b4d1f3455b16bc50c804 | 207 | py | Python | contests/atcoder/abc179/abc179_c/main.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | contests/atcoder/abc179/abc179_c/main.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | contests/atcoder/abc179/abc179_c/main.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
from typing import *
# def solve(N: int) -> int:
def solve(N):
pass
def main():
N = int(input())
a = solve(N)
print(a)
if __name__ == '__main__':
main()
| 10.894737 | 27 | 0.536232 |
97e23a495bde4cb07a0f2a980e666be3fe8eb718 | 405 | py | Python | backend/kickOffProject/asgi.py | Dobro929/HSOS-SEP-PlantMap-2022 | 37a307c48c62ffe96672696f52a2ab2e420b102d | [
"BSD-3-Clause"
] | null | null | null | backend/kickOffProject/asgi.py | Dobro929/HSOS-SEP-PlantMap-2022 | 37a307c48c62ffe96672696f52a2ab2e420b102d | [
"BSD-3-Clause"
] | 2 | 2022-03-31T16:56:53.000Z | 2022-03-31T16:58:24.000Z | backend/kickOffProject/asgi.py | Dobro929/HSOS-SEP-PlantMap-2022 | 37a307c48c62ffe96672696f52a2ab2e420b102d | [
"BSD-3-Clause"
] | null | null | null | """
ASGI config for kickOffProject project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
55080f6578bd7eaa7571d068151d95a08103e643 | 6,240 | py | Python | src/dof/model/container.py | docker-forensics-toolkit/toolkit | c9bb176b15e26a82036d2292493a3ea789ed5144 | [
"Apache-2.0"
] | 39 | 2019-03-27T03:34:17.000Z | 2022-03-24T20:02:56.000Z | src/dof/model/container.py | docker-forensics-toolkit/toolkit | c9bb176b15e26a82036d2292493a3ea789ed5144 | [
"Apache-2.0"
] | 2 | 2019-04-07T11:57:38.000Z | 2021-01-23T14:06:30.000Z | src/dof/model/container.py | docker-forensics-toolkit/toolkit | c9bb176b15e26a82036d2292493a3ea789ed5144 | [
"Apache-2.0"
] | 7 | 2020-02-21T04:13:27.000Z | 2022-03-26T21:01:21.000Z | import collections
import json
from enum import Enum, auto
from pathlib import Path
import subprocess
from typing import List
from infrastructure.logging import trace
Volume = collections.namedtuple('Volume', 'source destination')
class ConfigVersion(Enum):
One = auto()
Two = auto()
class Container:
d... | 34.285714 | 117 | 0.642949 |
d0bab84d7e71b32b433ef3b8e3fc8e14230b81bc | 522 | py | Python | src/pwbus/transformations/_transform_json.py | fszostak/pwbus | 008893b039547eb886b04eea1b6177902b4d12ea | [
"MIT"
] | 1 | 2020-05-05T01:12:46.000Z | 2020-05-05T01:12:46.000Z | src/pwbus/transformations/_transform_json.py | fszostak/pwbus | 008893b039547eb886b04eea1b6177902b4d12ea | [
"MIT"
] | null | null | null | src/pwbus/transformations/_transform_json.py | fszostak/pwbus | 008893b039547eb886b04eea1b6177902b4d12ea | [
"MIT"
] | null | null | null | # PWBus - _TransformJSON Class
#:
#: maintainer: fabio.szostak@perfweb.com.br | Mon Nov 18 07:36:30 -03 2019
import traceback
from pwbus.commons.logging import *
from pwbus.transformations._transform import _Transform
class _TransformJSON(_Transform):
# _TransformJSON.parsein - return Dict
#
def parse... | 22.695652 | 75 | 0.722222 |
91e447f59899b898b3a85d8bdde00306d83e08b7 | 54,682 | py | Python | pybind/slxos/v17r_2_00/tm_state/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_2_00/tm_state/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v17r_2_00/tm_state/__init__.py | extremenetworks/pybind | 44c467e71b2b425be63867aba6e6fa28b2cfe7fb | [
"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... | 95.933333 | 918 | 0.76111 |
2d724b75e651c82f19e874c7b0d9aa84b5bd14f6 | 5,418 | py | Python | augraphy/augmentations/folding.py | RyonSayer/augraphy | be1e8dcf0f129ac3fc30ba1cad0d8de02443f67f | [
"MIT"
] | null | null | null | augraphy/augmentations/folding.py | RyonSayer/augraphy | be1e8dcf0f129ac3fc30ba1cad0d8de02443f67f | [
"MIT"
] | null | null | null | augraphy/augmentations/folding.py | RyonSayer/augraphy | be1e8dcf0f129ac3fc30ba1cad0d8de02443f67f | [
"MIT"
] | null | null | null | import random
import numpy as np
from augraphy.augmentations.lib import warp_fold_left_side
from augraphy.augmentations.lib import warp_fold_right_side
from augraphy.base.augmentation import Augmentation
class Folding(Augmentation):
"""Emulates folding effect from perspective transformation
:param fold_x: ... | 36.608108 | 234 | 0.587117 |
f66b3183f393220dd6616c5d48bba4a671025c5a | 17,700 | py | Python | clients/python/generated/pyaemcloudmanagerapi/api/repositories_api.py | shinesolutions/cloudmanager-api-clients | d73a25878f6cc57af954362ba8dccc90d54e6131 | [
"Apache-2.0"
] | 3 | 2020-06-23T05:31:52.000Z | 2020-11-26T05:34:57.000Z | clients/python/generated/pyaemcloudmanagerapi/api/repositories_api.py | shinesolutions/cloudmanager-api-clients | d73a25878f6cc57af954362ba8dccc90d54e6131 | [
"Apache-2.0"
] | 2 | 2021-01-21T01:19:54.000Z | 2021-12-09T22:30:22.000Z | clients/python/generated/pyaemcloudmanagerapi/api/repositories_api.py | shinesolutions/cloudmanager-api-clients | d73a25878f6cc57af954362ba8dccc90d54e6131 | [
"Apache-2.0"
] | 1 | 2020-11-18T11:48:13.000Z | 2020-11-18T11:48:13.000Z | # coding: utf-8
"""
Cloud Manager API
This API allows access to Cloud Manager programs, pipelines, and environments by an authorized technical account created through the Adobe I/O Console. The base url for this API is https://cloudmanager.adobe.io, e.g. to get the list of programs for an organization, you wo... | 53.636364 | 550 | 0.630395 |
e13f5dced0632b1dfa7c17cd70e5a09a41863015 | 865 | py | Python | test/test_encoding.py | codders/mitmproxy | 4f9deae8fc2b5f8b0519f82b1f3cdda6c115b475 | [
"MIT"
] | 3 | 2016-10-08T05:19:11.000Z | 2020-05-29T20:08:56.000Z | test/test_encoding.py | codders/mitmproxy | 4f9deae8fc2b5f8b0519f82b1f3cdda6c115b475 | [
"MIT"
] | null | null | null | test/test_encoding.py | codders/mitmproxy | 4f9deae8fc2b5f8b0519f82b1f3cdda6c115b475 | [
"MIT"
] | 1 | 2015-08-20T02:20:27.000Z | 2015-08-20T02:20:27.000Z | from libmproxy import encoding
def test_identity():
assert "string" == encoding.decode("identity", "string")
assert "string" == encoding.encode("identity", "string")
assert not encoding.encode("nonexistent", "string")
assert None == encoding.decode("nonexistent encoding", "string")
def test_gzip():
... | 25.441176 | 68 | 0.559538 |
db1588c097751050abf6457a4816b1d57b2d4b01 | 364 | py | Python | db.py | nirbhay24/pythonRestApi | 03595d11181103cfddecf8925953aac2af4c4613 | [
"MIT"
] | null | null | null | db.py | nirbhay24/pythonRestApi | 03595d11181103cfddecf8925953aac2af4c4613 | [
"MIT"
] | null | null | null | db.py | nirbhay24/pythonRestApi | 03595d11181103cfddecf8925953aac2af4c4613 | [
"MIT"
] | 1 | 2019-01-09T16:35:40.000Z | 2019-01-09T16:35:40.000Z | #!flask/bin/python
import pyodbc
server = 'kms-db.database.windows.net'
database = 'kms_dev'
username = 'kmsadmin@kms-db'
password = 'Dotvik@98'
driver= '{SQL Server}'
connectionString = 'DRIVER='+driver+';PORT=1433;SERVER='+server+';PORT=1443;DATABASE='+database+';UID='+username+';PWD='+ password
print(connectionStr... | 33.090909 | 130 | 0.741758 |
38d921b9310db716abdea82726dc3758093340f9 | 920 | py | Python | 008-NoCorrectionBraking/008-NoCorrectionBraking.py | haruki-taka8/hello-python | c18419fd387240dde81e4df546a5e8a6d37d7164 | [
"Unlicense"
] | null | null | null | 008-NoCorrectionBraking/008-NoCorrectionBraking.py | haruki-taka8/hello-python | c18419fd387240dde81e4df546a5e8a6d37d7164 | [
"Unlicense"
] | null | null | null | 008-NoCorrectionBraking/008-NoCorrectionBraking.py | haruki-taka8/hello-python | c18419fd387240dde81e4df546a5e8a6d37d7164 | [
"Unlicense"
] | null | null | null | # 008-NoCorrectionBraking.py
# "No correction braking" is my best attempt at translating "ブレーキ込め直しなし"
# ブレーキ込め直しなし is an advanced train braking technique.
# Once the train driver applies brakes to a certain maximum level,
# they only release the brake gradually until the train stops.
# This is an example of no correc... | 26.285714 | 75 | 0.659783 |
d83a7e73f6c6b1a2247f1c15836210956a9a2e00 | 314 | py | Python | Add Digits.py | ChyavanKoushik/-My-Solutions-to-Leetcode-problems-using-Python-3 | b78779bd3f5313ab4752f9e9a23cb4a93805aff6 | [
"MIT"
] | 1 | 2020-07-11T15:10:19.000Z | 2020-07-11T15:10:19.000Z | Add Digits.py | ChyavanKoushik/-My-Solutions-to-Leetcode-problems-using-Python-3 | b78779bd3f5313ab4752f9e9a23cb4a93805aff6 | [
"MIT"
] | null | null | null | Add Digits.py | ChyavanKoushik/-My-Solutions-to-Leetcode-problems-using-Python-3 | b78779bd3f5313ab4752f9e9a23cb4a93805aff6 | [
"MIT"
] | null | null | null | class Solution:
def addDigits(self, num):
"""
:type num: int
:rtype: int
"""
lis = list(str(num))
while(len(lis)!=1):
summ = 0
for item in lis:
summ += int(item)
lis = list(str(summ))
return int(lis[0]) | 24.153846 | 33 | 0.414013 |
cf3a249490d91a26f7275cfd2b0a3474b83f292b | 3,730 | py | Python | project/test.py | ChakirBelhaj/python-for-text-analysis | 92320539a48d2a4ceea9dd55f4e17e5a39429508 | [
"Apache-2.0"
] | null | null | null | project/test.py | ChakirBelhaj/python-for-text-analysis | 92320539a48d2a4ceea9dd55f4e17e5a39429508 | [
"Apache-2.0"
] | null | null | null | project/test.py | ChakirBelhaj/python-for-text-analysis | 92320539a48d2a4ceea9dd55f4e17e5a39429508 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import seaborn as sns
import numpy as np
from scipy.stats import norm
from scipy import stats
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
import warnings
warnings.filterwarnings('ignore')
# ... | 40.107527 | 136 | 0.755228 |
ef22d723fda63f489fc37c7848b70eefaf8ab287 | 7,026 | py | Python | tape/tasks/AbstractLanguageModelingTask.py | nickbhat/tape-1 | 96778d1a3bb35acf966c6b32b4df1d738fa19ffd | [
"MIT"
] | null | null | null | tape/tasks/AbstractLanguageModelingTask.py | nickbhat/tape-1 | 96778d1a3bb35acf966c6b32b4df1d738fa19ffd | [
"MIT"
] | null | null | null | tape/tasks/AbstractLanguageModelingTask.py | nickbhat/tape-1 | 96778d1a3bb35acf966c6b32b4df1d738fa19ffd | [
"MIT"
] | null | null | null | from typing import Tuple, List, Dict, Union
import os
from glob import glob
import pickle as pkl
import tensorflow as tf
import rinokeras as rk
from tape.losses import classification_loss_and_accuracy
from .Task import SequenceToSequenceClassificationTask
class AbstractLanguageModelingTask(SequenceToSequenceClassif... | 41.087719 | 95 | 0.624395 |
0b1242bb3c7c7a1f5c7ed7b262f5a5737a2b3a33 | 1,671 | py | Python | Python/Tests/TestData/DebugAttach/Program.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 404 | 2019-05-07T02:21:57.000Z | 2022-03-31T17:03:04.000Z | Python/Tests/TestData/DebugAttach/Program.py | techkey/PTVS | 8355e67eedd8e915ca49bd38a2f36172696fd903 | [
"Apache-2.0"
] | 1,672 | 2019-05-06T21:09:38.000Z | 2022-03-31T23:16:04.000Z | Python/Tests/TestData/DebugAttach/Program.py | RaymonGulati1/PTVS | ee1d09f2a94be4e21016f7579205bb65ec82c616 | [
"Apache-2.0"
] | 186 | 2019-05-13T03:17:37.000Z | 2022-03-31T16:24:05.000Z | from threading import Thread
import threading
import time
from exceptions import KeyboardInterrupt
class C(object): pass
global thread_abort
thread_abort = False
def exception_storm():
my_name = threading.current_thread().name
my_ident = threading.current_thread().ident
i = 0
from weakref import WeakV... | 27.85 | 105 | 0.618791 |
5e9490b64546e921c59ffb9e80f8276b085e65e0 | 1,078 | py | Python | api.py | meantheory/rpn | 9092ac41ec21e8082d04d5a79a9586ece301c8da | [
"MIT"
] | null | null | null | api.py | meantheory/rpn | 9092ac41ec21e8082d04d5a79a9586ece301c8da | [
"MIT"
] | null | null | null | api.py | meantheory/rpn | 9092ac41ec21e8082d04d5a79a9586ece301c8da | [
"MIT"
] | null | null | null | from flask import Flask
from flask import request
from flask import jsonify
import rpncontroller
import shunt
app = Flask(__name__)
@app.route("/")
def hello():
return jsonify(info = "RPN API")
@app.route("/v1/rpn", methods=["POST"])
def v1rpnweb():
json = request.json
if request.json:
rpninput = request.j... | 18.586207 | 50 | 0.681818 |
bddcae8efcee5f405c291f0fcfc15c90af99fdbf | 25,376 | py | Python | main.py | TRojaner2013/vaccipy | bbd9c1b5f5edba6d6d91422034fdffa28804538b | [
"MIT"
] | null | null | null | main.py | TRojaner2013/vaccipy | bbd9c1b5f5edba6d6d91422034fdffa28804538b | [
"MIT"
] | null | null | null | main.py | TRojaner2013/vaccipy | bbd9c1b5f5edba6d6d91422034fdffa28804538b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import copy
import json
import os
from tools.exceptions import ValidationError, PushoverNotificationError, TelegramNotificationError
from tools.its import ImpfterminService
from tools.kontaktdaten import decode_wochentag, encode_wochentag, get_kontaktdaten, \
validate_kontak... | 42.222962 | 160 | 0.593119 |
aea2be1e099438299b4f649004f61a3b825f6c35 | 3,573 | py | Python | mpm88_2phase.py | taichi-dev/mls_mpm_88_extensions | 01928b95bde17d27a288d040d32514a9b45986db | [
"MIT"
] | 2 | 2021-06-24T10:25:28.000Z | 2021-08-10T13:00:00.000Z | mpm88_2phase.py | taichi-dev/mls_mpm_88_extensions | 01928b95bde17d27a288d040d32514a9b45986db | [
"MIT"
] | null | null | null | mpm88_2phase.py | taichi-dev/mls_mpm_88_extensions | 01928b95bde17d27a288d040d32514a9b45986db | [
"MIT"
] | 1 | 2021-08-10T09:31:01.000Z | 2021-08-10T09:31:01.000Z | import taichi as ti
ti.init(arch=ti.gpu)
n_particles = 16384
n_grid = 128
dx = 1 / n_grid
dt = 0.5e-4
p_vol = 1 / n_particles
p_mass0 = 1 / n_particles
gravity = 9.8
bound = 3
cAir = 20
RT = cAir**2
rho_ratio = 100
E = RT * (rho_ratio - 1)
x = ti.Vector.field(2, float, n_particles)
v = ti.Vector.field(2, float, n_p... | 28.814516 | 77 | 0.482228 |
277eb6fb4c3b367d31c8dd9e553ddea1e5a2febe | 5,809 | py | Python | tests/unit/api/mail/test_v0.py | ai-platform/amundsenfrontendlibrary | 6c95d5aa6acc9c85607b3453852cfb64cbdb712c | [
"Apache-2.0"
] | null | null | null | tests/unit/api/mail/test_v0.py | ai-platform/amundsenfrontendlibrary | 6c95d5aa6acc9c85607b3453852cfb64cbdb712c | [
"Apache-2.0"
] | null | null | null | tests/unit/api/mail/test_v0.py | ai-platform/amundsenfrontendlibrary | 6c95d5aa6acc9c85607b3453852cfb64cbdb712c | [
"Apache-2.0"
] | null | null | null | import unittest
from http import HTTPStatus
from typing import Dict, List
from flask import Response, jsonify, make_response
from amundsen_application import create_app
from amundsen_application.base.base_mail_client import BaseMailClient
local_app = create_app('amundsen_application.config.TestConfig', 'tests/templ... | 38.986577 | 105 | 0.621105 |
32e9f8a724c9c34b3d436e3528e9ac85d9b94a0f | 3,779 | py | Python | A3/A3_V2/Server/ServerController.py | lingt-xyz/Data-Communications-Computer-Networks | 79490b7177010525976fcad5ca3aa846765d4b2b | [
"MIT"
] | 2 | 2019-11-07T20:31:30.000Z | 2022-02-10T20:24:24.000Z | A3/A3_V2/Server/ServerController.py | lingt-xyz/Data-Communications-Computer-Networks | 79490b7177010525976fcad5ca3aa846765d4b2b | [
"MIT"
] | null | null | null | A3/A3_V2/Server/ServerController.py | lingt-xyz/Data-Communications-Computer-Networks | 79490b7177010525976fcad5ca3aa846765d4b2b | [
"MIT"
] | null | null | null | import logging
from socket import *
from DealPackets.Packet import *
from DealPackets.packetConstructor import *
from Server.ServerWindow import *
from Client.ClientWindow import *
import const
class ReceiverController:
address = None
__socketRC = None
__packetBuilder = None
def __init__(self):
... | 34.045045 | 137 | 0.622122 |
56c54c3a3ddc4bfec657215abcbba457b807abbd | 22,506 | py | Python | geotrek/maintenance/tests/test_views.py | billux/Geotrek-admin | cdc2749bb391b46a55d3870802d93f8a96db3740 | [
"BSD-2-Clause"
] | null | null | null | geotrek/maintenance/tests/test_views.py | billux/Geotrek-admin | cdc2749bb391b46a55d3870802d93f8a96db3740 | [
"BSD-2-Clause"
] | null | null | null | geotrek/maintenance/tests/test_views.py | billux/Geotrek-admin | cdc2749bb391b46a55d3870802d93f8a96db3740 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from collections import OrderedDict
from unittest import skipIf
from django.conf import settings
from django.contrib.gis.geos import Point, LineString
from django.contrib.gis import gdal
from django.test import TestCase
import json
from geotrek.common.tests import CommonTest
from map... | 41.677778 | 131 | 0.637652 |
7ad60f33c471984e98038bf32e77d5a95f525844 | 15,009 | py | Python | db/test.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | 1 | 2019-11-19T09:08:50.000Z | 2019-11-19T09:08:50.000Z | db/test.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | null | null | null | db/test.py | sysu-team1/BackEnd | 4773545897fee3aa7a767cbe6d011372623e1e58 | [
"MIT"
] | null | null | null | from config import make_pattern
from .Accept import Accept, random_accepts
from .Answer import Answer
from .Organization import Organization, random_orgs
from .prepare import ALL_TAGS, QUESTIONNAIRE_INDEX, model_repr
from .Problem import Problem
from .Student import Student, random_stus
from .Task import Task, random_... | 45.072072 | 174 | 0.663535 |
5bc26d90a5e4b80c29787a0dbe0ca98820c0a578 | 9,450 | py | Python | ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.py | netdrones/ml-agents | 7d7d6f149c92ea2067d7cea364d92c8c3b8db3f4 | [
"Apache-2.0"
] | 2 | 2021-08-10T21:39:09.000Z | 2021-08-11T09:46:03.000Z | ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.py | netdrones/ml-agents | 7d7d6f149c92ea2067d7cea364d92c8c3b8db3f4 | [
"Apache-2.0"
] | 1 | 2021-01-31T09:16:16.000Z | 2021-01-31T18:24:34.000Z | ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.py | netdrones/ml-agents | 7d7d6f149c92ea2067d7cea364d92c8c3b8db3f4 | [
"Apache-2.0"
] | 1 | 2021-01-31T09:02:17.000Z | 2021-01-31T09:02:17.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents_envs/communicator_objects/observation.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
fr... | 41.447368 | 1,023 | 0.773545 |
2499f19b59a22b5ce3c91ac6c25a85f923639d73 | 347 | py | Python | test_calweek.py | yuridadt/week_calc | 97c553b61d635803f8ceb623d96ffbfe81f6f390 | [
"MIT"
] | null | null | null | test_calweek.py | yuridadt/week_calc | 97c553b61d635803f8ceb623d96ffbfe81f6f390 | [
"MIT"
] | null | null | null | test_calweek.py | yuridadt/week_calc | 97c553b61d635803f8ceb623d96ffbfe81f6f390 | [
"MIT"
] | null | null | null | import pytest
from calweek import CalWeek
def test_cal_week():
cw = CalWeek('2018-51')
assert str(cw) == '2018-51', 'Str representation failed'
assert cw + 2 == '2019-01', 'Add failed'
assert cw - 3 == '2018-48', 'Sub failed'
assert CalWeek('2019-04') - cw == 5, 'Sub failed'
if __name__ == '__ma... | 23.133333 | 60 | 0.62536 |
74f54fa2924e6f3ae75a2187ad83bc0ed045e07a | 377 | py | Python | api/benchmarks/urls.py | OpenUpSA/salga-mobile-api | ef445c01404512a7b1c19912438a6f161a554c76 | [
"MIT"
] | null | null | null | api/benchmarks/urls.py | OpenUpSA/salga-mobile-api | ef445c01404512a7b1c19912438a6f161a554c76 | [
"MIT"
] | 4 | 2020-06-05T17:45:14.000Z | 2021-06-10T19:28:46.000Z | api/benchmarks/urls.py | OpenUpSA/salga-mobile-api | ef445c01404512a7b1c19912438a6f161a554c76 | [
"MIT"
] | 1 | 2020-06-22T02:09:25.000Z | 2020-06-22T02:09:25.000Z | from django.views.decorators.cache import cache_page
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^mandates$',
cache_page(600)(views.BenchmarkMandateView.as_view()),
name='mandates'),
url(r'^indicators/(?P<indicator>[\d]+)$',
cache_page(600)(views.Benchmar... | 26.928571 | 64 | 0.67374 |
3510e0f9cb1784865a95ecdc443effad56ad29a3 | 3,411 | py | Python | fuzzers/011-ffconfig/generate.py | unixb0y/prjxray | 569a44d8beadb7cf6548f7437e46fb456bacdd90 | [
"ISC"
] | 1 | 2020-10-31T19:32:41.000Z | 2020-10-31T19:32:41.000Z | fuzzers/011-ffconfig/generate.py | unixb0y/prjxray | 569a44d8beadb7cf6548f7437e46fb456bacdd90 | [
"ISC"
] | null | null | null | fuzzers/011-ffconfig/generate.py | unixb0y/prjxray | 569a44d8beadb7cf6548f7437e46fb456bacdd90 | [
"ISC"
] | 1 | 2021-05-07T11:53:23.000Z | 2021-05-07T11:53:23.000Z | #!/usr/bin/env python3
'''
FDCE Primitive: D Flip-Flop with Clock Enable and Asynchronous Clear
FDPE Primitive: D Flip-Flop with Clock Enable and Asynchronous Preset
FDRE Primitive: D Flip-Flop with Clock Enable and Synchronous Reset
FDSE Primitive: D Flip-Flop with Clock Enable and Synchronous Set
LDCE Primitive: Tran... | 27.731707 | 101 | 0.555849 |
fd256c93827f2e9a10927f2eaa40c2d71542d62e | 2,823 | py | Python | tensorflow_federated/python/research/analytics/heavy_hitters/heavy_hitters_utils_test.py | houcharlie/federated-legacy | cb10a9cdcea33288f8113e7445782d21c8c65f81 | [
"Apache-2.0"
] | 5 | 2020-06-04T20:10:25.000Z | 2020-07-22T02:15:38.000Z | tensorflow_federated/python/research/analytics/heavy_hitters/heavy_hitters_utils_test.py | houcharlie/federated-legacy | cb10a9cdcea33288f8113e7445782d21c8c65f81 | [
"Apache-2.0"
] | 5 | 2020-07-20T13:39:12.000Z | 2020-08-27T18:00:56.000Z | tensorflow_federated/python/research/analytics/heavy_hitters/heavy_hitters_utils_test.py | houcharlie/federated-legacy | cb10a9cdcea33288f8113e7445782d21c8c65f81 | [
"Apache-2.0"
] | 1 | 2022-02-27T18:31:12.000Z | 2022-02-27T18:31:12.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... | 37.144737 | 104 | 0.634786 |
20729801dbd6c15d742917db4d9ee76d6ea2353d | 330 | py | Python | day00/ex05/kata04.py | d-r-e/Machine-Learning-Bootcamp | 618cad97c04d15fec6e8a371c526ad8e08cae35a | [
"MIT"
] | null | null | null | day00/ex05/kata04.py | d-r-e/Machine-Learning-Bootcamp | 618cad97c04d15fec6e8a371c526ad8e08cae35a | [
"MIT"
] | 6 | 2021-05-25T08:51:39.000Z | 2021-05-25T08:51:40.000Z | day00/ex05/kata04.py | d-r-e/Python-Bootcamp-42AI | 618cad97c04d15fec6e8a371c526ad8e08cae35a | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
def main():
tup = (0, 4, 132.42222, 10000, 12345,67)
print("day_"+ str(tup[0]).zfill(2), end=', ')
print("ex_" + str(tup[1]).zfill(2), end=' : ')
print(str(round(tup[2], 2)), end=', ')
print(format(tup[3], ".2e"), end=', ')
print(format(tup[4], ".2e"))
if __name__ == "__main__"... | 27.5 | 48 | 0.536364 |
240f0d1ddda01f9784e04444a869d2decd719d61 | 5,313 | py | Python | test/unit/postprocessing/test_threshold_optimizer_multiple_sensitive_features.py | bthng/fairlearn | 042d18c530c397191363b5cf57d7684d52cf817e | [
"MIT"
] | null | null | null | test/unit/postprocessing/test_threshold_optimizer_multiple_sensitive_features.py | bthng/fairlearn | 042d18c530c397191363b5cf57d7684d52cf817e | [
"MIT"
] | null | null | null | test/unit/postprocessing/test_threshold_optimizer_multiple_sensitive_features.py | bthng/fairlearn | 042d18c530c397191363b5cf57d7684d52cf817e | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation and Fairlearn contributors.
# Licensed under the MIT License.
import numpy as np
import pandas as pd
from sklearn.metrics import balanced_accuracy_score, accuracy_score
from sklearn.linear_model import LinearRegression
from fairlearn.postprocessing import ThresholdOptimizer
from... | 42.166667 | 97 | 0.622624 |
e8cc56f26562298764147ef3d01135f02173bf5a | 23 | py | Python | spotlight/__init__.py | jordanwinemiller/spotlight | c3bae1130412238b968a6e80023f1cb6fbaaa5a7 | [
"MIT"
] | 42 | 2020-10-13T19:47:37.000Z | 2022-03-26T09:56:46.000Z | spotlight/__init__.py | jordanwinemiller/spotlight | c3bae1130412238b968a6e80023f1cb6fbaaa5a7 | [
"MIT"
] | 3 | 2020-01-29T16:37:50.000Z | 2022-02-04T12:01:51.000Z | spotlight/__init__.py | jordanwinemiller/spotlight | c3bae1130412238b968a6e80023f1cb6fbaaa5a7 | [
"MIT"
] | 5 | 2020-11-30T14:48:44.000Z | 2022-02-19T17:18:21.000Z | __version__ = 'v0.1.5'
| 11.5 | 22 | 0.652174 |
b8fac6278aea4ff61053316cf7c6403f0c40d6e8 | 957 | py | Python | utils/model.py | david8862/keras-CenterNet | e74b933f6dd5ffac04f2de3eb0d887742be8490f | [
"Apache-2.0"
] | 195 | 2019-11-10T10:50:22.000Z | 2022-03-18T01:37:05.000Z | utils/model.py | gellston/keras-CenterNet | 39cb123a94d7774490df28e637240de03577f912 | [
"Apache-2.0"
] | 57 | 2019-11-18T05:55:29.000Z | 2022-03-30T06:09:39.000Z | utils/model.py | gellston/keras-CenterNet | 39cb123a94d7774490df28e637240de03577f912 | [
"Apache-2.0"
] | 58 | 2019-11-11T08:13:56.000Z | 2022-03-14T09:49:47.000Z | """
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 31.9 | 87 | 0.745037 |
b84e14e2618c042a04491b43337c03f3a0ee0084 | 1,319 | py | Python | deoldify/dataset.py | Dakini/AnimeColorDeOldify | 5151e5fea87fec57366aed7afba54f743ffdfd10 | [
"MIT"
] | 115 | 2020-03-26T21:30:52.000Z | 2022-03-30T11:45:03.000Z | deoldify/dataset.py | A2K2005/AnimeColorDeOldify | 5151e5fea87fec57366aed7afba54f743ffdfd10 | [
"MIT"
] | 3 | 2020-04-02T18:26:06.000Z | 2022-03-12T00:20:11.000Z | deoldify/dataset.py | A2K2005/AnimeColorDeOldify | 5151e5fea87fec57366aed7afba54f743ffdfd10 | [
"MIT"
] | 18 | 2020-03-26T21:31:06.000Z | 2022-03-21T08:56:07.000Z | import fastai
from fastai import *
from fastai.core import *
from fastai.vision.transform import get_transforms
from fastai.vision.data import ImageImageList, ImageDataBunch, imagenet_stats
from .augs import noisify
def get_colorize_data(
sz: int,
bs: int,
crappy_path: Path,
good_path: Path,
rando... | 26.918367 | 82 | 0.648976 |
83d41bbd2bab53a6c0c4bd99fc847a316235ddca | 1,202 | py | Python | video_tools/commands/compress.py | bertonha/viceo_compressor | 601f222a2d5aa67a03cd3f792ba293346386d25f | [
"MIT"
] | 2 | 2019-08-15T03:34:36.000Z | 2019-08-15T04:36:44.000Z | video_tools/commands/compress.py | bertonha/video_compressor | 601f222a2d5aa67a03cd3f792ba293346386d25f | [
"MIT"
] | null | null | null | video_tools/commands/compress.py | bertonha/video_compressor | 601f222a2d5aa67a03cd3f792ba293346386d25f | [
"MIT"
] | 1 | 2019-10-08T12:45:08.000Z | 2019-10-08T12:45:08.000Z | from pathlib import Path
import click
from video_tools.utils import (
call_ffmpeg,
delete_file,
filter_compressible_files,
generate_output_filename,
print_style,
)
@click.group()
def compress_group():
pass
@compress_group.command()
@click.option("-r", "--rotate", default=False, is_flag=Tru... | 25.041667 | 69 | 0.650582 |
2e4a2603d1019c250d930cd9487d1f3fe115b911 | 7,881 | py | Python | libs/pyzmq/Leap_sample/Leap_sample.py | quanhua92/learning-notes | a9c50d3955c51bb58f4b012757c550b76c5309ef | [
"Apache-2.0"
] | null | null | null | libs/pyzmq/Leap_sample/Leap_sample.py | quanhua92/learning-notes | a9c50d3955c51bb58f4b012757c550b76c5309ef | [
"Apache-2.0"
] | null | null | null | libs/pyzmq/Leap_sample/Leap_sample.py | quanhua92/learning-notes | a9c50d3955c51bb58f4b012757c550b76c5309ef | [
"Apache-2.0"
] | null | null | null | import zmq
class SampleListener:
context = None
zmq_socket = None
def on_init(self):
print("\nInitialized")
self.context = zmq.Context()
self.zmq_socket = self.context.socket(zmq.PUSH)
self.zmq_socket.bind("tcp://127.0.0.1:5557")
def on_frame(self):
print("\nOn... | 42.370968 | 162 | 0.645984 |
6868ccb4108888ca08720bd241e8a0115ff8f7f7 | 8,718 | py | Python | DataStreamer/_Rtree.py | SanityLacking/Data-streamer | d9a051dd2c5d26aad58cceb9ea24a4e7cb0cf779 | [
"MIT"
] | 2 | 2020-03-01T11:12:18.000Z | 2021-11-25T04:03:26.000Z | DataStreamer/_Rtree.py | SanityLacking/DataStreamer | d9a051dd2c5d26aad58cceb9ea24a4e7cb0cf779 | [
"MIT"
] | null | null | null | DataStreamer/_Rtree.py | SanityLacking/DataStreamer | d9a051dd2c5d26aad58cceb9ea24a4e7cb0cf779 | [
"MIT"
] | null | null | null | '''
Rtree.py
Author: Yi Liu
Author: Yi Liu https://github.com/moment-of-peace/python-rtree
Modified by: Cailen Robertson https://github.com/SanityLacking
Classes representing parts of a r-tree
'''
import math
# a point in r-tree
class Point:
def __init__(self, pointInfo):
self.ident = pointInfo[0]
... | 34.872 | 95 | 0.563088 |
6979cbcd4e71e27d30aa2f87fef53d9341bb5645 | 237,603 | py | Python | buildscripts/cpplint.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 72 | 2020-06-12T06:33:41.000Z | 2021-03-22T03:15:56.000Z | buildscripts/cpplint.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 9 | 2020-07-02T09:36:49.000Z | 2021-03-25T23:54:00.000Z | buildscripts/cpplint.py | danx0r/mongo | 70d4944c235bcdf7fbbc63971099563d2af72956 | [
"Apache-2.0"
] | 14 | 2020-06-12T03:08:03.000Z | 2021-02-03T11:43:09.000Z | #!/usr/bin/env python
#
# Copyright (c) 2009 Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | 38.236724 | 97 | 0.652025 |
e1ad786574e503b51fe78f121e61c54f60bd1177 | 2,331 | py | Python | test/test_dynsys_equil.py | artemyk/dynpy | c2914ac315083ad76707a7fcb2c8800a2ec52944 | [
"BSD-2-Clause"
] | 6 | 2015-03-05T04:13:22.000Z | 2021-09-24T02:46:09.000Z | test/test_dynsys_equil.py | artemyk/dynpy | c2914ac315083ad76707a7fcb2c8800a2ec52944 | [
"BSD-2-Clause"
] | null | null | null | test/test_dynsys_equil.py | artemyk/dynpy | c2914ac315083ad76707a7fcb2c8800a2ec52944 | [
"BSD-2-Clause"
] | 6 | 2015-03-05T04:16:06.000Z | 2021-07-03T13:26:26.000Z | import numpy as np
import scipy.sparse as ss
import dynpy
from dynpy.mx import DenseMatrix, SparseMatrix
from dynpy.graphdynamics import RandomWalkerEnsemble
kc = dynpy.sample_nets.karateclub_net
initState = np.zeros(kc.shape[0], 'float')
initState[ 5 ] = 1
def very_close(mx1, mx2):
fmax = (lambda x: x.max())... | 35.861538 | 81 | 0.688117 |
29003b3570cc956b82fc4cabcf96213297708b20 | 425 | py | Python | fundamentos/007_opAritm.py | daldantas/Curso-Python | 96d09393b1ad278990156906e965c0d7adb4f4aa | [
"MIT"
] | null | null | null | fundamentos/007_opAritm.py | daldantas/Curso-Python | 96d09393b1ad278990156906e965c0d7adb4f4aa | [
"MIT"
] | null | null | null | fundamentos/007_opAritm.py | daldantas/Curso-Python | 96d09393b1ad278990156906e965c0d7adb4f4aa | [
"MIT"
] | null | null | null | n1 = int(input('Digite um número: '))
n2 = int(input('Digite outro: '))
s = n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
e = n1 ** n2
r = n1 % n2
top = ' Início '
bot = ' Fim '
print('\n Operadores Aritméticos \n')
print('{:=^30}'.format(top))
print('\n Soma: {} \n Mult: {} \n div : {:.2f} \n divi: {} \n e... | 28.333333 | 104 | 0.505882 |
44dd3e225e19be4b88c2bc3b2fd809bbb71e9200 | 291 | py | Python | projects/shixiseng/shixiseng/pipelines.py | 18839782321/lyf.github.io | 12c065f03d69dd7d99af27ded6c216f1954f8c7f | [
"MIT"
] | 13 | 2020-07-15T03:26:33.000Z | 2022-01-23T01:59:14.000Z | projects/shixiseng/shixiseng/pipelines.py | 18839782321/lyf.github.io | 12c065f03d69dd7d99af27ded6c216f1954f8c7f | [
"MIT"
] | 5 | 2021-03-31T20:07:10.000Z | 2022-03-02T14:54:19.000Z | projects/shixiseng/shixiseng/pipelines.py | 18839782321/lyf.github.io | 12c065f03d69dd7d99af27ded6c216f1954f8c7f | [
"MIT"
] | 5 | 2020-08-13T16:09:14.000Z | 2021-12-16T08:26:57.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
class ShixisengPipeline(object):
def process_item(self, item, spider):
return item
| 24.25 | 66 | 0.714777 |
56126d78c4b6490ff1dce3638014bc41b6ffb056 | 1,749 | py | Python | src/main/resources/pydev_tunnel/tunnel.py | gdlg/k8s-debugger-pycharm-pluggin | 30354f8e6ce3f979650c032e485137ec3f113a2c | [
"Apache-2.0"
] | null | null | null | src/main/resources/pydev_tunnel/tunnel.py | gdlg/k8s-debugger-pycharm-pluggin | 30354f8e6ce3f979650c032e485137ec3f113a2c | [
"Apache-2.0"
] | null | null | null | src/main/resources/pydev_tunnel/tunnel.py | gdlg/k8s-debugger-pycharm-pluggin | 30354f8e6ce3f979650c032e485137ec3f113a2c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Grégoire Payen de La Garanderie. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
from dispatcher import Dispatcher
from pipe_client_server import PipeClientServer
from pydev_server_monitor import PydevServerMonitor
import sys
import subprocess
impor... | 30.684211 | 150 | 0.760435 |
284e7be9f732aa086a029b5b9d8bca68acb295fa | 476 | py | Python | plotly/validators/layout/annotation/_valign.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/layout/annotation/_valign.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/layout/annotation/_valign.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class ValignValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name='valign', parent_name='layout.annotation', **kwargs
):
super(ValignValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | 28 | 77 | 0.617647 |
1991565e0567d2f07f55f0dafb344e8eb52facd1 | 3,068 | py | Python | tukey/dashboards/settings/project/forms.py | Li-Ko/tukey_portal | 8dc395ef1a1ebaa806d23c88ce51460e6c202921 | [
"Apache-2.0"
] | null | null | null | tukey/dashboards/settings/project/forms.py | Li-Ko/tukey_portal | 8dc395ef1a1ebaa806d23c88ce51460e6c202921 | [
"Apache-2.0"
] | null | null | null | tukey/dashboards/settings/project/forms.py | Li-Ko/tukey_portal | 8dc395ef1a1ebaa806d23c88ce51460e6c202921 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | 36.963855 | 78 | 0.625163 |
1d5110749d9c4dbf759343e9bd66c51bd31713d7 | 6,176 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_06_01/operations/_usages_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 40.900662 | 146 | 0.66386 |
2d793fe298b33e659b3568937d000255d835b32c | 12,212 | py | Python | pylot/perception/segmentation/segmented_frame.py | mageofboy/pylot | c3154dc24c9429b9916274894c72ef92e03c946d | [
"Apache-2.0"
] | 231 | 2019-06-05T00:22:00.000Z | 2022-03-28T06:15:00.000Z | pylot/perception/segmentation/segmented_frame.py | mageofboy/pylot | c3154dc24c9429b9916274894c72ef92e03c946d | [
"Apache-2.0"
] | 108 | 2019-06-27T16:28:01.000Z | 2022-03-28T19:14:18.000Z | pylot/perception/segmentation/segmented_frame.py | mageofboy/pylot | c3154dc24c9429b9916274894c72ef92e03c946d | [
"Apache-2.0"
] | 80 | 2019-06-07T01:08:13.000Z | 2022-03-28T01:44:42.000Z | import os
import PIL.Image as Image
import cv2
import numpy as np
import pylot.utils
from pylot.perception.detection.utils import BoundingBox2D
from skimage import measure
# Semantic Labels
CITYSCAPES_LABELS = {
0: "unlabeled",
1: "building",
2: "fence",
3: "other",
4: "person",
5: "pole",... | 37.80805 | 98 | 0.593269 |
05fb7d6810b2bfcba4646e2e5d8ef12efa2fce49 | 4,819 | py | Python | app/api/v1/views/products_views.py | kwanj-k/storemanager-API | e51511545a717341a7b1eb100eb3eab625a8b011 | [
"MIT"
] | 1 | 2019-05-08T08:39:08.000Z | 2019-05-08T08:39:08.000Z | app/api/v1/views/products_views.py | kwanj-k/storemanager-API | e51511545a717341a7b1eb100eb3eab625a8b011 | [
"MIT"
] | 2 | 2019-10-21T17:56:01.000Z | 2019-10-29T07:36:39.000Z | app/api/v1/views/products_views.py | kwanj-k/storemanager-API | e51511545a717341a7b1eb100eb3eab625a8b011 | [
"MIT"
] | null | null | null | """
This file contains all the product related resources
"""
# Third party imports
from flask import request, json, abort
from flask_restplus import Resource
from flask_jwt_extended import jwt_required, get_jwt_identity
# Local application imports
from app.api.v1.models.products import Product
from app.api.v1.model... | 29.746914 | 114 | 0.579581 |
94d2c8f36675dc7b164f9fa90fd6ac8073659521 | 2,398 | py | Python | tests/acceptance/test_accept_organization_invite.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/acceptance/test_accept_organization_invite.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_accept_organization_invite.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.db.models import F
from sentry.testutils import AcceptanceTestCase
from sentry.models import Organization, AuthProvider
class AcceptOrganizationInviteTest(AcceptanceTestCase):
def setUp(self):
super(AcceptOrganizationInviteTest, self).setUp()
se... | 45.245283 | 81 | 0.683069 |
206de274cb191e233c0c0778f5599c0e785b757e | 327 | py | Python | tutorials/W0D4_Calculus/solutions/W0D4_Tutorial2_Solution_7cf110c5.py | eduardojdiniz/CompNeuro | 20269e66540dc4e802273735c97323020ee37406 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 2,294 | 2020-05-11T12:05:35.000Z | 2022-03-28T21:23:34.000Z | tutorials/W0D4_Calculus/solutions/W0D4_Tutorial2_Solution_7cf110c5.py | pellet/course-content | bb383857992469e0e7a9c36639ac0d05e842d9bd | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 629 | 2020-05-11T15:42:26.000Z | 2022-03-29T12:23:35.000Z | tutorials/W0D4_Calculus/solutions/W0D4_Tutorial2_Solution_7cf110c5.py | pellet/course-content | bb383857992469e0e7a9c36639ac0d05e842d9bd | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 917 | 2020-05-11T12:47:53.000Z | 2022-03-31T12:14:41.000Z |
"""
1. Negative values of alpha result in an exponential decrease to 0 a stable solution.
2. Positive Values of alpha in an exponential increases to infinity.
3. Alpha equal to 0 is a unique point known as an equilibrium point when the
dp/dt=0 and there is no change in population. This is known as a stable poi... | 46.714286 | 87 | 0.749235 |
3806c9e37b320bd5bb3ceb1bec44ca9bd4d9ae05 | 249 | py | Python | 326. Power of Three.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 326. Power of Three.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 326. Power of Three.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | class Solution:
def isPowerOfThree(self, n: int) -> bool:
if n <= 0:
return False
while n != 1:
if n % 3 == 0:
n = n // 3
else:
return False
return True
| 22.636364 | 45 | 0.389558 |
592fb8de49db7c12cfcd882a1f9cf24bcebfc126 | 675 | py | Python | Cloud_Data_Warehousing/create_tables.py | bayatim/udacityDataEngineeringProjects | d3533eaec27c3b6af4d1f4b3e7bf385b3106121f | [
"MIT"
] | 1 | 2021-02-05T10:45:22.000Z | 2021-02-05T10:45:22.000Z | Cloud_Data_Warehousing/create_tables.py | bayatim/udacityDataEngineeringProjects | d3533eaec27c3b6af4d1f4b3e7bf385b3106121f | [
"MIT"
] | 6 | 2020-12-27T21:30:34.000Z | 2021-02-05T09:10:33.000Z | Cloud_Data_Warehousing/create_tables.py | bayatim/udacityDataEngineeringProjects | d3533eaec27c3b6af4d1f4b3e7bf385b3106121f | [
"MIT"
] | null | null | null | import configparser
import psycopg2
from sql_queries import create_table_queries, drop_table_queries
def drop_tables(cur, conn):
for query in drop_table_queries:
cur.execute(query)
conn.commit()
def create_tables(cur, conn):
for query in create_table_queries:
cur.execute(query)
... | 21.09375 | 112 | 0.663704 |
fdc38cda6fc2284b0ee3702407d87bff909fa646 | 38,951 | py | Python | salt/modules/gpg.py | calinrailean/salt | 6283b51bb44b734a3db82caaae4f4c4e32a9b9b3 | [
"Apache-2.0"
] | 2 | 2018-11-08T02:59:24.000Z | 2021-01-04T00:30:50.000Z | salt/modules/gpg.py | calinrailean/salt | 6283b51bb44b734a3db82caaae4f4c4e32a9b9b3 | [
"Apache-2.0"
] | 4 | 2020-09-04T10:19:34.000Z | 2020-11-09T12:55:59.000Z | salt/modules/gpg.py | calinrailean/salt | 6283b51bb44b734a3db82caaae4f4c4e32a9b9b3 | [
"Apache-2.0"
] | 5 | 2017-06-16T23:48:13.000Z | 2021-04-08T17:43:48.000Z | # -*- coding: utf-8 -*-
'''
Manage a GPG keychains, add keys, create keys, retrieve keys from keyservers.
Sign, encrypt and sign plus encrypt text and files.
.. versionadded:: 2015.5.0
.. note::
The ``python-gnupg`` library and ``gpg`` binary are required to be
installed.
'''
# Import python libs
from __fu... | 30.24146 | 116 | 0.5834 |
77bdbda17f70664c988db525fb48e7555147e0d1 | 857 | py | Python | Interesting Python Questions/merge sort.py | liu-yunfei/Python | 314cdc98f32f4f0de2c0904279865b944e34dd75 | [
"MIT"
] | 1 | 2020-10-08T09:29:59.000Z | 2020-10-08T09:29:59.000Z | Interesting Python Questions/merge sort.py | liu-yunfei/Python | 314cdc98f32f4f0de2c0904279865b944e34dd75 | [
"MIT"
] | 1 | 2021-01-30T12:04:51.000Z | 2021-01-30T12:05:37.000Z | Interesting Python Questions/merge sort.py | liu-yunfei/Python | 314cdc98f32f4f0de2c0904279865b944e34dd75 | [
"MIT"
] | null | null | null | def merge(lefthalf, righthalf):
answerList = []
while len(lefthalf) > 0 and len(righthalf) > 0:
if lefthalf[0] < righthalf[0]:
answerList += [lefthalf[0]]
lefthalf = lefthalf[1:]
else:
answerList += [righthalf[0]]
righthalf = righthalf[1:]
... | 23.805556 | 52 | 0.492415 |
6fba46e83f779618b4e8f5e7c2cb668565f49a2a | 2,528 | py | Python | hsaudiotag/id3v1.py | kaisenlinux/hsaudiotag | 394bc166f51caa6f9ac333fe1a3d662f411d5716 | [
"BSD-3-Clause"
] | null | null | null | hsaudiotag/id3v1.py | kaisenlinux/hsaudiotag | 394bc166f51caa6f9ac333fe1a3d662f411d5716 | [
"BSD-3-Clause"
] | 8 | 2015-02-14T05:29:45.000Z | 2015-03-09T13:49:28.000Z | src/hsaudiotag/id3v1.py | jmtchllrx/pyMuse | d85ca140ad572695349c03ee4cd0a8e5f960a045 | [
"MIT"
] | null | null | null | # Created By: Virgil Dupras
# Created On: 2004/12/07
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses... | 29.395349 | 104 | 0.599288 |
7fdeb0e2dfc8a0d11711fef3e805482d346c616d | 5,782 | py | Python | sfaira/unit_tests/tests_by_submodule/data/dataset/test_dataset.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | sfaira/unit_tests/tests_by_submodule/data/dataset/test_dataset.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | sfaira/unit_tests/tests_by_submodule/data/dataset/test_dataset.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import os
import pytest
import sfaira.versions.genomes
from sfaira.consts import AdataIdsSfaira
from sfaira.data import DatasetSuperGroup, DatasetInteractive
from sfaira.data import Universe
from sfaira.unit_tests.data_for_tests.loaders import RELEASE_HUMAN, PrepareData
from sfaira.unit_tests.direc... | 38.291391 | 119 | 0.70166 |
dec811c91954d823bdc8eb71faadd83662f1233e | 4,191 | py | Python | galaxiaclient/common/client.py | WiproOpenSourcePractice/galaxia | baa6ea0a2192625dce2df7daddb1d983520bb7ab | [
"Apache-2.0"
] | 25 | 2016-04-27T14:45:59.000Z | 2020-05-21T00:14:56.000Z | galaxiaclient/common/client.py | WiproOpenSource/galaxia | baa6ea0a2192625dce2df7daddb1d983520bb7ab | [
"Apache-2.0"
] | 62 | 2016-04-27T14:13:06.000Z | 2016-11-16T05:12:21.000Z | galaxiaclient/common/client.py | WiproOpenSource/galaxia | baa6ea0a2192625dce2df7daddb1d983520bb7ab | [
"Apache-2.0"
] | 20 | 2016-05-01T14:28:09.000Z | 2018-10-25T18:11:29.000Z | # Copyright 2016 - Wipro 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 33.798387 | 80 | 0.642806 |
2b924f7e9a07dfd9ea3291847da4bc9afbb54764 | 17,764 | py | Python | st2common/st2common/services/action.py | avezraj/st2 | 519c7f6819e52fb289c440bb7d1df7b558bb9ed7 | [
"Apache-2.0"
] | null | null | null | st2common/st2common/services/action.py | avezraj/st2 | 519c7f6819e52fb289c440bb7d1df7b558bb9ed7 | [
"Apache-2.0"
] | null | null | null | st2common/st2common/services/action.py | avezraj/st2 | 519c7f6819e52fb289c440bb7d1df7b558bb9ed7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Extreme Networks, 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 i... | 36.327198 | 99 | 0.715154 |
027f64020ccf8265a99855eed8c2ac923dafcfab | 9,893 | py | Python | analyse-classifications.py | zooniverse/comet-hunters-volcrowe-experiment | 570233a2595a06367f234766d37e25584fb213bb | [
"Apache-2.0"
] | null | null | null | analyse-classifications.py | zooniverse/comet-hunters-volcrowe-experiment | 570233a2595a06367f234766d37e25584fb213bb | [
"Apache-2.0"
] | null | null | null | analyse-classifications.py | zooniverse/comet-hunters-volcrowe-experiment | 570233a2595a06367f234766d37e25584fb213bb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
__author__ = 'alex'
from collections import OrderedDict
from datetime import datetime, date, timedelta
import unicodecsv as csv
import sys
import os
import time
import json
import numpy
import matplotlib.pyplot as plt
import pickle
OUTLIER_LOW_CUTOFF = 1
OUTLIER_HIGH_CUTOFF = 100
NUMBER_OF_HISTOG... | 42.459227 | 123 | 0.729304 |
fcfcd47b360bbfa240f2edf927bc9b684203539d | 10,361 | py | Python | pokedex/db/multilang.py | ymin1103/pokedex | 18925edcd3ad71dd912a94ce4b1bc1435943937a | [
"MIT"
] | 1,177 | 2015-01-09T02:17:26.000Z | 2022-03-30T05:29:06.000Z | pokedex/db/multilang.py | ymin1103/pokedex | 18925edcd3ad71dd912a94ce4b1bc1435943937a | [
"MIT"
] | 224 | 2015-01-13T04:44:52.000Z | 2022-03-28T18:16:35.000Z | pokedex/db/multilang.py | ymin1103/pokedex | 18925edcd3ad71dd912a94ce4b1bc1435943937a | [
"MIT"
] | 810 | 2015-01-14T22:40:39.000Z | 2022-03-23T16:24:54.000Z | from sqlalchemy.ext.associationproxy import association_proxy, AssociationProxy
from sqlalchemy.orm import Query, mapper, relationship, synonym
from sqlalchemy.orm.collections import attribute_mapped_collection
from sqlalchemy.orm.scoping import ScopedSession
from sqlalchemy.orm.session import Session, object_session
f... | 40.631373 | 105 | 0.694817 |
bde08d0a22c5fdda5f8578c6dc7d32acda03daa9 | 86 | py | Python | supstream/__version__.py | yaniv-aknin/django-static-upstream | 6b829317db73fa1ca567711a4f0ae9eef9c09d7b | [
"MIT"
] | 1 | 2015-11-08T16:08:07.000Z | 2015-11-08T16:08:07.000Z | supstream/__version__.py | yaniv-aknin/django-static-upstream | 6b829317db73fa1ca567711a4f0ae9eef9c09d7b | [
"MIT"
] | null | null | null | supstream/__version__.py | yaniv-aknin/django-static-upstream | 6b829317db73fa1ca567711a4f0ae9eef9c09d7b | [
"MIT"
] | null | null | null | __version__=(0,1,1)
__version_str__=".".join(str(element) for element in __version__)
| 28.666667 | 65 | 0.767442 |
5dec95e34b1de527ac8fec74d79b3e373e50808f | 287 | py | Python | test.py | Asif-ak/Web-Scrapping-BeautifulSoup | 29506481ecca4dd0d036b4ac58be2fbaa0878c00 | [
"Unlicense"
] | null | null | null | test.py | Asif-ak/Web-Scrapping-BeautifulSoup | 29506481ecca4dd0d036b4ac58be2fbaa0878c00 | [
"Unlicense"
] | null | null | null | test.py | Asif-ak/Web-Scrapping-BeautifulSoup | 29506481ecca4dd0d036b4ac58be2fbaa0878c00 | [
"Unlicense"
] | null | null | null | import requests, bs4
a=requests.get('http://www.tsinghua.edu.cn/publish/hyen/1694/2011/20110113141747864991749/20110113141747864991749_.html')
#print(a.text)
soup=bs4.BeautifulSoup(a.text,'lxml')
title=soup.select('div')
#print(title)
for titles in title:
print(titles.text) | 31.888889 | 122 | 0.756098 |
8a454f3fdddb88be2df6a26b9077ff32387ad36c | 5,324 | py | Python | tools/filters/gff_to_bed_converter.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 2 | 2016-02-23T00:09:14.000Z | 2019-02-11T07:48:44.000Z | tools/filters/gff_to_bed_converter.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | tools/filters/gff_to_bed_converter.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 6 | 2015-05-27T13:09:50.000Z | 2019-02-11T07:48:46.000Z | #!/usr/bin/env python
import sys
from galaxy import eggs
from galaxy.datatypes.util.gff_util import parse_gff_attributes
assert sys.version_info[:2] >= ( 2, 4 )
def get_bed_line( chrom, name, strand, blocks ):
""" Returns a BED line for given data. """
if len( blocks ) == 1:
# Use simple BED for... | 39.731343 | 140 | 0.552216 |
8866874dd908014dc19fe9495e196323ce8a3015 | 435 | py | Python | telegram_gcloner/utils/callback.py | renanjsilv/CloneBot_Heroku | fef15f3bc66c1fbbdd69df2cfb10461691d17dbe | [
"MIT"
] | null | null | null | telegram_gcloner/utils/callback.py | renanjsilv/CloneBot_Heroku | fef15f3bc66c1fbbdd69df2cfb10461691d17dbe | [
"MIT"
] | null | null | null | telegram_gcloner/utils/callback.py | renanjsilv/CloneBot_Heroku | fef15f3bc66c1fbbdd69df2cfb10461691d17dbe | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
from telegram.ext import CallbackContext
logger = logging.getLogger(__name__)
def callback_delete_message(context: CallbackContext):
(chat_id, message_id) = context.job.context
try:
context.bot.delete_message(chat_id=chat_id, message_id=messa... | 27.1875 | 80 | 0.724138 |
a15294df5789e3065ddb49b0439c31a92e918c6d | 1,627 | py | Python | backwork/backup.py | Bhaskers-Blu-Org1/backwork | b963845e1f17baa81e3697be838dc245dc6c0b48 | [
"Apache-2.0"
] | 2 | 2019-09-16T04:18:40.000Z | 2020-02-06T15:23:20.000Z | backwork/backup.py | IBM/backwork | b963845e1f17baa81e3697be838dc245dc6c0b48 | [
"Apache-2.0"
] | null | null | null | backwork/backup.py | IBM/backwork | b963845e1f17baa81e3697be838dc245dc6c0b48 | [
"Apache-2.0"
] | 2 | 2019-11-02T15:07:13.000Z | 2020-06-29T14:49:02.000Z | """Handle backup subcommand.
Backup commands should receive an argument specifying where to store the backup
file. It should also provide the options to archive, compress and timestamp the
backup into a single file to facilitate storage.
"""
import os
from .lib import utils
__all__ = ["parse_args", "backup", "BackupE... | 36.977273 | 79 | 0.630608 |
97bbce257c198ea53a75f6da805d4fc7d54108a5 | 17,766 | py | Python | allel/stats/mendel.py | smbadiwe/scikit-allel | 4432362fc2dea5706ad358f6b4bab4186fb70a60 | [
"MIT"
] | 1 | 2020-06-29T15:29:05.000Z | 2020-06-29T15:29:05.000Z | allel/stats/mendel.py | smbadiwe/scikit-allel | 4432362fc2dea5706ad358f6b4bab4186fb70a60 | [
"MIT"
] | null | null | null | allel/stats/mendel.py | smbadiwe/scikit-allel | 4432362fc2dea5706ad358f6b4bab4186fb70a60 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from allel.compat import memoryview_safe
from allel.model.ndarray import GenotypeArray, HaplotypeArray
from allel.util import check_ploidy, check_min_samples, check_type, check_dtype
from allel.opt.stats import phase_progeny_by_transmission as _opt_phase_progeny_by_transmiss... | 36.782609 | 98 | 0.507205 |
38a8ec426f0282fdef51946b6d0014e942969be9 | 12,183 | py | Python | Value_Based/C51/C51_1dim/agent.py | kyunghoon-jung/MacaronRL | b95be35fc95be7eb5aede2315a714984b282587a | [
"MIT"
] | 20 | 2020-10-05T07:07:46.000Z | 2021-05-23T02:18:43.000Z | Value_Based/C51/C51_1dim/agent.py | kyunghoon-jung/RL_implementation | b95be35fc95be7eb5aede2315a714984b282587a | [
"MIT"
] | null | null | null | Value_Based/C51/C51_1dim/agent.py | kyunghoon-jung/RL_implementation | b95be35fc95be7eb5aede2315a714984b282587a | [
"MIT"
] | null | null | null | import gym
import numpy as np
import time
import os
import cv2
import matplotlib.pyplot as plt
from IPython.display import clear_output
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from qnetwork import QNetwork
from replay_buffer import ReplayBuffer
import wandb
... | 46.678161 | 188 | 0.606747 |
1b7e99428936733bba947726f924d0f9881c3bfc | 2,478 | py | Python | adoctor-check-scheduler/adoctor_check_scheduler/tests/unit/test_retry_task.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | adoctor-check-scheduler/adoctor_check_scheduler/tests/unit/test_retry_task.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | adoctor-check-scheduler/adoctor_check_scheduler/tests/unit/test_retry_task.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... | 37.545455 | 98 | 0.563358 |
68248412320226885e776942d137ad0a7618d086 | 1,165 | py | Python | crawl/config.py | YuanruiZJU/GerritCrawler | 416eb74f4f8f50a461f849e579c12e3eba870d8c | [
"MIT"
] | 2 | 2020-06-27T03:32:49.000Z | 2020-07-22T15:06:46.000Z | crawl/config.py | YuanruiZJU/GerritCrawler | 416eb74f4f8f50a461f849e579c12e3eba870d8c | [
"MIT"
] | null | null | null | crawl/config.py | YuanruiZJU/GerritCrawler | 416eb74f4f8f50a461f849e579c12e3eba870d8c | [
"MIT"
] | 1 | 2020-06-27T03:32:54.000Z | 2020-06-27T03:32:54.000Z | import os
download_dir = 'E://GerritDownload/'
# number of code reviews in each step
num_one_step = 100
# REST API URL
urls = {}
urls['eclipse'] = 'https://git.eclipse.org/r/changes/?o=ALL_REVISIONS&o=ALL_FILES&o=ALL_COMMITS&o=MESSAGES&o=DETAILED_ACCOUNTS&n=%s' % num_one_step
urls['aosp'] = 'https://android-review.g... | 55.47619 | 158 | 0.761373 |
963a9133f25483a3dc7d23f6eea57554c04acff0 | 22,714 | py | Python | ventilation_wall_parameters.py | BRI-EES-House/03_ventilation_layer | 57e791dc94435392cf72e54152df38ee50d76ece | [
"MIT"
] | null | null | null | ventilation_wall_parameters.py | BRI-EES-House/03_ventilation_layer | 57e791dc94435392cf72e54152df38ee50d76ece | [
"MIT"
] | 2 | 2020-09-23T07:15:42.000Z | 2021-04-28T07:47:35.000Z | ventilation_wall_parameters.py | BRI-EES-House/03_ventilation_layer | 57e791dc94435392cf72e54152df38ee50d76ece | [
"MIT"
] | null | null | null | import itertools
import pandas as pd
import numpy as np
import global_number
import ventilation_wall as vw
import ventilation_wall_simplified as vws
import envelope_performance_factors as epf
import heat_transfer_coefficient as htc
class Log:
def write(self, msg):
"""
np.seterrのエラーログ記録用の処理(エラー発生時は... | 40.344583 | 158 | 0.58224 |
886c7de79e0407af60f5b0ce3ef11869a60720b8 | 300 | py | Python | solutions/293_flip_game.py | YiqunPeng/leetcode_pro | 7e6376984f9baec49a5e827d98330fe3d1b656f0 | [
"MIT"
] | null | null | null | solutions/293_flip_game.py | YiqunPeng/leetcode_pro | 7e6376984f9baec49a5e827d98330fe3d1b656f0 | [
"MIT"
] | null | null | null | solutions/293_flip_game.py | YiqunPeng/leetcode_pro | 7e6376984f9baec49a5e827d98330fe3d1b656f0 | [
"MIT"
] | null | null | null | class Solution:
def generatePossibleNextMoves(self, s: str) -> List[str]:
"""Running Time: O(n) where n is length of s.
"""
res = []
for i in range(len(s) - 1):
if s[i] == s[i+1] == '+':
res.append(s[:i] + '--' + s[i+2:])
return res
| 30 | 61 | 0.45 |
0d116b3741b9a69060689cc52cc88d9093f50cda | 1,748 | py | Python | src/richie/plugins/simple_picture/cms_plugins.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | 174 | 2018-04-14T23:36:01.000Z | 2022-03-10T09:27:01.000Z | src/richie/plugins/simple_picture/cms_plugins.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | 631 | 2018-04-04T11:28:53.000Z | 2022-03-31T11:18:31.000Z | src/richie/plugins/simple_picture/cms_plugins.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | 64 | 2018-06-27T08:35:01.000Z | 2022-03-10T09:27:43.000Z | """SimplePicture plugin for DjangoCMS."""
from django.utils.translation import gettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from djangocms_picture.models import Picture
from richie.apps.core.defaults import PLUGINS_GROUP
from .forms import SimplePictureForm
from... | 35.673469 | 97 | 0.719108 |
61f8bad6cb253d94d98c8d32c4ee06795f60e4f2 | 14 | py | Python | sampletest/__init__.py | lcskrishna/python-sample-project | 96976f63fc7f2956a0893a6d9a26894d1bfc7703 | [
"MIT"
] | null | null | null | sampletest/__init__.py | lcskrishna/python-sample-project | 96976f63fc7f2956a0893a6d9a26894d1bfc7703 | [
"MIT"
] | null | null | null | sampletest/__init__.py | lcskrishna/python-sample-project | 96976f63fc7f2956a0893a6d9a26894d1bfc7703 | [
"MIT"
] | null | null | null | import sample
| 7 | 13 | 0.857143 |
be338e71f57b849918f13881647c262cf4b08b6c | 1,223 | py | Python | coge/errors.py | asherkhb/PyCoGe_API | ad9e642399127187d9078585a4e65dd9df05f3f7 | [
"BSD-3-Clause"
] | null | null | null | coge/errors.py | asherkhb/PyCoGe_API | ad9e642399127187d9078585a4e65dd9df05f3f7 | [
"BSD-3-Clause"
] | null | null | null | coge/errors.py | asherkhb/PyCoGe_API | ad9e642399127187d9078585a4e65dd9df05f3f7 | [
"BSD-3-Clause"
] | null | null | null | import json
from datetime import datetime
class Error(Exception):
"""Base class for module exceptions."""
pass
class AuthError(Error):
"""Exception raised when authentication is invalid, or fails"""
def __init__(self, msg):
self.msg = msg
class InvalidResponseError(Error):
"""Exception... | 27.795455 | 71 | 0.619787 |
e934a714b54580dd1b6de820150cd074fd9f5fa2 | 2,977 | py | Python | tests/unit/test_vowpal_wabbit.py | mlnethub/recommenders | a744690785455f75a633ce43b67d8ad5a79d5cd7 | [
"MIT"
] | 28 | 2021-11-12T08:26:40.000Z | 2022-03-27T07:21:24.000Z | tests/unit/test_vowpal_wabbit.py | awesomemachinelearning/recommenders | de3782cce370a446e14e6b47e87686867fb7e069 | [
"MIT"
] | 5 | 2021-11-10T02:58:32.000Z | 2022-03-21T16:13:11.000Z | tests/unit/test_vowpal_wabbit.py | awesomemachinelearning/recommenders | de3782cce370a446e14e6b47e87686867fb7e069 | [
"MIT"
] | 9 | 2021-11-03T07:14:47.000Z | 2022-02-22T13:42:04.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import pytest
from unittest import mock
import pandas as pd
from reco_utils.recommender.vowpal_wabbit.vw import VW
@pytest.fixture(scope="module")
def df():
return pd.DataFrame(
dict(user=[1, 3, 2], i... | 22.9 | 87 | 0.570709 |
132805389a7d908aca581aca55b9510dd6be8418 | 11,310 | py | Python | torchvision/models/googlenet.py | ZJUGuoShuai/vision | a9940fe4b2b63bd82a2f853616e00fd0bd112f9a | [
"BSD-3-Clause"
] | null | null | null | torchvision/models/googlenet.py | ZJUGuoShuai/vision | a9940fe4b2b63bd82a2f853616e00fd0bd112f9a | [
"BSD-3-Clause"
] | null | null | null | torchvision/models/googlenet.py | ZJUGuoShuai/vision | a9940fe4b2b63bd82a2f853616e00fd0bd112f9a | [
"BSD-3-Clause"
] | 1 | 2020-01-10T12:50:14.000Z | 2020-01-10T12:50:14.000Z | import warnings
from collections import namedtuple
from typing import Optional, Tuple, List, Callable, Any
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
from .._internally_replaced_utils import load_state_dict_from_url
__all__ = ["GoogLeNet", "googlenet", "GoogLeNetOutpu... | 37.081967 | 119 | 0.598497 |
641db5f5430965629c20df0486b90fa9ee0dc533 | 3,524 | py | Python | aoc_2021/day18.py | guido-weber/AoC_2021 | f5d41ea0600f702857b2c479a67f4f9578afb52b | [
"Unlicense"
] | null | null | null | aoc_2021/day18.py | guido-weber/AoC_2021 | f5d41ea0600f702857b2c479a67f4f9578afb52b | [
"Unlicense"
] | null | null | null | aoc_2021/day18.py | guido-weber/AoC_2021 | f5d41ea0600f702857b2c479a67f4f9578afb52b | [
"Unlicense"
] | null | null | null | import functools
from aoc_2021 import common
test_input = """[[[0,[5,8]],[[1,7],[9,6]]],[[4,[1,2]],[[1,4],2]]]
[[[5,[2,8]],4],[5,[[9,9],0]]]
[6,[[[6,2],[5,6]],[[7,6],[4,7]]]]
[[[6,[0,7]],[0,9]],[4,[9,[9,0]]]]
[[[7,[6,4]],[3,[1,3]]],[[[5,5],1],9]]
[[6,[[7,3],[3,2]]],[[[3,8],[5,7]],4]]
[[[[5,4],[7,7]],8],[[8,3],8]]
[[9... | 24.643357 | 77 | 0.547673 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.