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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a051f456cf786012e54e9ca804359b91829fb53e | 895 | py | Python | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/unpickle/mechanisms/ElementDb.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 31 | 2018-11-21T01:49:06.000Z | 2022-03-30T03:41:43.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/unpickle/mechanisms/ElementDb.py | balos1/PelePhysics | d01190cc7b0eaad4ec96fac573034ccb485f0e9f | [
"BSD-3-Clause-LBNL"
] | 123 | 2019-03-12T22:27:29.000Z | 2022-03-29T17:00:04.000Z | Support/Fuego/Pythia/pythia-0.5/packages/fuego/fuego/serialization/chemkin/unpickle/mechanisms/ElementDb.py | sundials-codes/PelePhysics | 5624f83a04f43aa95288be9d8a7bb372a4adefe6 | [
"BSD-3-Clause-LBNL"
] | 32 | 2018-11-05T11:51:59.000Z | 2022-03-29T13:09:32.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~... | 20.813953 | 82 | 0.446927 |
cc4400f9a9855de938c22690f8c4fc18049fc15d | 1,423 | py | Python | settings/common.py | anselmomendes/Poker-Hand-Value-Ratings | 5fba451bddff83b7dec7d5211d5cd29ab66a5bb2 | [
"MIT"
] | 1 | 2021-11-20T02:46:02.000Z | 2021-11-20T02:46:02.000Z | settings/common.py | anselmomendes/Poker-Hand-Value-Ratings | 5fba451bddff83b7dec7d5211d5cd29ab66a5bb2 | [
"MIT"
] | null | null | null | settings/common.py | anselmomendes/Poker-Hand-Value-Ratings | 5fba451bddff83b7dec7d5211d5cd29ab66a5bb2 | [
"MIT"
] | null | null | null | #Support variables for suit checking and card scoring
class Common():
ROYAL_FLUSH_CARD:str = {"T": "10",
"J": "11",
"Q": "12",
"K": "13",
"A": "14"}
VALUE_CARD:str = {"2": "2",
... | 33.880952 | 54 | 0.141954 |
8c01a9f0e8c45460593b96b54b9c18686d8c1125 | 250 | py | Python | atcoder/other/idn_fb_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/other/idn_fb_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/other/idn_fb_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | n = int(input())
w = [list(map(lambda x: int(x)-1, input().split())) for _ in range(n)]
syussya = [0] * (n*2)
for s, _ in w:
syussya[s] += 1
for i in range(1, n*2):
syussya[i] += syussya[i-1]
for s, t in w:
print(syussya[t] - syussya[s])
| 25 | 70 | 0.552 |
da53c5f4dff5d08ad8f4026df6dbe008bb7701c6 | 445 | py | Python | core/program_service_map/serializer.py | themightychris/prevention-point | a92f98b25d32dd30bb33e7cb1ac7f10439f5203f | [
"MIT"
] | null | null | null | core/program_service_map/serializer.py | themightychris/prevention-point | a92f98b25d32dd30bb33e7cb1ac7f10439f5203f | [
"MIT"
] | null | null | null | core/program_service_map/serializer.py | themightychris/prevention-point | a92f98b25d32dd30bb33e7cb1ac7f10439f5203f | [
"MIT"
] | null | null | null | from rest_framework import serializers
from core.models import ProgramServiceMap
from core.services.serializers import ServiceSerializer
from core.programs.serializer import ProgramSerializer
class ProgramServiceMapSerializer(serializers.ModelSerializer):
service = ServiceSerializer(read_only=True)
program = ... | 31.785714 | 63 | 0.795506 |
39080ca089bc4cd2ab417c9a66447a6ef0471d77 | 2,725 | py | Python | jdcloud_sdk/services/cdn/apis/GetDomainListByFilterRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/cdn/apis/GetDomainListByFilterRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/cdn/apis/GetDomainListByFilterRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.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 ... | 28.385417 | 101 | 0.640734 |
841f5a308ac9628159314d202d92fddea08d9d01 | 20,868 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py | JianpingChen/azure-sdk-for-python | 3072fc8c0366287fbaea1b02493a50259c3248a2 | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 ... | 51.022005 | 222 | 0.671363 |
eec64a7ba9ea76a0a4a97cdb807d46ca343b6b73 | 6,611 | py | Python | arango/client.py | aquamatthias/python-arango | 9212461e2349f692312ee4e74756e5bbea2bc582 | [
"MIT"
] | 389 | 2015-10-16T13:26:33.000Z | 2021-08-15T04:26:32.000Z | arango/client.py | ITIVA-HUB/python-arango | ff990fde4a4403da170d8759adb46a7100e403a6 | [
"MIT"
] | 165 | 2015-10-12T17:28:33.000Z | 2021-07-26T16:46:49.000Z | arango/client.py | ITIVA-HUB/python-arango | ff990fde4a4403da170d8759adb46a7100e403a6 | [
"MIT"
] | 72 | 2015-12-07T17:29:19.000Z | 2021-08-13T14:30:07.000Z | __all__ = ["ArangoClient"]
from json import dumps, loads
from typing import Any, Callable, Optional, Sequence, Union
from pkg_resources import get_distribution
from arango.connection import (
BasicConnection,
Connection,
JwtConnection,
JwtSuperuserConnection,
)
from arango.database import StandardDat... | 36.125683 | 79 | 0.615036 |
67fe39592b9448c68f8f6b5d0bc3c38475e1e271 | 968 | py | Python | vfssh/vfs/fs_object.py | palwolus/Cyder | c6b123f3fd142b98017cf01ffb5efa28c2a075be | [
"MIT"
] | 9 | 2020-02-14T15:49:57.000Z | 2021-03-02T20:17:41.000Z | vfssh/vfs/fs_object.py | palwolus/Cyder | c6b123f3fd142b98017cf01ffb5efa28c2a075be | [
"MIT"
] | null | null | null | vfssh/vfs/fs_object.py | palwolus/Cyder | c6b123f3fd142b98017cf01ffb5efa28c2a075be | [
"MIT"
] | 2 | 2020-02-13T18:55:07.000Z | 2020-10-03T02:31:45.000Z | class FileObject:
def __init__(self, name, attributes, location, data=None, memory=None, size=None, timestamp=None, owner=None):
self.name = name
self.attributes = attributes
self.loc = location
# TODO: Find size of obj/file
self.size = size if size else size
self.me... | 31.225806 | 114 | 0.56405 |
fe3185555682fed99102d8c0fa0d7b5d4470187c | 2,396 | py | Python | python/lsst/eotest/sensor/ctesim.py | tguillemLSST/eotest | c6f150984fa5dff85b9805028645bf46fc846f11 | [
"BSD-3-Clause-LBNL"
] | 3 | 2016-04-21T07:05:45.000Z | 2020-08-05T08:37:37.000Z | python/lsst/eotest/sensor/ctesim.py | tguillemLSST/eotest | c6f150984fa5dff85b9805028645bf46fc846f11 | [
"BSD-3-Clause-LBNL"
] | 70 | 2015-03-26T09:48:53.000Z | 2020-04-22T16:29:43.000Z | python/lsst/eotest/sensor/ctesim.py | tguillemLSST/eotest | c6f150984fa5dff85b9805028645bf46fc846f11 | [
"BSD-3-Clause-LBNL"
] | 5 | 2017-08-15T20:52:44.000Z | 2022-03-25T12:54:07.000Z | """
Simulate effects of CTE using cte_matrix.
"""
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import astropy.io.fits as fits
import lsst.afw.image as afwImage
import lsst.eotest.image_utils as imutils
from .AmplifierGeometry import makeAmplifierGeometry
from .cte_matr... | 31.116883 | 77 | 0.623957 |
2b6c73a38bbdecdb99e71139b76acb65ba04b29d | 567 | py | Python | notification-endpoint/python/resource/__init__.py | hchoi36/CloudGuard-Repos- | 88ef000b2bca438e60612a64cd2434b9985ad4c1 | [
"MIT"
] | 46 | 2017-05-23T18:09:05.000Z | 2022-02-15T15:09:34.000Z | notification-endpoint/python/resource/__init__.py | hchoi36/CloudGuard-Repos- | 88ef000b2bca438e60612a64cd2434b9985ad4c1 | [
"MIT"
] | 28 | 2017-06-09T06:59:21.000Z | 2020-04-22T17:38:41.000Z | notification-endpoint/python/resource/__init__.py | hchoi36/CloudGuard-Repos- | 88ef000b2bca438e60612a64cd2434b9985ad4c1 | [
"MIT"
] | 70 | 2017-05-15T14:09:56.000Z | 2022-03-24T11:55:33.000Z | import logging
import json
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
try:
req_body = req.get_json()
request_as_text = json.dumps(req_body, default=lambda o: o.__dict__)
... | 27 | 77 | 0.638448 |
e24f0fbec77b62b8419d57aba95f0cfda4144b66 | 16,150 | py | Python | code/default/gae_proxy/server/gae/gae.py | wuyongwen/XX-Net | 313aefd862b8f230f7c61dc29db1b2b93a17e6ab | [
"BSD-2-Clause"
] | null | null | null | code/default/gae_proxy/server/gae/gae.py | wuyongwen/XX-Net | 313aefd862b8f230f7c61dc29db1b2b93a17e6ab | [
"BSD-2-Clause"
] | null | null | null | code/default/gae_proxy/server/gae/gae.py | wuyongwen/XX-Net | 313aefd862b8f230f7c61dc29db1b2b93a17e6ab | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
# GAE limit:
# only support http/https request, don't support tcp/udp connect for unpaid user.
# max timeout for every request is 60 seconds
# max upload data size is 30M
# max download data size is 10M
# How to Download file large then 10M?
# HTTP protocol support ran... | 39.975248 | 293 | 0.569164 |
e9d09cab60b868395ddcd86d8b42900dad6b4180 | 387 | py | Python | pformat/__init__.py | beasteers/pformat | 00b58a3e1ea7ff127295e1f70f496d7398ddab24 | [
"MIT"
] | 1 | 2021-03-15T16:11:41.000Z | 2021-03-15T16:11:41.000Z | pformat/__init__.py | beasteers/pformat | 00b58a3e1ea7ff127295e1f70f496d7398ddab24 | [
"MIT"
] | null | null | null | pformat/__init__.py | beasteers/pformat | 00b58a3e1ea7ff127295e1f70f496d7398ddab24 | [
"MIT"
] | null | null | null | '''Partial formatting, and more
'''
from . import core
# name shortcuts
PARTIAL = core.PartialFormatter
GLOB = core.GlobFormatter
REGEX = core.RegexFormatter
DEFAULT = core.DefaultFormatter
# Initialize default formatters
pformat = core.PartialFormatter().format
gformat = core.GlobFormatter().format
reformat = cor... | 20.368421 | 40 | 0.78553 |
a95ac7464261093eaf3c1ded292bf0c3dce31471 | 596 | py | Python | Tree/Easy/112. Path Sum/solution.py | tintindas/leetcode-solutions | eb97254dafddffccbce048ef04aea1e934277282 | [
"MIT"
] | 1 | 2021-03-10T02:48:39.000Z | 2021-03-10T02:48:39.000Z | Tree/Easy/112. Path Sum/solution.py | tintindas/leetcode-solutions | eb97254dafddffccbce048ef04aea1e934277282 | [
"MIT"
] | null | null | null | Tree/Easy/112. Path Sum/solution.py | tintindas/leetcode-solutions | eb97254dafddffccbce048ef04aea1e934277282 | [
"MIT"
] | 1 | 2021-03-18T08:22:29.000Z | 2021-03-18T08:22:29.000Z | # Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def hasPathSum(self, root: TreeNode, targetSum: int) -> bool:
if not root:
return False
... | 29.8 | 116 | 0.58557 |
9b582a73decb0ad26e11b6a0fdce751076f63f0e | 3,211 | py | Python | SpeedTrig.py | bryli/SpeedTrig | 5b5200ddaa39b3ce18ba77b5c4e7f77efd904b17 | [
"MIT"
] | null | null | null | SpeedTrig.py | bryli/SpeedTrig | 5b5200ddaa39b3ce18ba77b5c4e7f77efd904b17 | [
"MIT"
] | 1 | 2020-01-20T16:33:34.000Z | 2020-01-20T16:33:34.000Z | SpeedTrig.py | bryli/SpeedTrig | 5b5200ddaa39b3ce18ba77b5c4e7f77efd904b17 | [
"MIT"
] | null | null | null | from flask import Flask, request, render_template, send_file
from io import BytesIO
import TrigGen
from datetime import datetime
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def home():
return render_template('index.html')
@app.route('/generated-quiz', methods=['GET', 'POST'])
def generated():
... | 34.159574 | 124 | 0.632513 |
c4aa26015dffff7adbb4f6d69ec96e015e854359 | 758 | py | Python | backend/swagger_server/helpers/_verify.py | Lend88/libresign | 9537f39a696fa5f3433052406329d77d528b6cf9 | [
"MIT"
] | 6 | 2019-01-29T05:58:37.000Z | 2021-11-02T22:47:02.000Z | backend/swagger_server/helpers/_verify.py | Lend88/libresign | 9537f39a696fa5f3433052406329d77d528b6cf9 | [
"MIT"
] | 9 | 2020-09-09T04:53:01.000Z | 2022-03-08T22:52:18.000Z | backend/swagger_server/helpers/_verify.py | Lend88/libresign | 9537f39a696fa5f3433052406329d77d528b6cf9 | [
"MIT"
] | 4 | 2019-01-29T07:38:55.000Z | 2021-10-16T21:06:42.000Z |
from uuid import UUID
from flask_jwt_extended import get_jwt_identity
from ..mappings import Document, Field
def verify_permission(session, doc_id, signer_accessible=True):
if not isinstance(doc_id, UUID):
raise ValueError("doc_id should be a UUID object")
uid = UUID(hex=get_jwt_identity())
own... | 25.266667 | 63 | 0.601583 |
8d1b023e84af62363b2d34c29aaebd114f241990 | 3,356 | py | Python | ngram_visualization.py | ABerry057/js-sotf | 36ba930629595d2ec35da3aaeff982e50c7be008 | [
"MIT"
] | null | null | null | ngram_visualization.py | ABerry057/js-sotf | 36ba930629595d2ec35da3aaeff982e50c7be008 | [
"MIT"
] | null | null | null | ngram_visualization.py | ABerry057/js-sotf | 36ba930629595d2ec35da3aaeff982e50c7be008 | [
"MIT"
] | null | null | null | import pandas as pd
from tqdm import tqdm
from pathlib import Path
from unigram_analysis import *
import plotly.express as px
file_path = Path(__file__).resolve() # get path of this file
base_dir = file_path.parents[0] # get path of parent directory
unigram_dir = base_dir / 'ngram1' # get path to ngram1 subdir
figu... | 36.879121 | 118 | 0.629023 |
4cd356491a1529b6cf558e276a946ee9a63bce19 | 3,715 | py | Python | app/controllers/admin/recipe.py | fredsonchaves07/ruifma | 197222a16d475586e7f4674be0c2e0f36dccd5ae | [
"MIT"
] | null | null | null | app/controllers/admin/recipe.py | fredsonchaves07/ruifma | 197222a16d475586e7f4674be0c2e0f36dccd5ae | [
"MIT"
] | null | null | null | app/controllers/admin/recipe.py | fredsonchaves07/ruifma | 197222a16d475586e7f4674be0c2e0f36dccd5ae | [
"MIT"
] | null | null | null | from app.dao import chef as chef_dao
from app.dao import recipe as recipe_dao
from app.controllers.admin import file as file_controller
from datetime import datetime
def list_recipes():
recipes = recipe_dao.all_recipes()
for recipe in recipes:
recipe_files_img = recipe_dao.find_recipe_file(recipe.id)
... | 33.468468 | 92 | 0.656528 |
8977d735327b63eff0019c61a5aa6e5b35a27132 | 9,216 | py | Python | ckan/logic/auth/create.py | dbca-wa/ckan | 922d0eb168e1dfd7a2a513f5be5b661b15b9ba08 | [
"Apache-2.0"
] | null | null | null | ckan/logic/auth/create.py | dbca-wa/ckan | 922d0eb168e1dfd7a2a513f5be5b661b15b9ba08 | [
"Apache-2.0"
] | null | null | null | ckan/logic/auth/create.py | dbca-wa/ckan | 922d0eb168e1dfd7a2a513f5be5b661b15b9ba08 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import ckan.logic as logic
import ckan.authz as authz
import ckan.logic.auth as logic_auth
from ckan.common import _
@logic.auth_allow_anonymous_access
def package_create(context, data_dict=None):
user = context['user']
if authz.auth_is_anon_user(context):
check1 = all(authz.check_... | 34.777358 | 112 | 0.656467 |
a3c21945e0515e04e8d212b5076b6d0ea54186ab | 2,856 | py | Python | test/test_request.py | greysteil/gocardless-legacy-python | 6805815c1ba726fbcb17e4083fb5ff4e08be8f86 | [
"MIT"
] | null | null | null | test/test_request.py | greysteil/gocardless-legacy-python | 6805815c1ba726fbcb17e4083fb5ff4e08be8f86 | [
"MIT"
] | null | null | null | test/test_request.py | greysteil/gocardless-legacy-python | 6805815c1ba726fbcb17e4083fb5ff4e08be8f86 | [
"MIT"
] | 2 | 2017-11-10T20:44:49.000Z | 2021-03-17T18:24:19.000Z | import unittest
import mock
#from gocardless import request
import gocardless.request
class RequestTestCase(unittest.TestCase):
def setUp(self):
self.request = gocardless.request.Request('get', 'http://test.com')
def test_valid_method_allows_valid_methods(self):
for method in ('get', 'post'... | 39.666667 | 78 | 0.667017 |
a912ad8a78d950da6c62375f795f95e5b1b5662a | 1,579 | py | Python | send.py | Marusoftware/Marutools | 2b462ea02abaf957eb037c281b62d7efe053840e | [
"MIT"
] | null | null | null | send.py | Marusoftware/Marutools | 2b462ea02abaf957eb037c281b62d7efe053840e | [
"MIT"
] | 5 | 2021-01-21T09:46:12.000Z | 2022-02-14T13:54:44.000Z | send.py | Marusoftware/Marutools | 2b462ea02abaf957eb037c281b62d7efe053840e | [
"MIT"
] | 2 | 2021-11-02T11:01:53.000Z | 2022-02-14T10:11:21.000Z | #! /usr/bin/python3
import socket
import tkfilebrowser
import os
import time
from tkinter import simpledialog
import tkinter
tkinter.Tk().withdraw()
##name=simpledialog.askstring("name","name:")
##password=simpledialog.askstring("password","password:")
up_pbyte = 1024
file_name=tkfilebrowser.askopenfilename()
file_siz... | 29.792453 | 94 | 0.587714 |
7b8afbf5cbc5aa042cbf8af9bac429786da4d757 | 1,123 | py | Python | module1-introduction-to-sql/buddymove_holidayiq.py | JohnMorrisonn/DS-Unit-3-Sprint-2-SQL-and-Databases | b924d0f37e6bcc191cdb0a448fd36d379a136c5f | [
"MIT"
] | null | null | null | module1-introduction-to-sql/buddymove_holidayiq.py | JohnMorrisonn/DS-Unit-3-Sprint-2-SQL-and-Databases | b924d0f37e6bcc191cdb0a448fd36d379a136c5f | [
"MIT"
] | null | null | null | module1-introduction-to-sql/buddymove_holidayiq.py | JohnMorrisonn/DS-Unit-3-Sprint-2-SQL-and-Databases | b924d0f37e6bcc191cdb0a448fd36d379a136c5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# ## Load in the buddy dataset
# In[2]:
import pandas as pd
import sqlite3
# In[3]:
# Load in the dataset
buddy = pd.read_csv('buddymove_holidayiq.csv')
buddy.shape
# In[4]:
# Create an SQL connection to a blank dataset
conn = sqlite3.connect('buddymove_holidayiq.sqli... | 14.973333 | 111 | 0.676759 |
2ad510840393706312e8a9042d8e681adabb92dd | 5,918 | py | Python | research/cv/3dcnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/3dcnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/3dcnn/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 41.097222 | 119 | 0.654444 |
ca25c65333e9c220e666a2bb5413d22f1765ecb3 | 861 | py | Python | special-palindrome-again/main.py | joaojunior/hackerrank | a5ee0449e791535930b8659dfb7dddcf9e1237de | [
"MIT"
] | null | null | null | special-palindrome-again/main.py | joaojunior/hackerrank | a5ee0449e791535930b8659dfb7dddcf9e1237de | [
"MIT"
] | null | null | null | special-palindrome-again/main.py | joaojunior/hackerrank | a5ee0449e791535930b8659dfb7dddcf9e1237de | [
"MIT"
] | 1 | 2019-06-19T00:51:02.000Z | 2019-06-19T00:51:02.000Z | def _generate_substring(s):
size = len(s)
i = 0
while i < size:
j = i + 1
while j <= size:
yield s[i:j]
j += 1
i += 1
def _is_palindrome(s, memoize={}):
if s in memoize:
return memoize[s]
size = len(s)
mid = size // 2
result = False
... | 20.023256 | 46 | 0.445993 |
c0866c1069ac7f7e25cbd12cb5a490e2ed5e4bec | 43,598 | py | Python | tensorflow/python/grappler/hierarchical_controller.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/python/grappler/hierarchical_controller.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/grappler/hierarchical_controller.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.996422 | 80 | 0.655649 |
52eb07b58fd3e205f2210e941724c8cea088f748 | 9,147 | py | Python | teknologr/members/migrations/0001_initial.py | Pingviinituutti/teknologr.io | ac172f773819804c3124256eeda62d3d259baaec | [
"MIT"
] | null | null | null | teknologr/members/migrations/0001_initial.py | Pingviinituutti/teknologr.io | ac172f773819804c3124256eeda62d3d259baaec | [
"MIT"
] | null | null | null | teknologr/members/migrations/0001_initial.py | Pingviinituutti/teknologr.io | ac172f773819804c3124256eeda62d3d259baaec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-03-06 23:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operatio... | 53.805882 | 1,265 | 0.568711 |
feaba223d7309652460f25d955da6dda1552aca7 | 1,403 | py | Python | sols/917.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/917.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/917.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | class Solution:
# # One Pass, Two Pointers, if-while-while loop (Accepted), O(n) time and space
# def reverseOnlyLetters(self, s: str) -> str:
# n = len(s)
# l, r = 0, n-1
# s = list(s)
# while l < r:
# if s[l].isalpha() and s[r].isalpha():
# s[l], s[r... | 35.075 | 83 | 0.402708 |
9d1caad7dc9660309f1784ce4565c833e1c9304d | 2,067 | py | Python | bindings/pydrake/test/text_logging_test.py | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | 2 | 2021-02-25T02:01:02.000Z | 2021-03-17T04:52:04.000Z | bindings/pydrake/test/text_logging_test.py | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | null | null | null | bindings/pydrake/test/text_logging_test.py | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | 1 | 2021-06-13T12:05:39.000Z | 2021-06-13T12:05:39.000Z | import re
import subprocess
import unittest
class TestTextLogging(unittest.TestCase):
def expected_message(self, spdlog_level):
# Expected message format:
# [<date> <time>] [console] [<level>] <message>
# See bindings/pydrake/test/text_logging_test_py.cc
expected_messages = {"debu... | 36.263158 | 74 | 0.559748 |
a68ea5fcce58fe75c70670e12a8da923c023083f | 2,032 | py | Python | setup.py | tk0miya/nwdiag | 40849331267f2bb0f2f4f0249a33a53f760d3267 | [
"Apache-2.0"
] | null | null | null | setup.py | tk0miya/nwdiag | 40849331267f2bb0f2f4f0249a33a53f760d3267 | [
"Apache-2.0"
] | null | null | null | setup.py | tk0miya/nwdiag | 40849331267f2bb0f2f4f0249a33a53f760d3267 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
sys.path.insert(0, 'src')
import nwdiag
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python"... | 27.835616 | 77 | 0.605807 |
99fc61fa9703b679fe6a0895e955fe9acb749b41 | 2,376 | py | Python | dateparser/data/date_translation_data/ckb.py | bazingarj/dateparser | 48c4563fb7f6ce685fbd6d27e9e83257521d2203 | [
"BSD-3-Clause"
] | 8 | 2019-11-15T21:00:15.000Z | 2021-12-21T22:09:42.000Z | dateparser/data/date_translation_data/ckb.py | bazingarj/dateparser | 48c4563fb7f6ce685fbd6d27e9e83257521d2203 | [
"BSD-3-Clause"
] | 9 | 2020-06-05T21:28:57.000Z | 2022-02-12T12:30:39.000Z | dateparser/data/date_translation_data/ckb.py | bazingarj/dateparser | 48c4563fb7f6ce685fbd6d27e9e83257521d2203 | [
"BSD-3-Clause"
] | 21 | 2019-03-11T04:25:23.000Z | 2022-02-03T08:54:33.000Z | # -*- coding: utf-8 -*-
info = {
"name": "ckb",
"date_order": "YMD",
"january": [
"کانوونی دووەم"
],
"february": [
"شوبات"
],
"march": [
"ئازار"
],
"april": [
"نیسان"
],
"may": [
"ئایار"
],
"june": [
"حوزەیران"
],
... | 15.329032 | 28 | 0.274832 |
5350801c12cc234a33e61c652b12ea9f6faf1873 | 410 | py | Python | responder_login/__about__.py | theoldmoon0602/responder-login | f147e3c6d9db2876a908c459cb7aba905ee1f414 | [
"MIT"
] | null | null | null | responder_login/__about__.py | theoldmoon0602/responder-login | f147e3c6d9db2876a908c459cb7aba905ee1f414 | [
"MIT"
] | null | null | null | responder_login/__about__.py | theoldmoon0602/responder-login | f147e3c6d9db2876a908c459cb7aba905ee1f414 | [
"MIT"
] | null | null | null | __title__ = "Responder-Login"
__description__ = "User session management for Responder"
__url__ = "https://github.com/delta114514/responder-login"
__version_info__ = ("0", "0", "3")
__version__ = ".".join(__version_info__)
__author__ = "Yamato Nagata"
__author_email__ = "chickenwingswillfly@gmail.com"
__maintain... | 37.272727 | 59 | 0.741463 |
4ca88345b7322b183a473553c4670587503e8f3f | 271 | py | Python | src/riotwatcher/exceptions.py | acgandhi/Riot-Watcher | f8a7ea144a00fc62f9ffaee5bad3158f41251589 | [
"MIT"
] | 489 | 2015-01-04T22:49:51.000Z | 2022-03-28T03:15:54.000Z | src/riotwatcher/exceptions.py | acgandhi/Riot-Watcher | f8a7ea144a00fc62f9ffaee5bad3158f41251589 | [
"MIT"
] | 162 | 2015-02-09T22:10:40.000Z | 2022-02-22T13:48:50.000Z | src/riotwatcher/exceptions.py | acgandhi/Riot-Watcher | f8a7ea144a00fc62f9ffaee5bad3158f41251589 | [
"MIT"
] | 221 | 2015-01-07T18:01:57.000Z | 2022-03-26T21:18:48.000Z | import requests
from .Handlers import (
ApiError as _ApiError,
IllegalArgumentError as _IllegalArgumentError,
)
ApiError = _ApiError # should silence code analysis warning
IllegalArgumentError = _IllegalArgumentError
TimeoutError = requests.exceptions.Timeout
| 24.636364 | 60 | 0.815498 |
68177b945eb0fb8af4468fdb89b94a4967385dfe | 951 | py | Python | tools/vscode-extension/server/tests/test_events.py | orlandoojr1/wave | e86d0c87c6c67e510fb4e1fa571982ca0a09f33c | [
"Apache-2.0"
] | 1 | 2022-03-02T21:54:36.000Z | 2022-03-02T21:54:36.000Z | tools/vscode-extension/server/tests/test_events.py | orlandoojr1/wave | e86d0c87c6c67e510fb4e1fa571982ca0a09f33c | [
"Apache-2.0"
] | null | null | null | tools/vscode-extension/server/tests/test_events.py | orlandoojr1/wave | e86d0c87c6c67e510fb4e1fa571982ca0a09f33c | [
"Apache-2.0"
] | null | null | null | from server.tests.utils import BaseTestCase
class TestEventCompletions(BaseTestCase):
def test_events(self):
self.assert_interaction('q.events.')
def test_events_bracket(self):
self.assert_interaction("q.events['']")
def test_autocomplete_stop(self):
self.assertEqual(len(self.ge... | 36.576923 | 91 | 0.692955 |
9291b263a2501a9f23ceb5b70a85428766c1a11c | 216 | py | Python | setup.py | lidia-nna/stock-tracker-spa | d9b0d640836aefefe4d1e3a073bc1c41ab4ea552 | [
"MIT"
] | null | null | null | setup.py | lidia-nna/stock-tracker-spa | d9b0d640836aefefe4d1e3a073bc1c41ab4ea552 | [
"MIT"
] | 1 | 2021-04-01T15:59:57.000Z | 2021-04-01T15:59:57.000Z | setup.py | lidia-nna/stock-tracker-spa | d9b0d640836aefefe4d1e3a073bc1c41ab4ea552 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='app',
version='0.1',
packages=find_packages(),
include_package_data=False,
zip_safe=False,
install_requires=[
'flask',
],
) | 19.636364 | 43 | 0.643519 |
920bcab8a17595321fdbc401371001724e38f3c4 | 1,068 | py | Python | function1.py | debdutgoswami/IoT-cloud-function | 333bfb49e7e13178edcf34901e7a35df7b71d4b7 | [
"MIT"
] | null | null | null | function1.py | debdutgoswami/IoT-cloud-function | 333bfb49e7e13178edcf34901e7a35df7b71d4b7 | [
"MIT"
] | null | null | null | function1.py | debdutgoswami/IoT-cloud-function | 333bfb49e7e13178edcf34901e7a35df7b71d4b7 | [
"MIT"
] | null | null | null | import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime
def update(request):
#geting the variables ready
data = {
#your client_json contents as dictionary
}
request_json = request.get_json()
request_args = request.args
... | 31.411765 | 94 | 0.676966 |
4556a1727ce3acfb9a1648d53247d6808f305896 | 25,183 | py | Python | examples/frontiers/sagehen_90m.py | usgs-pygsflow/pygsflow | 66a6dc2848d6ea41c6e776a4226960d07dcbc85b | [
"Unlicense"
] | 1 | 2019-05-24T17:16:32.000Z | 2019-05-24T17:16:32.000Z | examples/frontiers/sagehen_90m.py | usgs-pygsflow/pygsflow | 66a6dc2848d6ea41c6e776a4226960d07dcbc85b | [
"Unlicense"
] | 1 | 2019-05-21T23:13:10.000Z | 2019-05-21T23:13:10.000Z | examples/frontiers/sagehen_90m.py | usgs-pygsflow/pygsflow | 66a6dc2848d6ea41c6e776a4226960d07dcbc85b | [
"Unlicense"
] | null | null | null | import os
import utm
import platform
import flopy
import numpy as np
import shapefile
import matplotlib.pyplot as plt
from flopy.utils import Raster
from flopy.plot import styles
from gsflow import GsflowModel, PrmsModel, PrmsData
from gsflow.builder import (
GenerateFishnet,
ModflowBuilder,
Co... | 39.043411 | 110 | 0.622523 |
f2dedb2b3b457dbec64ad4b148b87b72ca25136f | 1,861 | gyp | Python | base/base.gyp | PeterDaveHello/incubator-pagespeed-mod | 885f4653e204e1152cb3928f0755d93ec5fdceae | [
"Apache-2.0"
] | 2 | 2019-11-02T07:54:17.000Z | 2020-04-16T09:26:51.000Z | base/base.gyp | PeterDaveHello/incubator-pagespeed-mod | 885f4653e204e1152cb3928f0755d93ec5fdceae | [
"Apache-2.0"
] | 12 | 2017-03-14T18:26:11.000Z | 2021-10-01T15:33:50.000Z | base/base.gyp | PeterDaveHello/incubator-pagespeed-mod | 885f4653e204e1152cb3928f0755d93ec5fdceae | [
"Apache-2.0"
] | 1 | 2020-05-20T07:09:05.000Z | 2020-05-20T07:09:05.000Z | # Copyright (c) 2009 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.
# Base was branched from the chromium version to reduce the number of
# dependencies of this package. Specifically, we would like to avoid
# depending o... | 29.078125 | 77 | 0.586781 |
d8fce5b0ee358018e5fb6e51aa343aed8828b827 | 1,928 | py | Python | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/DescribeVsDomainRecordDataRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/DescribeVsDomainRecordDataRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-vs/aliyunsdkvs/request/v20181212/DescribeVsDomainRecordDataRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.428571 | 78 | 0.762967 |
e4e2cbbd63a010383ef5c34e579a345ee10605af | 1,926 | py | Python | 13.py | jick155/Y.L_leetcode | a3bae5014bc194261b016d88682602d0fe714f48 | [
"MIT"
] | null | null | null | 13.py | jick155/Y.L_leetcode | a3bae5014bc194261b016d88682602d0fe714f48 | [
"MIT"
] | null | null | null | 13.py | jick155/Y.L_leetcode | a3bae5014bc194261b016d88682602d0fe714f48 | [
"MIT"
] | null | null | null |
"""
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
For example, two is written as II in Roman numeral, just two one's added together. Twelve ... | 26.75 | 345 | 0.605919 |
a1968aba4cc4bcacd944cc1ea4e3cecfe8679083 | 1,959 | py | Python | nicos_ess/utilities/csv_utils.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_ess/utilities/csv_utils.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 4 | 2019-11-08T10:18:16.000Z | 2021-01-13T13:07:29.000Z | nicos_ess/utilities/csv_utils.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 34.368421 | 79 | 0.627361 |
b216450dbc15c08471b04fd78bb965443cb2e1fd | 21,653 | py | Python | tests/functional/test_download.py | DiegoCaraballo/pip | 4b6bb5da37c182acd509c85f72840ca37108cf65 | [
"MIT"
] | null | null | null | tests/functional/test_download.py | DiegoCaraballo/pip | 4b6bb5da37c182acd509c85f72840ca37108cf65 | [
"MIT"
] | null | null | null | tests/functional/test_download.py | DiegoCaraballo/pip | 4b6bb5da37c182acd509c85f72840ca37108cf65 | [
"MIT"
] | null | null | null | import os.path
import textwrap
import pytest
from pip._internal.cli.status_codes import ERROR
from tests.lib.path import Path
def fake_wheel(data, wheel_path):
data.packages.join(
'simple.dist-0.1-py2.py3-none-any.whl'
).copy(data.packages.join(wheel_path))
@pytest.mark.network
def test_download_i... | 29.419837 | 79 | 0.579365 |
4ed88f1c52dad3e783c46d6e0c305dcd09a42f80 | 177 | py | Python | abc/abc079/abc079b.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | abc/abc079/abc079b.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | abc/abc079/abc079b.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | N = int(input())
if N == 1:
print(1)
else:
L = [0] * (N + 1)
L[0] = 2
L[1] = 1
for i in range(2, N + 1):
L[i] = L[i - 1] + L[i - 2]
print(L[N])
| 14.75 | 34 | 0.350282 |
3a6fc1ac5dc223caeed7dc40cc4df25ed9758b0f | 18,179 | py | Python | src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/tests/test_rdbms_commands.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/tests/test_rdbms_commands.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-rdbms/azure/cli/command_modules/rdbms/tests/test_rdbms_commands.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 1 | 2017-12-28T04:51:44.000Z | 2017-12-28T04:51:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 47.713911 | 132 | 0.564442 |
2610658266b130c1b5972a0cd36b262b99e1c37d | 2,331 | py | Python | connectome/models/evaluation.py | JanaGauss/Connectome | 9b59aabfb4040201c72d7ff239b50bb47f092ad1 | [
"MIT"
] | 1 | 2022-03-22T15:58:31.000Z | 2022-03-22T15:58:31.000Z | connectome/models/evaluation.py | JanaGauss/Connectome | 9b59aabfb4040201c72d7ff239b50bb47f092ad1 | [
"MIT"
] | 6 | 2022-03-16T16:20:14.000Z | 2022-03-17T10:54:13.000Z | connectome/models/evaluation.py | JanaGauss/Connectome | 9b59aabfb4040201c72d7ff239b50bb47f092ad1 | [
"MIT"
] | null | null | null | """
function to evaluate the fitted model on test data
"""
from sklearn.metrics import accuracy_score, roc_auc_score, precision_score, recall_score, f1_score, mean_squared_error, \
mean_absolute_error, r2_score
import numpy as np
import pandas as pd
def model_evaluation(model, X_test, y_test):
"""
Evaluat... | 37.596774 | 121 | 0.670528 |
c052e64a4254b46fffdf2df8aee0571b90fba37a | 293 | py | Python | ccarl/plotting/utils.py | andrewguy/CCARL | 0afda67bcc58be2b6b6bf426cccaab04453c0590 | [
"MIT"
] | 2 | 2020-05-13T12:50:44.000Z | 2020-07-27T08:32:42.000Z | ccarl/plotting/utils.py | andrewguy/CCARL | 0afda67bcc58be2b6b6bf426cccaab04453c0590 | [
"MIT"
] | 1 | 2020-04-30T15:33:45.000Z | 2021-11-30T01:53:18.000Z | ccarl/plotting/utils.py | andrewguy/CCARL | 0afda67bcc58be2b6b6bf426cccaab04453c0590 | [
"MIT"
] | 2 | 2020-12-05T00:25:43.000Z | 2022-02-10T13:58:35.000Z | '''Plotting utility functions'''
def remove_top_right_borders(ax):
'''Remove top and right borders from Matplotlib axis'''
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
| 29.3 | 59 | 0.720137 |
aedaf67dbe5dccb9d33fc88a346a2868fe4999d7 | 19,149 | py | Python | sdk/python/pulumi_azure_native/network/v20200701/web_application_firewall_policy.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200701/web_application_firewall_policy.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200701/web_application_firewall_policy.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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, overload
from ... import _utilities
fro... | 49.737662 | 3,123 | 0.682647 |
addfa86da927cbc17c6a251b534219db012efc6d | 755 | py | Python | profiles_rest/urls.py | Gustah-araujo/Django-pratice | e2ab7574838a5a3be2aecfee745d27bff7754e7f | [
"MIT"
] | null | null | null | profiles_rest/urls.py | Gustah-araujo/Django-pratice | e2ab7574838a5a3be2aecfee745d27bff7754e7f | [
"MIT"
] | null | null | null | profiles_rest/urls.py | Gustah-araujo/Django-pratice | e2ab7574838a5a3be2aecfee745d27bff7754e7f | [
"MIT"
] | null | null | null | """profiles_rest URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 34.318182 | 77 | 0.711258 |
83cece6fc3f519be001b02975f0ee23d20b9b5eb | 177 | py | Python | check_nsqd.py | phobson/pynsqd | 84def12e8bfaa44307f9e235470661452507d606 | [
"MIT"
] | null | null | null | check_nsqd.py | phobson/pynsqd | 84def12e8bfaa44307f9e235470661452507d606 | [
"MIT"
] | null | null | null | check_nsqd.py | phobson/pynsqd | 84def12e8bfaa44307f9e235470661452507d606 | [
"MIT"
] | null | null | null | import sys
import matplotlib
matplotlib.use('agg')
from matplotlib.pyplot import style
style.use('classic')
import pynsqd
status = pynsqd.test(*sys.argv[1:])
sys.exit(status)
| 16.090909 | 35 | 0.768362 |
d03414bbc116321facb0bc11b6026ce4bf67055f | 424 | py | Python | django_dumpslow_example/example/views.py | lamby/django-dumpslow | 0c2c46d16510596ee830cc97cb69b53992ed3fe6 | [
"BSD-2-Clause"
] | 11 | 2016-03-21T17:39:03.000Z | 2020-10-13T18:10:46.000Z | django_dumpslow_example/example/views.py | lamby/django-dumpslow | 0c2c46d16510596ee830cc97cb69b53992ed3fe6 | [
"BSD-2-Clause"
] | 3 | 2019-04-15T07:40:40.000Z | 2019-07-07T14:11:45.000Z | django_dumpslow_example/example/views.py | lamby/django-dumpslow | 0c2c46d16510596ee830cc97cb69b53992ed3fe6 | [
"BSD-2-Clause"
] | 3 | 2019-04-11T09:42:21.000Z | 2019-07-07T07:02:47.000Z | import time
from django.http import HttpResponse
from django.shortcuts import render_to_response
def index(request):
return render_to_response('index.html')
def slow(request):
time.sleep(2)
return HttpResponse('This page should have taken >=2s to render.')
class slow2(object):
def __call__(self, req... | 24.941176 | 74 | 0.724057 |
e3d52970973d6f813ecb990ed0db57fa44a6afb7 | 366 | py | Python | benchmark/sapcloudsdkpipeline/protobuf/run.py | sourcemeta/json-size-benchmark | ec18002407fc97ea3181874b84c6342841cfb0a9 | [
"Apache-2.0"
] | null | null | null | benchmark/sapcloudsdkpipeline/protobuf/run.py | sourcemeta/json-size-benchmark | ec18002407fc97ea3181874b84c6342841cfb0a9 | [
"Apache-2.0"
] | 4 | 2022-01-15T01:27:24.000Z | 2022-01-19T00:47:20.000Z | benchmark/sapcloudsdkpipeline/protobuf/run.py | sourcemeta/json-size-benchmark | ec18002407fc97ea3181874b84c6342841cfb0a9 | [
"Apache-2.0"
] | null | null | null | def encode(json, schema):
payload = schema.Main()
payload.general = json['general'] or 0
payload.stages = json['stages'] or 0
payload.steps = json['steps'] or 0
return payload
def decode(payload):
return {
'general': payload.general or None,
'stages': payload.general or None,
... | 24.4 | 43 | 0.620219 |
56262aac36f1dcf6a2ef689677ad4a152d732480 | 425 | py | Python | tests/readwrite/test_paula.py | arne-cl/discoursegraphs | 4e14688e19c980ac9bbac75ff1bf5d751ef44ac3 | [
"BSD-3-Clause"
] | 41 | 2015-02-20T00:35:39.000Z | 2022-03-15T13:54:13.000Z | tests/readwrite/test_paula.py | arne-cl/discoursegraphs | 4e14688e19c980ac9bbac75ff1bf5d751ef44ac3 | [
"BSD-3-Clause"
] | 68 | 2015-01-09T18:07:38.000Z | 2021-10-06T16:30:43.000Z | tests/readwrite/test_paula.py | arne-cl/discoursegraphs | 4e14688e19c980ac9bbac75ff1bf5d751ef44ac3 | [
"BSD-3-Clause"
] | 8 | 2015-02-20T00:35:48.000Z | 2021-10-30T14:09:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Arne Neumann <discoursegraphs.programming@arne.cl>
from tempfile import NamedTemporaryFile, mkdtemp
from pytest import maz_1423 # global fixture
import discoursegraphs as dg
"""
Basic tests for the gexf output format.
"""
def test_write_paula():
"""conve... | 21.25 | 60 | 0.722353 |
7885701ebd5d168f645f4eaa276703d819f32436 | 18,367 | py | Python | tools/project-creator/Python2.6.6/Lib/test/test_py3kwarn.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 81 | 2017-03-13T08:24:01.000Z | 2021-04-02T09:48:38.000Z | tools/project-creator/Python2.6.6/Lib/test/test_py3kwarn.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 6 | 2017-04-30T08:36:55.000Z | 2017-09-22T01:37:28.000Z | tools/project-creator/Python2.6.6/Lib/test/test_py3kwarn.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 41 | 2017-03-18T14:11:58.000Z | 2021-04-14T05:06:09.000Z | import unittest
import sys
from test.test_support import (check_warnings, CleanImport,
TestSkipped, run_unittest)
import warnings
from contextlib import nested
if not sys.py3kwarning:
raise TestSkipped('%s must be run with the -3 flag' % __name__)
try:
from test.tes... | 42.320276 | 81 | 0.537268 |
1978ff784ec584176661aca5e1682a8bbe322702 | 1,056 | py | Python | source/dataset/ClueWordsDataset.py | celsofranssa/CluWords | 2c08932eeec8cc6a3a6d97782577df8768c21765 | [
"MIT"
] | 1 | 2021-08-18T18:15:11.000Z | 2021-08-18T18:15:11.000Z | source/dataset/ClueWordsDataset.py | celsofranssa/ClueWords | 2c08932eeec8cc6a3a6d97782577df8768c21765 | [
"MIT"
] | null | null | null | source/dataset/ClueWordsDataset.py | celsofranssa/ClueWords | 2c08932eeec8cc6a3a6d97782577df8768c21765 | [
"MIT"
] | null | null | null | import json
import pickle
import torch
from torch.utils.data import Dataset
class ClueWordsDataset(Dataset):
"""MNIST Dataset.
"""
def __init__(self, samples, ids_path, tokenizer, max_length):
super(ClueWordsDataset, self).__init__()
self.samples = samples
self.tokenizer = tokeni... | 25.756098 | 108 | 0.575758 |
9bb34fc506fd2d5d23c3c4198cd1c968ab01f4b2 | 35 | py | Python | data.py | Tchepga/bidding | ea99b791629033402df01e20dcbf75ab11471491 | [
"MIT"
] | null | null | null | data.py | Tchepga/bidding | ea99b791629033402df01e20dcbf75ab11471491 | [
"MIT"
] | null | null | null | data.py | Tchepga/bidding | ea99b791629033402df01e20dcbf75ab11471491 | [
"MIT"
] | null | null | null |
global encheres
encheres = dict()
| 8.75 | 17 | 0.742857 |
d6fd82548282fe93d7e73f4e9bc70c04ed427bef | 16,809 | py | Python | cinder/api/contrib/volume_actions.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/api/contrib/volume_actions.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/api/contrib/volume_actions.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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... | 41.709677 | 79 | 0.619133 |
175780f9c6671ba001414f995dc256d5e8bd2e41 | 3,257 | py | Python | nova/api/openstack/compute/plugins/v3/certificates.py | bopopescu/OpenStack-DNRM-Nova | 7354f378398850113ac93b511547ed05218dc770 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/plugins/v3/certificates.py | bopopescu/OpenStack-DNRM-Nova | 7354f378398850113ac93b511547ed05218dc770 | [
"Apache-2.0"
] | 1 | 2018-01-19T07:50:49.000Z | 2018-01-19T07:50:49.000Z | nova/api/openstack/compute/plugins/v3/certificates.py | bopopescu/OpenStack-DNRM-Nova | 7354f378398850113ac93b511547ed05218dc770 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:49:47.000Z | 2020-07-24T08:49:47.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation
#
# 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/LICE... | 33.234694 | 78 | 0.663187 |
b7021ce5b0a0f8e859cb233be295bbf48237ca48 | 1,825 | py | Python | initrd/usr/lib64/python2.6/site-packages/rpm/__init__.py | OpenCloudOS/OpenCloudOS-tools | 06b12aab3182f4207d78a5d8733be03f0d7b69a4 | [
"MulanPSL-1.0"
] | 8 | 2021-11-26T06:19:06.000Z | 2022-01-11T01:30:11.000Z | initrd/usr/lib64/python2.6/site-packages/rpm/__init__.py | OpenCloudOS/OpenCloudOS-tools | 06b12aab3182f4207d78a5d8733be03f0d7b69a4 | [
"MulanPSL-1.0"
] | null | null | null | initrd/usr/lib64/python2.6/site-packages/rpm/__init__.py | OpenCloudOS/OpenCloudOS-tools | 06b12aab3182f4207d78a5d8733be03f0d7b69a4 | [
"MulanPSL-1.0"
] | 2 | 2021-12-21T08:36:02.000Z | 2021-12-21T08:55:38.000Z | r"""RPM Module
This module enables you to manipulate rpms and the rpm database.
"""
import warnings
import os
from rpm._rpm import *
from rpm.transaction import *
import rpm._rpm as _rpm
_RPMVSF_NODIGESTS = _rpm._RPMVSF_NODIGESTS
_RPMVSF_NOHEADER = _rpm._RPMVSF_NOHEADER
_RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD
_RP... | 24.013158 | 77 | 0.664658 |
3ece285a1714e3bf7eae2a8672cf7ad713689b52 | 5,000 | py | Python | gmprocess/subcommands/generate_report.py | meramossepu1/groundmotion-processing | 5cc19023b94e5b5b718590ce8cd05a22a4088a67 | [
"Unlicense"
] | 54 | 2019-01-12T02:05:38.000Z | 2022-03-29T19:43:56.000Z | gmprocess/subcommands/generate_report.py | meramossepu1/groundmotion-processing | 5cc19023b94e5b5b718590ce8cd05a22a4088a67 | [
"Unlicense"
] | 700 | 2018-12-18T19:44:31.000Z | 2022-03-30T20:54:28.000Z | gmprocess/subcommands/generate_report.py | meramossepu1/groundmotion-processing | 5cc19023b94e5b5b718590ce8cd05a22a4088a67 | [
"Unlicense"
] | 41 | 2018-11-29T23:17:56.000Z | 2022-03-31T04:04:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from gmprocess.subcommands.lazy_loader import LazyLoader
distributed = LazyLoader("distributed", globals(), "dask.distributed")
base = LazyLoader("base", globals(), "gmprocess.subcommands.base")
arg_dicts = LazyLoader("arg_dicts", globals(), "gm... | 36.231884 | 87 | 0.6016 |
5c6372f7468b197754b5d863124b14294a859075 | 1,153 | py | Python | src/nodemgr/common/utils.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/nodemgr/common/utils.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/nodemgr/common/utils.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | #
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
import os
def get_package_version(pkg):
# retrieve current installed version of pkg
try:
cmd = 'rpm -q --qf "%%{VERSION}-%%{RELEASE}" %s' % pkg
return os.popen(cmd).read()
except Exception:
return None
def is_... | 22.607843 | 64 | 0.58196 |
7703cb3eb79c5a97d7d9f1d8efe4697ad347012b | 1,609 | py | Python | milieu/data/go.py | seyuboglu/milieu | dfcd23ecb4449e6fa5debf8ed371fbc5d5c22e8e | [
"Apache-2.0"
] | 1 | 2020-07-15T18:52:29.000Z | 2020-07-15T18:52:29.000Z | milieu/data/go.py | seyuboglu/milieu | dfcd23ecb4449e6fa5debf8ed371fbc5d5c22e8e | [
"Apache-2.0"
] | null | null | null | milieu/data/go.py | seyuboglu/milieu | dfcd23ecb4449e6fa5debf8ed371fbc5d5c22e8e | [
"Apache-2.0"
] | null | null | null | """GO Ontology data methods."""
import logging
import os
import json
import datetime
import time
import pickle
from collections import defaultdict
from multiprocessing import Pool
import numpy as np
from scipy.stats import spearmanr
import pandas as pd
from tqdm import tqdm
from goatools.obo_parser import GODag
from g... | 29.254545 | 72 | 0.661902 |
f16f00ff850669ce5c1caf9b939bf055749da7c3 | 1,111 | py | Python | office365/sharepoint/webs/remote_web.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | office365/sharepoint/webs/remote_web.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | office365/sharepoint/webs/remote_web.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | from office365.onedrive.list import List
from office365.runtime.client_object import ClientObject
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
from office365.runtime.resource_path import ResourcePath
from office365.sharepoint.webs.web import Web
class RemoteWeb(ClientObject):
... | 38.310345 | 117 | 0.733573 |
dd5e32493c35b1effdde08f940e8c95ffb06a901 | 10,152 | py | Python | model.py | yashbonde/NIPS-Generator | 270ad015b087f91ebffc340ffaf818108943991d | [
"MIT"
] | 2 | 2019-08-16T13:28:17.000Z | 2019-09-10T06:40:12.000Z | model.py | yashbonde/NIPS-Generator | 270ad015b087f91ebffc340ffaf818108943991d | [
"MIT"
] | null | null | null | model.py | yashbonde/NIPS-Generator | 270ad015b087f91ebffc340ffaf818108943991d | [
"MIT"
] | null | null | null | """
tf_layers.py
Layer functions for the GPT-2 based model
27.09.2019 - @yashbonde
"""
import numpy as np
import tensorflow as tf
def gelu_activation(inp):
"""
Gaussian Error Linear Unit (GELU) is a new type of activation function that can
estimate any of the existing activation values such as Sigmoid,... | 31.333333 | 117 | 0.627364 |
39bde199c543f4b16493ca87f62a882a3ba120b4 | 760 | py | Python | algorithms/grokking_algorithms/binary_search.py | pyerbiz/re-exploring-python | c395d20a520dc8cf28ae5f7c9eaad9cf7f652145 | [
"MIT"
] | null | null | null | algorithms/grokking_algorithms/binary_search.py | pyerbiz/re-exploring-python | c395d20a520dc8cf28ae5f7c9eaad9cf7f652145 | [
"MIT"
] | 1 | 2021-06-29T04:19:15.000Z | 2021-06-29T04:19:15.000Z | algorithms/grokking_algorithms/binary_search.py | pyerbiz/re-exploring-python | c395d20a520dc8cf28ae5f7c9eaad9cf7f652145 | [
"MIT"
] | 1 | 2021-09-06T23:16:30.000Z | 2021-09-06T23:16:30.000Z | """ a module with multiple binary search object definitions"""
class BinarySearchBase:
def __init__(self, array, value) -> None:
self.array = array
self.value = value
def simple_binary_search(self):
"""take a list and a value, search for the value in the list
and return its i... | 26.206897 | 68 | 0.535526 |
9ca6a14995e96c0d0cb161793ec536b1005d2c79 | 2,192 | py | Python | __scraping__/fcainfoweb.nic.in/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | __scraping__/fcainfoweb.nic.in/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | __scraping__/fcainfoweb.nic.in/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | #!/usr/bin/env python3
# date: 2020.05.28
#
from selenium import webdriver
from selenium.webdriver.support.ui import Select
import pandas as pd
import time
# --- functions ---
def get_data(start_date, end_date, product):
# select `Variation Report`
driver.find_element_by_id('ctl00_MainContent_Rbl_Rpt... | 31.314286 | 98 | 0.715785 |
9e4246844b1c9761968a8b8fb77417543f79d9d0 | 100 | py | Python | app/user_manage/__init__.py | sargentfrancesca/flasky | 0bea79fddb45f1279da7c468d1ae7f8a6a3e8c7f | [
"MIT"
] | 3 | 2017-12-12T19:38:07.000Z | 2022-01-17T09:54:07.000Z | app/user_manage/__init__.py | sargentfrancesca/flasky | 0bea79fddb45f1279da7c468d1ae7f8a6a3e8c7f | [
"MIT"
] | 117 | 2016-08-08T09:10:13.000Z | 2017-01-31T15:19:51.000Z | app/user_manage/__init__.py | sargentfrancesca/flasky | 0bea79fddb45f1279da7c468d1ae7f8a6a3e8c7f | [
"MIT"
] | 1 | 2020-05-01T08:36:42.000Z | 2020-05-01T08:36:42.000Z | from flask import Blueprint
user_manage = Blueprint('admin_manage', __name__)
from . import views
| 16.666667 | 49 | 0.79 |
82387e8513eb1db2a2aa57d45bccbd6d944586ec | 383 | py | Python | intersectionarray2.py | kundan7kumar/AI_Challenge | 0e510443f26fffeedc517572715083084827ae1a | [
"MIT"
] | null | null | null | intersectionarray2.py | kundan7kumar/AI_Challenge | 0e510443f26fffeedc517572715083084827ae1a | [
"MIT"
] | null | null | null | intersectionarray2.py | kundan7kumar/AI_Challenge | 0e510443f26fffeedc517572715083084827ae1a | [
"MIT"
] | null | null | null | """
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
"""
def intersectionarray2(nums1,nums2):
from collections import Counter
num1 = Counter(nums1)
num... | 31.916667 | 204 | 0.733681 |
9752586e0652c3de21cd26eb50ef6ed94ce76018 | 7,133 | py | Python | sdk/python/pulumi_azure_native/netapp/v20200901/get_snapshot_policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/netapp/v20200901/get_snapshot_policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/netapp/v20200901/get_snapshot_policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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... | 35.665 | 211 | 0.650357 |
8dfcf86ac17e1e72d480a74b8249533c3871b085 | 1,411 | py | Python | hackerspace/tools/space_open.py | y0av/HackspaceOS | f20579f29c6659a8d768a4254809cf7ca94cf039 | [
"MIT"
] | null | null | null | hackerspace/tools/space_open.py | y0av/HackspaceOS | f20579f29c6659a8d768a4254809cf7ca94cf039 | [
"MIT"
] | null | null | null | hackerspace/tools/space_open.py | y0av/HackspaceOS | f20579f29c6659a8d768a4254809cf7ca94cf039 | [
"MIT"
] | null | null | null | def getOpenNowStatus(language):
from datetime import datetime
import calendar
import pytz
from getConfig import get_config
from hackerspace.templatetags.translate import landingpage
from hackerspace.models import Event
# if an event is happening - show space open. Else use opening hours def... | 45.516129 | 133 | 0.672573 |
903f46dd8655e6f1ebbe768ac4a22b943060c370 | 4,796 | py | Python | main.py | TaehyeonKim-pyomu/CNN_compression_rank_selection_BayesOpt | 3a8f1b2c2311a9edbdae1f71ba1f7a5890c614b9 | [
"MIT"
] | 9 | 2020-05-23T12:06:46.000Z | 2021-08-10T09:34:56.000Z | main.py | TaehyeonKim-pyomu/CNN_compression_rank_selection_BayesOpt | 3a8f1b2c2311a9edbdae1f71ba1f7a5890c614b9 | [
"MIT"
] | 1 | 2020-11-23T15:51:52.000Z | 2020-12-11T05:44:54.000Z | main.py | TaehyeonKim-pyomu/CNN_compression_rank_selection_BayesOpt | 3a8f1b2c2311a9edbdae1f71ba1f7a5890c614b9 | [
"MIT"
] | 2 | 2020-06-04T12:56:24.000Z | 2020-07-26T12:56:49.000Z | import torch
import torchvision.models as models
import torch.nn as nn
import tensorly as tl
from tensorly.decomposition import partial_tucker
import GPyOpt
import GPy
from GPyOpt.models.gpmodel import GPModel
from GPyOpt.core.task.space import Design_space
from GPyOpt.acquisitions.EI import AcquisitionEI
import numpy ... | 29.243902 | 88 | 0.653253 |
9841837cb5f19c48163ca53a03fff2c8dbdbdcea | 457 | py | Python | Cudoviste/cudo.py | rajitbanerjee/kattis | 3a5dd4c84c07e21f09ef45ebd9c1bad2a0adc6ad | [
"CC0-1.0"
] | 2 | 2021-04-13T12:56:30.000Z | 2022-03-21T16:46:58.000Z | Cudoviste/cudo.py | rajitbanerjee/kattis | 3a5dd4c84c07e21f09ef45ebd9c1bad2a0adc6ad | [
"CC0-1.0"
] | null | null | null | Cudoviste/cudo.py | rajitbanerjee/kattis | 3a5dd4c84c07e21f09ef45ebd9c1bad2a0adc6ad | [
"CC0-1.0"
] | 1 | 2021-11-14T14:06:46.000Z | 2021-11-14T14:06:46.000Z | """https://open.kattis.com/problems/cudoviste"""
R, C = map(int, input().split())
squashed = [0] * 5
mat = []
for _ in range(R):
mat.append(list(input()))
for i in range(R - 1):
for j in range(C - 1):
space = [mat[i][j], mat[i][j + 1], mat[i + 1][j], mat[i + 1][j + 1]]
buildings = space.count... | 21.761905 | 76 | 0.516411 |
6263c2a0138eb30156950f144166360d8e4479c8 | 2,961 | py | Python | venv/lib/python3.8/site-packages/ansible_collections/cisco/ise/plugins/action/network_access_conditions_for_authorization_rule_info.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/cisco/ise/plugins/action/network_access_conditions_for_authorization_rule_info.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/cisco/ise/plugins/action/network_access_conditions_for_authorization_rule_info.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
... | 33.269663 | 128 | 0.667004 |
0df0c48870c45770fb515781cca46df18dda87a5 | 2,201 | py | Python | unit_tests/lenet.py | evtHsa/sdcTrafficSignClassifier | 73bfea8964dc6be5ee7b70105511f255a13f5cdb | [
"MIT"
] | null | null | null | unit_tests/lenet.py | evtHsa/sdcTrafficSignClassifier | 73bfea8964dc6be5ee7b70105511f255a13f5cdb | [
"MIT"
] | null | null | null | unit_tests/lenet.py | evtHsa/sdcTrafficSignClassifier | 73bfea8964dc6be5ee7b70105511f255a13f5cdb | [
"MIT"
] | null | null | null | import tensorflow as tf
def LeNet(x):
# Arguments used for tf.truncated_normal, randomly defines variables for the
# weights and biases for each layer
# conv strides: (batch, height, width, depth)
# 2DO: Layer 1: Convolutional. Input = 32x32x1. Output = 28x28x6.
conv1_W = tf.Variable(tf.tr... | 36.683333 | 80 | 0.580645 |
f5ac5e093e67724ceed9bece2fb8ea15562c0673 | 1,572 | py | Python | tests/test_datasets/test_download.py | souravsingh/yellowbrick | a5941a6c47fbe5264f3622bc15276ba618bbe1d0 | [
"Apache-2.0"
] | 2 | 2018-05-24T01:32:03.000Z | 2018-05-27T19:56:02.000Z | tests/test_datasets/test_download.py | souravsingh/yellowbrick | a5941a6c47fbe5264f3622bc15276ba618bbe1d0 | [
"Apache-2.0"
] | null | null | null | tests/test_datasets/test_download.py | souravsingh/yellowbrick | a5941a6c47fbe5264f3622bc15276ba618bbe1d0 | [
"Apache-2.0"
] | null | null | null | # tests.test_datasets.test_download
# Tests the download from S3 to ensure data is accessible.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Tue Jan 01 15:06:05 2019 -0500
#
# For license information, see LICENSE.txt
#
# ID: test_download.py [] benjamin@bengfort.com $
"""
Tests the download from ... | 34.173913 | 86 | 0.673664 |
e5223dad3ffcd941cfcb61215af23420d2750571 | 494 | py | Python | Desafio018.py | GabrielSanchesRosa/Python | 3a129e27e076b2a91af03d68ede50b9c45c50217 | [
"MIT"
] | null | null | null | Desafio018.py | GabrielSanchesRosa/Python | 3a129e27e076b2a91af03d68ede50b9c45c50217 | [
"MIT"
] | null | null | null | Desafio018.py | GabrielSanchesRosa/Python | 3a129e27e076b2a91af03d68ede50b9c45c50217 | [
"MIT"
] | null | null | null | # Faça um programa que leia um ângulo qualquer e mostre na tela o valor do seno, cosseno e tangente desse ângulo.
from math import radians, sin, cos, tan
angulo = float(input('Digite o ângulo que você deseja: '))
seno = sin(radians(angulo))
print(f'O ângulo de {angulo} tem o SENO de {seno:.2f}.')
cosseno = cos(radi... | 32.933333 | 113 | 0.714575 |
c9aec3c930ea60ea55cdd803e3a8ae738d073870 | 663 | py | Python | research/delf/delf/python/training/create_oxford5k_list.py | fwtan/models | d0e9833d33a7a699c80a60fd1d342eb2e923d755 | [
"Apache-2.0"
] | null | null | null | research/delf/delf/python/training/create_oxford5k_list.py | fwtan/models | d0e9833d33a7a699c80a60fd1d342eb2e923d755 | [
"Apache-2.0"
] | null | null | null | research/delf/delf/python/training/create_oxford5k_list.py | fwtan/models | d0e9833d33a7a699c80a60fd1d342eb2e923d755 | [
"Apache-2.0"
] | null | null | null | from glob import glob
import os.path as osp
import pickle
def pickle_load(path):
with open(path, 'rb') as fid:
data_ = pickle.load(fid)
return data_
gnd = pickle_load('oxford5k/gnd_roxford5k.pkl')
query_names = gnd['qimlist']
index_names = gnd['imlist']
query_paths = ['oxford5k/oxford5k_images/%s.jpg'... | 33.15 | 72 | 0.710407 |
951555cdfd92834a5eea0c15334da170cba5eee8 | 7,163 | py | Python | core/python/kungfu/data/sqlite/models.py | yunnant/kungfu | 03dba19c922a5950068bd2d223488b8543ad8dd1 | [
"Apache-2.0"
] | null | null | null | core/python/kungfu/data/sqlite/models.py | yunnant/kungfu | 03dba19c922a5950068bd2d223488b8543ad8dd1 | [
"Apache-2.0"
] | 1 | 2019-08-23T01:52:33.000Z | 2019-08-23T01:52:33.000Z | core/python/kungfu/data/sqlite/models.py | yunnant/kungfu | 03dba19c922a5950068bd2d223488b8543ad8dd1 | [
"Apache-2.0"
] | null | null | null | from . import *
from sqlalchemy import Column, ForeignKey, Integer, String, Date, Float, Boolean, PrimaryKeyConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
import time
Base = declarative_base()
class Account(Base):
__tablename__ = 'account_config'
a... | 29.356557 | 135 | 0.688818 |
cc756809aedcb181b2e8372a280b8d19169908e1 | 1,181 | py | Python | src/pydi/pydi.py | chadwell1028/pydi | 361cdd517ade0177c658747b5a6c62bbe6488295 | [
"MIT"
] | null | null | null | src/pydi/pydi.py | chadwell1028/pydi | 361cdd517ade0177c658747b5a6c62bbe6488295 | [
"MIT"
] | null | null | null | src/pydi/pydi.py | chadwell1028/pydi | 361cdd517ade0177c658747b5a6c62bbe6488295 | [
"MIT"
] | null | null | null | import glob
import importlib
import inspect
import logging
import os
import re
import sys
from os.path import isfile, basename
class Pydi:
def __init__(self, directory=None):
self._logger = logging.getLogger(__name__)
self._directory = directory or os.getcwd()
self._class_type_map = self._... | 35.787879 | 231 | 0.676545 |
76226f08c6fe33e5c4ed1c95b877e0dccf132ec7 | 5,059 | py | Python | beetsplug/mbsync.py | Profpatsch/beets | eb5c37ecc0f5c7ab7ac902d8d88219c068b9db1f | [
"MIT"
] | 1 | 2015-11-06T03:32:25.000Z | 2015-11-06T03:32:25.000Z | beetsplug/mbsync.py | wudangt/beets | b7da5df5eef6dd6be2a8888035f2dd0077e6ebaa | [
"MIT"
] | null | null | null | beetsplug/mbsync.py | wudangt/beets | b7da5df5eef6dd6be2a8888035f2dd0077e6ebaa | [
"MIT"
] | null | null | null | # This file is part of beets.
# Copyright 2014, Jakob Schnitzer.
#
# 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,... | 35.131944 | 78 | 0.603084 |
b0d35f275868ba88d689bd48482aab22bdfc61d0 | 792 | py | Python | tests/parser/syntax/test_logging.py | ryan-rozario/vyper | 9d235e6e7e85ee0dbfaf54a6efd5fb6334c2d00f | [
"Apache-2.0"
] | null | null | null | tests/parser/syntax/test_logging.py | ryan-rozario/vyper | 9d235e6e7e85ee0dbfaf54a6efd5fb6334c2d00f | [
"Apache-2.0"
] | null | null | null | tests/parser/syntax/test_logging.py | ryan-rozario/vyper | 9d235e6e7e85ee0dbfaf54a6efd5fb6334c2d00f | [
"Apache-2.0"
] | null | null | null | import pytest
from pytest import (
raises,
)
from vyper import (
compiler,
)
from vyper.exceptions import (
InvalidLiteral,
TypeMismatch,
)
fail_list = [
"""
Bar: event({_value: int128[4]})
x: decimal[4]
@public
def foo():
log.Bar(self.x)
""",
"""
Bar: event({_value: int128[4]})
@pub... | 15.84 | 47 | 0.59596 |
f37c126499bc5b1d855a5f53b265c99a78a2ba32 | 7,272 | py | Python | pyjfuzz/core/pjf_factory.py | ParrotSec/PyJFuzz | b206ef75ef8f941c660ac1f70e533bf79ed3fd0c | [
"MIT"
] | 1 | 2017-02-10T15:07:20.000Z | 2017-02-10T15:07:20.000Z | pyjfuzz/core/pjf_factory.py | ParrotSec/PyJFuzz | b206ef75ef8f941c660ac1f70e533bf79ed3fd0c | [
"MIT"
] | null | null | null | pyjfuzz/core/pjf_factory.py | ParrotSec/PyJFuzz | b206ef75ef8f941c660ac1f70e533bf79ed3fd0c | [
"MIT"
] | 2 | 2018-09-15T15:12:38.000Z | 2020-07-15T01:24:48.000Z | """
The MIT License (MIT)
Copyright (c) 2016 Daniele Linguaglossa <d.linguaglossa@mseclab.com>
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 th... | 35.130435 | 107 | 0.550468 |
faa6eb0d250385d4bea018998948740d48d6ebbc | 5,693 | py | Python | samcli/local/docker/manager.py | theowenyoung/aws-sam-cli | 27dbe8f426531365c26788382dbf0a1b0844192b | [
"Apache-2.0"
] | null | null | null | samcli/local/docker/manager.py | theowenyoung/aws-sam-cli | 27dbe8f426531365c26788382dbf0a1b0844192b | [
"Apache-2.0"
] | null | null | null | samcli/local/docker/manager.py | theowenyoung/aws-sam-cli | 27dbe8f426531365c26788382dbf0a1b0844192b | [
"Apache-2.0"
] | null | null | null | """
Provides classes that interface with Docker to create, execute and manage containers.
"""
import logging
import sys
import docker
import requests
from samcli.lib.utils.stream_writer import StreamWriter
LOG = logging.getLogger(__name__)
class ContainerManager:
"""
This class knows how to interface with... | 35.805031 | 120 | 0.642895 |
a2ba04130292b1b20368abab7c5b4c8ea507bc6c | 1,317 | py | Python | tests/test_prompt.py | staticdev/irpf-investidor | d3f7cba1b6cc719d77b7d9f36202f6deb704152d | [
"MIT"
] | 8 | 2022-02-14T19:03:59.000Z | 2022-03-30T03:52:20.000Z | tests/test_prompt.py | staticdev/irpf-investidor | d3f7cba1b6cc719d77b7d9f36202f6deb704152d | [
"MIT"
] | 12 | 2022-01-02T09:49:40.000Z | 2022-03-31T12:04:17.000Z | tests/test_prompt.py | staticdev/irpf-investidor | d3f7cba1b6cc719d77b7d9f36202f6deb704152d | [
"MIT"
] | 2 | 2022-02-07T13:53:56.000Z | 2022-03-08T02:18:40.000Z | """Test cases for prompt module."""
import pytest
from pytest_mock import MockerFixture
import irpf_investidor.prompt as prompt
TRADES = [(0, "trade 1"), (0, "trade 2")]
@pytest.fixture
def mock_checkboxlist_dialog(mocker: MockerFixture) -> MockerFixture:
"""Fixture for mocking shortcuts.checkboxlist_dialog.""... | 29.931818 | 86 | 0.754746 |
bab8fa380db0e59b4551c309861020fcc006f06e | 186 | py | Python | corehq/sql_accessors/migrations/0022_last_modified_form_id.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/sql_accessors/migrations/0022_last_modified_form_id.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/sql_accessors/migrations/0022_last_modified_form_id.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sql_accessors', '0021_get_ledger_values_for_cases'),
]
operations = []
| 16.909091 | 62 | 0.688172 |
a21588ea414b3b1a60186de4686537783a609b46 | 30,990 | py | Python | seleniumbase/fixtures/js_utils.py | kendrickassignemt/Selenium-Testing | b8833b1e9a1235e86d1383f64d1da18f811b8e4d | [
"MIT"
] | null | null | null | seleniumbase/fixtures/js_utils.py | kendrickassignemt/Selenium-Testing | b8833b1e9a1235e86d1383f64d1da18f811b8e4d | [
"MIT"
] | null | null | null | seleniumbase/fixtures/js_utils.py | kendrickassignemt/Selenium-Testing | b8833b1e9a1235e86d1383f64d1da18f811b8e4d | [
"MIT"
] | 1 | 2021-11-06T06:39:18.000Z | 2021-11-06T06:39:18.000Z | """
This module contains useful Javascript utility methods for base_case.py
These helper methods SHOULD NOT be called directly from tests.
"""
import re
import requests
import time
from selenium.common.exceptions import WebDriverException
from seleniumbase import config as sb_config
from seleniumbase.common import deco... | 37.247596 | 79 | 0.600355 |
5a48c018059313f6af4335c5360cf3b9e972a5c4 | 5,774 | py | Python | rltk/similarity/tf_idf.py | ckxz105/rltk | 2d08269002c00c0218421c8c2dc0cc7c4f677131 | [
"MIT"
] | 98 | 2017-03-07T22:59:41.000Z | 2022-02-02T16:10:40.000Z | rltk/similarity/tf_idf.py | ckxz105/rltk | 2d08269002c00c0218421c8c2dc0cc7c4f677131 | [
"MIT"
] | 26 | 2017-04-25T17:25:22.000Z | 2021-09-10T16:57:05.000Z | rltk/similarity/tf_idf.py | ckxz105/rltk | 2d08269002c00c0218421c8c2dc0cc7c4f677131 | [
"MIT"
] | 31 | 2017-03-09T22:40:40.000Z | 2022-03-11T16:28:23.000Z | import collections
import math
import rltk.utils as utils
def tf_idf_similarity(bag1, bag2, df_corpus, doc_size, math_log=False):
"""
Computes TF/IDF measure. This measure employs the notion of TF/IDF score commonly used in information retrieval (IR) to find documents that are relevant to keyword queries. Th... | 31.380435 | 288 | 0.583478 |
caf0317a36e6b48f36fff4fd562e4aead090c756 | 1,122 | py | Python | scripts/switch.py | vortydev/projet-avion | a447ee7ecc448e712b3a898352e054870160e0e2 | [
"MIT"
] | null | null | null | scripts/switch.py | vortydev/projet-avion | a447ee7ecc448e712b3a898352e054870160e0e2 | [
"MIT"
] | null | null | null | scripts/switch.py | vortydev/projet-avion | a447ee7ecc448e712b3a898352e054870160e0e2 | [
"MIT"
] | null | null | null | import time
from time import sleep
import RPi.GPIO as GPIO
# define switch pins
interrupteur = 12
def setup():
GPIO.setmode(GPIO.BCM)
GPIO.setup(interrupteur, GPIO.IN, GPIO.PUD_UP)
GPIO.add_event_detect(interrupteur, GPIO.RISING, callback=interrupteurCallback)
# GPIO.add_event_detect(interrupteur, GP... | 24.391304 | 89 | 0.683601 |
6dc9cf4df98d589c477473a05689c0ae6a69ed72 | 10,838 | py | Python | fastai/widgets/image_cleaner.py | Whoaa512/fastai | b3491479cbef69f7617b25b9a24c52a0d9ecb02b | [
"Apache-2.0"
] | 1 | 2021-06-15T13:50:43.000Z | 2021-06-15T13:50:43.000Z | fastai/widgets/image_cleaner.py | Whoaa512/fastai | b3491479cbef69f7617b25b9a24c52a0d9ecb02b | [
"Apache-2.0"
] | 2 | 2021-05-20T23:02:08.000Z | 2021-09-28T05:48:00.000Z | fastai/widgets/image_cleaner.py | Whoaa512/fastai | b3491479cbef69f7617b25b9a24c52a0d9ecb02b | [
"Apache-2.0"
] | 1 | 2020-11-19T06:46:30.000Z | 2020-11-19T06:46:30.000Z | from ..torch_core import *
from ..basic_train import *
from ..basic_data import *
from ..vision.data import *
from ..vision.transform import *
from ..vision.image import *
from ..callbacks.hooks import *
from ..layers import *
from ipywidgets import widgets, Layout
from IPython.display import clear_output, display
__a... | 46.316239 | 134 | 0.645599 |
af097aed99b125692c2a8f2f09e7a9c7f58df30c | 51 | py | Python | spotdl/helpers/__init__.py | khjxiaogu/spotify-downloader | a8dcb8d998da0769bbe210f2808d16b346453c23 | [
"MIT"
] | 4,698 | 2017-06-20T22:37:10.000Z | 2022-03-28T13:38:07.000Z | spotdl/helpers/__init__.py | Delgan/spotify-downloader | 8adf3e8d6b98269b1538dd91c9a44ed345c77545 | [
"MIT"
] | 690 | 2017-06-20T20:08:42.000Z | 2022-02-26T23:36:07.000Z | spotdl/helpers/__init__.py | Delgan/spotify-downloader | 8adf3e8d6b98269b1538dd91c9a44ed345c77545 | [
"MIT"
] | 741 | 2017-06-21T23:32:51.000Z | 2022-03-07T12:11:54.000Z | from spotdl.helpers.spotify import SpotifyHelpers
| 17 | 49 | 0.862745 |
fb47a23c6b7ee56f435278ebab07dbf9f146508a | 3,004 | py | Python | experiments/where_image/architecture/activations.py | mtanti/where-image | 3e232f2eb29c12e0d8ec322cdff656d68b753d19 | [
"MIT"
] | 3 | 2017-04-05T12:20:49.000Z | 2020-12-06T07:11:14.000Z | experiments/where_image/architecture/activations.py | mtanti/where-image | 3e232f2eb29c12e0d8ec322cdff656d68b753d19 | [
"MIT"
] | null | null | null | experiments/where_image/architecture/activations.py | mtanti/where-image | 3e232f2eb29c12e0d8ec322cdff656d68b753d19 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str, super, zip
import theano
import theano.tensor as T
import math
import numpy as np
from architecture.layer impo... | 40.594595 | 131 | 0.370173 |
efcd531be54b9e8098c78ce81d90713777634f86 | 1,492 | py | Python | app/user.py | StidZhang/gomaku | af41c255fe9b4fac404acb06d5395db19c9cfb22 | [
"MIT"
] | 1 | 2022-02-23T00:53:16.000Z | 2022-02-23T00:53:16.000Z | app/user.py | StidZhang/gomaku | af41c255fe9b4fac404acb06d5395db19c9cfb22 | [
"MIT"
] | 8 | 2019-12-09T05:37:07.000Z | 2019-12-09T05:37:09.000Z | app/user.py | StidZhang/gomaku | af41c255fe9b4fac404acb06d5395db19c9cfb22 | [
"MIT"
] | null | null | null | from datetime import datetime
from .db import get_db
from pymongo.collation import Collation, CollationStrength
from bson import ObjectId
def get_user_collection():
db = get_db()
return db.user
def get_user_by_name(name):
user = get_user_collection()
return user.find_one({
"username": name
... | 21.941176 | 78 | 0.615282 |
8b63db6983a6a6844e9cf0247086f23a441eedb3 | 2,216 | py | Python | analysis/experiment3/helpers/stats.py | hawkrobe/fish | 2000e46c397f7c95bba8ecb0c6afd26013929ff8 | [
"MIT"
] | 1 | 2015-12-11T16:51:08.000Z | 2015-12-11T16:51:08.000Z | analysis/experiment3/helpers/stats.py | hawkrobe/fish | 2000e46c397f7c95bba8ecb0c6afd26013929ff8 | [
"MIT"
] | 3 | 2020-02-11T21:36:11.000Z | 2020-11-01T21:25:17.000Z | analysis/experiment3/helpers/stats.py | hawkrobe/couzin_replication | ff491639954f0652d6b4b2a318477bb54c38fadf | [
"MIT"
] | null | null | null | import numpy as np
def get_normal_fit(points):
"""
>>> mu = np.array([10,100])
>>> cov = np.array([[10,-5],[-5,20]])
>>> samples = np.random.multivariate_normal(mu, cov, size = 1000000)
>>> m,s = get_normal_fit(samples)
>>> assert np.linalg.norm(mu - m) < 1
>>> assert np.linalg.norm(cov -... | 29.157895 | 84 | 0.54648 |
cadd9ae0f1d38b619c997a54b7eecfead7141775 | 953 | py | Python | isi_sdk_9_0_0/test/test_snapshot_locks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/test/test_snapshot_locks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/test/test_snapshot_locks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_9_0_0
from ... | 23.243902 | 100 | 0.720881 |
268a944804a0d2528434261f8a31d02eae35b460 | 12,899 | py | Python | multiagent/util.py | dcalacci/ml-expectimax-agent | 1b74a1a02f98b702bf2d21e09f616b590bff481c | [
"MIT"
] | 2 | 2018-05-02T07:51:25.000Z | 2020-05-11T00:55:08.000Z | multiagent/util.py | dcalacci/ml-expectimax-agent | 1b74a1a02f98b702bf2d21e09f616b590bff481c | [
"MIT"
] | null | null | null | multiagent/util.py | dcalacci/ml-expectimax-agent | 1b74a1a02f98b702bf2d21e09f616b590bff481c | [
"MIT"
] | 2 | 2017-10-10T22:11:51.000Z | 2019-12-11T16:05:12.000Z | import sys
import inspect
import heapq, random
"""
Data structures useful for implementing SearchAgents
"""
class Stack:
"A container with a last-in-first-out (LIFO) queuing policy."
def __init__(self):
self.list = []
def push(self,item):
"Push 'item' onto the stack"
self.list.append(item)
... | 26.541152 | 88 | 0.616327 |
b275b08fc8c6fe2473736e7513a13d8b1801c7e0 | 2,347 | py | Python | contacts/views.py | Gerard-007/musicalpacks | ef12c7281b395268ac53247fd34c3499f7a0569a | [
"MIT"
] | null | null | null | contacts/views.py | Gerard-007/musicalpacks | ef12c7281b395268ac53247fd34c3499f7a0569a | [
"MIT"
] | 7 | 2020-06-05T20:23:21.000Z | 2022-03-11T23:45:33.000Z | contacts/views.py | Gerard-007/musicalpacks | ef12c7281b395268ac53247fd34c3499f7a0569a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404, redirect, render
from django.http import HttpResponseRedirect, Http404
from .forms import contactForm
from django.conf import settings
from django.core.mail import send_mail
#Create your views here.
def co... | 34.514706 | 96 | 0.617384 |
5187e64ed0b1eaf0685f03bda418aed255eb7443 | 4,513 | py | Python | tests/Simple/Sup/multi_plot_loss.py | maxiaoba/rlk | 3e23473f6bbc59552b6b2bcd97245e024d7ca95d | [
"MIT"
] | 1 | 2021-09-28T21:16:54.000Z | 2021-09-28T21:16:54.000Z | tests/Simple/Sup/multi_plot_loss.py | maxiaoba/rlkit | 3e23473f6bbc59552b6b2bcd97245e024d7ca95d | [
"MIT"
] | null | null | null | tests/Simple/Sup/multi_plot_loss.py | maxiaoba/rlkit | 3e23473f6bbc59552b6b2bcd97245e024d7ca95d | [
"MIT"
] | null | null | null | import csv
import os.path
import matplotlib
matplotlib.rcParams.update({'font.size': 13})
from matplotlib import pyplot as plt
import numpy as np
itr_interval = 100
max_itr = 2e4
fields = [
'evaluation/Average Returns',
# 'evaluation/Actions Max',
# 'evaluation/Actions Min',
... | 32.702899 | 86 | 0.474186 |
2720623617e3eb6fb9e2a5b3f6f51e9f469880fa | 23,022 | py | Python | ideScripts/updateMakefile.py | poshcoe/VS-Code-STM32-IDE | d5509876c0642c9b1fbf53363d6640940b2a7084 | [
"MIT"
] | 2 | 2020-06-06T16:15:57.000Z | 2020-08-14T13:39:46.000Z | ideScripts/updateMakefile.py | poshcoe/VS-Code-STM32-IDE | d5509876c0642c9b1fbf53363d6640940b2a7084 | [
"MIT"
] | 2 | 2020-06-06T16:18:43.000Z | 2020-06-06T16:19:55.000Z | ideScripts/updateMakefile.py | poshcoe/VS-Code-STM32-IDE | d5509876c0642c9b1fbf53363d6640940b2a7084 | [
"MIT"
] | null | null | null | '''
Generate (replace existing) Makefile file in workspace folder wtih data from
original Makefile and 'c_cpp_properties.json'.
'''
import os
import datetime
from subprocess import Popen, PIPE
import utilities as utils
import templateStrings as tmpStr
import updatePaths as pth
import updateWorkspaceSour... | 45.408284 | 125 | 0.584962 |
63cc6ca3652a89b7bfd3aef0c3722d49347ec2dc | 751 | py | Python | deployed-devices/rest/deployments/update-deployment/update-deployment.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 234 | 2016-01-27T03:04:38.000Z | 2022-02-25T20:13:43.000Z | deployed-devices/rest/deployments/update-deployment/update-deployment.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 351 | 2016-04-06T16:55:33.000Z | 2022-03-10T18:42:36.000Z | deployed-devices/rest/deployments/update-deployment/update-deployment.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 494 | 2016-03-30T15:28:20.000Z | 2022-03-28T19:39:36.000Z | # Get the Python helper library from https://twilio.com/docs/libraries/python
import os
from twilio.rest import Client
# Get your Account SID and Auth Token from https://twilio.com/console
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.envi... | 37.55 | 77 | 0.727031 |
b7f1f461936bdd9b99c2534e41e04ba3683a0e6e | 21,606 | py | Python | cogs/image.py | OpenRobot/JDBot | 314d715eec7174a0199a20b516b7f5e0db9900be | [
"MIT"
] | 1 | 2022-03-30T16:50:07.000Z | 2022-03-30T16:50:07.000Z | cogs/image.py | OpenRobot/JDBot | 314d715eec7174a0199a20b516b7f5e0db9900be | [
"MIT"
] | null | null | null | cogs/image.py | OpenRobot/JDBot | 314d715eec7174a0199a20b516b7f5e0db9900be | [
"MIT"
] | null | null | null | import discord
import sr_api
import asuna_api
import random
import io
import cairosvg
import functools
from discord.ext import commands
import utils
import jeyyapi
class Image(commands.Cog):
"A bunch of Image Manipulation and other related Image commands"
def __init__(self, bot):
self.bot = bot
... | 39.863469 | 120 | 0.614922 |
81a15133d578f5a72d9c0ac46229218634f5da94 | 2,289 | py | Python | checkers/passman/passman_lib.py | C4T-BuT-S4D/innoctf-teazer-01-03-2020 | 05b5b0cf8b4a7df9f03b616996372c7d68ccd2c3 | [
"WTFPL"
] | null | null | null | checkers/passman/passman_lib.py | C4T-BuT-S4D/innoctf-teazer-01-03-2020 | 05b5b0cf8b4a7df9f03b616996372c7d68ccd2c3 | [
"WTFPL"
] | null | null | null | checkers/passman/passman_lib.py | C4T-BuT-S4D/innoctf-teazer-01-03-2020 | 05b5b0cf8b4a7df9f03b616996372c7d68ccd2c3 | [
"WTFPL"
] | null | null | null | import re
import requests
from checklib import *
PORT = 9171
class CheckMachine:
def __init__(self, checker: BaseChecker):
self.c = checker
@property
def url(self):
return f'http://{self.c.host}:{PORT}'
def register(self, username=None, password=None):
username = username o... | 38.15 | 101 | 0.639581 |
befe88d4c636e1a785bf52c9e73a185c4a7722ee | 21,962 | py | Python | tests/test_date.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_date.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | tests/test_date.py | ASOdesk/dateparser | d8050511772c30199d14cd8506d46f9c587c61a8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import regex as re
import unittest
from collections import OrderedDict
from datetime import datetime, timedelta
from mock import Mock, patch
from nose_parameterized import parameterized, param
import six
import dateparser
from date... | 42.234615 | 119 | 0.641153 |
9cd2315800dcc6a3fe2ad2faf4bcc0aa1d01accc | 6,657 | py | Python | nengo/utils/matplotlib.py | HugoChateauLaurent/nengo | 749893186ee09aa6c621a40da3ffd3878114db9c | [
"BSD-2-Clause"
] | null | null | null | nengo/utils/matplotlib.py | HugoChateauLaurent/nengo | 749893186ee09aa6c621a40da3ffd3878114db9c | [
"BSD-2-Clause"
] | null | null | null | nengo/utils/matplotlib.py | HugoChateauLaurent/nengo | 749893186ee09aa6c621a40da3ffd3878114db9c | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
import warnings
from distutils.version import LooseVersion
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from nengo.utils.compat import range
from nengo.utils.ensemble import tuning_curves
has_prop_cycle = LooseVersion(matplotlib.__version__) >= '1.5.0'
... | 31.851675 | 78 | 0.62085 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.