hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2b4b523dc3affd3f0fdb8ee01aec0662e90656e0 | 2,395 | py | Python | ost/s1/burst_batch.py | EOX-A/OpenSarToolk | b0c24065cef282cb433b5f0c14eb535c6c7cbf0c | [
"MIT"
] | 1 | 2020-04-03T17:01:16.000Z | 2020-04-03T17:01:16.000Z | ost/s1/burst_batch.py | EOX-A/OpenSarToolk | b0c24065cef282cb433b5f0c14eb535c6c7cbf0c | [
"MIT"
] | 10 | 2020-05-29T16:21:17.000Z | 2021-03-05T12:23:57.000Z | ost/s1/burst_batch.py | EOX-A/OpenSarToolk | b0c24065cef282cb433b5f0c14eb535c6c7cbf0c | [
"MIT"
] | 1 | 2021-09-24T10:53:39.000Z | 2021-09-24T10:53:39.000Z | import os
import logging
from godale._concurrent import Executor
from ost.s1.burst_to_ard import burst_to_ard
from ost.s1 import burst_inventory
logger = logging.getLogger(__name__)
# ---------------------------------------------------
# Global variable
PRODUCT_LIST = [
'bs.HH', 'bs.VV', 'bs.HV', 'bs.VH',
... | 34.214286 | 84 | 0.601253 |
2b794864d957482deb4258d96cda4b6704a6e69d | 510 | py | Python | 基础教程/A1-Python与基础知识/算法第一步/ExampleCodes/chapter15/15-11_15-12.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 11,094 | 2019-05-07T02:48:50.000Z | 2022-03-31T08:49:42.000Z | 基础教程/A1-Python与基础知识/算法第一步/ExampleCodes/chapter15/15-11_15-12.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 157 | 2019-05-13T15:07:19.000Z | 2022-03-23T08:52:32.000Z | 基础教程/A1-Python与基础知识/算法第一步/ExampleCodes/chapter15/15-11_15-12.py | microsoft/ai-edu | 2f59fa4d3cf19f14e0b291e907d89664bcdc8df3 | [
"Apache-2.0"
] | 2,412 | 2019-05-07T02:55:15.000Z | 2022-03-30T06:56:52.000Z | from Utilities import partition_v2
def q_sort_iteration(arr, low, high):
if low >= high:
return
regions = [[low, high]]
i = 0
while i < len(regions):
low = regions[i][0]
high = regions[i][1]
p = partition_v2(arr, low, high)
if p != -1:
regions.append... | 20.4 | 41 | 0.517647 |
80e31ebf5434345054a827dc131d528ef254bed6 | 256 | py | Python | cart/context_processors.py | itzomen/E-shop | a37e4cc90bbfd598273410b167969fd4edf5fb1f | [
"MIT"
] | 4 | 2020-07-13T10:23:04.000Z | 2020-11-06T04:42:28.000Z | cart/context_processors.py | itzomen/E-shop | a37e4cc90bbfd598273410b167969fd4edf5fb1f | [
"MIT"
] | 7 | 2021-04-08T19:24:02.000Z | 2022-03-12T00:38:34.000Z | cart/context_processors.py | itzomen/E-shop | a37e4cc90bbfd598273410b167969fd4edf5fb1f | [
"MIT"
] | 1 | 2020-08-11T19:11:03.000Z | 2020-08-11T19:11:03.000Z | from .models import Cart
def cart(request):
try:
if(request.user.id):
cart = Cart.objects.get(user=request.user)
return {'cart': cart}
# handles anonymous user
return {}
except:
return {} | 23.272727 | 54 | 0.535156 |
b0592789441a13f70ca2d0d78eca5bb4e7b8b353 | 2,936 | py | Python | tests/conftest.py | vytas7/falcon-multipart-tests | ec761223e9f9b49b82c82f77cb211c0dbad2b318 | [
"Apache-2.0"
] | 2 | 2019-10-07T17:34:19.000Z | 2019-10-16T21:16:51.000Z | tests/conftest.py | vytas7/falcon-multipart-tests | ec761223e9f9b49b82c82f77cb211c0dbad2b318 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | vytas7/falcon-multipart-tests | ec761223e9f9b49b82c82f77cb211c0dbad2b318 | [
"Apache-2.0"
] | null | null | null | import functools
import io
import os
import pytest
from falcon.media.multipart import MultipartForm, MultipartParseOptions
from falcon.util.reader import BufferedReader
try:
from falcon.cyutil.reader import BufferedReader as CyBufferedReader
except ImportError:
CyBufferedReader = None
PARSE_OPTIONS = Multi... | 26.214286 | 79 | 0.700613 |
e516a10c07c3c50a1a25ecc7a9d457d1a8d90a0c | 7,581 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_command.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | null | null | null | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_command.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | null | null | null | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_command.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | 32.676724 | 82 | 0.664424 |
c72f4048f11a759c4ed22abcc5859996ff15bfba | 10,997 | py | Python | TestParametersALL/surface_PSO2 - Test Parameters.py | induraj2020/A7--Optimization-of-Surface-Area-in-land-for-construction | 0efa9606d355be0035385701479148e6f1bb7710 | [
"BSD-2-Clause"
] | null | null | null | TestParametersALL/surface_PSO2 - Test Parameters.py | induraj2020/A7--Optimization-of-Surface-Area-in-land-for-construction | 0efa9606d355be0035385701479148e6f1bb7710 | [
"BSD-2-Clause"
] | null | null | null | TestParametersALL/surface_PSO2 - Test Parameters.py | induraj2020/A7--Optimization-of-Surface-Area-in-land-for-construction | 0efa9606d355be0035385701479148e6f1bb7710 | [
"BSD-2-Clause"
] | null | null | null | from scipy import *
from math import *
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.path import Path
import matplotlib.patches as patches
import sys
import pyclipper
from functools import *
import time
fig = plt.figure()
canv = fig.add_subplot(1,1,1)
canv.set_xlim(0,500)
canv.set_ylim(0,500)
... | 37.152027 | 164 | 0.58425 |
b191331a4b52d3df10e740c700a6a4ee94d6c32d | 13,808 | py | Python | api/python/quilt3/main.py | NathanDeMaria/quilt | 894c98c23fd4788b90ef75ff1b547c6258e5ccce | [
"Apache-2.0"
] | null | null | null | api/python/quilt3/main.py | NathanDeMaria/quilt | 894c98c23fd4788b90ef75ff1b547c6258e5ccce | [
"Apache-2.0"
] | null | null | null | api/python/quilt3/main.py | NathanDeMaria/quilt | 894c98c23fd4788b90ef75ff1b547c6258e5ccce | [
"Apache-2.0"
] | null | null | null | """
Parses the command-line arguments and runs a command.
"""
import argparse
import subprocess
import time
import sys
import dns.resolver
import requests
from . import api, session
from . import __version__ as quilt3_version
from .session import open_url
from .util import get_from_config, catalog_s3_url, catalog_pa... | 35.314578 | 129 | 0.671567 |
7916ac373b55547f5f918640d120c14da1d1d5b0 | 7,612 | py | Python | bw2io/strategies/generic.py | pjamesjoyce/brightway2-io | 142fc26e2ffc47d8ec474386ee93ab2737a089ce | [
"BSD-3-Clause"
] | null | null | null | bw2io/strategies/generic.py | pjamesjoyce/brightway2-io | 142fc26e2ffc47d8ec474386ee93ab2737a089ce | [
"BSD-3-Clause"
] | null | null | null | bw2io/strategies/generic.py | pjamesjoyce/brightway2-io | 142fc26e2ffc47d8ec474386ee93ab2737a089ce | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from eight import *
from bw2data import mapping, Database, databases
from ..units import normalize_units as normalize_units_function
from ..errors import StrategyError
from ..utils import activity_hash, DEFAULT_FIELDS
from copy import deep... | 34.757991 | 185 | 0.614687 |
9d1e09cd2dfade8ab8466b3f4a04883ccf450996 | 346 | py | Python | strings.py | csamiselo/PythonScripsts | 8ac0c086fca691d9c2dd0d8f758059c02f44e3e4 | [
"MIT"
] | null | null | null | strings.py | csamiselo/PythonScripsts | 8ac0c086fca691d9c2dd0d8f758059c02f44e3e4 | [
"MIT"
] | null | null | null | strings.py | csamiselo/PythonScripsts | 8ac0c086fca691d9c2dd0d8f758059c02f44e3e4 | [
"MIT"
] | null | null | null |
def sum(number_one, number_two):
number_one_int = convert_integer(number_one)
number_two_int = convert_integer(number_two)
result = number_one_int + number_two_int
return result
def convert_integer(number_string):
converted_integer = int(number_string)
return converted_integer
answer = su... | 19.222222 | 48 | 0.748555 |
015e0f8bb6fb38dfbf37824b9138a52711659836 | 52,309 | py | Python | models/mhp.py | saadlabyad/aslsd | 95a1cc660079972b45a77ec6dc587d9225489212 | [
"BSD-3-Clause"
] | null | null | null | models/mhp.py | saadlabyad/aslsd | 95a1cc660079972b45a77ec6dc587d9225489212 | [
"BSD-3-Clause"
] | null | null | null | models/mhp.py | saadlabyad/aslsd | 95a1cc660079972b45a77ec6dc587d9225489212 | [
"BSD-3-Clause"
] | null | null | null | # License: BSD 3 clause
import bisect
import copy
import itertools
import pickle
import numpy as np
from tqdm import tqdm
from aslsd.estimators.adaptive_stratified_estimator import AdaptiveStratified
from aslsd.estimators.estimator import Estimator
from aslsd.evaluation import goodness_of_fit as gof
fro... | 41.680478 | 235 | 0.529966 |
81767e2b6ccaa42b3e2bda249db0d2191273c72c | 7,012 | py | Python | code-class-team/Team.py | kirmar/delaysay | 9cba01d9840ddb1ba35430cc709608256134b798 | [
"Apache-2.0"
] | null | null | null | code-class-team/Team.py | kirmar/delaysay | 9cba01d9840ddb1ba35430cc709608256134b798 | [
"Apache-2.0"
] | 2 | 2022-01-19T11:20:06.000Z | 2022-01-19T11:34:32.000Z | code-class-team/Team.py | kirmar/delaysay | 9cba01d9840ddb1ba35430cc709608256134b798 | [
"Apache-2.0"
] | null | null | null | import boto3
import time
import os
from StripeSubscription import StripeSubscription
from datetime import datetime, timedelta
# This is the format used to log dates in the DynamoDB table.
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
class Team:
def __init__(self, id):
assert id and isinstance(id, str)
... | 38.108696 | 79 | 0.604963 |
7a173ce1916ded6e23ac55792cc4f03b17531560 | 5,380 | py | Python | x7/view/modes/common.py | gribbg/x7-view | 53a07b651a08eae63f019b388584cfffceeb2ccb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | x7/view/modes/common.py | gribbg/x7-view | 53a07b651a08eae63f019b388584cfffceeb2ccb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | x7/view/modes/common.py | gribbg/x7-view | 53a07b651a08eae63f019b388584cfffceeb2ccb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | import tkinter as tk
from abc import ABC
from x7.geom.typing import *
from x7.geom.geom import Point
import x7.view.event
from ..digi import DigitizeController
from ..digibase import Mode
from ..shapes import DigitizeShape
__all__ = ['tag_area', 'canvas_find', 'canvas_find_multiple', 'ViewEvent', 'ModeCommon']
def... | 36.849315 | 118 | 0.573234 |
f517b2dc51d59bba847f503456bab0d95ea35198 | 19,842 | py | Python | nailgun/nailgun/test/integration/test_network_configuration.py | prmtl/fuel-web | 3577169e209596a8e4a95d1c41d2dde099a3945f | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/test/integration/test_network_configuration.py | prmtl/fuel-web | 3577169e209596a8e4a95d1c41d2dde099a3945f | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/test/integration/test_network_configuration.py | prmtl/fuel-web | 3577169e209596a8e4a95d1c41d2dde099a3945f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | 40.084848 | 79 | 0.60004 |
89b21958a0272c3d79b8c74565d4170040a236c2 | 2,650 | py | Python | dtcwt/tf/common.py | OneOneFour/dtcwt | c34711561ba00386a727e499bd2ae249640f9aba | [
"BSD-2-Clause"
] | null | null | null | dtcwt/tf/common.py | OneOneFour/dtcwt | c34711561ba00386a727e499bd2ae249640f9aba | [
"BSD-2-Clause"
] | null | null | null | dtcwt/tf/common.py | OneOneFour/dtcwt | c34711561ba00386a727e499bd2ae249640f9aba | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
try:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
except ImportError:
# The lack of tensorflow will be caught by the low-level routines.
pass
class Pyramid(object):
"""A tensorflow representation of a transform domain signal.
An interface-... | 34.415584 | 78 | 0.623019 |
97ee7ff977a8203a0fa561b22e5d3098e87adad4 | 6,881 | py | Python | sdk/python/pulumi_azure_nextgen/web/v20180201/get_web_app_vnet_connection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/web/v20180201/get_web_app_vnet_connection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/web/v20180201/get_web_app_vnet_connection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 36.796791 | 189 | 0.646418 |
a5228ef1ec58881f3e0cd3632e63ac9e499be36c | 12,310 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/dcenodeinterestedvlanrange_02e7ef1c95a71c8d764fab0f1f227d4f.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/dcenodeinterestedvlanrange_02e7ef1c95a71c8d764fab0f1f227d4f.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/dcenodeinterestedvlanrange_02e7ef1c95a71c8d764fab0f1f227d4f.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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, ... | 44.601449 | 255 | 0.6684 |
50018a8e60a806a7cc4e9102f9981c323b6252c3 | 6,414 | py | Python | samples/cookbook/regression/custom_regression.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | samples/cookbook/regression/custom_regression.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | samples/cookbook/regression/custom_regression.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.109756 | 95 | 0.704085 |
03dde642babfb6267b5a0e3381e4627249da49e9 | 1,623 | py | Python | checkov/terraform/checks/resource/aws/SecurityGroupUnrestrictedIngress22.py | acdha/checkov | 3b78cd6297f5b708f63aebd8c07acecf252ffa05 | [
"Apache-2.0"
] | null | null | null | checkov/terraform/checks/resource/aws/SecurityGroupUnrestrictedIngress22.py | acdha/checkov | 3b78cd6297f5b708f63aebd8c07acecf252ffa05 | [
"Apache-2.0"
] | 1 | 2021-06-02T02:53:31.000Z | 2021-06-02T02:53:31.000Z | checkov/terraform/checks/resource/aws/SecurityGroupUnrestrictedIngress22.py | acdha/checkov | 3b78cd6297f5b708f63aebd8c07acecf252ffa05 | [
"Apache-2.0"
] | null | null | null | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
from checkov.common.util.type_forcers import force_list
PORT = 22
class SecurityGroupUnrestrictedIngress22(BaseResourceCheck):
def __init__(self):
name ... | 43.864865 | 123 | 0.636476 |
bb6c4c1a03ec8f9274fb4ce1638c9e19c69892a2 | 1,713 | py | Python | tests/actors/accessibility/test_simulator.py | reapler/geckordp | 29dab2e6e691954a473e054fa95ba40a3ad10e53 | [
"MIT"
] | 1 | 2021-12-24T04:37:02.000Z | 2021-12-24T04:37:02.000Z | tests/actors/accessibility/test_simulator.py | jpramosi/geckordp | 29dab2e6e691954a473e054fa95ba40a3ad10e53 | [
"MIT"
] | 1 | 2021-07-23T13:38:36.000Z | 2021-08-07T14:17:54.000Z | tests/actors/accessibility/test_simulator.py | reapler/geckordp | 29dab2e6e691954a473e054fa95ba40a3ad10e53 | [
"MIT"
] | 1 | 2021-10-31T17:31:35.000Z | 2021-10-31T17:31:35.000Z | # pylint: disable=unused-import
import pytest
import tests.helpers.constants as constants
from tests.helpers.utils import *
from geckordp.rdp_client import RDPClient
from geckordp.actors.root import RootActor
from geckordp.actors.descriptors.tab import TabActor
from geckordp.actors.accessibility.accessibility import Ac... | 35.6875 | 87 | 0.729714 |
751616e1c546cb4c31557124c668c546a7135240 | 4,999 | py | Python | predicting_abx_resistance/PerMutation-GA.py | broadinstitute/PerMutation | 84ff524e53a701c1deb7f253b4caf219e2eb9016 | [
"BSD-3-Clause"
] | null | null | null | predicting_abx_resistance/PerMutation-GA.py | broadinstitute/PerMutation | 84ff524e53a701c1deb7f253b4caf219e2eb9016 | [
"BSD-3-Clause"
] | null | null | null | predicting_abx_resistance/PerMutation-GA.py | broadinstitute/PerMutation | 84ff524e53a701c1deb7f253b4caf219e2eb9016 | [
"BSD-3-Clause"
] | 1 | 2021-09-29T16:48:52.000Z | 2021-09-29T16:48:52.000Z | import os
import sys
import argparse
from collections import defaultdict
import numpy
import math
def p_adjust_bh(p):
"""
Using implementation from https://stackoverflow.com/questions/7450957/how-to-implement-rs-p-adjust-in-python/33532498#33532498
Benjamini-Hochberg p-value correction for multiple hypothe... | 36.489051 | 156 | 0.638328 |
a9a0dae567cc7d99c3270f100c14fe73db91c48b | 2,394 | py | Python | host-software/keyplus/keycodes/lang_map/Russian0.py | ai03-2725/keyplus | 6fb857dff7aa88284d6f6f08532f8da3aae981e1 | [
"MIT"
] | 226 | 2017-08-14T16:11:36.000Z | 2022-03-13T00:58:13.000Z | host-software/keyplus/keycodes/lang_map/Russian0.py | ai03-2725/keyplus | 6fb857dff7aa88284d6f6f08532f8da3aae981e1 | [
"MIT"
] | 90 | 2017-09-12T02:07:39.000Z | 2022-01-27T20:58:19.000Z | host-software/keyplus/keycodes/lang_map/Russian0.py | ai03-2725/keyplus | 6fb857dff7aa88284d6f6f08532f8da3aae981e1 | [
"MIT"
] | 44 | 2017-09-17T17:31:25.000Z | 2022-02-27T08:19:46.000Z | # Copyright 2018 jem@seethis.link
# Licensed under the MIT license (http://opensource.org/licenses/MIT)
from hid_keycodes import *
lang = 'Russian'
country = 'Russia'
scancode_map = {
KC_0: ('0', ')', '', '%', '0', ''),
KC_1: ('1', '!', '', '№', '1', ''),
KC_2: ('2', '@', '', '-', '2', ''),
KC_3: ('3', ... | 40.576271 | 69 | 0.258563 |
25d3ac79100655319309995ddd07e3e669de0d74 | 368,315 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/geodata/data1.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/geodata/data1.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/geodata/data1.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2017 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... | 36.746982 | 75 | 0.531716 |
b1abf7c81e9fe042ac34e59b32616e4452c68bec | 383 | py | Python | src/tars/strategies/__init__.py | fredmontet/tars | 922786e8c6456fc0cc1a9db07714f11dd78219d9 | [
"MIT"
] | 3 | 2022-02-06T14:41:07.000Z | 2022-03-25T16:27:45.000Z | src/tars/strategies/__init__.py | fredmontet/tars | 922786e8c6456fc0cc1a9db07714f11dd78219d9 | [
"MIT"
] | 6 | 2021-09-20T03:33:31.000Z | 2022-03-24T09:00:48.000Z | src/tars/strategies/__init__.py | fredmontet/tars | 922786e8c6456fc0cc1a9db07714f11dd78219d9 | [
"MIT"
] | null | null | null | from .abstract_strategy import AbstractStrategy
from .buy_and_hold_strategy import BuyAndHold
from .random_investment_strategy import RandomInvestment
from .sequential_investment_strategy import SequentialInvestment
from .trend_following_strategy import TrendFollowing
from .trend_following_macd_strategy import TrendFol... | 47.875 | 64 | 0.908616 |
b5dbdcc6413acae66261f9783c3eb96335bbaf29 | 11,274 | py | Python | test/functional/rpc_psbt.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | 1 | 2021-07-12T07:38:58.000Z | 2021-07-12T07:38:58.000Z | test/functional/rpc_psbt.py | anandhu-here/chuckrum | f2a734745e752cda50f5556cded7a713d969f4bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from test_framework.test_framework import ChuckrumTestFrame... | 49.665198 | 209 | 0.644758 |
969429acd21b101d3565ac8f11590d31cec75d4f | 3,099 | py | Python | covid.py | renancvr/covid19-piumhi | 5159bfe1fcc11dc26f1b260ba2a06c4a61249bf5 | [
"MIT"
] | null | null | null | covid.py | renancvr/covid19-piumhi | 5159bfe1fcc11dc26f1b260ba2a06c4a61249bf5 | [
"MIT"
] | null | null | null | covid.py | renancvr/covid19-piumhi | 5159bfe1fcc11dc26f1b260ba2a06c4a61249bf5 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import pandas as pd
import math
def moving_average(a, n=7) :
ret = np.cumsum(a, dtype=float)
ret[n:] = ret[n:] - ret[:-n]
return ret[n - 1:] / n
#leitura de dados e montagem dos arrays para plotagem:
df = pd.read_exc... | 29.798077 | 126 | 0.727654 |
6afd272e033ced6a6b66a9d7761f8febdebaeeb3 | 10,879 | py | Python | tests/puzzle/test_provider.py | maggyero/poetry | 3c7592c2f3d481f5e655a68fc1fa15c5bc024cda | [
"MIT"
] | 2 | 2019-06-19T15:07:58.000Z | 2019-11-24T14:08:55.000Z | tests/puzzle/test_provider.py | djetelina/poetry | 1aa1ab2962bb8b6aed33c2308cf8352809d91685 | [
"MIT"
] | 1 | 2019-09-07T16:31:54.000Z | 2019-09-07T16:31:54.000Z | tests/puzzle/test_provider.py | djetelina/poetry | 1aa1ab2962bb8b6aed33c2308cf8352809d91685 | [
"MIT"
] | 1 | 2019-06-19T15:08:05.000Z | 2019-06-19T15:08:05.000Z | import pytest
from poetry.io import NullIO
from poetry.packages import ProjectPackage
from poetry.packages.directory_dependency import DirectoryDependency
from poetry.packages.file_dependency import FileDependency
from poetry.packages.vcs_dependency import VCSDependency
from poetry.puzzle.provider import Provider
from... | 29.32345 | 87 | 0.646107 |
22914c017cc4c2bae76cc7b6f60e76ed95f9cf20 | 7,515 | py | Python | net3.py | Linuxfabrik/lib | 5dfad5fccf4e6e32e5882c9c832c5a42036a6a35 | [
"Unlicense"
] | 11 | 2022-01-20T14:44:05.000Z | 2022-03-02T13:08:00.000Z | net3.py | Linuxfabrik/lib | 5dfad5fccf4e6e32e5882c9c832c5a42036a6a35 | [
"Unlicense"
] | 4 | 2022-03-07T16:29:02.000Z | 2022-03-24T08:49:17.000Z | net3.py | Linuxfabrik/lib | 5dfad5fccf4e6e32e5882c9c832c5a42036a6a35 | [
"Unlicense"
] | 1 | 2022-03-22T19:17:45.000Z | 2022-03-22T19:17:45.000Z | #! /usr/bin/env python3
# -*- coding: utf-8; py-indent-offset: 4 -*-
#
# Author: Linuxfabrik GmbH, Zurich, Switzerland
# Contact: info (at) linuxfabrik (dot) ch
# https://www.linuxfabrik.ch/
# License: The Unlicense, see LICENSE file.
# https://git.linuxfabrik.ch/linuxfabrik-icinga-plugins/checks-linux/-/blo... | 27.228261 | 98 | 0.579375 |
ce2b8f91c4cde9a0a3dcf6af1fe621756003fb1d | 1,217 | py | Python | tests/uploadscript_tests.py | ZabeMath/pywikibot | 856a197c53efcb80b16475a8d203a4ecd79eee2f | [
"MIT"
] | 326 | 2017-11-21T07:04:19.000Z | 2022-03-26T01:25:44.000Z | tests/uploadscript_tests.py | ZabeMath/pywikibot | 856a197c53efcb80b16475a8d203a4ecd79eee2f | [
"MIT"
] | 17 | 2017-12-20T13:41:32.000Z | 2022-02-16T16:42:41.000Z | tests/uploadscript_tests.py | ZabeMath/pywikibot | 856a197c53efcb80b16475a8d203a4ecd79eee2f | [
"MIT"
] | 147 | 2017-11-22T19:13:40.000Z | 2022-03-29T04:47:07.000Z | """upload.py script test."""
#
# (C) Pywikibot team, 2019-2021
#
# Distributed under the terms of the MIT license.
#
import unittest
from contextlib import suppress
from scripts.upload import CHUNK_SIZE_REGEX, get_chunk_size
from tests.aspects import TestCase
def match(value: str = '') -> int:
"""Create a match ... | 25.893617 | 64 | 0.649137 |
a80fe71def9f07c26f2c7a5084929017e089637d | 4,324 | py | Python | pyam/timeseries.py | Rlamboll/pyam | 0045b119aaa0054d18fed812f5c778d0ab7da4cc | [
"Apache-2.0"
] | null | null | null | pyam/timeseries.py | Rlamboll/pyam | 0045b119aaa0054d18fed812f5c778d0ab7da4cc | [
"Apache-2.0"
] | null | null | null | pyam/timeseries.py | Rlamboll/pyam | 0045b119aaa0054d18fed812f5c778d0ab7da4cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import numpy as np
from pyam.utils import isstr, to_int
logger = logging.getLogger(__name__)
# %%
def fill_series(x, time):
"""Returns the value of a timeseries (indexed over years) for a year or
datetime by linear interpolation.
Parameters
----------
x: p... | 34.592 | 78 | 0.598289 |
f00bdc368aac4a98e6ee7bd50ca6e2fcedf4be01 | 6,112 | py | Python | xls/tools/codegen_main_test.py | ted-xie/xls | ef48ade3403fffc6481ffd779e49aa7082ee268f | [
"Apache-2.0"
] | null | null | null | xls/tools/codegen_main_test.py | ted-xie/xls | ef48ade3403fffc6481ffd779e49aa7082ee268f | [
"Apache-2.0"
] | null | null | null | xls/tools/codegen_main_test.py | ted-xie/xls | ef48ade3403fffc6481ffd779e49aa7082ee268f | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
#
# 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 a... | 38.929936 | 80 | 0.701734 |
e0e8d535dbe9d49c223e329dbf8f9984300d5c4d | 295 | py | Python | endpoint/urls.py | mbp76/tasklist-django | e2a092ae6e704d5c4bfcacd0df5e4c6753373d40 | [
"Apache-2.0"
] | 1 | 2017-04-30T11:08:02.000Z | 2017-04-30T11:08:02.000Z | endpoint/urls.py | mbp76/django-endpoint | e2a092ae6e704d5c4bfcacd0df5e4c6753373d40 | [
"Apache-2.0"
] | null | null | null | endpoint/urls.py | mbp76/django-endpoint | e2a092ae6e704d5c4bfcacd0df5e4c6753373d40 | [
"Apache-2.0"
] | 1 | 2020-06-24T15:30:11.000Z | 2020-06-24T15:30:11.000Z | """
URL Configuration
The `urlpatterns` list routes URLs to views. For more information please, see
https://docs.djangoproject.com/en/1.10/topics/http/urls/
"""
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
| 21.071429 | 77 | 0.735593 |
f2670d778a79fe24a69633e5e663cbcdf3db2444 | 1,994 | py | Python | con_Emergence.py | wbarfuss/EcoPG | 6b9dfe0c75f2af973ddc505135ac9ba5dabc37eb | [
"BSD-2-Clause"
] | 2 | 2021-10-20T09:27:22.000Z | 2022-01-14T13:48:11.000Z | con_Emergence.py | wbarfuss/EcoPG | 6b9dfe0c75f2af973ddc505135ac9ba5dabc37eb | [
"BSD-2-Clause"
] | null | null | null | con_Emergence.py | wbarfuss/EcoPG | 6b9dfe0c75f2af973ddc505135ac9ba5dabc37eb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
condition for the emergemence of cooperation out of CLD
"""
# %% imports
from aux_CLDoperations import X, Xg
from aux_EcoPG import N, Nd, qci, qcj, qri, qrj, b, c, f, mi, mj
from aux_EcoPG import R, T
from aux_EcoPG import fc_reward_subs
import aux_CLDoperations as cld
import sympy as sp
... | 29.323529 | 76 | 0.582748 |
e637ba584daa3755b47a9c0da4c4717b22514b8b | 23,113 | py | Python | scripts/cluster/agent.py | aliceUnhinged613/microk8s | 56a91115b40378952f3b16b8bb9bd4b5ed37901c | [
"Apache-2.0"
] | 1 | 2020-08-09T18:58:38.000Z | 2020-08-09T18:58:38.000Z | scripts/cluster/agent.py | thegirlintheroom613/microk8s | 56a91115b40378952f3b16b8bb9bd4b5ed37901c | [
"Apache-2.0"
] | 16 | 2020-08-25T17:02:09.000Z | 2022-03-02T03:03:55.000Z | scripts/cluster/agent.py | thegirlintheroom613/microk8s | 56a91115b40378952f3b16b8bb9bd4b5ed37901c | [
"Apache-2.0"
] | null | null | null | #!flask/bin/python
import getopt
import json
import os
import random
import shutil
import socket
import string
import subprocess
import sys
import time
import yaml
from .common.utils import (
try_set_file_permissions,
remove_expired_token_from_file,
is_node_running_dqlite,
get_callback_token,
remo... | 33.113181 | 101 | 0.613508 |
a392304a1c1e0383a5ceaf94855be9fb866c6c27 | 2,825 | py | Python | test/functional/rpc_spork.py | CortezDevTeam/encocoin | 638030888618b8b4572a809706346e3297b5cbb7 | [
"MIT"
] | 1 | 2020-10-04T15:43:15.000Z | 2020-10-04T15:43:15.000Z | test/functional/rpc_spork.py | CortezDevTeam/encocoin | 638030888618b8b4572a809706346e3297b5cbb7 | [
"MIT"
] | null | null | null | test/functional/rpc_spork.py | CortezDevTeam/encocoin | 638030888618b8b4572a809706346e3297b5cbb7 | [
"MIT"
] | 3 | 2020-06-07T22:05:26.000Z | 2020-08-31T18:10:54.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 The EncoCoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# -*- coding: utf-8 -*-
from time import sleep
from test_framework.test_framework import EncoCoinTestFramework
fr... | 37.666667 | 102 | 0.668319 |
fa5e18ff877a90f22409d67e866a6b4f0b2a7bee | 4,514 | py | Python | tools/hits_ratios_graph.py | matus-chochlik/ctcache | 59f5c6c75a9d204c70cddce81b61d24bb13ef94a | [
"BSL-1.0"
] | 9 | 2020-12-17T18:56:03.000Z | 2022-02-08T08:23:34.000Z | tools/hits_ratios_graph.py | matus-chochlik/ctcache | 59f5c6c75a9d204c70cddce81b61d24bb13ef94a | [
"BSL-1.0"
] | 3 | 2021-04-12T14:58:58.000Z | 2021-04-14T15:42:53.000Z | tools/hits_ratios_graph.py | matus-chochlik/ctcache | 59f5c6c75a9d204c70cddce81b61d24bb13ef94a | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/python3 -B
# coding=utf8
# Copyright (c) 2020 Matus Chochlik
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt
# ------------------------------------------------------------------------------
# Data from htt... | 31.131034 | 89 | 0.429331 |
643506556a1fb737c7b2351803f1c2bd095e2855 | 1,173 | py | Python | runtests.py | comandrei/django-shortcircuit | a6ab5b5631a753830ae4fe0f6500adf4ea6c4634 | [
"BSD-3-Clause"
] | 1 | 2019-03-20T10:09:48.000Z | 2019-03-20T10:09:48.000Z | runtests.py | comandrei/django-shortcircuit | a6ab5b5631a753830ae4fe0f6500adf4ea6c4634 | [
"BSD-3-Clause"
] | null | null | null | runtests.py | comandrei/django-shortcircuit | a6ab5b5631a753830ae4fe0f6500adf4ea6c4634 | [
"BSD-3-Clause"
] | 1 | 2019-05-09T12:19:57.000Z | 2019-05-09T12:19:57.000Z | import sys
try:
from django.conf import settings
from django.test.utils import get_runner
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
ROOT_URLCONF="shortci... | 20.946429 | 85 | 0.57971 |
ebacc77b25258106e9a2e66b334ccefd5d535782 | 438 | py | Python | meta/scripts/uninstall.py | daephx/dotfiles | 842959c13a000c0f259bdd4df81bbbf8e5f9248e | [
"MIT"
] | null | null | null | meta/scripts/uninstall.py | daephx/dotfiles | 842959c13a000c0f259bdd4df81bbbf8e5f9248e | [
"MIT"
] | null | null | null | meta/scripts/uninstall.py | daephx/dotfiles | 842959c13a000c0f259bdd4df81bbbf8e5f9248e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import yaml
import os
CONFIG="meta/base.yaml"
stream = open(CONFIG, "r")
conf = yaml.load(stream, yaml.FullLoader)
for section in conf:
if 'link' in section:
for target in section['link']:
realpath = os.path.expanduser(target)
... | 21.9 | 49 | 0.630137 |
840484af1b52e54ce3caf21cbba5eba67bcdaadc | 429 | py | Python | photo/migrations/0003_image_created_at.py | leon-bi/foto_ops | 3b58cddaa329c2f49124a9a1f2fc8ee85143c189 | [
"Unlicense"
] | null | null | null | photo/migrations/0003_image_created_at.py | leon-bi/foto_ops | 3b58cddaa329c2f49124a9a1f2fc8ee85143c189 | [
"Unlicense"
] | 6 | 2020-06-06T00:24:31.000Z | 2021-09-08T01:25:04.000Z | photo/migrations/0003_image_created_at.py | Bchizi/foto_ops | 3b58cddaa329c2f49124a9a1f2fc8ee85143c189 | [
"Unlicense"
] | null | null | null | # Generated by Django 2.2.6 on 2019-11-10 14:59
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photo', '0002_auto_20191108_1237'),
]
operations = [
migrations.AddField(
model_name='image',
name='... | 21.45 | 78 | 0.622378 |
808673b77dfa909f9dca9be1ad5692b575177df5 | 403 | py | Python | backend/writers/serializers.py | Nikita-Sherstnev/writers-vue-app | f3c9342306d55e0bb503b62d7450c6ee132ca301 | [
"MIT"
] | null | null | null | backend/writers/serializers.py | Nikita-Sherstnev/writers-vue-app | f3c9342306d55e0bb503b62d7450c6ee132ca301 | [
"MIT"
] | null | null | null | backend/writers/serializers.py | Nikita-Sherstnev/writers-vue-app | f3c9342306d55e0bb503b62d7450c6ee132ca301 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from writers.models import Writer
class WriterSerializer(serializers.ModelSerializer):
class Meta:
model = Writer
fields = ['id',
'surname',
'name',
'middlename',
'birthYear',
... | 23.705882 | 52 | 0.486352 |
6d2b35fe36eef1f9bbdc595b24f63012ef94578d | 132 | py | Python | scripts/portal/market13.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 9 | 2021-04-26T11:59:29.000Z | 2021-12-20T13:15:27.000Z | scripts/portal/market13.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/portal/market13.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 6 | 2021-07-14T06:32:05.000Z | 2022-02-06T02:32:56.000Z | # Magatia (261000000) / NLC Town Center (600000000) => Free Market
sm.setReturnField()
sm.setReturnPortal()
sm.warp(910000000, 36)
| 26.4 | 67 | 0.742424 |
0ed3f86649af2eb513851d355928e9c4ddd76d3e | 3,404 | py | Python | script.module.streamlink.base/resources/lib/streamlink/plugins/tga.py | bobbybark/tantrumrepo | 1451c481254d3fedec9f430139d18db7312a9b1a | [
"Beerware"
] | 3 | 2020-03-03T13:21:44.000Z | 2021-07-21T09:53:31.000Z | script.module.streamlink.base/resources/lib/streamlink/plugins/tga.py | eggman19/tantrumrepo | 1451c481254d3fedec9f430139d18db7312a9b1a | [
"Beerware"
] | null | null | null | script.module.streamlink.base/resources/lib/streamlink/plugins/tga.py | eggman19/tantrumrepo | 1451c481254d3fedec9f430139d18db7312a9b1a | [
"Beerware"
] | 1 | 2018-08-30T20:04:34.000Z | 2018-08-30T20:04:34.000Z | #coding: utf-8
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.plugin.api.utils import parse_query
from streamlink.stream import HLSStream, HTTPStream, RTMPStream
CHANNEL_INFO_URL = "http://api.plu.cn/tga/streams/%s"
QQ_STREAM_INFO_URL = "http://info.zb... | 29.344828 | 91 | 0.583431 |
ccd1909529709cf366ae1acac1353e850ce4488e | 23,550 | py | Python | conjureup/utils.py | iMichka/conjure-up | 8e4599e6f58b52163384150d8d71e7802462d126 | [
"MIT"
] | 1 | 2015-11-09T17:21:22.000Z | 2015-11-09T17:21:22.000Z | conjureup/utils.py | iMichka/conjure-up | 8e4599e6f58b52163384150d8d71e7802462d126 | [
"MIT"
] | null | null | null | conjureup/utils.py | iMichka/conjure-up | 8e4599e6f58b52163384150d8d71e7802462d126 | [
"MIT"
] | null | null | null | import asyncio
import codecs
import errno
import json
import logging
import os
import pty
import re
import shutil
import socket
import subprocess
import sys
import uuid
from collections import Mapping
from contextlib import contextmanager
from functools import partial
from itertools import chain
from pathlib import Pat... | 29.77244 | 79 | 0.573036 |
ba507421d8f9c3f1233785244e5dbc1354d0f23e | 866 | py | Python | var/spack/repos/builtin/packages/py-pep517/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-pep517/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/py-pep517/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyPep517(PythonPackage):
"""Wrappers to build Python packages using PEP 517 hooks.... | 39.363636 | 96 | 0.683603 |
dd720c816d93af55600e1f69aa4f28e34dfc5a53 | 989 | py | Python | hub/sensorhub/migrations/0005_user_agent.py | kblum/sensor-hub | 6b766ca59be74ae1a8d3d42afe048d04b6a0c546 | [
"MIT"
] | null | null | null | hub/sensorhub/migrations/0005_user_agent.py | kblum/sensor-hub | 6b766ca59be74ae1a8d3d42afe048d04b6a0c546 | [
"MIT"
] | null | null | null | hub/sensorhub/migrations/0005_user_agent.py | kblum/sensor-hub | 6b766ca59be74ae1a8d3d42afe048d04b6a0c546 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sensorhub', '0004_deployment_description'),
]
operations = [
migrations.CreateModel(
name='UserAgent',
... | 30.90625 | 114 | 0.57634 |
45e352c25d2731ce5e6b7174f320c27cc01a4286 | 3,222 | py | Python | src/core/annotate.py | 1stDayHack/1stdaykit | ce381cfb24a1a60a72624cb7d57d4bf8a1420c83 | [
"MIT"
] | 5 | 2020-12-05T02:27:23.000Z | 2021-06-28T00:50:20.000Z | src/core/annotate.py | 1stDayHack/1stdaykit | ce381cfb24a1a60a72624cb7d57d4bf8a1420c83 | [
"MIT"
] | 1 | 2020-12-04T05:03:59.000Z | 2020-12-26T06:22:23.000Z | src/core/annotate.py | 1stDayHack/1stdaykit | ce381cfb24a1a60a72624cb7d57d4bf8a1420c83 | [
"MIT"
] | 6 | 2020-12-04T06:16:01.000Z | 2020-12-06T03:57:57.000Z | ### Import modules
import torch
import torch.nn.functional as F
import numpy as np
import json
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import skimage.transform
import argparse
import warnings
from imageio import imread
from PIL import Image
from pprint imp... | 28.767857 | 93 | 0.616698 |
b8b7c6da12e0bbb4139ec3f25764bf3e03ffaf59 | 6,542 | py | Python | dojo/tools/arachni/parser.py | sebbrandt87/django-DefectDojo | e8c152a4270d0ee4701db3804ea1de9bf58a0fe5 | [
"BSD-3-Clause"
] | 11 | 2018-02-25T09:51:58.000Z | 2022-02-18T13:42:32.000Z | dojo/tools/arachni/parser.py | sebbrandt87/django-DefectDojo | e8c152a4270d0ee4701db3804ea1de9bf58a0fe5 | [
"BSD-3-Clause"
] | 102 | 2016-09-12T03:47:41.000Z | 2022-01-20T07:34:18.000Z | dojo/tools/arachni/parser.py | sebbrandt87/django-DefectDojo | e8c152a4270d0ee4701db3804ea1de9bf58a0fe5 | [
"BSD-3-Clause"
] | 40 | 2015-11-23T12:58:29.000Z | 2022-01-20T06:41:16.000Z | from __future__ import with_statement
import json
import re
from base64 import b64encode
from urlparse import urlparse
import html2text
from dojo.models import Finding, Endpoint
from django.utils.encoding import smart_text, force_str
__author__ = "Jay Paz"
class ArachniJSONParser(object):
def __init__(self, j... | 32.874372 | 530 | 0.535005 |
5d2cfa96734abe2fa38608836f127e5906847e25 | 2,061 | py | Python | decisiontree/multitenancy/utils.py | datamade/rapidsms-decisiontree-app | 7613a43f1bb17ffcd6d5a5d6d6f93ad9c09bd2a6 | [
"BSD-3-Clause"
] | 1 | 2018-08-23T06:29:23.000Z | 2018-08-23T06:29:23.000Z | decisiontree/multitenancy/utils.py | datamade/rapidsms-decisiontree-app | 7613a43f1bb17ffcd6d5a5d6d6f93ad9c09bd2a6 | [
"BSD-3-Clause"
] | 9 | 2018-08-07T20:37:52.000Z | 2018-12-28T17:17:16.000Z | decisiontree/multitenancy/utils.py | datamade/rapidsms-decisiontree-app | 7613a43f1bb17ffcd6d5a5d6d6f93ad9c09bd2a6 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.core.urlresolvers import reverse
from django.db.models import Q
def multitenancy_enabled():
return "decisiontree.multitenancy" in settings.INSTALLED_APPS
def get_tenants_for_user(user):
"""Return all tenants that the user can manage."""
from multitenancy.mode... | 36.803571 | 84 | 0.701116 |
7ba964928cc146e05a45a13a5d911e2295db5d1a | 769 | py | Python | 110. Balanced Binary Tree.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | 1 | 2020-07-15T20:48:27.000Z | 2020-07-15T20:48:27.000Z | 110. Balanced Binary Tree.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | 110. Balanced Binary Tree.py | rohitpatwa/leetcode | f4826763e8f154cac9134d53b154b8299acd39a8 | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def isBalanced(self, root: TreeNode) -> bool:
if not root:
return True
return False if self.helper(ro... | 26.517241 | 55 | 0.514954 |
1811394daa51cb9b4bb63b7a6cc3f83a3728d5ca | 1,307 | py | Python | tests/views.py | WoLpH/django-debug-toolbar | 9763d109babc2ca67fd28592d7d253d8a50dd046 | [
"BSD-3-Clause"
] | null | null | null | tests/views.py | WoLpH/django-debug-toolbar | 9763d109babc2ca67fd28592d7d253d8a50dd046 | [
"BSD-3-Clause"
] | null | null | null | tests/views.py | WoLpH/django-debug-toolbar | 9763d109babc2ca67fd28592d7d253d8a50dd046 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import, unicode_literals
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.template.response import TemplateResponse
from django.views.decorators.cache import cache_page... | 25.627451 | 85 | 0.739862 |
2b8d573c5f31e71a51d277352d2f953a81bde2cc | 2,324 | py | Python | test.py | vliu15/dialogue-seq2seq | d78354cdb568963f8e85fce1202e85690535f01c | [
"MIT"
] | 27 | 2019-04-17T11:02:39.000Z | 2021-12-16T09:42:41.000Z | test.py | lixinyu-up/dialogue-seq2seq | d78354cdb568963f8e85fce1202e85690535f01c | [
"MIT"
] | 1 | 2019-03-01T09:21:09.000Z | 2019-03-02T22:49:48.000Z | test.py | vliu15/transformer-rnn-pytorch | d78354cdb568963f8e85fce1202e85690535f01c | [
"MIT"
] | 13 | 2019-03-31T05:16:49.000Z | 2021-07-09T13:08:14.000Z | ''' Translate input text with trained model '''
import torch
import torch.utils.data
import argparse
from tqdm import tqdm
import pickle
from utils.dataset import collate_fn, TranslationDataset
from seq2seq.Translator import Translator
def main():
''' Main function '''
parser = argparse.ArgumentParser(descri... | 37.483871 | 136 | 0.648451 |
3f22e005a43c983631444babc97e8fbb35b0b0a3 | 6,882 | py | Python | examples/from-wiki/light_field_3d_viewer.py | hesom/pycuda | f2f999f51617fcf3deb77f2104b5051885cae498 | [
"Apache-2.0"
] | 1,264 | 2015-01-01T15:38:32.000Z | 2022-03-31T22:30:21.000Z | examples/from-wiki/light_field_3d_viewer.py | hesom/pycuda | f2f999f51617fcf3deb77f2104b5051885cae498 | [
"Apache-2.0"
] | 262 | 2015-01-18T20:52:48.000Z | 2022-03-30T15:57:50.000Z | examples/from-wiki/light_field_3d_viewer.py | hesom/pycuda | f2f999f51617fcf3deb77f2104b5051885cae498 | [
"Apache-2.0"
] | 289 | 2015-01-14T04:30:00.000Z | 2022-03-19T19:58:49.000Z | #!python
"""
3D display of Light Field images.
Example images can be download from:
http://graphics.stanford.edu/software/LFDisplay/LFDisplay-samples.zip
Use:
>> python LFview.py <path to light-field image>
Prerequisites:
- Python 2.7
- Enthought Tool Suite (ETS)
- PIL
- Jinja
Author: Amit Aides. amitibo at technio... | 26.988235 | 89 | 0.555217 |
4fcd9cded2f739414028ba21ae3b5427bd153f63 | 608 | py | Python | datamegh/util/types.py | yankeexe/datamegh | f5a95f493d2dba2c8f9ff22a94b2ff9afc7f0d6e | [
"MIT"
] | 3 | 2020-02-25T09:28:40.000Z | 2020-02-28T04:18:23.000Z | datamegh/util/types.py | yankeexe/datamegh | f5a95f493d2dba2c8f9ff22a94b2ff9afc7f0d6e | [
"MIT"
] | 21 | 2020-02-12T15:32:19.000Z | 2020-03-20T06:48:02.000Z | datamegh/util/types.py | yankeexe/datamegh | f5a95f493d2dba2c8f9ff22a94b2ff9afc7f0d6e | [
"MIT"
] | 1 | 2020-02-20T08:18:48.000Z | 2020-02-20T08:18:48.000Z | """ Type utility functions. """
def is_string(obj):
""" Check if the object is a string. """
try:
basestring
except NameError:
basestring = str
return isinstance(obj, basestring)
def is_iterable(obj):
""" Check if the object is iterable. """
has_iter = hasattr(obj, "__iter__... | 20.266667 | 47 | 0.625 |
44d28a0fe9c0e324efbea306df7edfdf5cce171f | 278 | py | Python | src/utils.py | tech-sketch/fiware-gamepad-controller | d09ec58d8dc642550ffb13806b0a1134aec60e04 | [
"Apache-2.0"
] | 2 | 2019-02-16T14:18:20.000Z | 2019-02-18T02:35:43.000Z | src/utils.py | RoboticBase/fiware-gamepad-controller | d09ec58d8dc642550ffb13806b0a1134aec60e04 | [
"Apache-2.0"
] | null | null | null | src/utils.py | RoboticBase/fiware-gamepad-controller | d09ec58d8dc642550ffb13806b0a1134aec60e04 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
def find_item(obj, cond):
if not isinstance(obj, (tuple, list,)):
return None
if not callable(cond):
return None
try:
return next((item for item in obj if cond(item)), None)
except Exception:
return None
| 21.384615 | 63 | 0.579137 |
e23e05f2a97104066ed6fc93458de8b4696b4611 | 1,576 | py | Python | tests/test_engine_bf.py | shahinsba/angr-platforms | 86f9ea90c396fb5561d0196a2d1a873e573b0294 | [
"BSD-2-Clause"
] | null | null | null | tests/test_engine_bf.py | shahinsba/angr-platforms | 86f9ea90c396fb5561d0196a2d1a873e573b0294 | [
"BSD-2-Clause"
] | null | null | null | tests/test_engine_bf.py | shahinsba/angr-platforms | 86f9ea90c396fb5561d0196a2d1a873e573b0294 | [
"BSD-2-Clause"
] | null | null | null | import os
import logging
import pyvex
import angr
from angr_platforms.bf.engine_bf import UberEngineWithBF
def test_hello():
lifters = pyvex.lifting.lifters['BF']
pyvex.lifting.lifters['BF'] = []
try:
hellobf = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../test_programs/bf/hell... | 36.651163 | 112 | 0.666878 |
0264389a6d97de2e60d69120df2d6843910df099 | 917 | py | Python | setup.py | arjun-zeiss/apeer-python-sdk | d42f1cd5b3ddc444122fda2e09eb2ac376ae3b27 | [
"MIT"
] | null | null | null | setup.py | arjun-zeiss/apeer-python-sdk | d42f1cd5b3ddc444122fda2e09eb2ac376ae3b27 | [
"MIT"
] | null | null | null | setup.py | arjun-zeiss/apeer-python-sdk | d42f1cd5b3ddc444122fda2e09eb2ac376ae3b27 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='apeer-dev-kit',
version='1.1.0',
description='Development kit for creating modules on apeer',
url='https://github.com/apeer-micro/apeer-python-sdk',
author='apeer-micro',
packages=['apeer_dev_kit'],
classifiers=[
"Programming Language... | 48.263158 | 140 | 0.706652 |
9c6bb2f78d74586cc4fa3c52e61553d78ac2b196 | 8,464 | py | Python | equality/wallet/cc_wallet/cc_utils.py | grayfallstown/equality-blockchain | 019425b703f6b013e441481ac43389a80415f2f1 | [
"Apache-2.0"
] | 10 | 2021-07-04T15:14:12.000Z | 2021-10-17T14:52:56.000Z | equality/wallet/cc_wallet/cc_utils.py | grayfallstown/equality-blockchain | 019425b703f6b013e441481ac43389a80415f2f1 | [
"Apache-2.0"
] | 11 | 2021-07-04T19:31:36.000Z | 2022-01-11T02:46:23.000Z | equality/wallet/cc_wallet/cc_utils.py | grayfallstown/equality-blockchain | 019425b703f6b013e441481ac43389a80415f2f1 | [
"Apache-2.0"
] | 11 | 2021-07-04T21:49:17.000Z | 2021-10-04T17:45:38.000Z | import dataclasses
from typing import List, Optional, Tuple
from blspy import AugSchemeMPL, G2Element
from equality.types.blockchain_format.coin import Coin
from equality.types.blockchain_format.program import Program, INFINITE_COST
from equality.types.blockchain_format.sized_bytes import bytes32
from equality.types.... | 33.454545 | 110 | 0.71302 |
4edd364399d169071cb79a83e69d08df5c3b37c1 | 284 | py | Python | tests/models/base/models.py | beproud/bpcommons | c24aed4143d743b1af6c621630ed9faa7e1ccaa4 | [
"BSD-2-Clause"
] | 2 | 2016-03-07T01:52:12.000Z | 2017-08-30T06:14:43.000Z | tests/models/base/models.py | beproud/bpcommons | c24aed4143d743b1af6c621630ed9faa7e1ccaa4 | [
"BSD-2-Clause"
] | 18 | 2015-03-08T13:52:18.000Z | 2022-01-25T02:46:09.000Z | tests/models/base/models.py | beproud/bpcommons | c24aed4143d743b1af6c621630ed9faa7e1ccaa4 | [
"BSD-2-Clause"
] | 2 | 2015-02-07T01:33:00.000Z | 2015-09-08T14:57:44.000Z | #:coding=utf-8:
from beproud.django.commons.models import (
DatedModel as DatedModelBase,
BaseModel as BaseModelBase
)
class DatedModel(DatedModelBase):
class Meta:
app_label = 'base'
class BaseModel(BaseModelBase):
class Meta:
app_label = 'base'
| 16.705882 | 43 | 0.690141 |
133f0df421911c2bf437f8e0fda3199424aad81a | 15,621 | py | Python | piazza_api/rpc.py | jlumbroso/piazza-api | e52b1909fd9df0db262651df56a3f06b3d5773ee | [
"MIT"
] | null | null | null | piazza_api/rpc.py | jlumbroso/piazza-api | e52b1909fd9df0db262651df56a3f06b3d5773ee | [
"MIT"
] | null | null | null | piazza_api/rpc.py | jlumbroso/piazza-api | e52b1909fd9df0db262651df56a3f06b3d5773ee | [
"MIT"
] | null | null | null | import getpass
import json
import requests
import six.moves
from piazza_api.exceptions import AuthenticationError, NotAuthenticatedError, \
RequestError
from piazza_api.nonce import nonce as _piazza_nonce
class PiazzaRPC(object):
"""Unofficial Client for Piazza's Internal API
Example:
>>> p = ... | 35.910345 | 93 | 0.574227 |
584bfdd2a0cda92c1233b152da60fc75964e98df | 8,892 | py | Python | private/upload_pwfile.py | noraj/Kvasir | a5b3775184a8343240e1154a1f762f75df04dc0a | [
"BSD-3-Clause"
] | 194 | 2015-01-04T23:06:42.000Z | 2022-02-11T17:39:28.000Z | private/upload_pwfile.py | The-L0st-Technocrat/Kvasir | ac04512546685cbe814d3eabf644ee3161b6052c | [
"BSD-3-Clause"
] | 26 | 2015-01-02T19:15:39.000Z | 2020-11-11T17:58:34.000Z | private/upload_pwfile.py | The-L0st-Technocrat/Kvasir | ac04512546685cbe814d3eabf644ee3161b6052c | [
"BSD-3-Clause"
] | 65 | 2015-01-19T08:30:51.000Z | 2020-12-28T23:53:31.000Z | #!/usr/bin/env python
# encoding: utf-8
__version__ = "1.0"
"""
##--------------------------------------#
## Kvasir
##
## (c) 2010-2014 Cisco Systems, Inc.
## (c) 2015 Kurt Grutzmacher
##
## Sends the password file(s) via Kvasir API
##
##--------------------------------------#
"""
from optparse import OptionParser, ... | 43.37561 | 1,112 | 0.52834 |
f07b12824ee3722e5badbb911a58502d06fb5448 | 166 | py | Python | python_api/machine_common_sense/mcs_pose.py | bzinberg/MCS | 495562a0d4d0b1e3679b78f0f6fb568a1b9a9ae2 | [
"Apache-2.0"
] | 1 | 2020-03-19T18:44:01.000Z | 2020-03-19T18:44:01.000Z | python_api/machine_common_sense/mcs_pose.py | bzinberg/MCS | 495562a0d4d0b1e3679b78f0f6fb568a1b9a9ae2 | [
"Apache-2.0"
] | null | null | null | python_api/machine_common_sense/mcs_pose.py | bzinberg/MCS | 495562a0d4d0b1e3679b78f0f6fb568a1b9a9ae2 | [
"Apache-2.0"
] | null | null | null | from enum import Enum, unique
@unique
class MCS_Pose(Enum):
CRAWL = "CRAWL"
LIE = "LIE"
SQUAT = "SQUAT"
STAND = "STAND"
UNDEFINED = "UNDEFINED"
| 15.090909 | 29 | 0.608434 |
8f1c17992035c2d83fd70c3c6da4c33ebfe1da77 | 6,313 | py | Python | umpnet/spherical_sampling.py | harryzhangOG/umpnet | 25dabcfbd36ff59a6a2c8c77f52ce6bd307d705e | [
"MIT"
] | 18 | 2022-02-09T07:31:26.000Z | 2022-03-18T01:25:50.000Z | umpnet/spherical_sampling.py | harryzhangOG/umpnet | 25dabcfbd36ff59a6a2c8c77f52ce6bd307d705e | [
"MIT"
] | 2 | 2022-02-15T21:32:23.000Z | 2022-03-22T01:43:08.000Z | umpnet/spherical_sampling.py | harryzhangOG/umpnet | 25dabcfbd36ff59a6a2c8c77f52ce6bd307d705e | [
"MIT"
] | 4 | 2022-02-14T20:26:00.000Z | 2022-03-04T18:53:34.000Z | # https://github.com/marc1701/area-beamforming/blob/SRP_dev/utilities.py
import numpy as np
from scipy.spatial.distance import cdist
# golden ratio
R = (1 + np.sqrt(5)) / 2
def cart_to_sph(cart_co_ords, return_r=False):
# transformation between co-ordinate systems
x, y, z = cart_co_ords[:,0], cart_co_ords[:,1]... | 28.436937 | 77 | 0.556629 |
9bd19c2a51f7692bf186dac80985f36a839194a1 | 10,783 | py | Python | qa/rpc-tests/maxuploadtarget.py | mirzaei-ce/linux-shiabit | 1c0e7371d1bb41e3efe20add0819d4e5050a3a0f | [
"MIT"
] | null | null | null | qa/rpc-tests/maxuploadtarget.py | mirzaei-ce/linux-shiabit | 1c0e7371d1bb41e3efe20add0819d4e5050a3a0f | [
"MIT"
] | null | null | null | qa/rpc-tests/maxuploadtarget.py | mirzaei-ce/linux-shiabit | 1c0e7371d1bb41e3efe20add0819d4e5050a3a0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import ShiabitTestFramework
from test_framework.util import *
from test_framew... | 40.385768 | 140 | 0.65594 |
3b376bc44618f8291c753440b800e755b21088be | 182 | py | Python | gogamechen3/api/wsgi/__init__.py | lolizeppelin/gogamechen3 | 4ff06f9042f1bb0cc22e1cc0b342967a829ae0f8 | [
"MIT"
] | null | null | null | gogamechen3/api/wsgi/__init__.py | lolizeppelin/gogamechen3 | 4ff06f9042f1bb0cc22e1cc0b342967a829ae0f8 | [
"MIT"
] | null | null | null | gogamechen3/api/wsgi/__init__.py | lolizeppelin/gogamechen3 | 4ff06f9042f1bb0cc22e1cc0b342967a829ae0f8 | [
"MIT"
] | null | null | null | from simpleutil.config import cfg
from gogamechen3.api.wsgi.config import register_opts
from gogamechen3 import common
CONF = cfg.CONF
register_opts(CONF.find_group(common.NAME))
| 20.222222 | 53 | 0.82967 |
7764ea891b4fc690e8bab5d9469e656c10c3a727 | 8,514 | py | Python | game_control-master/controlling_steer.py | thedeveloperss/Gesture | 02acb6954f7545e3e868714e90fd4b46e30a2db0 | [
"Apache-2.0"
] | 1 | 2022-03-03T17:57:50.000Z | 2022-03-03T17:57:50.000Z | game_control-master/controlling_steer.py | shivansh-mishraa/Gesture | dac29cfc6510b1ad1530cbcfaeef1b94daf9dbdd | [
"Apache-2.0"
] | null | null | null | game_control-master/controlling_steer.py | shivansh-mishraa/Gesture | dac29cfc6510b1ad1530cbcfaeef1b94daf9dbdd | [
"Apache-2.0"
] | 1 | 2020-10-01T03:52:15.000Z | 2020-10-01T03:52:15.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat July 11 2020
@author: Chanchal Choudhary
@discription: Game control by a steering wheel using openCV
This code is inspired by a project by Patel Digant https://github.com/pateldigant/gesture-gaming-python
"""
# directkeys.py is taken from https://st... | 40.932692 | 124 | 0.646934 |
a5126bc856b182ee5af1fb7c62be5d64686b19c6 | 7,159 | py | Python | trinity/protocol/eth/proto.py | Uxio0/trinity | 38fa6826b80bbda4f608e6dca366e468c362e3c2 | [
"MIT"
] | null | null | null | trinity/protocol/eth/proto.py | Uxio0/trinity | 38fa6826b80bbda4f608e6dca366e468c362e3c2 | [
"MIT"
] | null | null | null | trinity/protocol/eth/proto.py | Uxio0/trinity | 38fa6826b80bbda4f608e6dca366e468c362e3c2 | [
"MIT"
] | null | null | null | from typing import (
List,
Tuple,
TYPE_CHECKING,
Union,
)
from eth_typing import (
Hash32,
BlockNumber,
)
from eth.rlp.headers import BlockHeader
from eth.rlp.receipts import Receipt
from eth.rlp.transactions import BaseTransactionFields
from lahja import (
BroadcastConfig,
)
from p2p.kade... | 29.705394 | 96 | 0.645062 |
e5ad1fbba95f740fa623f281120a97fce30af287 | 384 | py | Python | ai/python/dailyPy/2019/py1118_iter_extend.py | littlepoem/learning | 00b46b09c9ee496addf604bee8b349bc0cf7e6ff | [
"Apache-2.0"
] | null | null | null | ai/python/dailyPy/2019/py1118_iter_extend.py | littlepoem/learning | 00b46b09c9ee496addf604bee8b349bc0cf7e6ff | [
"Apache-2.0"
] | null | null | null | ai/python/dailyPy/2019/py1118_iter_extend.py | littlepoem/learning | 00b46b09c9ee496addf604bee8b349bc0cf7e6ff | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 反向迭代
list1 = list(range(10))
print(list1)
list2 = list(reversed(list1))
print(list2)
# 同时迭代 zip
# zip(a, b) 会生成一个可返回元组 (x, y) 的迭代器,其中 x 来自 a,y 来自 b
# 迭代长度跟参数中最短序列长度一致
names = ['Kate', 'Tom', 'Jim']
ages = [18, 19, 20]
for name, age in zip(names, ages):
print(n... | 10.666667 | 51 | 0.609375 |
14d02c4ad629ee91d9d12d86e0f6b56778b61b36 | 16,701 | py | Python | test/test_parameter_bytes_conversion.py | yochaytz/py-c3d | 215a92be036b5c56839cdcf16264440da3e1a3ee | [
"MIT"
] | null | null | null | test/test_parameter_bytes_conversion.py | yochaytz/py-c3d | 215a92be036b5c56839cdcf16264440da3e1a3ee | [
"MIT"
] | null | null | null | test/test_parameter_bytes_conversion.py | yochaytz/py-c3d | 215a92be036b5c56839cdcf16264440da3e1a3ee | [
"MIT"
] | null | null | null | import c3d
import struct
import unittest
import numpy as np
def genByteWordArr(word, shape):
''' Generate a multi-dimensional byte array from a specific word.
'''
arr = np.array(word)
for d in shape[::-1]:
arr = arr[np.newaxis].repeat(d, 0)
return arr, [len(word)] + [d for d in shape]
... | 47.717143 | 119 | 0.619663 |
cc6f22a21ce13c643d10ca6ca4cbbcb6c15c15fb | 13,572 | py | Python | saleor/dashboard/supplier/views.py | glosoftgroup/ps254-backend | f9c9d798ae8eba29a3a502c6913c2238c4d3906c | [
"BSD-3-Clause"
] | null | null | null | saleor/dashboard/supplier/views.py | glosoftgroup/ps254-backend | f9c9d798ae8eba29a3a502c6913c2238c4d3906c | [
"BSD-3-Clause"
] | 6 | 2021-02-08T20:20:06.000Z | 2022-03-11T23:18:59.000Z | saleor/dashboard/supplier/views.py | glosoftgroup/ps254-backend | f9c9d798ae8eba29a3a502c6913c2238c4d3906c | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import JsonResponse
from django.db.models import Q
from django.shortcuts import get_object_or_404, redirec... | 36 | 153 | 0.714854 |
834e3d8d10b01c56df8b40c64003547202e06fb7 | 3,469 | py | Python | stable-marriages/stable_marriage_test.py | dawidvdh/programmers-introduction-to-mathematics | 2345a118f055bb7f98140ee58d5332c6691e1fc1 | [
"MIT"
] | 2,915 | 2018-10-29T12:42:36.000Z | 2022-03-30T19:12:12.000Z | stable-marriages/stable_marriage_test.py | dawidvdh/programmers-introduction-to-mathematics | 2345a118f055bb7f98140ee58d5332c6691e1fc1 | [
"MIT"
] | 34 | 2018-12-04T23:58:40.000Z | 2021-10-04T16:22:41.000Z | stable-marriages/stable_marriage_test.py | dawidvdh/programmers-introduction-to-mathematics | 2345a118f055bb7f98140ee58d5332c6691e1fc1 | [
"MIT"
] | 272 | 2018-11-04T06:53:40.000Z | 2022-03-28T17:31:45.000Z | from assertpy import assert_that
from stable_marriage import Suited
from stable_marriage import Suitor
from stable_marriage import stable_marriage
from stable_marriage import verify_stable
def test_eq():
suitor = Suitor(0, [0, 1])
suitor2 = Suitor(0, [1, 0])
suited = Suited(0, [0, 1])
suited2 = Suite... | 31.252252 | 68 | 0.556356 |
fb23dd46ca3ec87d1049c30d81d92085a64fdda6 | 5,263 | py | Python | server/particles.py | vanjo9800/gravityBalls | 921374a8d1a8c392d331e1d8a8164c35f1045f00 | [
"MIT"
] | 1 | 2019-05-07T14:12:32.000Z | 2019-05-07T14:12:32.000Z | server/particles.py | vanjo9800/gravityBalls | 921374a8d1a8c392d331e1d8a8164c35f1045f00 | [
"MIT"
] | null | null | null | server/particles.py | vanjo9800/gravityBalls | 921374a8d1a8c392d331e1d8a8164c35f1045f00 | [
"MIT"
] | null | null | null | import math
import random
def addVectors(al1,al2):
""" Returns the sum of two vectors """
angle2,length2 = al2
angle1,length1 = al1
x = math.sin(angle1) * length1 + math.sin(angle2) * length2
y = math.cos(angle1) * length1 + math.cos(angle2) * length2
angle = 0.5 * math.pi... | 36.804196 | 141 | 0.560707 |
21af8e4b5380a3aa21e81ef859c35dac7cdc0324 | 1,697 | py | Python | test/test_mutators.py | mehrdad-shokri/Bashfuscator | 7487348da2d0112213f8540ae28bf12b652f924a | [
"MIT"
] | 859 | 2018-08-07T02:06:01.000Z | 2022-03-24T10:00:13.000Z | test/test_mutators.py | mehrdad-shokri/Bashfuscator | 7487348da2d0112213f8540ae28bf12b652f924a | [
"MIT"
] | 25 | 2018-09-13T19:30:17.000Z | 2022-01-05T17:53:35.000Z | test/test_mutators.py | mehrdad-shokri/Bashfuscator | 7487348da2d0112213f8540ae28bf12b652f924a | [
"MIT"
] | 123 | 2018-08-11T02:48:36.000Z | 2022-03-30T13:46:57.000Z | from datetime import datetime
import os
import pytest
from subprocess import STDOUT, PIPE, Popen
from bashfuscator.core.engine.obfuscation_handler import ObfuscationHandler
inputCommand = "echo 'It works!'"
expectedOutput = "It works!\n"
obHandler = ObfuscationHandler()
commandObNames = [(c.longName, s.longName) f... | 38.568182 | 153 | 0.695345 |
4df043d61d6da23e6220ee89734d8b0b3e186611 | 3,508 | py | Python | Old model/Old v2/scenario_module.py | zenmood/IndoorFarmWiz | 0f5075007cbd1d15c83ed3aef820ec3d72048a90 | [
"MIT"
] | 11 | 2020-06-28T04:30:26.000Z | 2022-03-26T08:40:47.000Z | Old model/Old v2/scenario_module.py | zenmood/IndoorFarmWiz | 0f5075007cbd1d15c83ed3aef820ec3d72048a90 | [
"MIT"
] | 4 | 2020-07-27T19:45:27.000Z | 2020-07-28T13:58:41.000Z | Old model/Old v2/scenario_module.py | zenmood/IndoorFarmWiz | 0f5075007cbd1d15c83ed3aef820ec3d72048a90 | [
"MIT"
] | null | null | null | # INPUT SCENARIO CLASS #
class Scenario(object):
def __init__(self):
self.currency = None # The type of currency
self.country = None # The country of the farm (no caps)
self.capex = None # The starting amount of money or loan
self.repayment = None # The loan repayment amount
... | 48.054795 | 116 | 0.651083 |
a65d335085a5b4fc1613ed3db7cf60ad7f55ecab | 4,508 | py | Python | test/unit/services/eth/test_eth_extension_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 21 | 2019-11-06T17:37:41.000Z | 2022-03-28T07:18:33.000Z | test/unit/services/eth/test_eth_extension_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 4 | 2019-11-06T22:08:00.000Z | 2021-12-08T06:20:51.000Z | test/unit/services/eth/test_eth_extension_block_cleanup_service.py | doubleukay/bxgateway | ac01fc9475c039cf4255576dd4ecd6bff6c48f69 | [
"MIT"
] | 10 | 2020-08-05T15:58:16.000Z | 2022-02-07T23:51:10.000Z | import os
from mock import MagicMock
from bxcommon.services.extension_transaction_service import ExtensionTransactionService
from bxcommon.services.transaction_service import TransactionService
from bxcommon.test_utils import helpers
from bxcommon.utils import convert
from bxcommon.utils.object_hash import Sha256Hash,... | 47.957447 | 102 | 0.76331 |
f41c25d0cd16554447fbfd1dc0e39e6dfc1d3f80 | 43,861 | py | Python | lektor/builder.py | evilham/lektor | a2f32e620f8978504c2b898dc2e50a6bf71ec30e | [
"BSD-3-Clause"
] | null | null | null | lektor/builder.py | evilham/lektor | a2f32e620f8978504c2b898dc2e50a6bf71ec30e | [
"BSD-3-Clause"
] | null | null | null | lektor/builder.py | evilham/lektor | a2f32e620f8978504c2b898dc2e50a6bf71ec30e | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import os
import shutil
import sqlite3
import stat
import sys
import tempfile
from collections import deque
from collections import namedtuple
from contextlib import contextmanager
from itertools import chain
import click
from lektor.build_programs import builtin_build_programs
from lektor.buildfailure... | 34.64534 | 91 | 0.552427 |
78736908ac90934f91fdd1b9cbd63b1f98ba3e8b | 1,628 | py | Python | module1-web-application-development-with-flask/Unit 3 Sprint 3 Module 1/myapp.py | SarmenSinanian/DS-Unit-3-Sprint-3-Productization-and-Cloud | f67562632eef1377921eee53e3d0d62bbafc5d5e | [
"MIT"
] | null | null | null | module1-web-application-development-with-flask/Unit 3 Sprint 3 Module 1/myapp.py | SarmenSinanian/DS-Unit-3-Sprint-3-Productization-and-Cloud | f67562632eef1377921eee53e3d0d62bbafc5d5e | [
"MIT"
] | null | null | null | module1-web-application-development-with-flask/Unit 3 Sprint 3 Module 1/myapp.py | SarmenSinanian/DS-Unit-3-Sprint-3-Productization-and-Cloud | f67562632eef1377921eee53e3d0d62bbafc5d5e | [
"MIT"
] | null | null | null | # # import my flask package
# from flask import Flask, render_template
#
# # create Flask web server
# app = Flask(__name__)
#
# # route determines location
# @app.route("/")
#
# # define a little function to tell
# # app what to do at that route (app.rout("/"))
# # http://127.0.0.1:5000
# def home():
# ... | 25.046154 | 55 | 0.665848 |
abfeb155e60cd9806ebca20210a264a430c4c30b | 3,105 | py | Python | playground/optimization/ottKama155it/custom_indicators/ott.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 38 | 2021-09-18T15:33:28.000Z | 2022-02-21T17:29:08.000Z | playground/optimization/ottKama155it/custom_indicators/ott.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 4 | 2022-01-02T14:46:12.000Z | 2022-02-16T18:39:41.000Z | playground/optimization/ottKama155it/custom_indicators/ott.py | ysdede/jesse_strategies | ade9f4ba42cec11207c766d267b9d8feb8bce648 | [
"CC0-1.0"
] | 11 | 2021-10-19T06:21:43.000Z | 2022-02-21T17:29:10.000Z | from collections import namedtuple
import numpy as np
import numba
import talib
from jesse.helpers import get_candle_source, slice_candles
import custom_indicators as cta
OTT = namedtuple('OTT', ['ott', 'mavg', 'long_stop', 'short_stop'])
def ott(candles: np.ndarray, length: int = 2, percent: float = 1.4, ma_type=... | 33.031915 | 103 | 0.599678 |
5cf04ffa93f43d7508e83b8f363f59b518da2e8b | 1,193 | py | Python | drawbot/animateMutatorSans.py | justvanrossum/mutatorSans | d8f0fb27ec3815486887328dd843689d2a10db86 | [
"MIT"
] | null | null | null | drawbot/animateMutatorSans.py | justvanrossum/mutatorSans | d8f0fb27ec3815486887328dd843689d2a10db86 | [
"MIT"
] | null | null | null | drawbot/animateMutatorSans.py | justvanrossum/mutatorSans | d8f0fb27ec3815486887328dd843689d2a10db86 | [
"MIT"
] | null | null | null | import math
d = listFontVariations("MutatorMathTest")
print(list(d.keys()))
for fontName in installedFonts():
variations = listFontVariations(fontName)
if variations:
print(fontName)
for axis_name, dimensions in variations.items():
print (axis_name, dimensions)
print ()
w... | 25.934783 | 89 | 0.656329 |
760a7bd040511bef9fd32f55a315eb790b647c0a | 61,723 | py | Python | python/ccxt/async_support/huobipro.py | mark-luke/Pay-Encrypt | 1579917a7ad8f28038625ee27beed98a42c9f28f | [
"MIT"
] | null | null | null | python/ccxt/async_support/huobipro.py | mark-luke/Pay-Encrypt | 1579917a7ad8f28038625ee27beed98a42c9f28f | [
"MIT"
] | null | null | null | python/ccxt/async_support/huobipro.py | mark-luke/Pay-Encrypt | 1579917a7ad8f28038625ee27beed98a42c9f28f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.... | 43.899716 | 355 | 0.484698 |
4bcedbd7b4ffbca748c760e8e1dcbcb940f49430 | 2,221 | py | Python | eisenmann-backend/service/migrations/0001_initial.py | RubenRodrigo/Eisenmann-Inventory | 5abb59a11d43987db3d1742b6f0978c6aa6ee81d | [
"MIT"
] | null | null | null | eisenmann-backend/service/migrations/0001_initial.py | RubenRodrigo/Eisenmann-Inventory | 5abb59a11d43987db3d1742b6f0978c6aa6ee81d | [
"MIT"
] | null | null | null | eisenmann-backend/service/migrations/0001_initial.py | RubenRodrigo/Eisenmann-Inventory | 5abb59a11d43987db3d1742b6f0978c6aa6ee81d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2022-01-31 11:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('product', '0001_initial'),
('employee', '0001_initial'),
('client', '0001_initial'),
... | 49.355556 | 170 | 0.615038 |
2a8566e4cd6e4c7b7f59bc6fbabffb5f1337881e | 1,461 | py | Python | linked_list.py | cunctat0r/pystudy | 5fe55518faa6ba957001ce9c6f268babb4b98784 | [
"MIT"
] | null | null | null | linked_list.py | cunctat0r/pystudy | 5fe55518faa6ba957001ce9c6f268babb4b98784 | [
"MIT"
] | null | null | null | linked_list.py | cunctat0r/pystudy | 5fe55518faa6ba957001ce9c6f268babb4b98784 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, data, nxt=None):
self.data = data
self.next_node = nxt
def get_next(self):
return self.next_node
def set_next(self, nxt):
self.next_node = nxt
def get_data(self):
return self.data
def set_data(delf, data):
sel... | 23.564516 | 60 | 0.531828 |
8ba12b6a1db5d0324347ee37f701ccc86197dc3c | 569 | py | Python | api/features/migrations/0033_feature_owners.py | mevinbabuc/flagsmith | 751bd6cb4a34bd2f80af5a9c547559da9c2fa010 | [
"BSD-3-Clause"
] | 1,259 | 2021-06-10T11:24:09.000Z | 2022-03-31T10:30:44.000Z | api/features/migrations/0033_feature_owners.py | mevinbabuc/flagsmith | 751bd6cb4a34bd2f80af5a9c547559da9c2fa010 | [
"BSD-3-Clause"
] | 392 | 2021-06-10T11:12:29.000Z | 2022-03-31T10:13:53.000Z | api/features/migrations/0033_feature_owners.py | mevinbabuc/flagsmith | 751bd6cb4a34bd2f80af5a9c547559da9c2fa010 | [
"BSD-3-Clause"
] | 58 | 2021-06-11T03:18:07.000Z | 2022-03-31T14:39:10.000Z | # Generated by Django 2.2.24 on 2021-09-19 11:36
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("features", "0032_update_feature_type"),
]
opera... | 24.73913 | 74 | 0.630931 |
10dd16be2abb4036d19f9676058453da831f6e1a | 13,254 | py | Python | segtypes/common/data.py | paulsapps/splat | e312b86f36982dfddc4b00f082d7066f0b259938 | [
"MIT"
] | null | null | null | segtypes/common/data.py | paulsapps/splat | e312b86f36982dfddc4b00f082d7066f0b259938 | [
"MIT"
] | null | null | null | segtypes/common/data.py | paulsapps/splat | e312b86f36982dfddc4b00f082d7066f0b259938 | [
"MIT"
] | null | null | null | from segtypes.common.code import CommonSegCode
from segtypes.common.codesubsegment import CommonSegCodeSubsegment
from segtypes.common.group import CommonSegGroup
from pathlib import Path
from typing import List, Optional
from util.symbols import Symbol
from util import floats, options
class CommonSegData(CommonSegCod... | 36.61326 | 147 | 0.543459 |
62d4f4f89a83f439fb9af5e57e54d2282e0eceef | 1,835 | py | Python | rlbench/tasks/disl_pick_up_blue_cup_ur.py | Schellenberg3/RLBench | eb282087d50a9758df319feef8e0762bf27d56ca | [
"BSD-3-Clause"
] | null | null | null | rlbench/tasks/disl_pick_up_blue_cup_ur.py | Schellenberg3/RLBench | eb282087d50a9758df319feef8e0762bf27d56ca | [
"BSD-3-Clause"
] | null | null | null | rlbench/tasks/disl_pick_up_blue_cup_ur.py | Schellenberg3/RLBench | eb282087d50a9758df319feef8e0762bf27d56ca | [
"BSD-3-Clause"
] | null | null | null | from typing import List, Tuple
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor
from rlbench.const import colors
from rlbench.backend.task import Task
from rlbench.backend.conditions import DetectedCondition, NothingGrasped, GraspedCondition
from rlbenc... | 35.288462 | 90 | 0.673569 |
f929322fd15947e59964e596298437abbaf46242 | 15,609 | py | Python | dataset/convert_tfrecords.py | wenzhenmiao/KITTI_to_tfrecords | febb7ab1948c827a0c9071ba0d1d1a859ce9a47c | [
"Apache-2.0"
] | 1 | 2020-03-09T19:23:02.000Z | 2020-03-09T19:23:02.000Z | dataset/convert_tfrecords.py | wenzhenmiao/KITTI_to_tfrecords | febb7ab1948c827a0c9071ba0d1d1a859ce9a47c | [
"Apache-2.0"
] | null | null | null | dataset/convert_tfrecords.py | wenzhenmiao/KITTI_to_tfrecords | febb7ab1948c827a0c9071ba0d1d1a859ce9a47c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Changan Wang
# 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, so... | 39.31738 | 133 | 0.681466 |
192cbf6ffd8a42ff4c9affe89bfd85fe3e425d81 | 13,338 | py | Python | devel/_setup_util.py | shang-hl/ROS-NUS_FYP | 92aff3f8ad0beebb27f8c29a942108aac0172f58 | [
"MIT"
] | null | null | null | devel/_setup_util.py | shang-hl/ROS-NUS_FYP | 92aff3f8ad0beebb27f8c29a942108aac0172f58 | [
"MIT"
] | null | null | null | devel/_setup_util.py | shang-hl/ROS-NUS_FYP | 92aff3f8ad0beebb27f8c29a942108aac0172f58 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, 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:
#
# * Redistri... | 43.731148 | 213 | 0.682336 |
d455c827f283b40066dc88d9a9e638feeae71a38 | 5,952 | py | Python | utilities/copy_acd_bcd_files.py | slochower/host-guest-benchmarks | c398b499fe6dbae39523278946c0e25eb78d6d66 | [
"MIT"
] | null | null | null | utilities/copy_acd_bcd_files.py | slochower/host-guest-benchmarks | c398b499fe6dbae39523278946c0e25eb78d6d66 | [
"MIT"
] | 8 | 2019-07-05T17:55:27.000Z | 2022-03-21T18:59:50.000Z | utilities/copy_acd_bcd_files.py | slochower/host-guest-benchmarks | c398b499fe6dbae39523278946c0e25eb78d6d66 | [
"MIT"
] | 1 | 2020-05-05T22:51:21.000Z | 2020-05-05T22:51:21.000Z | import os
import subprocess as sp
from pathlib import Path
import parmed as pmd
systems = """./a-bam-p
./a-bam-s
./a-but-p
./a-but-s
./a-cbu-p
./a-chp-p
./a-cbu-s
./a-chp-s
./a-cpe-p
./a-coc-p
./a-coc-s
./a-cpe-s
./a-hep-p
./a-ham-s
./a-ham-p
./a-hep-s
./a-hp6-p
./a-hex-p
./a-hex-s
./a-hp6-s
./a-hx2-p
./a-hpa-s
./a-h... | 24.293878 | 101 | 0.59711 |
5a3f3a3a3ebb96d3fca6cb7e897bebc49823db66 | 1,748 | py | Python | KFM_train.py | Collapsar-G/Recommended-system | 687cedd8d8fa7354363bf7d2ee482bb172abd6a2 | [
"Apache-2.0"
] | null | null | null | KFM_train.py | Collapsar-G/Recommended-system | 687cedd8d8fa7354363bf7d2ee482bb172abd6a2 | [
"Apache-2.0"
] | null | null | null | KFM_train.py | Collapsar-G/Recommended-system | 687cedd8d8fa7354363bf7d2ee482bb172abd6a2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Author : Collapsar-G
@License : (C) Copyright 2021-*
@Contact : gjf840513468@gmail.com
@File : $train.py
@Time : $2021.4.21 $8:50
@Desc : KFM模型训练入口
"""
import os
import time as time
import torch
from dataset import data_load
from miscc... | 24.971429 | 95 | 0.616133 |
28b13a6c7d9f536811a17b4e5f4a65a8296434b7 | 1,048 | py | Python | lib/surface/compute/disks/__init__.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/disks/__init__.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/disks/__init__.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# 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 requir... | 31.757576 | 74 | 0.764313 |
0dc6d990a7747c25cc2dbb86fee8e1d0e67a9208 | 1,297 | py | Python | test/blueprints/plant/conftest.py | keithly/flower-bed-designer | 598cc14d60f822b91557df2328844da99b8040b7 | [
"MIT"
] | null | null | null | test/blueprints/plant/conftest.py | keithly/flower-bed-designer | 598cc14d60f822b91557df2328844da99b8040b7 | [
"MIT"
] | null | null | null | test/blueprints/plant/conftest.py | keithly/flower-bed-designer | 598cc14d60f822b91557df2328844da99b8040b7 | [
"MIT"
] | null | null | null | import pytest
@pytest.fixture
def test_plants_data():
return [
{
'plant_id': 1,
'common_name': 'common milkweed',
'genus': 'asclepias',
'species': 'syriaca',
'family': 'asclepiadaceae',
'rhizomatous': True,
'garden_friendl... | 24.471698 | 48 | 0.511951 |
3c535fab8ad79c9a4b76652917aba6dc3bdc7f29 | 4,201 | py | Python | index.py | scottmetoyer/nzb-indexer | 177cd3cb54f385d7af5df9668f9c6793147cd092 | [
"MIT"
] | 8 | 2015-01-17T06:16:08.000Z | 2019-12-04T10:49:45.000Z | index.py | scottmetoyer/nzb-indexer | 177cd3cb54f385d7af5df9668f9c6793147cd092 | [
"MIT"
] | null | null | null | index.py | scottmetoyer/nzb-indexer | 177cd3cb54f385d7af5df9668f9c6793147cd092 | [
"MIT"
] | 2 | 2016-10-26T10:21:07.000Z | 2019-12-04T10:49:46.000Z | # index.py
# Scott Metoyer, 2013
# Retrieves a list of new NZB's from the newsgroups specified in a config file
from nntplib import *
from pymongo import MongoClient
import string
import datetime
import time
try:
from config_local import config as config
except ImportError:
from config_default import config a... | 35.008333 | 119 | 0.577482 |
fd20639d81f778e7905249f8f2bce96e731e762c | 9,488 | py | Python | code/viz.py | minji7608/asst4-s20 | e901ff749799240eb30dba52ef6721cbcf414d87 | [
"MIT"
] | null | null | null | code/viz.py | minji7608/asst4-s20 | e901ff749799240eb30dba52ef6721cbcf414d87 | [
"MIT"
] | null | null | null | code/viz.py | minji7608/asst4-s20 | e901ff749799240eb30dba52ef6721cbcf414d87 | [
"MIT"
] | null | null | null | # Visualization tools for graphrat simulator
# For printing ASCII representation of maze
# And for showing as a heat map
import math
import sys
import curses
import time
import datetime
# Some installations don't support Tkinter and PIL libraries.
# Import them only if needed
specialImported = False
def importSpeci... | 31.732441 | 116 | 0.536046 |
cdc3691b923fbfc148679779e845c8adbd8fa6d2 | 6,167 | py | Python | core/gdelt-diff.py | JustinTimperio/gdelt-diff | b20290837ffb12dff4e112cd87ec070df9932e9d | [
"MIT"
] | 3 | 2019-06-27T21:45:38.000Z | 2021-02-11T15:26:43.000Z | core/gdelt-diff.py | JustinTimperio/gdelt-diff | b20290837ffb12dff4e112cd87ec070df9932e9d | [
"MIT"
] | 1 | 2021-02-11T15:26:39.000Z | 2021-02-11T17:52:40.000Z | core/gdelt-diff.py | JustinTimperio/gdelt-diff | b20290837ffb12dff4e112cd87ec070df9932e9d | [
"MIT"
] | 1 | 2020-10-22T18:19:30.000Z | 2020-10-22T18:19:30.000Z | #! /usr/bin/env python3
import os
import sys
import paf
import argparse
import requests
config = {
'base': '/opt/gdelt-diff',
'user_config': '/etc/gdelt-diff/config',
'english': 'http://data.gdeltproject.org/gdeltv2/masterfilelist.txt',
'translation': 'http://data.gdeltproject.org/gdeltv2/masterfileli... | 34.261111 | 148 | 0.624615 |
a01e8a6e1621e19158817fa366e18c450d24cebd | 5,002 | py | Python | student_feedback_project/student_feedback_app/tests/test_models.py | Ashwin-MJ/UniCom | 89d02bd93ba7de6fd774a8a0be9c4b8c12f8ee99 | [
"Unlicense"
] | null | null | null | student_feedback_project/student_feedback_app/tests/test_models.py | Ashwin-MJ/UniCom | 89d02bd93ba7de6fd774a8a0be9c4b8c12f8ee99 | [
"Unlicense"
] | 5 | 2019-01-15T15:03:45.000Z | 2019-03-20T11:58:55.000Z | student_feedback_project/student_feedback_app/tests/test_models.py | Ashwin-MJ/UniCom | 89d02bd93ba7de6fd774a8a0be9c4b8c12f8ee99 | [
"Unlicense"
] | null | null | null | from student_feedback_app.models import *
from django.test import TestCase
from populate import *
# Ensure all test methods begin with test_..... otherwise they will not run
class StudentTestCase(TestCase):
def setUp(self):
add_course("Systems Programming 3", "SP3", "Introduction to Systems Programming u... | 41 | 116 | 0.681927 |
694afea209a03d3de15b92102f2dbfffe64b657a | 14,922 | py | Python | conda_concourse_ci/cli.py | pseudoyim/conda-concourse-ci | 36ea5ff858397556412508574bccebd3b0c6fb9f | [
"BSD-3-Clause"
] | null | null | null | conda_concourse_ci/cli.py | pseudoyim/conda-concourse-ci | 36ea5ff858397556412508574bccebd3b0c6fb9f | [
"BSD-3-Clause"
] | null | null | null | conda_concourse_ci/cli.py | pseudoyim/conda-concourse-ci | 36ea5ff858397556412508574bccebd3b0c6fb9f | [
"BSD-3-Clause"
] | null | null | null | import argparse
import logging
import os
from conda_build.conda_interface import cc_conda_build
from conda_concourse_ci import __version__, execute
def parse_args(parse_this=None):
parser = argparse.ArgumentParser()
parser.add_argument('--debug', action='store_true')
parser.add_argument('--version', act... | 50.073826 | 115 | 0.611178 |
74997322d8643623ca4361148bc4de94b30c738c | 17,544 | py | Python | pytorch_lightning/trainer/distrib_parts.py | sebastienwood/pytorch-lightning | b8e864b2a854851463b9217efcb9616ff7f2c49e | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/distrib_parts.py | sebastienwood/pytorch-lightning | b8e864b2a854851463b9217efcb9616ff7f2c49e | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/distrib_parts.py | sebastienwood/pytorch-lightning | b8e864b2a854851463b9217efcb9616ff7f2c49e | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning 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
#
# Unless required by applicable law or agreed to i... | 33.803468 | 124 | 0.661879 |
3e576ebbff6bd52e93c4107223d4f5e8c9e18386 | 3,306 | py | Python | tests/test_sums.py | Autoplectic/ludology | e43d7f3c996ae9499d33cd5e1b64acca8b1d29b8 | [
"BSD-2-Clause"
] | 4 | 2021-03-09T18:10:41.000Z | 2021-10-14T03:10:46.000Z | tests/test_sums.py | Autoplectic/ludology | e43d7f3c996ae9499d33cd5e1b64acca8b1d29b8 | [
"BSD-2-Clause"
] | 11 | 2018-05-19T00:40:10.000Z | 2019-12-09T06:14:35.000Z | tests/test_sums.py | Autoplectic/ludology | e43d7f3c996ae9499d33cd5e1b64acca8b1d29b8 | [
"BSD-2-Clause"
] | 5 | 2018-08-23T17:33:39.000Z | 2022-02-04T15:04:55.000Z | """
Tests for ludology.sums.
"""
import pytest
from ludology import Game
from ludology.canonical_form import canonical_form
from ludology.closet import one, pm_one, star, up, zero
from ludology.sums import (conjunctive, continued_conjunctive,
diminished_disjunctive, disjunctive, ordinal,
... | 24.308824 | 91 | 0.572293 |
33b43106e49be9783886d263a639d461d747098c | 17,396 | py | Python | reflectivity_ui/interfaces/data_handling/data_info.py | jenest/reflectivity_ui | 9fc746e1729d57268c621e6a655b5022fba3af8b | [
"Apache-2.0"
] | null | null | null | reflectivity_ui/interfaces/data_handling/data_info.py | jenest/reflectivity_ui | 9fc746e1729d57268c621e6a655b5022fba3af8b | [
"Apache-2.0"
] | null | null | null | reflectivity_ui/interfaces/data_handling/data_info.py | jenest/reflectivity_ui | 9fc746e1729d57268c621e6a655b5022fba3af8b | [
"Apache-2.0"
] | null | null | null | """
Meta-data information for MR reduction
"""
#pylint: disable=too-few-public-methods, wrong-import-position, too-many-instance-attributes, wrong-import-order
from __future__ import absolute_import, division, print_function
import sys
import time
import logging
import math
import copy
import numpy as np
from scip... | 39.899083 | 121 | 0.590423 |
12db84745394ce94d911a93f3780604a01ea9b78 | 325 | py | Python | golpy/model/rules/example_rules.py | dkuska/golpy | a7bc73693090c252fa5ac587fe0d6c77472d9e9c | [
"MIT"
] | 1 | 2021-01-06T09:19:19.000Z | 2021-01-06T09:19:19.000Z | golpy/model/rules/example_rules.py | dkuska/golpy | a7bc73693090c252fa5ac587fe0d6c77472d9e9c | [
"MIT"
] | null | null | null | golpy/model/rules/example_rules.py | dkuska/golpy | a7bc73693090c252fa5ac587fe0d6c77472d9e9c | [
"MIT"
] | null | null | null | """ https://www.conwaylife.com/wiki/List_of_Life-like_cellular_automata """
gol = "3/23"
gol_generations = "3/23/2"
seeds = "2/"
brians_brain = "2//3"
replicator = "B1357/S1357"
fredkin = "B1357/S02468"
live_free_or_die = "B2/S0"
life_without_death = "B3/S012345678"
highlife = "B36/S230"
day_and_night = "B3678/S34... | 19.117647 | 75 | 0.710769 |
ab9ced234870f04571cbaedbfd1483ce55d5be22 | 102 | py | Python | hbot_dataset/targets/apps.py | CodeZeroAI/hbot-dataset | 1b20a93e2c0fb9e2f8b887fefae68422b2c74efb | [
"MIT"
] | 1 | 2019-01-24T09:31:51.000Z | 2019-01-24T09:31:51.000Z | hbot_dataset/targets/apps.py | CodeZeroAI/hbot-dataset | 1b20a93e2c0fb9e2f8b887fefae68422b2c74efb | [
"MIT"
] | null | null | null | hbot_dataset/targets/apps.py | CodeZeroAI/hbot-dataset | 1b20a93e2c0fb9e2f8b887fefae68422b2c74efb | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TargetsConfig(AppConfig):
name = 'hbot_dataset.targets'
| 17 | 33 | 0.77451 |
3f308a11060723f183d92f0be5078d870303e5cb | 22,610 | py | Python | orderportal/form.py | SciLifeLab/OrderPortal | 1fd737a694306eba06f290bf58b685929bd4389a | [
"MIT"
] | null | null | null | orderportal/form.py | SciLifeLab/OrderPortal | 1fd737a694306eba06f290bf58b685929bd4389a | [
"MIT"
] | null | null | null | orderportal/form.py | SciLifeLab/OrderPortal | 1fd737a694306eba06f290bf58b685929bd4389a | [
"MIT"
] | null | null | null | "Forms are templates for orders."
from __future__ import print_function, absolute_import
import json
import logging
from collections import OrderedDict as OD
import tornado.web
from . import constants
from . import saver
from . import settings
from . import utils
from .fields import Fields
from .requesthandler impo... | 37.55814 | 80 | 0.575763 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.