hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cdb82fb4a5ce5b953358d23bc38b6930cc8ca8a7 | 13,860 | py | Python | gpsConvFrame.py | qqgit/somefoot_tracklog_converter | 3bc1cc90bdff8fa96da9d061ec1c5ee4222397b1 | [
"MIT"
] | null | null | null | gpsConvFrame.py | qqgit/somefoot_tracklog_converter | 3bc1cc90bdff8fa96da9d061ec1c5ee4222397b1 | [
"MIT"
] | null | null | null | gpsConvFrame.py | qqgit/somefoot_tracklog_converter | 3bc1cc90bdff8fa96da9d061ec1c5ee4222397b1 | [
"MIT"
] | null | null | null | '''
Created on 2012-3-17
@author: cqq
'''
import wx
import wx.lib.filebrowsebutton as filebrowse
import os
import codecs
from subprocess import call
import time
import json
class gpsConvFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "GPS Track Data Converter")
... | 44.423077 | 223 | 0.567316 |
b18fe35cc17192417d5e37950e38d7313a530f89 | 339 | py | Python | carts/admin.py | gitRipan/greatkart | 2ea1a60f7d87ba86716bd50666b7b3ed804254ce | [
"MIT"
] | null | null | null | carts/admin.py | gitRipan/greatkart | 2ea1a60f7d87ba86716bd50666b7b3ed804254ce | [
"MIT"
] | null | null | null | carts/admin.py | gitRipan/greatkart | 2ea1a60f7d87ba86716bd50666b7b3ed804254ce | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Cart, CartItem
class CartAdmin(admin.ModelAdmin):
list_display = ('cart_id', 'date_added')
class CartItemAdmin(admin.ModelAdmin):
list_display = ('product', 'cart', 'quantity', 'is_active')
admin.site.register(Cart, CartAdmin)
admin.site.register(CartIt... | 22.6 | 63 | 0.752212 |
0d8a6240b5e8349c170f6e2833e29895602f4743 | 7,424 | py | Python | vint/linting/linter.py | mosheavni/vint | 9078dd626415cfe37ddaf03032e714bbaca8b336 | [
"MIT"
] | 538 | 2015-01-03T18:54:53.000Z | 2020-01-11T01:34:51.000Z | vint/linting/linter.py | mosheavni/vint | 9078dd626415cfe37ddaf03032e714bbaca8b336 | [
"MIT"
] | 235 | 2015-01-01T06:20:01.000Z | 2020-01-17T11:32:39.000Z | vint/linting/linter.py | mosheavni/vint | 9078dd626415cfe37ddaf03032e714bbaca8b336 | [
"MIT"
] | 43 | 2015-01-23T16:59:49.000Z | 2019-12-27T10:56:12.000Z | from typing import Dict, Any, List # noqa: F401
import re
import logging
from typing import Dict, List, Any # noqa: F401
from pathlib import Path
from vint._bundles import vimlparser
from vint.encodings.decoder import EncodingDetectionError
from vint.ast.parsing import Parser
from vint.ast.node_type import NodeType
f... | 35.018868 | 128 | 0.660426 |
7d069b91e61865b4c3c6d6d3031be697f5b11d7b | 3,255 | py | Python | examples/tutorials/scipy2008/custom_overlay_dataspace.py | janvonrickenbach/Chaco_wxPhoenix_py3 | 21a10cfd81100f28e3fbc273357ac45642519f33 | [
"BSD-3-Clause"
] | null | null | null | examples/tutorials/scipy2008/custom_overlay_dataspace.py | janvonrickenbach/Chaco_wxPhoenix_py3 | 21a10cfd81100f28e3fbc273357ac45642519f33 | [
"BSD-3-Clause"
] | null | null | null | examples/tutorials/scipy2008/custom_overlay_dataspace.py | janvonrickenbach/Chaco_wxPhoenix_py3 | 21a10cfd81100f28e3fbc273357ac45642519f33 | [
"BSD-3-Clause"
] | null | null | null | from numpy import linspace, sin
from chaco.api import ArrayPlotData, Plot, AbstractOverlay
from chaco.tools.api import PanTool
from enable.component_editor import ComponentEditor
from enable.api import ColorTrait
from traits.api import Button, CArray, Bool, Float, Range, HasTraits,\
In... | 31.911765 | 80 | 0.569892 |
3960247fc76c462d1ceecd51c403cbed08327a03 | 936 | py | Python | kubernetes_asyncio/test/test_rbac_authorization_api.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | 1 | 2020-03-25T01:24:27.000Z | 2020-03-25T01:24:27.000Z | kubernetes_asyncio/test/test_rbac_authorization_api.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_rbac_authorization_api.py | olitheolix/kubernetes_asyncio | 344426793e4e4b653bcd8e4a29c6fa4766e1fff7 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... | 22.829268 | 119 | 0.725427 |
96527fa4ed9aa8a7e7c35bc3e758867bfe9e582d | 1,953 | py | Python | test/functional/timestampindex.py | silviopeluso/sucrecoin | 41a499919229cfa47f34c9575e4a7252b02c41a8 | [
"MIT"
] | null | null | null | test/functional/timestampindex.py | silviopeluso/sucrecoin | 41a499919229cfa47f34c9575e4a7252b02c41a8 | [
"MIT"
] | null | null | null | test/functional/timestampindex.py | silviopeluso/sucrecoin | 41a499919229cfa47f34c9575e4a7252b02c41a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2015 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 timestampindex generation and fetching
#
import time
from test_framework.test_framework import... | 31 | 97 | 0.650282 |
2e9457d313c872af247951ae9d9203eead348e43 | 5,802 | py | Python | testscripts/RDKB/component/CosaCM/TS_CosaCM_GetIPv6DHCPInfo.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/CosaCM/TS_CosaCM_GetIPv6DHCPInfo.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/CosaCM/TS_CosaCM_GetIPv6DHCPInfo.py | cablelabs/tools-tdkb | 1fd5af0f6b23ce6614a4cfcbbaec4dde430fad69 | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 44.290076 | 233 | 0.721303 |
075d4ccf783bd880411cb5882c60f807f0bdfb89 | 2,474 | py | Python | lookup/simple-lookup-service-client-python/sls_client/records.py | sitedata/simple-lookup-service | 27ed63592653f96d4d80d0ac9289f0a9bf1f96ce | [
"BSD-3-Clause-LBNL"
] | 4 | 2015-03-18T14:15:52.000Z | 2022-03-22T20:04:14.000Z | lookup/simple-lookup-service-client-python/sls_client/records.py | esnet/simple-lookup-service | 27ed63592653f96d4d80d0ac9289f0a9bf1f96ce | [
"BSD-3-Clause-LBNL"
] | 72 | 2015-04-30T20:57:22.000Z | 2022-03-23T16:43:48.000Z | lookup/simple-lookup-service-client-python/sls_client/records.py | sitedata/simple-lookup-service | 27ed63592653f96d4d80d0ac9289f0a9bf1f96ce | [
"BSD-3-Clause-LBNL"
] | 5 | 2017-02-16T18:17:45.000Z | 2022-03-27T00:59:42.000Z | import copy
import json
from voluptuous import Schema
from voluptuous import Extra, Required
from sls_client.constants import *
from sls_client.validators import *
class Record(object):
"""Base class for record objects"""
record_schema = Schema({
Required(LSKey(LS_KEY_TYPE)): LSValues(),
... | 27.186813 | 67 | 0.625707 |
1f3a9dc9e87360963b2b34a0d0e8879916ad82f0 | 1,295 | py | Python | tests/interface/gcp_utils_test.py | ubclaunchpad/rocket2 | 7a4f05f46229d1c9a900aac1694b3d822f9d6b0f | [
"MIT"
] | 14 | 2019-01-20T21:54:36.000Z | 2021-10-09T21:06:23.000Z | tests/interface/gcp_utils_test.py | ubclaunchpad/rocket2 | 7a4f05f46229d1c9a900aac1694b3d822f9d6b0f | [
"MIT"
] | 510 | 2018-11-18T20:07:51.000Z | 2022-02-01T15:34:03.000Z | tests/interface/gcp_utils_test.py | ubclaunchpad/rocket2.0 | 7a4f05f46229d1c9a900aac1694b3d822f9d6b0f | [
"MIT"
] | 9 | 2019-08-20T16:57:21.000Z | 2021-05-04T12:51:47.000Z | from unittest import mock, TestCase
from interface.gcp_utils import sync_user_email_perms, sync_team_email_perms
from app.model import User, Team
from tests.memorydb import MemoryDB
from interface.gcp import GCPInterface
class TestGCPUtils(TestCase):
def setUp(self):
self.u0 = User('U93758')
self.... | 34.078947 | 76 | 0.69112 |
810ea3367628a517ba76108415b3e999e6c19c48 | 265 | py | Python | nortok/__init__.py | Froskekongen/nortok | 7a31011515de7004db893906de64c871949004b9 | [
"MIT"
] | null | null | null | nortok/__init__.py | Froskekongen/nortok | 7a31011515de7004db893906de64c871949004b9 | [
"MIT"
] | null | null | null | nortok/__init__.py | Froskekongen/nortok | 7a31011515de7004db893906de64c871949004b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from nortok.tokenizers import WordTokenizer,RawCharTokenizer,HierarchicalTokenizer
from nortok.parsers import NTBParse,ParseText
from nortok.stopwords import get_norwegian_stopwords
from nortok.bpe_encoding import BPE
| 37.857143 | 82 | 0.833962 |
ac4fab65d855067024524fe96b8f8ae9e2f2156b | 9,813 | py | Python | python/eggroll/roll_pair/transfer_pair.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | null | null | null | python/eggroll/roll_pair/transfer_pair.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | null | null | null | python/eggroll/roll_pair/transfer_pair.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019 - now, Eggroll 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... | 43.613333 | 138 | 0.617956 |
d52d1f4c0ec16810848f48cb8a795aaec42f1537 | 386 | py | Python | matf-zadaci/1.13.py | peranovicc/python | b669060eb539f5f23684ffa1de13e6c927cc0b06 | [
"MIT"
] | null | null | null | matf-zadaci/1.13.py | peranovicc/python | b669060eb539f5f23684ffa1de13e6c927cc0b06 | [
"MIT"
] | null | null | null | matf-zadaci/1.13.py | peranovicc/python | b669060eb539f5f23684ffa1de13e6c927cc0b06 | [
"MIT"
] | null | null | null | students = ['Marko','Petar','Pavle']
marks = []
for student in students:
marks.append(int(input('Unesi ocenu za studenta "{}": '.format(student))))
# map returns map object in python3, so we must convert it to list
print(list(map(lambda student,mark: (student,mark),students,marks)))
# Коришћена функција zip - ... | 25.733333 | 89 | 0.712435 |
dc777fc14b7c06b0c3c5c5727874a5e35acf22bd | 25 | py | Python | Motospeed-ck62/f4.py | godrix/motospeed-ck62-fix-key | 48c65a2ddd2aa7b8be04c2c5e65939b8de6ec280 | [
"MIT"
] | null | null | null | Motospeed-ck62/f4.py | godrix/motospeed-ck62-fix-key | 48c65a2ddd2aa7b8be04c2c5e65939b8de6ec280 | [
"MIT"
] | null | null | null | Motospeed-ck62/f4.py | godrix/motospeed-ck62-fix-key | 48c65a2ddd2aa7b8be04c2c5e65939b8de6ec280 | [
"MIT"
] | null | null | null | keyboard.send_key("<f4>") | 25 | 25 | 0.72 |
a0f5cb7d9caa44e1d30b53e7b67bf3a5bba0ebbd | 6,133 | py | Python | Lib/site-packages/Cryptodome/Hash/SHA512.py | Kronos3/pyexec | c9e76a0302dee047ed137bc38aa669cec04c24cd | [
"bzip2-1.0.6"
] | 2,557 | 2016-07-19T22:20:45.000Z | 2022-01-25T10:53:35.000Z | Lib/site-packages/Cryptodome/Hash/SHA512.py | Kronos3/pyexec | c9e76a0302dee047ed137bc38aa669cec04c24cd | [
"bzip2-1.0.6"
] | 1,360 | 2016-07-20T02:06:42.000Z | 2021-07-27T12:46:40.000Z | Lib/site-packages/Cryptodome/Hash/SHA512.py | Kronos3/pyexec | c9e76a0302dee047ed137bc38aa669cec04c24cd | [
"bzip2-1.0.6"
] | 607 | 2016-07-20T03:34:04.000Z | 2022-01-05T14:57:09.000Z | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | 35.247126 | 99 | 0.578021 |
e0783c0b387228a79df8212f5d40480c4b022a02 | 167 | py | Python | tests/__init__.py | aaman123/faceswap | a5825c3457b062c1824ef3f8b02e4f3fa4c2217f | [
"MIT"
] | 2 | 2021-11-11T08:29:01.000Z | 2021-11-11T08:34:50.000Z | tests/__init__.py | aaman123/faceswap | a5825c3457b062c1824ef3f8b02e4f3fa4c2217f | [
"MIT"
] | null | null | null | tests/__init__.py | aaman123/faceswap | a5825c3457b062c1824ef3f8b02e4f3fa4c2217f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" Use custom Importer for importing Keras for tests """
import sys
from lib.utils import KerasFinder
sys.meta_path.insert(0, KerasFinder())
| 20.875 | 57 | 0.754491 |
ad15a543d4873fbce01399f8b3edd755c3f37dec | 2,088 | py | Python | main.py | LaroTand/ExcelArt | e5d2a980048e9ece93553f9b90b127d5f60bdc26 | [
"MIT"
] | null | null | null | main.py | LaroTand/ExcelArt | e5d2a980048e9ece93553f9b90b127d5f60bdc26 | [
"MIT"
] | null | null | null | main.py | LaroTand/ExcelArt | e5d2a980048e9ece93553f9b90b127d5f60bdc26 | [
"MIT"
] | null | null | null | import PIL.Image
from openpyxl import Workbook
import openpyxl
import os
# Resize Image
def resize_image(image, new_width=100):
width, height = image.size
ratio = height / width
new_height = int(new_width * ratio)
resized_image = image.resize((new_width, new_height), PIL.Image.NEAREST)
return resiz... | 31.636364 | 134 | 0.671935 |
82c712b705d3a5dedfd01a3a192ab7f49afd3877 | 1,516 | py | Python | PythonServer/carmovingLib/mylib.py | asling/avis-test | 936bae5956d93283be1e3f9e813aeac979c3a926 | [
"MIT"
] | null | null | null | PythonServer/carmovingLib/mylib.py | asling/avis-test | 936bae5956d93283be1e3f9e813aeac979c3a926 | [
"MIT"
] | null | null | null | PythonServer/carmovingLib/mylib.py | asling/avis-test | 936bae5956d93283be1e3f9e813aeac979c3a926 | [
"MIT"
] | null | null | null | '''
Created on Jun 13, 2017
@author: eliiyui
'''
import math
import pandas as pd
import numpy as np
class MyLib(object):
def __init__(self):
return
@staticmethod
def CalGPSDistance(lati1,longti1,lati2,longti2):
EARTH_RADIUS = 6378.137
lati1 = math.radians(lati1)
... | 24.063492 | 71 | 0.492744 |
b9253a29c3579e80b044ceb6cf214638cd8eaa73 | 2,260 | py | Python | ramlfications/loader.py | benhamill/ramlfications | bcb729e887a2f55009a8756bd78bb04c2d2724e0 | [
"Apache-2.0"
] | null | null | null | ramlfications/loader.py | benhamill/ramlfications | bcb729e887a2f55009a8756bd78bb04c2d2724e0 | [
"Apache-2.0"
] | null | null | null | ramlfications/loader.py | benhamill/ramlfications | bcb729e887a2f55009a8756bd78bb04c2d2724e0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Spotify AB
__all__ = ["RAMLLoader"]
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
import os
import yaml
from .errors import LoadRAMLError
class RAMLLoader(object):
"""
Extends YAML ... | 29.350649 | 79 | 0.621239 |
5fb35c5d823334daad399a65dfe5dbebf7438705 | 9,133 | py | Python | patron/tests/unit/api/openstack/compute/contrib/test_rescue.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patron/tests/unit/api/openstack/compute/contrib/test_rescue.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patron/tests/unit/api/openstack/compute/contrib/test_rescue.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 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... | 38.699153 | 78 | 0.645899 |
554788be9c9e9eb0a35a51d72a3761d06dec294b | 23,149 | py | Python | coremltools/models/model.py | BearerPipelineTest/coremltools | a84609bfae35b2d4e70d9ba3d592a6756df7d197 | [
"BSD-3-Clause"
] | null | null | null | coremltools/models/model.py | BearerPipelineTest/coremltools | a84609bfae35b2d4e70d9ba3d592a6756df7d197 | [
"BSD-3-Clause"
] | null | null | null | coremltools/models/model.py | BearerPipelineTest/coremltools | a84609bfae35b2d4e70d9ba3d592a6756df7d197 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from copy import deepcopy as _deepcopy
import os as _os
import shutil as _shutil
import tempfile as _tem... | 38.26281 | 188 | 0.638041 |
ebb40d038b74a8200792eea0fe6ddc951614544d | 9,753 | py | Python | tests/llvm/test_multiple_executions.py | JeshuaT/PsyNeuLink | 912f691028e848659055430f37b6c15273c762f1 | [
"Apache-2.0"
] | 67 | 2018-01-05T22:18:44.000Z | 2022-03-27T11:27:31.000Z | tests/llvm/test_multiple_executions.py | JeshuaT/PsyNeuLink | 912f691028e848659055430f37b6c15273c762f1 | [
"Apache-2.0"
] | 1,064 | 2017-12-01T18:58:27.000Z | 2022-03-31T22:22:24.000Z | tests/llvm/test_multiple_executions.py | JeshuaT/PsyNeuLink | 912f691028e848659055430f37b6c15273c762f1 | [
"Apache-2.0"
] | 25 | 2017-12-01T20:27:07.000Z | 2022-03-08T21:49:39.000Z | import pytest
import psyneulink.core.llvm as pnlvm
import numpy as np
import psyneulink.core.components.functions.function as Function
import psyneulink.core.components.functions.nonstateful.objectivefunctions as Functions
from psyneulink.core.components.functions.stateful.integratorfunctions import AdaptiveIntegrator... | 42.220779 | 109 | 0.66964 |
d86f6f4315befc2f3d4c20ba4e13f456403b57e7 | 8,522 | py | Python | nncg/nodes/misc.py | BerlinUnited/nncg | ddced6e0e2449ab40d037b2d59547829a55544f4 | [
"Apache-2.0"
] | null | null | null | nncg/nodes/misc.py | BerlinUnited/nncg | ddced6e0e2449ab40d037b2d59547829a55544f4 | [
"Apache-2.0"
] | null | null | null | nncg/nodes/misc.py | BerlinUnited/nncg | ddced6e0e2449ab40d037b2d59547829a55544f4 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import os
import sys
from numpy import unravel_index
from nncg.writer import Writer
from nncg.nodes.expressions import *
from nncg.traverse.tree import TreeNode
from nncg.nodes.expressions import Variable
class Writable(TreeNode):
"""
Base class for nodes that can be written... | 35.214876 | 128 | 0.597864 |
9f876ec9528ed499e04da7cdddcad4216cd2d49c | 9,810 | py | Python | fairseq/modules/resnet.py | esalesky/visrep | b1d9f2384d3f3e2a1e813c830581a8b0b9cda1f5 | [
"MIT"
] | 19 | 2021-09-16T14:03:09.000Z | 2022-03-31T20:25:18.000Z | fairseq/modules/resnet.py | esalesky/visrep | b1d9f2384d3f3e2a1e813c830581a8b0b9cda1f5 | [
"MIT"
] | 2 | 2022-01-09T00:40:02.000Z | 2022-01-31T17:35:07.000Z | fairseq/modules/resnet.py | esalesky/visrep | b1d9f2384d3f3e2a1e813c830581a8b0b9cda1f5 | [
"MIT"
] | 1 | 2022-02-15T18:50:37.000Z | 2022-02-15T18:50:37.000Z |
import torch.nn as nn
from torchvision.models.utils import load_state_dict_from_url
model_urls = {}
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilat... | 36.468401 | 106 | 0.605708 |
d2eca3e9f3497ffa0019e628b1df95b54015d4fc | 6,085 | py | Python | qa/rpc-tests/signrawtransactions.py | alphapayofficial/alphapay | 471c411ad03b20b49db4f80874a3eac21e1ca91a | [
"MIT"
] | null | null | null | qa/rpc-tests/signrawtransactions.py | alphapayofficial/alphapay | 471c411ad03b20b49db4f80874a3eac21e1ca91a | [
"MIT"
] | null | null | null | qa/rpc-tests/signrawtransactions.py | alphapayofficial/alphapay | 471c411ad03b20b49db4f80874a3eac21e1ca91a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Alphapay Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class... | 43.776978 | 131 | 0.683648 |
04837f0c72a572eb6bc7d97502ee1052eb65b7b8 | 2,431 | py | Python | doc/source/conf.py | akjayaku/ansible-role-diskimage-builder | 0f424b85b04442015fcb806a355c591cb52ec213 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | akjayaku/ansible-role-diskimage-builder | 0f424b85b04442015fcb806a355c591cb52ec213 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | akjayaku/ansible-role-diskimage-builder | 0f424b85b04442015fcb806a355c591cb52ec213 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 32.851351 | 79 | 0.699301 |
ad4dcabda1373b77ee7210e78f1a0973b8921e0e | 381 | py | Python | contacts/migrations/0002_auto_20211109_0650.py | webspace95/studyhelp | 70e0978b4a97cdb45d1574924e7997932bb410fb | [
"MIT"
] | null | null | null | contacts/migrations/0002_auto_20211109_0650.py | webspace95/studyhelp | 70e0978b4a97cdb45d1574924e7997932bb410fb | [
"MIT"
] | null | null | null | contacts/migrations/0002_auto_20211109_0650.py | webspace95/studyhelp | 70e0978b4a97cdb45d1574924e7997932bb410fb | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2021-11-09 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='email',
name='date',
fie... | 20.052632 | 58 | 0.593176 |
36e2c1b93c9fe9a876d99470c2f4d16e36e352d2 | 24,630 | py | Python | docassemble_webapp/docassemble/webapp/playground.py | sahilsoi/legalzoom | 149fcfac4d4a5a36b467a6cb4aad244e9b1332b4 | [
"MIT"
] | null | null | null | docassemble_webapp/docassemble/webapp/playground.py | sahilsoi/legalzoom | 149fcfac4d4a5a36b467a6cb4aad244e9b1332b4 | [
"MIT"
] | null | null | null | docassemble_webapp/docassemble/webapp/playground.py | sahilsoi/legalzoom | 149fcfac4d4a5a36b467a6cb4aad244e9b1332b4 | [
"MIT"
] | null | null | null | import os
import re
import copy
import sys
import yaml
import tempfile
from docassemble.webapp.files import SavedFile, get_ext_and_mimetype, make_package_zip
from docassemble.base.pandoc import word_to_markdown, convertible_mimetypes, convertible_extensions
from docassemble.base.core import DAObject, DADict, DAList
fro... | 47.548263 | 269 | 0.601218 |
fb075996f005f08188744e43c4affcc00371b1fb | 8,022 | py | Python | fast.py | Vik2ry/transfer-learning-conv-ai | a227ff71654600735d9caf54490b6975907cb4ef | [
"MIT"
] | null | null | null | fast.py | Vik2ry/transfer-learning-conv-ai | a227ff71654600735d9caf54490b6975907cb4ef | [
"MIT"
] | 2 | 2021-11-28T11:07:10.000Z | 2021-11-29T03:21:07.000Z | fast.py | Vik2ry/transfer-learning-conv-ai | a227ff71654600735d9caf54490b6975907cb4ef | [
"MIT"
] | 1 | 2021-11-28T06:16:43.000Z | 2021-11-28T06:16:43.000Z | # # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
import random
from argparse import ArgumentParser
from itertools import chain
from pprint import pforma... | 45.579545 | 184 | 0.700324 |
25107b79d55e1d2e45ee25ed74be1e1eb1dad77e | 690 | py | Python | ema_workbench/examples/feature_scoring_flu_example.py | brodderickrodriguez/EMAworkbench | 90031223a4b6feb49633d45816e20981dc9415a0 | [
"BSD-3-Clause"
] | 2 | 2019-09-20T04:10:37.000Z | 2019-09-20T04:10:47.000Z | ema_workbench/examples/feature_scoring_flu_example.py | brodderickrodriguez/EMAworkbench | 90031223a4b6feb49633d45816e20981dc9415a0 | [
"BSD-3-Clause"
] | null | null | null | ema_workbench/examples/feature_scoring_flu_example.py | brodderickrodriguez/EMAworkbench | 90031223a4b6feb49633d45816e20981dc9415a0 | [
"BSD-3-Clause"
] | 1 | 2021-03-23T06:06:48.000Z | 2021-03-23T06:06:48.000Z | '''
Created on 30 Oct 2018
@author: jhkwakkel
'''
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from ema_workbench import ema_logging, load_results
from ema_workbench.analysis import feature_scoring
ema_logging.log_to_stderr(level=ema_logging.INFO)
# load data
fn = r'./data/1000 flu case... | 23.793103 | 80 | 0.757971 |
16fa538e93a6999de7245c812970f875f403d288 | 4,334 | py | Python | utils/model_utils.py | zimengq/PyLMFAO-PyTorch-Language-Model-Framework | e75c90b27a9f4f5927d65d884ef72761dc241f93 | [
"Apache-2.0"
] | null | null | null | utils/model_utils.py | zimengq/PyLMFAO-PyTorch-Language-Model-Framework | e75c90b27a9f4f5927d65d884ef72761dc241f93 | [
"Apache-2.0"
] | null | null | null | utils/model_utils.py | zimengq/PyLMFAO-PyTorch-Language-Model-Framework | e75c90b27a9f4f5927d65d884ef72761dc241f93 | [
"Apache-2.0"
] | null | null | null | """
Define some model utils
https://gist.github.com/jeasinema/ed9236ce743c8efaf30fa2ff732749f5
"""
import torch
import torch.nn as nn
import torch.nn.init as init
def xavier_uniform_(tensor, gain=1.):
# type: (Tensor, float) -> Tensor
r"""Fills the input `Tensor` with values according to the method
descr... | 35.52459 | 118 | 0.634287 |
134e73cd6dd22ae682675b5964b22e7c90ed03d9 | 5,717 | py | Python | drive.py | lyzMaster/DeepGTA5-V2 | f290e8957e1a0b6837cd391f110961a6cc97aa51 | [
"MIT"
] | 12 | 2019-05-30T06:00:36.000Z | 2022-02-24T18:08:15.000Z | drive.py | HTL2018/DeepGTA5-V2 | 096f2fa1e991a68bf3d9243a310d9bd487740700 | [
"MIT"
] | null | null | null | drive.py | HTL2018/DeepGTA5-V2 | 096f2fa1e991a68bf3d9243a310d9bd487740700 | [
"MIT"
] | 6 | 2019-08-27T16:30:45.000Z | 2021-12-27T03:45:19.000Z | import time
import requests
import multiprocessing
import numpy as np
from keras.models import load_model
from utils.img_process import process, yolo_img_process
import utils.yolo_util as yolo_util
from deepgtav.messages import Start, Stop, Scenario, Commands, frame2numpy, Dataset
from deepgtav.client import Client
imp... | 33.238372 | 131 | 0.546615 |
20811512e73359f20f7db479bf0e9e9ba1919ffe | 323 | py | Python | tools/readFolder.py | jettom/JtSpider | 7e2cb32415ca5d439b117c0277a7f7b2b27fa0bf | [
"Apache-2.0"
] | 1 | 2019-01-25T12:54:24.000Z | 2019-01-25T12:54:24.000Z | tools/readFolder.py | jettom/JtSpider | 7e2cb32415ca5d439b117c0277a7f7b2b27fa0bf | [
"Apache-2.0"
] | null | null | null | tools/readFolder.py | jettom/JtSpider | 7e2cb32415ca5d439b117c0277a7f7b2b27fa0bf | [
"Apache-2.0"
] | 1 | 2020-05-16T01:18:25.000Z | 2020-05-16T01:18:25.000Z | import os
for folderName, subfolders, filenames in os.walk('C:\\book'):
print('The current folder is ' + folderName)
for subfolder in subfolders:
print('SUBFOLDER OF ' + folderName + ': ' + subfolder)
for filename in filenames:
print('FILE INSIDE ' + folderName + ': ' + filename)
print('... | 35.888889 | 62 | 0.634675 |
25ac1915818b76cf67d300e1729e0855a30dbadf | 6,685 | py | Python | samtranslator/model/preferences/deployment_preference_collection.py | oltruong/serverless-application-model | f6a3c5140c85f53bfcc2c7a7494b74f9f302580b | [
"Apache-2.0"
] | 2 | 2019-04-13T16:57:10.000Z | 2019-12-13T08:32:16.000Z | samtranslator/model/preferences/deployment_preference_collection.py | oltruong/serverless-application-model | f6a3c5140c85f53bfcc2c7a7494b74f9f302580b | [
"Apache-2.0"
] | 4 | 2021-05-12T00:13:20.000Z | 2022-03-12T00:56:07.000Z | samtranslator/model/preferences/deployment_preference_collection.py | oltruong/serverless-application-model | f6a3c5140c85f53bfcc2c7a7494b74f9f302580b | [
"Apache-2.0"
] | 15 | 2019-05-27T01:04:30.000Z | 2021-10-01T05:54:45.000Z | from .deployment_preference import DeploymentPreference
from samtranslator.model.codedeploy import CodeDeployApplication
from samtranslator.model.codedeploy import CodeDeployDeploymentGroup
from samtranslator.model.iam import IAMRole
from samtranslator.model.intrinsics import fnSub
from samtranslator.model.update_polic... | 45.168919 | 120 | 0.679581 |
c3576ee7dcfb33d83c357fa8314acd5e0aff2d7e | 1,605 | py | Python | build/lib/projectmlincvmediapipe/demo.py | billynguyenlss/projectMLinComputerVision | 08f76980652f05d2092a2ee7c6cbc1a6c40e0a3d | [
"Apache-2.0"
] | null | null | null | build/lib/projectmlincvmediapipe/demo.py | billynguyenlss/projectMLinComputerVision | 08f76980652f05d2092a2ee7c6cbc1a6c40e0a3d | [
"Apache-2.0"
] | 1 | 2022-02-23T12:31:35.000Z | 2022-02-23T12:31:35.000Z | build/lib/projectmlincvmediapipe/demo.py | billynguyenlss/projectMLinComputerVision | 08f76980652f05d2092a2ee7c6cbc1a6c40e0a3d | [
"Apache-2.0"
] | null | null | null | import os
import cv2
import numpy as np
try:
from tflite_runtime.interpreter import Interpreter
except:
from tensorflow.lite.python.interpreter import Interpreter
def main():
dir_path = os.path.dirname(os.path.realpath(__file__))
img_path = os.path.join(dir_path, "portrait.jpg")
img = cv2.imread... | 27.20339 | 87 | 0.660436 |
8ea8d2464aba33a6db942caea3eebed229ea9d91 | 5,792 | py | Python | workflow/scripts/parse_tn_mode.py | NCIPangaea/CCBR_GATK4_Exome_Seq_Pipeline | 57eaa2eae00970ba0d24f712de3162ff08cbf8ee | [
"MIT"
] | 2 | 2021-10-14T19:45:59.000Z | 2022-01-31T17:13:44.000Z | workflow/scripts/parse_tn_mode.py | NCIPangaea/CCBR_GATK4_Exome_Seq_Pipeline | 57eaa2eae00970ba0d24f712de3162ff08cbf8ee | [
"MIT"
] | 4 | 2021-11-20T00:05:46.000Z | 2021-12-30T15:54:17.000Z | workflow/scripts/parse_tn_mode.py | NCIPangaea/CCBR_GATK4_Exome_Seq_Pipeline | 57eaa2eae00970ba0d24f712de3162ff08cbf8ee | [
"MIT"
] | 3 | 2021-11-05T01:27:18.000Z | 2021-12-03T17:18:10.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function, division
import sys, gzip
# USAGE
# sys.argv[1] = sample_name.R1.fastq.gz
# sys.argv[2] = sample_name (name without PATH and .R?.fastq.gz extension)
# Example
# $ python get_flowcell_lanes.py input.R1.fastq.gz input > flowcell_lanes... | 37.128205 | 171 | 0.601519 |
6b23412bf15c163d4c8cb65664980842912d96ec | 6,527 | py | Python | network_loader.py | wzzheng/DCML | 01a7220bac7ebb1e70416ef663f3ba7cee9e8bf5 | [
"MIT"
] | 11 | 2021-06-15T08:47:10.000Z | 2022-03-30T02:31:25.000Z | network_loader.py | wzzheng/DCML | 01a7220bac7ebb1e70416ef663f3ba7cee9e8bf5 | [
"MIT"
] | 2 | 2021-08-09T05:05:21.000Z | 2021-09-03T13:56:23.000Z | network_loader.py | wzzheng/DCML | 01a7220bac7ebb1e70416ef663f3ba7cee9e8bf5 | [
"MIT"
] | 2 | 2021-06-21T08:59:30.000Z | 2022-01-01T19:22:04.000Z | import numpy as np, os, pickle as pkl, torch, torch.nn as nn, faiss
from tqdm import tqdm
import architectures as archs
import datasampler as dsamplers
import datasets as dsets
import criteria as criteria
import metrics as metrics
import batchminer as bmine
import evaluation as eval
RERUN SPECI... | 53.942149 | 183 | 0.661866 |
e8eb7921d9e20113e7e9f9d971908101ff081a9c | 2,069 | py | Python | news/views.py | JohnAzedo/NewsletterServer | 0e9df39afcbb148064a8e25890597676e0e22a57 | [
"MIT"
] | 1 | 2021-11-30T23:44:25.000Z | 2021-11-30T23:44:25.000Z | news/views.py | JohnAzedo/NewsletterServer | 0e9df39afcbb148064a8e25890597676e0e22a57 | [
"MIT"
] | null | null | null | news/views.py | JohnAzedo/NewsletterServer | 0e9df39afcbb148064a8e25890597676e0e22a57 | [
"MIT"
] | null | null | null | from django.db.models import Q
from rest_framework.generics import ListCreateAPIView, ListAPIView, RetrieveAPIView, RetrieveUpdateDestroyAPIView, \
CreateAPIView
from rest_framework.permissions import IsAuthenticated, AllowAny
from news.models import News, Comment, UserNews
from news.serializers import NewsSerializ... | 31.830769 | 116 | 0.77912 |
2879dfd75e147f900a099fa6045a9eb444a3876b | 1,030 | py | Python | perfin/importutils.py | dpdornseifer/PerFin | 85c2d297ce0be9b6a8b31110f2c6e94d4e0b6365 | [
"MIT"
] | 8 | 2017-03-08T20:11:22.000Z | 2022-03-11T09:19:07.000Z | perfin/importutils.py | dpdornseifer/PerFin | 85c2d297ce0be9b6a8b31110f2c6e94d4e0b6365 | [
"MIT"
] | null | null | null | perfin/importutils.py | dpdornseifer/PerFin | 85c2d297ce0be9b6a8b31110f2c6e94d4e0b6365 | [
"MIT"
] | 2 | 2017-05-21T17:56:59.000Z | 2019-09-21T21:11:33.000Z | import glob
import logging
import pandas as pd
def import_csvs_from_directory(path, index=None):
""" Function which takes a directory path as a input and delivers back one a pandas dataframe.
Args:
path (str): The path to the folder containing the csv files which should be imported.
index (st... | 35.517241 | 105 | 0.696117 |
40a1c8e6119dd357e3cfdea388293b8c0f576613 | 3,265 | py | Python | pypidb/_patch.py | jayvdb/pypidb | 7b27f9314cb4d87c2d6cd383a8d3c094ce4a2d3a | [
"Apache-2.0"
] | 14 | 2020-03-21T11:03:43.000Z | 2022-03-05T14:54:03.000Z | pypidb/_patch.py | jayvdb/pypidb | 7b27f9314cb4d87c2d6cd383a8d3c094ce4a2d3a | [
"Apache-2.0"
] | 119 | 2020-03-22T11:57:29.000Z | 2020-09-11T03:54:46.000Z | pypidb/_patch.py | jayvdb/pypidb | 7b27f9314cb4d87c2d6cd383a8d3c094ce4a2d3a | [
"Apache-2.0"
] | 3 | 2020-04-14T12:42:35.000Z | 2022-03-18T15:58:59.000Z | import io
import unidiff
from logging_helper import setup_logging
from ._url_extract import _url_extractor_wrapper
logger = setup_logging()
def _get_raw_patch_url(url):
assert url.startswith("https://github.com/") or url.endswith(".patch"), url
if "/pull/" in url:
slug = url[len("https://github.com... | 36.277778 | 89 | 0.514242 |
8d2ad7fe103358f1914a7e357f04235465508014 | 6,889 | py | Python | theano/sparse/sandbox/sp2.py | ganguli-lab/Theano | d61c929b6d1a5bae314545cba79c879de687ea18 | [
"BSD-3-Clause"
] | 11 | 2016-12-01T19:49:28.000Z | 2021-11-08T11:12:08.000Z | theano/sparse/sandbox/sp2.py | ganguli-lab/Theano | d61c929b6d1a5bae314545cba79c879de687ea18 | [
"BSD-3-Clause"
] | null | null | null | theano/sparse/sandbox/sp2.py | ganguli-lab/Theano | d61c929b6d1a5bae314545cba79c879de687ea18 | [
"BSD-3-Clause"
] | 6 | 2015-06-21T20:55:55.000Z | 2019-04-24T20:03:25.000Z | import numpy
import scipy.sparse
from theano import gof, tensor
from theano.sparse.basic import (
as_sparse_variable, SparseType, add_s_s, neg,
mul_s_s, mul_s_d, dot,
CSMProperties, CSM, register_specialize,
_is_sparse_variable, _is_dense_variable, CSC, CSR,
csm_properties, csm_data, csm_indices, ... | 32.804762 | 78 | 0.645522 |
1cd0d621cd4b3a14256b8ea6b90c222f476f2ee7 | 7,004 | py | Python | Lib/test/test_unicode_file_functions.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 2,441 | 2020-07-31T06:45:53.000Z | 2022-03-30T15:56:49.000Z | Lib/test/test_unicode_file_functions.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | Lib/test/test_unicode_file_functions.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | # Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import os
import sys
import unittest
import warnings
from unicodedata import normalize
from test import support
filenames = [
'1_abc',
'2_ascii',
'3_Gr\xfc\xdf-Gott'... | 35.734694 | 88 | 0.619075 |
5622a945f3020f3673b10c2d1dbde336fc378eef | 3,065 | py | Python | applications/reports/process/signature_service.py | ebs-integrator/bic-reporting-api | 23c75f52af41405eb9d483245416f096b7f4ad38 | [
"MIT"
] | 1 | 2021-04-26T15:02:48.000Z | 2021-04-26T15:02:48.000Z | applications/reports/process/signature_service.py | ebs-integrator/bic-reporting-api | 23c75f52af41405eb9d483245416f096b7f4ad38 | [
"MIT"
] | null | null | null | applications/reports/process/signature_service.py | ebs-integrator/bic-reporting-api | 23c75f52af41405eb9d483245416f096b7f4ad38 | [
"MIT"
] | null | null | null | import os
import requests
import pathlib
from bs4 import BeautifulSoup
from requests import HTTPError
from rest_framework.exceptions import ValidationError
from config.settings import (SERVICE_SIGNATURE_TEMPLATES, SERVICE_SIGNATURE_HOST, SERVICE_SIGNATURE_PRIVATES)
# Create your services here.
class SignatureServ... | 31.927083 | 111 | 0.639478 |
5830e4360cca51f73e321abba3af6744b1483c73 | 917 | py | Python | tests/cosmetic/literals/input.py | sobolevn/teyit | 9b65dfdf0120a8d9817f32495bbf228fe2b3ed70 | [
"MIT"
] | null | null | null | tests/cosmetic/literals/input.py | sobolevn/teyit | 9b65dfdf0120a8d9817f32495bbf228fe2b3ed70 | [
"MIT"
] | null | null | null | tests/cosmetic/literals/input.py | sobolevn/teyit | 9b65dfdf0120a8d9817f32495bbf228fe2b3ed70 | [
"MIT"
] | null | null | null | import unittest
class TestCase(unittest.TestCase):
def test_random(self):
self.assertIs(
1e400,
True,
msg="""
complex
string"""
)
self.assertIs(
2 + 2,
False
)
def test_ind... | 28.65625 | 79 | 0.522356 |
0db296ee9d66d656ac36e76202ceb3f796b05c95 | 9,880 | py | Python | e2e_tests/tests/fixtures/no_op/model_def.py | coreystatendet/determined | abe5f3d0f64f7b05422507731d800621cf0ace8e | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/fixtures/no_op/model_def.py | coreystatendet/determined | abe5f3d0f64f7b05422507731d800621cf0ace8e | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/fixtures/no_op/model_def.py | coreystatendet/determined | abe5f3d0f64f7b05422507731d800621cf0ace8e | [
"Apache-2.0"
] | null | null | null | import collections
import json
import logging
import os
import pathlib
import pickle
import random
import time
from typing import Any, Dict, Optional
import numpy as np
import determined as det
from determined import layers, util, workload
from determined.common import check
class NoOpTrialContext(det.TrialContext)... | 41.338912 | 100 | 0.643117 |
d0985418b1f0414b2291a4e17c1bdbc0c3861f35 | 8,783 | py | Python | IMTool/IMBatchExport.py | naong2/MayaPython | 011c5665d30c27eb42e718564bca6b954718c2ea | [
"MIT"
] | null | null | null | IMTool/IMBatchExport.py | naong2/MayaPython | 011c5665d30c27eb42e718564bca6b954718c2ea | [
"MIT"
] | null | null | null | IMTool/IMBatchExport.py | naong2/MayaPython | 011c5665d30c27eb42e718564bca6b954718c2ea | [
"MIT"
] | 1 | 2022-03-23T09:25:27.000Z | 2022-03-23T09:25:27.000Z | from maya import cmds
import maya.mel as mel
import sys, os
def batchExport(sourcePath, destPath, toFileType='fbx', recursively=True, matchDirectorySructure=True, **keywords):
"""
Batch export files in one location to another location. Returns True on
success. Only intended for use in standalone mode; otherwise... | 41.042056 | 124 | 0.593988 |
c8d525706a5796585c276f0a6ad2674836ec0d77 | 1,264 | py | Python | setup.py | Nkzono99/camptools | 3f5b1ac3f1a5885143b40cfe1eb30bcb193edc77 | [
"MIT"
] | null | null | null | setup.py | Nkzono99/camptools | 3f5b1ac3f1a5885143b40cfe1eb30bcb193edc77 | [
"MIT"
] | null | null | null | setup.py | Nkzono99/camptools | 3f5b1ac3f1a5885143b40cfe1eb30bcb193edc77 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
long_description = open('README.md', 'r', encoding='utf-8').read()
setup(
name="camptools",
version="0.5.3",
install_requires=[
'f90nml',
],
entry_points={
'console_scripts': [
'nmyqsub = camptools.qsub_wrapper:nmyqsub',
... | 32.410256 | 66 | 0.628165 |
453562e694ac706011bd0dba59be2530ab9e1abf | 4,949 | py | Python | hexrd/ui/hand_drawn_mask_dialog.py | cjh1/hexrdgui | eb8968ba763cebbffce61164f1bda1e2cc622461 | [
"BSD-3-Clause"
] | null | null | null | hexrd/ui/hand_drawn_mask_dialog.py | cjh1/hexrdgui | eb8968ba763cebbffce61164f1bda1e2cc622461 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T14:34:42.000Z | 2020-10-29T15:30:20.000Z | hexrd/ui/hand_drawn_mask_dialog.py | cjh1/hexrdgui | eb8968ba763cebbffce61164f1bda1e2cc622461 | [
"BSD-3-Clause"
] | null | null | null | from PySide2.QtCore import QObject, Signal
from itertools import cycle
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Cursor
from hexrd.ui import enter_key_filter
from hexrd.ui.constants import ViewType
from hexrd.ui.ui_loader import UiLoader
class HandDrawnMaskDialog(QObject):... | 27.043716 | 72 | 0.59608 |
4e40ac346d1544574525cb8c8301078a55bfde07 | 68,798 | py | Python | test/orm/test_collection.py | vrajmohan/sqlalchemy | b2cf93089370d9403fd1f410f204e6ad1ff42d9c | [
"MIT"
] | null | null | null | test/orm/test_collection.py | vrajmohan/sqlalchemy | b2cf93089370d9403fd1f410f204e6ad1ff42d9c | [
"MIT"
] | null | null | null | test/orm/test_collection.py | vrajmohan/sqlalchemy | b2cf93089370d9403fd1f410f204e6ad1ff42d9c | [
"MIT"
] | null | null | null | from operator import and_
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import text
from sqlalchemy import util
from sqlalchemy.orm import attributes
from sqlalch... | 27.398646 | 79 | 0.520335 |
206558ad2500246be582c82a8fcc4e00ef0c0157 | 1,902 | py | Python | alipay/aop/api/domain/StudyAccountInfo.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/StudyAccountInfo.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/StudyAccountInfo.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class StudyAccountInfo(object):
def __init__(self):
self._alipay_card_no = None
self._card_type = None
self._study_id = None
@property
def alipay_card_no(self):
... | 26.788732 | 79 | 0.590957 |
92ba9d0da85d8f23a991505d67040a84c040f286 | 8,674 | py | Python | tests/query_test/test_scanners.py | AtScaleInc/Impala | 1073a9108220faffe61c3bc9dff7a953adde12df | [
"Apache-2.0"
] | 2 | 2017-05-30T16:47:31.000Z | 2020-07-21T04:28:17.000Z | tests/query_test/test_scanners.py | AtScaleInc/Impala | 1073a9108220faffe61c3bc9dff7a953adde12df | [
"Apache-2.0"
] | null | null | null | tests/query_test/test_scanners.py | AtScaleInc/Impala | 1073a9108220faffe61c3bc9dff7a953adde12df | [
"Apache-2.0"
] | 2 | 2019-06-08T23:27:36.000Z | 2022-02-08T09:53:37.000Z | #!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.
#
# This test suite validates the scanners by running queries against ALL file formats and
# their permutations (e.g. compression codec/compression type). This works by exhaustively
# generating the table format test vectors for this specifi... | 39.97235 | 90 | 0.741411 |
798b1a7b40f52c402eb38773fac3dd7ee948f06f | 3,661 | py | Python | pyvaspflow/vasp/test_para.py | ChangChunHe/VASP-calculation-process | 99268479f826f2f31a59d92daff443aeec688fb2 | [
"MIT"
] | 13 | 2019-06-03T11:41:35.000Z | 2022-03-04T07:45:42.000Z | pyvaspflow/vasp/test_para.py | ChangChunHe/VASP-calculation-process | 99268479f826f2f31a59d92daff443aeec688fb2 | [
"MIT"
] | 2 | 2019-03-12T10:51:15.000Z | 2019-03-14T02:18:18.000Z | pyvaspflow/vasp/test_para.py | ChangChunHe/VASP-calculation-process | 99268479f826f2f31a59d92daff443aeec688fb2 | [
"MIT"
] | 8 | 2019-06-03T03:20:20.000Z | 2021-01-06T11:48:37.000Z | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
from pyvaspflow.vasp import prep_vasp,run_vasp
from pyvaspflow.io.vasp_input import Kpoints
from pyvaspflow.utils import is_2d_structure
from pyvaspflow.io.vasp_out import ExtractValue
from sagar.io.vasp import read_vasp
from os import makedirs,path,chdir,remove
from s... | 40.677778 | 97 | 0.587544 |
b26d4fb6626c8dc72ce1a6fd6c6ad7ef05c6d3d0 | 1,905 | py | Python | foresight/pruners/measures/__init__.py | debadeepta/zero-cost-nas | e14ee81078ed1a2f0e11d4db6e12bddf4b309776 | [
"Apache-2.0"
] | 47 | 2021-04-15T09:27:44.000Z | 2022-03-25T21:33:55.000Z | foresight/pruners/measures/__init__.py | zhengjian2322/zero-cost-nas | 46622d60ebe6c4604387ef0aac033d48eb84435f | [
"Apache-2.0"
] | 4 | 2021-07-07T10:53:40.000Z | 2022-01-15T01:10:14.000Z | foresight/pruners/measures/__init__.py | zhengjian2322/zero-cost-nas | 46622d60ebe6c4604387ef0aac033d48eb84435f | [
"Apache-2.0"
] | 11 | 2021-04-22T14:31:58.000Z | 2022-02-09T03:13:26.000Z | # Copyright 2021 Samsung Electronics 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... | 30.725806 | 79 | 0.618373 |
6a06dfb2af43050fdd42dff69837966eccfe1128 | 655 | py | Python | ss411/users/tests/test_urls.py | mbronstein/ss411 | e901423e1fd16d4c414039083c6c7bc99b7e35ad | [
"MIT"
] | null | null | null | ss411/users/tests/test_urls.py | mbronstein/ss411 | e901423e1fd16d4c414039083c6c7bc99b7e35ad | [
"MIT"
] | null | null | null | ss411/users/tests/test_urls.py | mbronstein/ss411 | e901423e1fd16d4c414039083c6c7bc99b7e35ad | [
"MIT"
] | null | null | null | import pytest
from django.urls import resolve, reverse
from ss411.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (
reverse("users:detail", kwargs={"username": user.username})
== f"/users/{user.username}/"
)
assert resolve(f"/users/{user.us... | 26.2 | 74 | 0.674809 |
4d6c7a8f31eab38dc4439a1f226e940abf493b1c | 16,147 | py | Python | powergenome/util.py | annafjacobson/PowerGenome | e075d1b912eff110d8a0261767c9df02af34ffbb | [
"MIT"
] | null | null | null | powergenome/util.py | annafjacobson/PowerGenome | e075d1b912eff110d8a0261767c9df02af34ffbb | [
"MIT"
] | null | null | null | powergenome/util.py | annafjacobson/PowerGenome | e075d1b912eff110d8a0261767c9df02af34ffbb | [
"MIT"
] | null | null | null | import collections
from copy import deepcopy
import itertools
import logging
import subprocess
from typing import Dict, Tuple, Union
import pandas as pd
import pudl
import requests
import sqlalchemy as sa
from flatten_dict import flatten
import yaml
from ruamel.yaml import YAML
from pathlib import Path
from powergen... | 30.992322 | 107 | 0.617948 |
35f37f9d46eea4da2baf2cb9bf8c5112758e4a23 | 644 | py | Python | test/test_inputs/test_input_generator.py | marxav0319/DSMC_HTML_Generator | bc08b366a7b6b72d68e36be2517aa5fdb71e95d8 | [
"MIT"
] | null | null | null | test/test_inputs/test_input_generator.py | marxav0319/DSMC_HTML_Generator | bc08b366a7b6b72d68e36be2517aa5fdb71e95d8 | [
"MIT"
] | null | null | null | test/test_inputs/test_input_generator.py | marxav0319/DSMC_HTML_Generator | bc08b366a7b6b72d68e36be2517aa5fdb71e95d8 | [
"MIT"
] | null | null | null | """
Generates a test input file using the .png files located in the resources directory.
Author: Mark Xavier
"""
import os
def generate_test_input():
"""Generates a single test input file using the images in the resources directory"""
directory = os.listdir('../resources')
f = open('test_input.txt', 'w'... | 26.833333 | 88 | 0.631988 |
1130905f923ccf1409fccca00a184982b17ac428 | 5,496 | py | Python | amino/maybe.py | tek/amino | 51b314933e047a45587a24ecff02c836706d27ff | [
"MIT"
] | 33 | 2016-12-21T07:05:46.000Z | 2020-04-29T04:26:46.000Z | amino/maybe.py | tek/amino | 51b314933e047a45587a24ecff02c836706d27ff | [
"MIT"
] | 1 | 2019-04-19T17:15:52.000Z | 2019-04-20T18:28:23.000Z | amino/maybe.py | tek/amino | 51b314933e047a45587a24ecff02c836706d27ff | [
"MIT"
] | 4 | 2017-09-04T18:46:23.000Z | 2021-11-02T04:18:13.000Z | import typing
from typing import TypeVar, Generic, Callable, Union, Any, cast, Optional, Type, Iterator, Awaitable
from functools import wraps
from operator import eq
import inspect
from amino import boolean
from amino.tc.base import F
from amino.func import call_by_name, I, curried, CallByName
A = TypeVar('A')
B = T... | 27.48 | 100 | 0.587336 |
fcfc0d451dfeb2fc4ec0f3ed3de8324f686e66cf | 1,845 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/edcps/models/Subnet.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/edcps/models/Subnet.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/edcps/models/Subnet.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 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 ... | 36.9 | 203 | 0.678591 |
49abb32cde3c9e3cfbd85903614dcc42712ebddf | 1,842 | py | Python | CS/CSC148/labs/lab3/stack.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC148/labs/lab3/stack.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC148/labs/lab3/stack.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | class Stack:
"""
Last-in, first-out (LIFO) stack.
"""
def __init__(self):
"""
Create a new, empty Stack self.
@param Stack self: this stack
@rtype: None
"""
self._contents = []
def add(self, obj):
"""
Add object obj to top of Stack s... | 20.931818 | 61 | 0.48317 |
2b6c99ff21cfe71e350242cb2ac4637f180fc20a | 6,266 | py | Python | hypha/apply/activity/models.py | OpenTechFund/opentech.fund | 701b17f36ea27f891cd7e8a6743007302a52f34d | [
"BSD-3-Clause"
] | 14 | 2018-10-05T14:34:21.000Z | 2020-01-17T17:45:44.000Z | hypha/apply/activity/models.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 1,098 | 2017-12-15T11:23:03.000Z | 2020-01-24T07:58:07.000Z | hypha/apply/activity/models.py | OpenTechFund/WebApp | d6e2bb21a39d1fa7566cb60fe19f372dabfa5f0f | [
"BSD-3-Clause"
] | 7 | 2018-01-09T10:13:06.000Z | 2019-08-12T16:38:59.000Z | from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import Case, Value, When
from django.db.models.functions import Concat
from .options import MESSAGES
COMMENT =... | 32.466321 | 139 | 0.686562 |
719a07d9d327d3aa2e8f13654761811b80b961da | 18,394 | py | Python | tests/escore_python/core/test_process_services.py | mbaak/Eskapade-Core | 9ddffd0c5d511711ba258fd388a8bcf8c7e02a41 | [
"Apache-2.0"
] | 1 | 2019-01-04T15:20:11.000Z | 2019-01-04T15:20:11.000Z | tests/escore_python/core/test_process_services.py | mbaak/Eskapade-Core | 9ddffd0c5d511711ba258fd388a8bcf8c7e02a41 | [
"Apache-2.0"
] | 1 | 2018-12-19T10:01:52.000Z | 2018-12-19T10:01:52.000Z | tests/escore_python/core/test_process_services.py | KaveIO/Eskapade-Core | 70bdb8d541bbe785c22b8d476e599bdfb9a55b65 | [
"Apache-2.0"
] | null | null | null | import unittest
import unittest.mock as mock
from escore.core.definitions import (CONFIG_VARS, CONFIG_TYPES, CONFIG_DEFAULTS, USER_OPTS,
USER_OPTS_CONF_KEYS,
CONFIG_OPTS_SETTERS, RandomSeeds, set_opt_var, set_log_level_opt,
... | 45.870324 | 118 | 0.65255 |
7d87225841440400f898044fa9c030e47936458e | 3,488 | py | Python | makepages.py | sadaszewski/tcgprogs | 1dc05c84786ad3595a174d320c4541460d2d3158 | [
"BSD-2-Clause"
] | null | null | null | makepages.py | sadaszewski/tcgprogs | 1dc05c84786ad3595a174d320c4541460d2d3158 | [
"BSD-2-Clause"
] | null | null | null | makepages.py | sadaszewski/tcgprogs | 1dc05c84786ad3595a174d320c4541460d2d3158 | [
"BSD-2-Clause"
] | null | null | null | #
# Copyright (C) Stanislaw Adaszewski, 2016
# http://algoholic.eu
#
# Generate printout of MtG cards based on a deck list
# and directory containing images.
#
from argparse import ArgumentParser
from PIL import Image
import os
import random
def levenshtein(a,b):
"Calculates the Levenshtein dist... | 30.596491 | 64 | 0.606078 |
5a818953a18eea2b59572ab4883b6b287b2f90a1 | 5,215 | py | Python | looper/const.py | pepkit/looper | cd1c7d4da84c631a4b6565b7a80926c7ac3640c3 | [
"BSD-2-Clause"
] | 11 | 2018-03-27T02:09:32.000Z | 2021-05-27T10:23:00.000Z | looper/const.py | pepkit/looper | cd1c7d4da84c631a4b6565b7a80926c7ac3640c3 | [
"BSD-2-Clause"
] | 292 | 2017-11-17T20:02:58.000Z | 2022-02-10T13:35:59.000Z | looper/const.py | pepkit/looper | cd1c7d4da84c631a4b6565b7a80926c7ac3640c3 | [
"BSD-2-Clause"
] | 6 | 2018-01-19T16:48:22.000Z | 2020-11-01T17:20:53.000Z | """ Shared project constants """
import os
__author__ = "Databio lab"
__email__ = "nathan@code.databio.org"
__all__ = [
"BUTTON_APPEARANCE_BY_FLAG", "TABLE_APPEARANCE_BY_FLAG", "VAR_TEMPL_KEY",
"ID_COLNAME", "NO_DATA_PLACEHOLDER", "OUTKEY", "ALL_SUBCMD_KEY",
"OUTDIR_KEY", "LOOPER_KEY", "COMPUTE_KEY", "PI... | 38.62963 | 123 | 0.725024 |
9cfb5f5ea98eb7facd545687112ace7f052544ad | 14,917 | py | Python | src/unittest/python/plugins/python/distutils_plugin_tests.py | tjpnz/pybuilder | 35e27629662cd3cf6c25075d5c14ea84d837e3a1 | [
"Apache-2.0"
] | null | null | null | src/unittest/python/plugins/python/distutils_plugin_tests.py | tjpnz/pybuilder | 35e27629662cd3cf6c25075d5c14ea84d837e3a1 | [
"Apache-2.0"
] | null | null | null | src/unittest/python/plugins/python/distutils_plugin_tests.py | tjpnz/pybuilder | 35e27629662cd3cf6c25075d5c14ea84d837e3a1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2014 PyBuilder 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/l... | 43.112717 | 120 | 0.665549 |
4cfb4e987823f9eb1140fd88a48d0a0166415712 | 8,854 | py | Python | miricoord/imager/mirim_tools.py | STScI-MIRI/miricoord | d378c24f4b8d649fb15d557c6350ab5070afba66 | [
"BSD-3-Clause"
] | null | null | null | miricoord/imager/mirim_tools.py | STScI-MIRI/miricoord | d378c24f4b8d649fb15d557c6350ab5070afba66 | [
"BSD-3-Clause"
] | 2 | 2019-06-05T18:04:22.000Z | 2021-12-02T21:00:55.000Z | miricoord/imager/mirim_tools.py | STScI-MIRI/miricoord | d378c24f4b8d649fb15d557c6350ab5070afba66 | [
"BSD-3-Clause"
] | 2 | 2019-09-20T14:01:30.000Z | 2021-11-04T11:52:54.000Z | #
"""
Useful python tools for working with the MIRI Imager; calls a specific version
of the tools specific below.
This version of the tools uses a standalone implementation
of the distortion solution to do the transformations,
and hooks into offline versions of the FITS reference
files contained within this github rep... | 28.840391 | 88 | 0.647504 |
59615586fe61f4f4dc32bce3e5afc7ea2948134a | 8,785 | py | Python | oasis/common/keystone.py | iBluemind/oasis | f57d2183fb92d383877976648cf2267efedf09ef | [
"CC-BY-3.0"
] | null | null | null | oasis/common/keystone.py | iBluemind/oasis | f57d2183fb92d383877976648cf2267efedf09ef | [
"CC-BY-3.0"
] | null | null | null | oasis/common/keystone.py | iBluemind/oasis | f57d2183fb92d383877976648cf2267efedf09ef | [
"CC-BY-3.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 37.382979 | 77 | 0.614456 |
a9415dab919aabb45b14d047d33d07493fa18534 | 27 | py | Python | test_for.py | 1CoderB/pynet_testx | db09d76e38cfcbacc816b191dcc22c3d1fc1cb31 | [
"Apache-2.0"
] | null | null | null | test_for.py | 1CoderB/pynet_testx | db09d76e38cfcbacc816b191dcc22c3d1fc1cb31 | [
"Apache-2.0"
] | null | null | null | test_for.py | 1CoderB/pynet_testx | db09d76e38cfcbacc816b191dcc22c3d1fc1cb31 | [
"Apache-2.0"
] | null | null | null | for i in range(10):print i
| 13.5 | 26 | 0.703704 |
e78461061d509bae261423a066ca4427d9a44772 | 792 | py | Python | optimizer.py | S-Choudhuri/Partial_Domain_Adaptation_Keras | 5a59befd8b021d72771b4f3ce1f908c7d72de488 | [
"MIT"
] | null | null | null | optimizer.py | S-Choudhuri/Partial_Domain_Adaptation_Keras | 5a59befd8b021d72771b4f3ce1f908c7d72de488 | [
"MIT"
] | null | null | null | optimizer.py | S-Choudhuri/Partial_Domain_Adaptation_Keras | 5a59befd8b021d72771b4f3ce1f908c7d72de488 | [
"MIT"
] | null | null | null | import numpy as np
from keras.optimizers import SGD
'''
def opt_classifier(param):
return Adam(lr=param["lr_classifier"], beta_1=param["b1_classifier"], beta_2=param["b2_classifier"])
def opt_discriminator(param):
return Adam(lr=param["lr_discriminator"], beta_1=param["b1_discriminator"], beta_2=param... | 33 | 114 | 0.717172 |
aab1e6dfe1784cf9c05dbc15ebf5a499386d82c9 | 2,594 | py | Python | simpleportscan-v2.py | guilhermej/simpleportscan | 4e4b5ccf7f71225fbcbfea501dd4a40ffa3199f0 | [
"MIT"
] | 4 | 2016-06-14T02:13:26.000Z | 2021-11-08T08:56:18.000Z | simpleportscan-v2.py | guilhermej/simpleportscan | 4e4b5ccf7f71225fbcbfea501dd4a40ffa3199f0 | [
"MIT"
] | null | null | null | simpleportscan-v2.py | guilhermej/simpleportscan | 4e4b5ccf7f71225fbcbfea501dd4a40ffa3199f0 | [
"MIT"
] | 1 | 2018-11-01T05:58:08.000Z | 2018-11-01T05:58:08.000Z | #################################################
# Simple Port Scanner v2.0 #
# Guilherme Junqueira <contato@solyd.com.br> #
# https://solyd.com.br/treinamentos #
#################################################
import socket
import ipaddress
import sys
import argparse
... | 32.024691 | 113 | 0.558597 |
76d90f13501419264f621c1ba69324fa1541de6a | 2,603 | py | Python | deeppavlov/models/trackers/hcn_et.py | khakhulin/DeepPavlov | 5f631cc887aa935f2e67b7c65a19c7e777cf7db7 | [
"Apache-2.0"
] | 1 | 2018-07-18T11:50:45.000Z | 2018-07-18T11:50:45.000Z | deeppavlov/models/trackers/hcn_et.py | khakhulin/DeepPavlov | 5f631cc887aa935f2e67b7c65a19c7e777cf7db7 | [
"Apache-2.0"
] | null | null | null | deeppavlov/models/trackers/hcn_et.py | khakhulin/DeepPavlov | 5f631cc887aa935f2e67b7c65a19c7e777cf7db7 | [
"Apache-2.0"
] | null | null | null | import copy
from enum import Enum
import numpy as np
from deeppavlov.core.common.registry import register
from deeppavlov.core.models.component import Component
from deeppavlov.core.common.log import get_logger
log = get_logger(__name__)
ENTITIES = {
'<cuisine>': None,
'<location>': None,
'<party_size... | 32.5375 | 93 | 0.581252 |
3b398c776414fe350bd77ae481643d5805257f33 | 2,339 | py | Python | image/vision_transformer/data_parallel/train_with_cifar10.py | hpcaitech/ColossalAI-Examples | 45b6e9cc24b57aed4c5cf2c9278277e74cdef541 | [
"Apache-2.0"
] | 39 | 2022-01-18T09:35:17.000Z | 2022-03-30T09:17:35.000Z | image/vision_transformer/data_parallel/train_with_cifar10.py | hpcaitech/ColossalAI-Examples | 45b6e9cc24b57aed4c5cf2c9278277e74cdef541 | [
"Apache-2.0"
] | 26 | 2022-01-20T05:45:23.000Z | 2022-03-30T08:41:39.000Z | image/vision_transformer/data_parallel/train_with_cifar10.py | hpcaitech/ColossalAI-Examples | 45b6e9cc24b57aed4c5cf2c9278277e74cdef541 | [
"Apache-2.0"
] | 31 | 2022-01-18T14:16:29.000Z | 2022-03-30T09:17:39.000Z | import os
import colossalai
import torch
from colossalai.context import ParallelMode
from colossalai.core import global_context as gpc
from colossalai.logging import disable_existing_loggers, get_dist_logger
from colossalai.utils import get_dataloader
from colossalai.nn.lr_scheduler import LinearWarmupLR
from... | 32.486111 | 120 | 0.683625 |
67b9876295b5992193eae16fda0c1c38d1e39a5b | 2,747 | py | Python | desktop/core/ext-py/Twisted/twisted/words/test/test_jabbersaslmechanisms.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/Twisted/twisted/words/test/test_jabbersaslmechanisms.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/Twisted/twisted/words/test/test_jabbersaslmechanisms.py | civascu/hue | 82f2de44789ff5a981ed725175bae7944832d1e9 | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.protocols.jabber.sasl_mechanisms}.
"""
from twisted.trial import unittest
from twisted.words.protocols.jabber import sasl_mechanisms
class PlainTest(unittest.TestCase):
def test_getInitialResponse(sel... | 36.144737 | 96 | 0.636331 |
2923d718fcf3be6d9cd763f71e0cfd9c2bb2f05c | 506 | py | Python | evm/__init__.py | cburgdorf/py-evm | 98d98f69816081b0a280c2682de7a5d3cb29b9d6 | [
"MIT"
] | 2 | 2018-05-03T03:02:36.000Z | 2018-05-03T03:02:39.000Z | evm/__init__.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | 4 | 2018-12-07T21:32:48.000Z | 2019-02-22T15:25:01.000Z | evm/__init__.py | PEPEcoin/py-evm | 455f1b7bbd284f8ab9760194314672681c025a8b | [
"MIT"
] | null | null | null | import pkg_resources
import sys
from evm.utils.logging import (
setup_trace_logging
)
#
# Setup TRACE level logging.
#
# This needs to be done before the other imports
setup_trace_logging()
from evm.vm import ( # noqa: F401
VM,
)
from evm.chains import ( # noqa: F401
Chain,
MainnetChain,
Mainn... | 16.322581 | 62 | 0.721344 |
cb288480633a1f6b8630aa489d29cc404074ce5d | 4,031 | py | Python | examples/dfp/v201702/custom_targeting_service/create_custom_targeting_keys_and_values.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201702/custom_targeting_service/create_custom_targeting_keys_and_values.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201702/custom_targeting_service/create_custom_targeting_keys_and_values.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 30.308271 | 80 | 0.602084 |
cd5bd5af96d337e63e72cf644de660b74ac9b9ec | 1,820 | py | Python | pokemongo_bot/websocket_remote_control.py | PokePy/-PokemonGo-Bot | aaa5519291b45b5817cb38d3b5a60e5b08719a76 | [
"MIT"
] | 2 | 2018-11-27T06:02:24.000Z | 2019-12-31T19:10:32.000Z | pokemongo_bot/websocket_remote_control.py | PokePy/-PokemonGo-Bot | aaa5519291b45b5817cb38d3b5a60e5b08719a76 | [
"MIT"
] | 1 | 2018-10-28T04:50:46.000Z | 2018-10-28T04:50:46.000Z | pokemongo_bot/websocket_remote_control.py | PokePy/-PokemonGo-Bot | aaa5519291b45b5817cb38d3b5a60e5b08719a76 | [
"MIT"
] | null | null | null | import threading
from socketIO_client import SocketIO, BaseNamespace
class WebsocketRemoteControl(object):
def __init__(self, bot):
self.bot = bot
self.host, port_str = self.bot.config.websocket_server_url.split(':')
self.port = int(port_str)
self.sio = SocketIO(self.host, self.p... | 30.847458 | 77 | 0.559341 |
94a4bd3244df2cb6c8d5474fdb0bf8bff60a2a8f | 17,088 | py | Python | Sources/libosp/bin/osp_cliZ.py | nihospr01/OpenSpeechPlatform-2020B | 592fd4da3741f976be8293419e986093473fb95f | [
"BSD-2-Clause"
] | 2 | 2021-11-19T00:57:20.000Z | 2021-12-13T23:24:51.000Z | Sources/libosp/bin/osp_cliZ.py | nihospr01/OpenSpeechPlatform-2020B | 592fd4da3741f976be8293419e986093473fb95f | [
"BSD-2-Clause"
] | null | null | null | Sources/libosp/bin/osp_cliZ.py | nihospr01/OpenSpeechPlatform-2020B | 592fd4da3741f976be8293419e986093473fb95f | [
"BSD-2-Clause"
] | 1 | 2021-12-19T23:31:13.000Z | 2021-12-19T23:31:13.000Z | #!/usr/bin/env python3
# This implements a command-line interface to the osp process (RT-MHA)
# This version used ZeroMQ
import sys
import atexit
import code
import os
import readline
import shlex
import time
import argparse
import socket
import select
import json
import zmq
try:
from colors import color
except Mo... | 36.280255 | 182 | 0.574204 |
766d9516fdcb5c0b0c21ca548b30ce744e7d5931 | 1,247 | py | Python | python_scripts/old_files/sample_variance.py | raspstephan/convective_variability_analysis | 946a07c70025650e34b015a7a8986bb47dc47930 | [
"MIT"
] | 3 | 2018-09-14T04:08:55.000Z | 2021-11-05T08:55:06.000Z | python_scripts/old_files/sample_variance.py | raspstephan/convective_variability_analysis | 946a07c70025650e34b015a7a8986bb47dc47930 | [
"MIT"
] | 4 | 2017-04-18T06:39:33.000Z | 2017-07-07T12:56:45.000Z | python_scripts/old_files/sample_variance.py | raspstephan/convective_variability_analysis | 946a07c70025650e34b015a7a8986bb47dc47930 | [
"MIT"
] | 5 | 2019-01-10T08:20:31.000Z | 2021-11-05T08:55:07.000Z | # Imports
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
pdfwidth = 7.87
def calc_beta(sample):
return np.var(sample, ddof = 1)/np.mean(sample)**2
def calc_alpha(sample):
return np.var(sample, ddof = 1)/np.mean(sample)
#
mean_m = 4.7e7
n_iter = 10000
n_sample = (r... | 23.980769 | 75 | 0.674419 |
f5b15b47d784fbc15ceee43291457a8e4348e027 | 6,765 | py | Python | hue.py | connorjrw/hue_gui | a90e03bbb20829efe1e922c6b696b3c737138eca | [
"MIT"
] | null | null | null | hue.py | connorjrw/hue_gui | a90e03bbb20829efe1e922c6b696b3c737138eca | [
"MIT"
] | null | null | null | hue.py | connorjrw/hue_gui | a90e03bbb20829efe1e922c6b696b3c737138eca | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 9 22:20:49 2020
@author: con
"""
import requests
import time
import random
import os
from pathlib import Path
import json
from rgbxy import Converter
from rgbxy import GamutA
from custom_errors import *
class Bridge:
def __init__(self):
... | 33 | 95 | 0.555063 |
4886787db501c38a6dd1e99ce4e1691a8772ffed | 1,916 | py | Python | incomepropertyevaluator/shared_authentication/views/api_login_view.py | MikaSoftware/django-incomepropertyevaluator | d30dc9ba38dc2c2cb8ad858e9e7cfec17a45e73b | [
"BSD-2-Clause"
] | 2 | 2019-02-22T23:34:59.000Z | 2022-03-22T06:10:21.000Z | incomepropertyevaluator/shared_authentication/views/api_login_view.py | MikaSoftware/django-incomepropertyevaluator | d30dc9ba38dc2c2cb8ad858e9e7cfec17a45e73b | [
"BSD-2-Clause"
] | 6 | 2020-02-11T23:57:35.000Z | 2022-03-11T23:17:44.000Z | incomepropertyevaluator/shared_authentication/views/api_login_view.py | MikaSoftware/django-incomepropertyevaluator | d30dc9ba38dc2c2cb8ad858e9e7cfec17a45e73b | [
"BSD-2-Clause"
] | null | null | null | import django_filters
from django.conf.urls import url, include
from django.contrib.auth.models import User, Group
from django.contrib.auth import authenticate, login, logout
from django_filters import rest_framework as filters
from django.http import Http404
from rest_framework.views import APIView
from rest_framework... | 37.568627 | 160 | 0.72286 |
7231cfa1ec8aca434e9eaea535a3a7533dbc5a76 | 1,560 | py | Python | dags/subdags/common_task_1_subdag.py | reljicd/ml_airflow | 505c663e94ec3abf067609d82b7c8f27fc830e4a | [
"Apache-2.0"
] | 13 | 2018-03-21T11:46:40.000Z | 2022-02-03T02:27:20.000Z | dags/subdags/common_task_1_subdag.py | reljicd/ml_airflow | 505c663e94ec3abf067609d82b7c8f27fc830e4a | [
"Apache-2.0"
] | 10 | 2019-10-28T11:37:11.000Z | 2022-03-01T23:10:24.000Z | dags/subdags/common_task_1_subdag.py | reljicd/ml_airflow | 505c663e94ec3abf067609d82b7c8f27fc830e4a | [
"Apache-2.0"
] | 5 | 2019-07-31T07:10:44.000Z | 2021-11-04T16:08:00.000Z | from typing import Dict
from sqlalchemy.engine.base import Engine
from dags.repositories.common_task_1 import CommonTask1Repository
from dags.subdags.base_subdag import MLTaskSubDag
from dags.utils import dag_utils
class CommonTask1SubDag(MLTaskSubDag):
""" Class for Common Task 1 subDAGs """
def __init__(... | 34.666667 | 110 | 0.578205 |
ef69fa0d6795d609da6b041020b8c396e7ab3881 | 3,238 | py | Python | speech_analysis_raspi/support/configuration_classes.py | Karawalaya/Stress-Detection-Through-Speech-Emotion-Recognition | e1ffdb3258bf08806fbc71f35ce3a1187f716e63 | [
"MIT"
] | null | null | null | speech_analysis_raspi/support/configuration_classes.py | Karawalaya/Stress-Detection-Through-Speech-Emotion-Recognition | e1ffdb3258bf08806fbc71f35ce3a1187f716e63 | [
"MIT"
] | null | null | null | speech_analysis_raspi/support/configuration_classes.py | Karawalaya/Stress-Detection-Through-Speech-Emotion-Recognition | e1ffdb3258bf08806fbc71f35ce3a1187f716e63 | [
"MIT"
] | null | null | null | from speech_analysis_raspi.support import configurations_variables as confv
import os
'''
class ModelConfig:
pass
'''
# The below ModelConfig is only for reference. Just the name of ModelConfig is enough as above.
class ModelConfig:
def __init__(self, database, gender, mode, classes='', nfilt=26, nfeat=13, ... | 46.927536 | 150 | 0.697035 |
5a1ac1b0ab7f9f859f0ee6773fc269d82d76516f | 10,007 | py | Python | recrawl.py | capjamesg/indieweb-search | 856ac117974bba593549136dfc17c3402c9f0066 | [
"MIT"
] | 14 | 2021-08-31T14:36:55.000Z | 2022-03-14T15:14:14.000Z | recrawl.py | capjamesg/indieweb-search | 856ac117974bba593549136dfc17c3402c9f0066 | [
"MIT"
] | 22 | 2021-09-24T06:21:49.000Z | 2022-02-13T15:41:57.000Z | recrawl.py | capjamesg/indieweb-search | 856ac117974bba593549136dfc17c3402c9f0066 | [
"MIT"
] | 1 | 2021-09-24T09:40:14.000Z | 2021-09-24T09:40:14.000Z | import requests
import mf2py
import datetime
import feedparser
import microformats2
from time import mktime
from crawler.url_handling import crawl_urls
import concurrent.futures
import logging
import config
import os
# ignore insecure request warning
from requests.packages.urllib3.exceptions import InsecureRequestWarn... | 32.702614 | 194 | 0.558309 |
aed18b025b277de93a4af66b85d8a937873995fe | 1,203 | py | Python | gitlab-ci/tools/cargo_tree_viz/cargo_tree_viz.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 941 | 2021-05-10T08:14:14.000Z | 2022-03-31T11:40:24.000Z | gitlab-ci/tools/cargo_tree_viz/cargo_tree_viz.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 4 | 2021-12-22T22:34:51.000Z | 2022-03-31T07:34:19.000Z | gitlab-ci/tools/cargo_tree_viz/cargo_tree_viz.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 122 | 2021-05-10T08:21:23.000Z | 2022-03-25T20:34:12.000Z | import re
import subprocess
def run():
"""Run `cargo tree` in the current directory, and produce `dot` output."""
result = subprocess.run(
["cargo", "tree", "--workspace", "--prefix=depth"],
capture_output=True,
text=True,
)
nodes = set()
edges = []
stack = []
for l... | 26.152174 | 78 | 0.520366 |
fce85bfcb0e0d89403c0ac04ac7c7ed6f39ec0c5 | 3,344 | py | Python | htdocs/plotting/auto/scripts/p85.py | jamayfieldjr/iem | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | htdocs/plotting/auto/scripts/p85.py | jamayfieldjr/iem | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | [
"MIT"
] | null | null | null | htdocs/plotting/auto/scripts/p85.py | jamayfieldjr/iem | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | [
"MIT"
] | null | null | null | """Hourly Temp Frequencies"""
import calendar
from collections import OrderedDict
from pandas.io.sql import read_sql
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.plot.use_agg import plt
from pyiem.exceptions import NoDataFound
PDICT = OrderedDict([
('above', 'At or Above Temperature'),
(... | 34.474227 | 78 | 0.582237 |
c496f206461ccd66d2012fa297f7c6de8c5cac9e | 5,498 | py | Python | cotede/qctests/location_at_sea.py | BillMills/CoTeDe | 5d69eaf009331f091c2add80d68473d13a5f23f9 | [
"BSD-3-Clause"
] | null | null | null | cotede/qctests/location_at_sea.py | BillMills/CoTeDe | 5d69eaf009331f091c2add80d68473d13a5f23f9 | [
"BSD-3-Clause"
] | null | null | null | cotede/qctests/location_at_sea.py | BillMills/CoTeDe | 5d69eaf009331f091c2add80d68473d13a5f23f9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import numpy as np
from numpy import ma
from .qctests import QCCheck
module_logger = logging.getLogger(__name__)
try:
import oceansdb
except ImportError:
module_logger.debug("OceansDB package is not available")
def location_at_sea(data, cfg=None):
""" Evaluate i... | 33.730061 | 126 | 0.56857 |
7293e5837a0f9248093237255e3fb21c41d8e847 | 37,738 | py | Python | discord/ext/commands/bot.py | null2264/discord.py | fb94e7b874df1772f4b3d35194ee6d4a3e8c90d0 | [
"MIT"
] | null | null | null | discord/ext/commands/bot.py | null2264/discord.py | fb94e7b874df1772f4b3d35194ee6d4a3e8c90d0 | [
"MIT"
] | null | null | null | discord/ext/commands/bot.py | null2264/discord.py | fb94e7b874df1772f4b3d35194ee6d4a3e8c90d0 | [
"MIT"
] | 1 | 2020-11-23T14:31:25.000Z | 2020-11-23T14:31:25.000Z | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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 t... | 34.845799 | 144 | 0.605808 |
9226f95c33ce157226b34332254ebb12d18b030c | 18,445 | py | Python | IMGAN/model_zgenerator.py | IsaacGuan/implicit-decoder | 1e543951deeed4cbc93a06f9e785277dc1c42c98 | [
"MIT"
] | null | null | null | IMGAN/model_zgenerator.py | IsaacGuan/implicit-decoder | 1e543951deeed4cbc93a06f9e785277dc1c42c98 | [
"MIT"
] | null | null | null | IMGAN/model_zgenerator.py | IsaacGuan/implicit-decoder | 1e543951deeed4cbc93a06f9e785277dc1c42c98 | [
"MIT"
] | null | null | null | import os
import time
import math
from glob import glob
import tensorflow as tf
import numpy as np
import pandas as pd
import h5py
import cv2
import mcubes
from ops import *
class ZGenerator(object):
def __init__(self, sess, real_size, batch_size_input, is_training = False, z_dim=128, ef_dim=32, gf_dim=128, dataset_... | 39.328358 | 212 | 0.672811 |
f40ebb6f8e9d3e0cffea6b150ea7278aa6571366 | 1,000 | py | Python | chapter8/8_6Creating Managed Attributes/8_6.py | atigerboy/PythonCookBook | e9238c7676063b5077a7645707ecc51052063d8d | [
"MIT"
] | null | null | null | chapter8/8_6Creating Managed Attributes/8_6.py | atigerboy/PythonCookBook | e9238c7676063b5077a7645707ecc51052063d8d | [
"MIT"
] | null | null | null | chapter8/8_6Creating Managed Attributes/8_6.py | atigerboy/PythonCookBook | e9238c7676063b5077a7645707ecc51052063d8d | [
"MIT"
] | null | null | null | '''
You want to add extra processing (e.g., type checking or validation) to the getting or
setting of an instance attribute
使用@property声明属性 @name setter做set类型检查等
不用写大量的重复代码,比如setter都有共同的类型检查代码
'''
class Person:
def __init__(self, first_name):
self.first_name = first_name
# Getter function
@property
... | 24.390244 | 86 | 0.665 |
5fe71e65d2ceb9a24a53fd87eceba8edb2236b34 | 205 | py | Python | pantera/reactors/EquilibriumReactors.py | rddaz2013/pantera | b8cd957f433e0c38550e1f4cd3f9448fb28ef9cd | [
"MIT"
] | null | null | null | pantera/reactors/EquilibriumReactors.py | rddaz2013/pantera | b8cd957f433e0c38550e1f4cd3f9448fb28ef9cd | [
"MIT"
] | null | null | null | pantera/reactors/EquilibriumReactors.py | rddaz2013/pantera | b8cd957f433e0c38550e1f4cd3f9448fb28ef9cd | [
"MIT"
] | 1 | 2018-12-03T08:48:01.000Z | 2018-12-03T08:48:01.000Z | from PanteraReactorBases import *
"""
overload solve method
to run equilibrate() on contents
"""
class EquilibriumReactor(PanteraReactor):
def solve(self):
self._contents.equilibrate('TP')
| 17.083333 | 41 | 0.726829 |
85dfef4c977422e594bf3bcb4ac5b60ebb190d20 | 915 | py | Python | src/foreign_if/python/UT/src/scaler/test009.py | XpressAI/frovedis | bda0f2c688fb832671c5b542dd8df1c9657642ff | [
"BSD-2-Clause"
] | 63 | 2018-06-21T14:11:59.000Z | 2022-03-30T11:24:36.000Z | src/foreign_if/python/UT/src/scaler/test009.py | XpressAI/frovedis | bda0f2c688fb832671c5b542dd8df1c9657642ff | [
"BSD-2-Clause"
] | 5 | 2018-09-22T14:01:53.000Z | 2021-12-27T16:11:05.000Z | src/foreign_if/python/UT/src/scaler/test009.py | XpressAI/frovedis | bda0f2c688fb832671c5b542dd8df1c9657642ff | [
"BSD-2-Clause"
] | 12 | 2018-08-23T15:59:44.000Z | 2022-02-20T06:47:22.000Z | #!/usr/bin/env python
import sys
import numpy as np
from frovedis.exrpc.server import FrovedisServer
from frovedis.mllib.preprocessing import StandardScaler
desc = "Testing StandardScaler inverse_transform(), with fit. " #Dense data
# initializing the Frovedis server
argvs = sys.argv
argc = len(argvs)
if (argc < 2):
... | 25.416667 | 144 | 0.75082 |
d7140672c63e036c0d73b21e2baf1958c34bd099 | 9,378 | py | Python | src/ralph/admin/autocomplete.py | DoNnMyTh/ralph | 97b91639fa68965ad3fd9d0d2652a6545a2a5b72 | [
"Apache-2.0"
] | 1 | 2019-01-17T17:26:20.000Z | 2019-01-17T17:26:20.000Z | src/ralph/admin/autocomplete.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 1 | 2020-10-30T10:22:43.000Z | 2020-10-30T10:22:43.000Z | src/ralph/admin/autocomplete.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 1 | 2021-03-02T18:10:10.000Z | 2021-03-02T18:10:10.000Z | import logging
import operator
import re
from functools import reduce
from dj.choices import Choices
from django.conf.urls import url
from django.core.exceptions import FieldDoesNotExist
from django.db.models import Manager, Q
from django.db.models.loading import get_model
from django.http import Http404, HttpResponse... | 33.855596 | 79 | 0.586692 |
2979401b956feea33a8e3bf5b54cbf741960fff4 | 2,068 | py | Python | setup.py | google-research/deadunits | 5f4c7d9dc0201cefeb3dc970bcaee66a78cfa423 | [
"Apache-2.0"
] | 3 | 2021-04-01T02:52:04.000Z | 2021-11-05T15:48:43.000Z | setup.py | google-research/deadunits | 5f4c7d9dc0201cefeb3dc970bcaee66a78cfa423 | [
"Apache-2.0"
] | null | null | null | setup.py | google-research/deadunits | 5f4c7d9dc0201cefeb3dc970bcaee66a78cfa423 | [
"Apache-2.0"
] | 2 | 2021-11-05T15:45:30.000Z | 2022-01-16T11:50:00.000Z | # coding=utf-8
# Copyright 2021 The Deadunits Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 27.210526 | 74 | 0.655222 |
836592ce0b3906faba4f4b464897704f61737652 | 979 | py | Python | backend/fsmLogic/actionCodes/action_testBool.py | AsperTheDog/NeoSkeletonBot | 3f27c00e0aeaddc93aba6e12b3f3f25303b6c3a4 | [
"MIT"
] | null | null | null | backend/fsmLogic/actionCodes/action_testBool.py | AsperTheDog/NeoSkeletonBot | 3f27c00e0aeaddc93aba6e12b3f3f25303b6c3a4 | [
"MIT"
] | null | null | null | backend/fsmLogic/actionCodes/action_testBool.py | AsperTheDog/NeoSkeletonBot | 3f27c00e0aeaddc93aba6e12b3f3f25303b6c3a4 | [
"MIT"
] | null | null | null | import disnake
from fsmLogic.nodeClasses.actionTemplate import Action
from fsmLogic.actionManager import ActionManager
from fsmLogic.nodeClasses.inputs import ValueInput, EventOutput, ValueOutput
from fsmLogic.nodeClasses.valueTypes import ValueType
@ActionManager.actionclass
class TestBool(Action):
guildID = -1... | 26.459459 | 103 | 0.671093 |
008668a4fe42a6bdec1bbabef1cd4058328dce39 | 2,557 | py | Python | calc_beta.py | victor-caldeira/Beta-Ibov | 87bf1136060a7c17216fee48a6dc5ef702487ec3 | [
"MIT"
] | null | null | null | calc_beta.py | victor-caldeira/Beta-Ibov | 87bf1136060a7c17216fee48a6dc5ef702487ec3 | [
"MIT"
] | null | null | null | calc_beta.py | victor-caldeira/Beta-Ibov | 87bf1136060a7c17216fee48a6dc5ef702487ec3 | [
"MIT"
] | null | null | null | '''
Esta aplicação calcula o beta de uma ação em relação ao Ibovespa, dada uma data de início da análise.
Desenvolvido por Victor Caldeira
Github: https://github.com/victor-caldeira
'''
import pandas as pd
import pandas_datareader.data as web
from pandas_datareader._utils import RemoteDataError
import matplotlib.pyp... | 31.567901 | 137 | 0.647243 |
9099038a402d9a0f28e2ae861e93a39e0a4073d3 | 140 | py | Python | python/testData/quickFixes/PyTypeHintsQuickFixTest/callableTwoElementsParenthesizedAsFirst.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/quickFixes/PyTypeHintsQuickFixTest/callableTwoElementsParenthesizedAsFirst.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/quickFixes/PyTypeHintsQuickFixTest/callableTwoElementsParenthesizedAsFirst.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from typing import Callable
g: Callable[<error descr="'Callable' must be used as 'Callable[[arg, ...], result]'">(int<caret>)</error>, str] | 46.666667 | 111 | 0.685714 |
f76350fcca019968303e68e7a71068b7efbd66b8 | 7,423 | py | Python | test/engine/test_bind.py | rclmenezes/sqlalchemy-moat | ecd9a812055307d68069e366763cad182560788d | [
"MIT"
] | null | null | null | test/engine/test_bind.py | rclmenezes/sqlalchemy-moat | ecd9a812055307d68069e366763cad182560788d | [
"MIT"
] | null | null | null | test/engine/test_bind.py | rclmenezes/sqlalchemy-moat | ecd9a812055307d68069e366763cad182560788d | [
"MIT"
] | 1 | 2015-02-09T22:15:14.000Z | 2015-02-09T22:15:14.000Z | """tests the "bind" attribute/argument across schema and SQL,
including the deprecated versions of these arguments"""
from __future__ import with_statement
from sqlalchemy.testing import eq_, assert_raises
from sqlalchemy import engine, exc
from sqlalchemy import MetaData, ThreadLocalMetaData
from sqlalchemy import Int... | 34.525581 | 78 | 0.498451 |
580abd1b3dc0624e60e33fad3190521c6968604a | 4,083 | py | Python | deeplearning/clgen/preprocessors/cxx.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | null | null | null | deeplearning/clgen/preprocessors/cxx.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | 2 | 2020-07-27T08:22:06.000Z | 2020-07-30T17:34:35.000Z | deeplearning/clgen/preprocessors/cxx.py | Zacharias030/ProGraML | cd99d2c5362acd0b24ee224492bb3e8c4d4736fb | [
"Apache-2.0"
] | 1 | 2020-06-05T04:58:13.000Z | 2020-06-05T04:58:13.000Z | # Copyright (c) 2016, 2017, 2018, 2019 Chris Cummins.
#
# clgen 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.
#
# clgen is distribute... | 28.552448 | 78 | 0.717365 |
7dbf56f0afe767953338f481636efd1d36e055e6 | 28,198 | py | Python | tools/gen-postmortem-metadata.py | ksti/v8 | 700f9b0ea64c5e7d15cab441295761ff5677a4c5 | [
"BSD-3-Clause"
] | null | null | null | tools/gen-postmortem-metadata.py | ksti/v8 | 700f9b0ea64c5e7d15cab441295761ff5677a4c5 | [
"BSD-3-Clause"
] | null | null | null | tools/gen-postmortem-metadata.py | ksti/v8 | 700f9b0ea64c5e7d15cab441295761ff5677a4c5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# not... | 40.053977 | 131 | 0.566423 |
2074644cf2b42f92e0a8337a41c6b7108eb8fb96 | 623 | py | Python | src/backend/common/sitevars/google_api_secret.py | ofekashery/the-blue-alliance | df0e47d054161fe742ac6198a6684247d0713279 | [
"MIT"
] | 266 | 2015-01-04T00:10:48.000Z | 2022-03-28T18:42:05.000Z | src/backend/common/sitevars/google_api_secret.py | ofekashery/the-blue-alliance | df0e47d054161fe742ac6198a6684247d0713279 | [
"MIT"
] | 2,673 | 2015-01-01T20:14:33.000Z | 2022-03-31T18:17:16.000Z | src/backend/common/sitevars/google_api_secret.py | ofekashery/the-blue-alliance | df0e47d054161fe742ac6198a6684247d0713279 | [
"MIT"
] | 230 | 2015-01-04T00:10:48.000Z | 2022-03-26T18:12:04.000Z | from typing import Optional, TypedDict
from backend.common.sitevars.sitevar import Sitevar
class ContentType(TypedDict):
api_key: str
class GoogleApiSecret(Sitevar[ContentType]):
@staticmethod
def key() -> str:
return "google.secrets"
@staticmethod
def description() -> str:
ret... | 23.074074 | 71 | 0.677368 |
6c09f8abb755b727307f227cef4bb722b5b3b8ff | 4,963 | py | Python | evmscript_parser/core/ABI/utilities/etherscan.py | DmitIv/EVMScriptParser | 2a565cffb9cd890b9ded1978727364270150a72a | [
"MIT"
] | null | null | null | evmscript_parser/core/ABI/utilities/etherscan.py | DmitIv/EVMScriptParser | 2a565cffb9cd890b9ded1978727364270150a72a | [
"MIT"
] | null | null | null | evmscript_parser/core/ABI/utilities/etherscan.py | DmitIv/EVMScriptParser | 2a565cffb9cd890b9ded1978727364270150a72a | [
"MIT"
] | null | null | null | """
Getting contracts ABI through Etherscan API.
"""
import json
import time
import logging
import requests
import brownie
from functools import lru_cache, partial
from typing import Dict, Tuple
from evmscript_parser.core.exceptions import (
ABIEtherscanNetworkError, ABIEtherscanStatusCode
)
from evmscript_parse... | 31.01875 | 78 | 0.584123 |
2128c2873947a0ac488b6b4bd608ec4c745e8a3d | 21,884 | py | Python | bokeh/models/formatters.py | masdao/bokeh | fc39b47387ae37ba5b06ebabf9bae0afb3eada3d | [
"BSD-3-Clause"
] | 1 | 2018-12-19T06:52:07.000Z | 2018-12-19T06:52:07.000Z | bokeh/models/formatters.py | masdao/bokeh | fc39b47387ae37ba5b06ebabf9bae0afb3eada3d | [
"BSD-3-Clause"
] | null | null | null | bokeh/models/formatters.py | masdao/bokeh | fc39b47387ae37ba5b06ebabf9bae0afb3eada3d | [
"BSD-3-Clause"
] | null | null | null | ''' Models for controlling the text and visual formatting of tick
labels on Bokeh plot axes.
'''
from __future__ import absolute_import
from types import FunctionType
from bokeh.util.string import format_docstring
from ..core.enums import LatLon, NumeralLanguage, RoundingFunction
from ..core.has_props import abstrac... | 35.816694 | 124 | 0.598063 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.