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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9304009ae75f30470c311ee470ff6e1eeb87fdbd | 10,110 | py | Python | lib/bridgedb/parse/networkstatus.py | wfn/bridgedb | f266f32c365eb7a16cf156cc02f7e492266a7b51 | [
"BSD-3-Clause-Clear"
] | 1 | 2016-09-21T12:55:21.000Z | 2016-09-21T12:55:21.000Z | lib/bridgedb/parse/networkstatus.py | wfn/bridgedb | f266f32c365eb7a16cf156cc02f7e492266a7b51 | [
"BSD-3-Clause-Clear"
] | null | null | null | lib/bridgedb/parse/networkstatus.py | wfn/bridgedb | f266f32c365eb7a16cf156cc02f7e492266a7b51 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013 Isis Lovecruft
# (c) 2007-2013, The Tor Project, Inc.
# (c) 2007-2013... | 36.89781 | 79 | 0.614639 |
bbf1e13c10521e0b31a77a9bd282c88ea408bf29 | 6,656 | py | Python | kubernetes/client/models/v1beta1_certificate_signing_request_condition.py | palnabarun/Python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_certificate_signing_request_condition.py | palnabarun/Python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | 7 | 2020-11-07T10:35:21.000Z | 2022-02-07T03:06:25.000Z | kubernetes/client/models/v1beta1_certificate_signing_request_condition.py | palnabarun/python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 32 | 129 | 0.629207 |
3cb3aab2972ddef7e033e503b54c9982069abff2 | 5,135 | py | Python | samcli/lib/bootstrap/companion_stack/data_types.py | torresxb1/aws-sam-cli | d307f2eb6e1a91a476a5e2ca6070f974b0c913f1 | [
"BSD-2-Clause",
"Apache-2.0"
] | 859 | 2020-08-25T03:53:17.000Z | 2022-03-31T12:33:07.000Z | samcli/lib/bootstrap/companion_stack/data_types.py | torresxb1/aws-sam-cli | d307f2eb6e1a91a476a5e2ca6070f974b0c913f1 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1,369 | 2020-08-25T10:57:03.000Z | 2022-03-31T23:00:25.000Z | samcli/lib/bootstrap/companion_stack/data_types.py | torresxb1/aws-sam-cli | d307f2eb6e1a91a476a5e2ca6070f974b0c913f1 | [
"BSD-2-Clause",
"Apache-2.0"
] | 275 | 2020-08-25T19:33:50.000Z | 2022-03-26T08:32:52.000Z | """
Date type classes for companion stacks
"""
import re
from typing import Optional
from samcli.lib.utils.hash import str_checksum
class CompanionStack:
"""
Abstraction class for the companion stack
Companion stack name will be generated by this class.
"""
_parent_stack_name: str
_escape... | 35.171233 | 119 | 0.644985 |
63fbc922e2b1281f3ec90ecb4a7716e123760904 | 12,922 | py | Python | frappe/utils/file_manager.py | AWDGroup/frappe | 9687384328012bf82a2784ab950c4f74a69b4ebe | [
"MIT"
] | 1 | 2019-05-21T04:55:01.000Z | 2019-05-21T04:55:01.000Z | frappe/utils/file_manager.py | AWDGroup/frappe | 9687384328012bf82a2784ab950c4f74a69b4ebe | [
"MIT"
] | null | null | null | frappe/utils/file_manager.py | AWDGroup/frappe | 9687384328012bf82a2784ab950c4f74a69b4ebe | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os, base64, re
import hashlib
import mimetypes
import io
from frappe.utils import get_hook_method, get_files_path, random_string, encode, cstr, call_hook_meth... | 29.43508 | 130 | 0.726203 |
72a4621d5ed7c20157581b4aa02cf3c07f951f79 | 2,271 | py | Python | tensortrade/orders/order_spec.py | owodunni/tensortrade | d6d7fb12f926b3c451d7e200cb693d750a35f95a | [
"Apache-2.0"
] | 1 | 2020-04-05T05:15:36.000Z | 2020-04-05T05:15:36.000Z | tensortrade/orders/order_spec.py | owodunni/tensortrade | d6d7fb12f926b3c451d7e200cb693d750a35f95a | [
"Apache-2.0"
] | null | null | null | tensortrade/orders/order_spec.py | owodunni/tensortrade | d6d7fb12f926b3c451d7e200cb693d750a35f95a | [
"Apache-2.0"
] | 2 | 2020-12-31T02:57:22.000Z | 2021-06-21T16:12:24.000Z | # Copyright 2019 The TensorTrade 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 or agreed to... | 33.895522 | 86 | 0.597974 |
af5f5d42ea6717872a77c8e365e3e6bef104cf9d | 415 | py | Python | venv/Scripts/pip3-script.py | baniraz/selenium_ | e07362659fcc79b048cd88ea30429b0f6123a4d1 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3-script.py | baniraz/selenium_ | e07362659fcc79b048cd88ea30429b0f6123a4d1 | [
"Apache-2.0"
] | null | null | null | venv/Scripts/pip3-script.py | baniraz/selenium_ | e07362659fcc79b048cd88ea30429b0f6123a4d1 | [
"Apache-2.0"
] | null | null | null | #!C:\Users\User\Documents\GitHub\selenium_\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.arg... | 31.923077 | 69 | 0.66988 |
0a94c33594634aa098314c06ddcd857e45827fda | 7,862 | py | Python | mmtbx/conformation_dependent_library/metal_coordination_library.py | indu-in/cctbx_project1 | e09447ddc2ba3aa9d91b21008b0162ab290b0c30 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-18T12:31:57.000Z | 2022-03-14T06:27:06.000Z | mmtbx/conformation_dependent_library/metal_coordination_library.py | indu-in/cctbx_project1 | e09447ddc2ba3aa9d91b21008b0162ab290b0c30 | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/conformation_dependent_library/metal_coordination_library.py | indu-in/cctbx_project1 | e09447ddc2ba3aa9d91b21008b0162ab290b0c30 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
import sys
from cctbx import geometry_restraints
from cctbx.geometry_restraints import linking_class
origin_ids = linking_class.linking_class()
headers = ['Zn-SG (A)',
'SG-Zn-SG (degrees)',
'Zn-N (A)',
'N-Zn-N (degrees)',
'ZnCysxHisy',
... | 33.313559 | 80 | 0.585729 |
f0ccb633264d7faba7c7fdfec32e834078072c65 | 23,292 | py | Python | scripts/deploy/deploy_badger.py | lookfirst/badger-system | 8362bcbf00abf51d24e0ba67b1b30c301ca34e40 | [
"MIT"
] | null | null | null | scripts/deploy/deploy_badger.py | lookfirst/badger-system | 8362bcbf00abf51d24e0ba67b1b30c301ca34e40 | [
"MIT"
] | null | null | null | scripts/deploy/deploy_badger.py | lookfirst/badger-system | 8362bcbf00abf51d24e0ba67b1b30c301ca34e40 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
from brownie import *
from config.badger_config import badger_config, badger_total_supply
from helpers.constants import APPROVED_STAKER_ROLE
from helpers.registry import registry
from rich.console import Console
from scripts.systems.badger_system import BadgerSystem, print_to_file
from t... | 35.398176 | 187 | 0.675897 |
24255c3e007c7c3896f7418e8236a8238d23de87 | 1,420 | py | Python | RNAStructure_processing_example.py | wenjingk/MapToCleave | 53bb73525eabf8d1f7f11781864813d8c7f800f6 | [
"MIT"
] | null | null | null | RNAStructure_processing_example.py | wenjingk/MapToCleave | 53bb73525eabf8d1f7f11781864813d8c7f800f6 | [
"MIT"
] | null | null | null | RNAStructure_processing_example.py | wenjingk/MapToCleave | 53bb73525eabf8d1f7f11781864813d8c7f800f6 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
from scripts.RNAStructure import RNAStructure
# input
vienna=sys.argv[1]
rna = RNAStructure(vienna)
# ### MapToCleave hairpin information
# In[2]:
print('# MapToCleave hairpin identity')
print(rna.name)
# In[3]:
print('# MapToCleave hairpin sequence (118nt)')
print(rna.sequence_wi... | 20 | 166 | 0.734507 |
9326ac6e5ab9423ac6e813d971f295fe5745181a | 14,918 | py | Python | superset/security.py | zuxqoj/incubator-superset | de5972610998d8faf1dfe2036aee07a2ffbc4509 | [
"Apache-2.0"
] | null | null | null | superset/security.py | zuxqoj/incubator-superset | de5972610998d8faf1dfe2036aee07a2ffbc4509 | [
"Apache-2.0"
] | null | null | null | superset/security.py | zuxqoj/incubator-superset | de5972610998d8faf1dfe2036aee07a2ffbc4509 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# pylint: disable=C,R,W
"""A set of constants and methods to manage permissions and security"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from flask import g
from flask_app... | 36.474328 | 138 | 0.648545 |
2a84e2a4ceadb8570c7abe4b43cfbd7b699b7f9c | 4,436 | py | Python | cold_posterior_bnn/core/frn.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-01-19T23:35:59.000Z | 2022-01-19T23:35:59.000Z | cold_posterior_bnn/core/frn.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | cold_posterior_bnn/core/frn.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 36.966667 | 109 | 0.669973 |
67162283d0c1692fd44b60011c31d3121559f7d8 | 899 | py | Python | setup.py | DasIch/argvard | 2603e323a995e0915ce41fcf49e2a82519556195 | [
"Apache-2.0"
] | 3 | 2015-02-09T02:28:30.000Z | 2020-04-26T00:31:40.000Z | setup.py | DasIch/argvard | 2603e323a995e0915ce41fcf49e2a82519556195 | [
"Apache-2.0"
] | null | null | null | setup.py | DasIch/argvard | 2603e323a995e0915ce41fcf49e2a82519556195 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import os
from setuptools import setup
from argvard import __version__
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
setup(
name='Argvard',
version=__version__,
url='https://github.com/DasIch/argvard',
author='Daniel Neuhäuser',
author_email='ich@danielneuhaeuser.de',... | 29 | 74 | 0.665184 |
dfe6bab08ec9d355967edcf055241e10da8379f1 | 2,580 | py | Python | urlfetch/urlfetch.py | sourcery-ai-bot/aikaterna-cogs | 75c84f53d5a3a1aa91564fef87cc8d5e67887707 | [
"Apache-2.0"
] | null | null | null | urlfetch/urlfetch.py | sourcery-ai-bot/aikaterna-cogs | 75c84f53d5a3a1aa91564fef87cc8d5e67887707 | [
"Apache-2.0"
] | null | null | null | urlfetch/urlfetch.py | sourcery-ai-bot/aikaterna-cogs | 75c84f53d5a3a1aa91564fef87cc8d5e67887707 | [
"Apache-2.0"
] | null | null | null | import asyncio
import aiohttp
import logging
from urllib.parse import urlparse
from redbot.core import checks, commands
from redbot.core.utils.chat_formatting import box, pagify
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
log = logging.getLogger("red.aikaterna.urlfetch")
__version__ = "1.1.0"
class... | 33.076923 | 116 | 0.587597 |
f58b16638322bc508a91c9ba75736ca783520dc7 | 2,712 | py | Python | parkingmotel.ie/parkingmotel/parkingmotel/settings.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | parkingmotel.ie/parkingmotel/parkingmotel/settings.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | 1 | 2015-11-08T11:49:35.000Z | 2015-11-08T11:49:43.000Z | parkingmotel.ie/parkingmotel/parkingmotel/settings.py | ProfessionalIT/customers | 3dbc1989bb3494fb6de7edad67dc59b7b0385ac3 | [
"MIT"
] | null | null | null | """
Django settings for parkingmotel project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build... | 25.111111 | 71 | 0.702434 |
9bcfdb9a82d86b08c32ffff33162f99b3052ba6b | 6,139 | py | Python | restservice/migrations/0001_initial.py | Ecotrust/formhub | 05033bb5aa152cc2cbcd7382c2c999d82b2c3276 | [
"BSD-2-Clause"
] | 123 | 2015-01-08T09:21:05.000Z | 2021-11-14T19:45:23.000Z | restservice/migrations/0001_initial.py | Ecotrust/formhub | 05033bb5aa152cc2cbcd7382c2c999d82b2c3276 | [
"BSD-2-Clause"
] | 16 | 2015-02-13T16:56:42.000Z | 2021-02-20T23:58:43.000Z | restservice/migrations/0001_initial.py | Ecotrust/formhub | 05033bb5aa152cc2cbcd7382c2c999d82b2c3276 | [
"BSD-2-Clause"
] | 110 | 2015-01-19T14:34:06.000Z | 2021-02-01T14:55:11.000Z | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'RestService'
db.create_table('restservice_restservice', (
('id', self.gf('djan... | 66.728261 | 182 | 0.566705 |
e501ecffb31bd049350296fc92c96929e1767b9c | 9,307 | py | Python | configs/ruby/DSI.py | Aayush-Ankit/ece666-parallelArch-gem5 | 3c20f5852a4b4f7ae59b69a46f483cfee06ad20f | [
"BSD-3-Clause"
] | 1 | 2021-04-29T03:26:29.000Z | 2021-04-29T03:26:29.000Z | configs/ruby/DSI.py | Aayush-Ankit/ece666-parallelArch-gem5 | 3c20f5852a4b4f7ae59b69a46f483cfee06ad20f | [
"BSD-3-Clause"
] | null | null | null | configs/ruby/DSI.py | Aayush-Ankit/ece666-parallelArch-gem5 | 3c20f5852a4b4f7ae59b69a46f483cfee06ad20f | [
"BSD-3-Clause"
] | 1 | 2019-11-13T00:40:44.000Z | 2019-11-13T00:40:44.000Z | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source co... | 44.5311 | 82 | 0.686365 |
41eaefb54fa6103f6dbbd40ded4b35c8d5896ff7 | 6,171 | py | Python | 4-Object_Detection/RPN/demo.py | Jack19960208/TensorFlow2.0-Examples | f0ec3fbd27af90f0d040cd70ec1fd3ad408c3a6d | [
"MIT"
] | 1 | 2019-10-21T11:39:03.000Z | 2019-10-21T11:39:03.000Z | 4-Object_Detection/RPN/demo.py | Jack19960208/TensorFlow2.0-Examples | f0ec3fbd27af90f0d040cd70ec1fd3ad408c3a6d | [
"MIT"
] | null | null | null | 4-Object_Detection/RPN/demo.py | Jack19960208/TensorFlow2.0-Examples | f0ec3fbd27af90f0d040cd70ec1fd3ad408c3a6d | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2019 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : demo.py
# Author : YunYang1994
# Created date: 2019-10-20 15:06:46
# Description :
#
#==========================... | 41.695946 | 108 | 0.583536 |
c0d9d58c31a819cf0e4a15f14530756be98c5d6e | 1,081 | py | Python | J_linked_list/problems/I_pairwise_swap_nodes_of_linked_list.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 58 | 2021-01-06T10:05:51.000Z | 2022-02-10T05:15:19.000Z | J_linked_list/problems/I_pairwise_swap_nodes_of_linked_list.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 5 | 2021-02-22T04:14:24.000Z | 2021-12-26T09:19:17.000Z | J_linked_list/problems/I_pairwise_swap_nodes_of_linked_list.py | Princeton21/DSA | 0f2321b284fc54f4ddf73733cc1a8d05e549aeea | [
"MIT"
] | 27 | 2021-02-09T13:58:33.000Z | 2022-03-06T03:48:08.000Z | class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def pairwiseSwap(self):
temp = self.head
if temp is None:
return
while temp is not None and temp.next is not None:
... | 22.520833 | 81 | 0.553191 |
9fd22edfa5eceb96f9723497e0ac8f9561721dae | 2,058 | py | Python | src/rejection-sampling.py | waidotto/ridgelet-transform-numerial-experiment | 2af1dc969347031c64e168cf071eb13d9ac1824c | [
"MIT"
] | 4 | 2018-09-01T11:13:27.000Z | 2020-10-12T02:37:44.000Z | src/rejection-sampling.py | waidotto/ridgelet-transform-numerial-experiment | 2af1dc969347031c64e168cf071eb13d9ac1824c | [
"MIT"
] | null | null | null | src/rejection-sampling.py | waidotto/ridgelet-transform-numerial-experiment | 2af1dc969347031c64e168cf071eb13d9ac1824c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#棄却法でオラクル分布から重みを生成する
import numpy as np
import numpy.matlib
import random
#活性化関数
def eta(x):
return np.exp(-np.square(x) / 2.0) #Gauss関数(正規分布)
with open('./temp/setting.py') as f:
exec(f.read())
#ファイル読み込み
dist = np.loadtxt('./output/numerical-ridgelet.txt', usecols = range(J))
Max = np.max(... | 31.181818 | 107 | 0.675413 |
c838d8900a25a261d655879ddfcf5e52b6ce5867 | 12,196 | py | Python | DB-CNN/Mars_experiments/model.py | bitzj2015/DB-CNN | 36a173daa37d22448c1d4f3a76b7953927b7d75e | [
"MIT"
] | 5 | 2019-01-08T11:35:38.000Z | 2021-12-01T05:30:10.000Z | DB-CNN/Mars_experiments/model.py | bitzj2015/DB-CNN | 36a173daa37d22448c1d4f3a76b7953927b7d75e | [
"MIT"
] | null | null | null | DB-CNN/Mars_experiments/model.py | bitzj2015/DB-CNN | 36a173daa37d22448c1d4f3a76b7953927b7d75e | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from utils import conv2d_flipkernel, conv2d_flipkernel_d
def VIN(X, S1, S2, config, length):
keep_drop = 0.5
k = config.k # Number of value iterations performed
ch_i = config.ch_i # Channels in input layer
ch_h = config.ch_h # Channels in initial hidden ... | 49.577236 | 148 | 0.613726 |
094e4b7e0a3406fe3c96e42e237dfb23512df2aa | 7,084 | py | Python | neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Mellanox Technologies, 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 t... | 44.275 | 79 | 0.643139 |
f60cb9d1817a748eca8fa4b430e8ac5f69448329 | 1,047 | py | Python | pestudio_extractor.py | team-missing-one/malware-predictor | 5dbe6a04f57469527818e06dc3c03ff92cd982bb | [
"MIT"
] | null | null | null | pestudio_extractor.py | team-missing-one/malware-predictor | 5dbe6a04f57469527818e06dc3c03ff92cd982bb | [
"MIT"
] | 10 | 2021-12-11T14:58:45.000Z | 2021-12-16T14:59:14.000Z | pestudio_extractor.py | team-missing-one/malware-predictor | 5dbe6a04f57469527818e06dc3c03ff92cd982bb | [
"MIT"
] | null | null | null | import numpy as np
import glob
import copy
import data_processor
from scipy import stats
def guess_imputation_vector():
ret = []
pathes = [
data_processor.get_train_path("PESTUDIO"),
data_processor.get_valid_path("PESTUDIO")
]
for i in pathes:
for fname in glob.glob(i + '*'):
... | 22.76087 | 92 | 0.620821 |
560b0af5a907f6052d2fb9aa63be7d7efd66dd4e | 702 | py | Python | tests/test_precount.py | akiomik/precountify | 521aac23bb0a92b0de961c46d9cc2a4d0a99b24e | [
"Apache-2.0"
] | null | null | null | tests/test_precount.py | akiomik/precountify | 521aac23bb0a92b0de961c46d9cc2a4d0a99b24e | [
"Apache-2.0"
] | 8 | 2020-03-24T18:09:15.000Z | 2020-12-17T02:36:28.000Z | tests/test_precount.py | akiomik/precountify | 521aac23bb0a92b0de961c46d9cc2a4d0a99b24e | [
"Apache-2.0"
] | null | null | null | import os
from precountify.click import Click
from precountify.precount import Precount
def test_prepend():
# TODO
pass
def test_from_click():
filename = os.path.join(os.path.dirname(__file__), 'fixtures/click.wav')
click = Click(filename, 44100, 120, False)
precount = Precount.from_click(click... | 25.071429 | 76 | 0.663818 |
b615a82a80cd41e6f0872638a603951f768e41ca | 6,962 | py | Python | ignite/engine/__init__.py | nzare/ignite | 002b595daa8a8345286c5e096c33e278948686a7 | [
"BSD-3-Clause"
] | 1 | 2020-08-29T16:49:36.000Z | 2020-08-29T16:49:36.000Z | ignite/engine/__init__.py | alxlampe/ignite | b53c6aeef87754b3cd3638c91172b386dc73af12 | [
"BSD-3-Clause"
] | 5 | 2020-08-29T16:49:48.000Z | 2020-08-29T17:05:54.000Z | ignite/engine/__init__.py | alxlampe/ignite | b53c6aeef87754b3cd3638c91172b386dc73af12 | [
"BSD-3-Clause"
] | 1 | 2020-10-15T06:21:01.000Z | 2020-10-15T06:21:01.000Z | from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
import torch
import ignite.distributed as idist
from ignite.engine.deterministic import DeterministicEngine
from ignite.engine.engine import Engine
from ignite.engine.events import CallableEventWithFilter, EventEnum, Events, State
from ignite.me... | 40.242775 | 120 | 0.683424 |
b1299386bbce2a6b69206a6576a63e6cff3a39dc | 4,385 | py | Python | aalh_iit_celebrations_001/populate-format-extent-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_celebrations_001/populate-format-extent-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_celebrations_001/populate-format-extent-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | from openpyxl import load_workbook
filename = 'aalh_iit_celebrations_001.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 47
maximumcol = 47
minimumrow = 7
maximumrow = 206
iterationrow = 7
targetcol = 47
formatcol = 33
extentcol = 34
for row in ws.iter_rows(min_row=minim... | 51.588235 | 105 | 0.619384 |
5b068ced582d0aac2ed2517fce300a21bc904140 | 93,430 | py | Python | qa/rpc-tests/p2p-segwit.py | litecoineco/litecoineco | a0b3c09215ef798abdd0738571a3a36dbfbb6d2d | [
"MIT"
] | 1 | 2021-03-12T16:25:16.000Z | 2021-03-12T16:25:16.000Z | qa/rpc-tests/p2p-segwit.py | litecoineco/litecoineco | a0b3c09215ef798abdd0738571a3a36dbfbb6d2d | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-segwit.py | litecoineco/litecoineco | a0b3c09215ef798abdd0738571a3a36dbfbb6d2d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin 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.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test... | 45.642404 | 143 | 0.658001 |
13621de3879a3964706c178c2e3c444f97abdac2 | 628 | py | Python | server/users/backends.py | Sonatrix/reango | 5533bb126a5972f7f4124c6e9a26c6207596ff80 | [
"MIT"
] | 60 | 2016-12-12T19:46:41.000Z | 2019-04-29T05:09:50.000Z | server/users/backends.py | Sonatrix/reango | 5533bb126a5972f7f4124c6e9a26c6207596ff80 | [
"MIT"
] | 28 | 2016-11-06T19:25:38.000Z | 2018-06-11T22:43:01.000Z | server/users/backends.py | ncrmro/ango | 15bca070ed01ec8fa885a224305d1ac67d458b47 | [
"MIT"
] | 14 | 2016-11-30T22:01:12.000Z | 2019-03-07T22:45:09.000Z | from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import check_password
class UserModelEmailBackend(ModelBackend):
def authenticate(self, username="", password="", **kwargs):
try:
user = get_user_model().objec... | 34.888889 | 76 | 0.667197 |
4b4834e647e7ffea388f14c735898103d2763386 | 1,933 | py | Python | main.py | ovsartem/json_navigator | 89d41e9ea3c351e74e418062d89f5e8a6e6bb111 | [
"MIT"
] | null | null | null | main.py | ovsartem/json_navigator | 89d41e9ea3c351e74e418062d89f5e8a6e6bb111 | [
"MIT"
] | null | null | null | main.py | ovsartem/json_navigator | 89d41e9ea3c351e74e418062d89f5e8a6e6bb111 | [
"MIT"
] | null | null | null | import json
def get_info(path):
"""
Reads json file
"""
with open("frienfs_list_Obama.json", 'r', encoding='utf-8') as f:
data = json.load(f)
return data
def dictionary(element):
"""
Function to work with dictionary
"""
all_elements = list(element.keys())
print("T... | 24.1625 | 74 | 0.602173 |
d867838c31b8010793298ab7616e80742167f681 | 5,469 | py | Python | py2app/bundletemplate/lib/site.py | MAKOMO/py2app | 942763aaffc2da553db743a2ebb5b3ae96acdb64 | [
"MIT"
] | null | null | null | py2app/bundletemplate/lib/site.py | MAKOMO/py2app | 942763aaffc2da553db743a2ebb5b3ae96acdb64 | [
"MIT"
] | null | null | null | py2app/bundletemplate/lib/site.py | MAKOMO/py2app | 942763aaffc2da553db743a2ebb5b3ae96acdb64 | [
"MIT"
] | null | null | null | """
Append module search paths for third-party packages to sys.path.
This is stripped down and customized for use in py2app applications
"""
import sys
# os is actually in the zip, so we need to do this here.
# we can't call it python24.zip because zlib is not a built-in module (!)
_libdir = "/lib/python" + sys.vers... | 26.548544 | 87 | 0.640519 |
b6c0dee51be70674d12dd64c650c880877c6882d | 2,356 | py | Python | mason/engines/metastore/models/table/table.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 4 | 2021-04-12T17:49:34.000Z | 2022-01-23T19:54:29.000Z | mason/engines/metastore/models/table/table.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 24 | 2021-04-30T18:40:25.000Z | 2021-05-12T20:52:06.000Z | mason/engines/metastore/models/table/table.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 3 | 2021-04-12T19:40:43.000Z | 2021-09-07T21:56:36.000Z | from datetime import datetime
from typing import Optional, List, Dict, Union
import pandas as pd
from mason.engines.metastore.models.schemas.text import TextSchema
from mason.clients.responsable import Responsable
from mason.clients.response import Response
from mason.engines.metastore.models.schemas.schema import Sch... | 33.183099 | 220 | 0.654499 |
2a6768d18d00eac1aa5b0854f121267cd9b7dbeb | 5,747 | py | Python | game_seq_embedder/game_seq_embedder/transformers/modeling_tf_camembert.py | fuxiAIlab/PMTC | bea55d821bc8adf64044194a0b72d8ce913a6213 | [
"Artistic-1.0-Perl"
] | 4 | 2021-02-28T11:58:18.000Z | 2022-02-03T03:26:45.000Z | game_seq_embedder/game_seq_embedder/transformers/modeling_tf_camembert.py | fuxiAIlab/PMTC | bea55d821bc8adf64044194a0b72d8ce913a6213 | [
"Artistic-1.0-Perl"
] | 2 | 2022-03-16T13:57:37.000Z | 2022-03-16T14:00:51.000Z | game_seq_embedder/game_seq_embedder/transformers/modeling_tf_camembert.py | fuxiAIlab/PMTC | bea55d821bc8adf64044194a0b72d8ce913a6213 | [
"Artistic-1.0-Perl"
] | 2 | 2020-07-16T16:20:59.000Z | 2021-08-08T20:22:47.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 39.634483 | 224 | 0.753437 |
2338c143f1a4ff42cfb5f8d8230ffe0d86677e3a | 4,316 | py | Python | Preference2/src/main/java/voidblue/preference/demo/Preference/Preference.py | voidblue/PreferenceWebPage | 7b36a6b0df09b84aa46fb63f9b191c84b46509d6 | [
"Apache-2.0"
] | null | null | null | Preference2/src/main/java/voidblue/preference/demo/Preference/Preference.py | voidblue/PreferenceWebPage | 7b36a6b0df09b84aa46fb63f9b191c84b46509d6 | [
"Apache-2.0"
] | null | null | null | Preference2/src/main/java/voidblue/preference/demo/Preference/Preference.py | voidblue/PreferenceWebPage | 7b36a6b0df09b84aa46fb63f9b191c84b46509d6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import openpyxl
import tensorflow as tf
import numpy.core._methods
import numpy.lib.format
from Softmax import Softmax
import os
import sys
if getattr(sys, 'frozen', False):
# frozen
dir_ = os.path.dirname(sys.executable)
else:
# unfrozen
dir_ = os.path.dirname(os.path.realpath(__fil... | 30.609929 | 73 | 0.401993 |
8d756e2fb9607ed1a1ee3a35144f1674d20b1170 | 10,192 | py | Python | flashfocus/display_protocols/x11.py | ardevd/flashfocus | 694bd97ba30d565c82235c976c7133e28778f0fc | [
"MIT"
] | null | null | null | flashfocus/display_protocols/x11.py | ardevd/flashfocus | 694bd97ba30d565c82235c976c7133e28778f0fc | [
"MIT"
] | null | null | null | flashfocus/display_protocols/x11.py | ardevd/flashfocus | 694bd97ba30d565c82235c976c7133e28778f0fc | [
"MIT"
] | null | null | null | """Xorg utility code.
All submodules in flashfocus.display_protocols are expected to contain a minimal set of
functions/classes for abstracting across various display protocols. See list in flashfocus.compat
"""
import functools
import logging
from queue import Queue
import struct
from threading import Thread
from ty... | 33.636964 | 99 | 0.645899 |
995c3165d08ccedec632bb58689f90632fd7cf13 | 4,481 | py | Python | test/test_acquirer.py | coleygroup/molpal | 7b3dd1488af6e734caea527fe2738ff7f6ebfc49 | [
"MIT"
] | 81 | 2020-12-15T14:28:57.000Z | 2022-03-14T12:26:00.000Z | test/test_acquirer.py | ashuein/molpal | 1e17a0c406516ceaeaf273a6983d06206bcfe76f | [
"MIT"
] | 13 | 2021-01-07T17:09:00.000Z | 2022-03-01T12:45:22.000Z | test/test_acquirer.py | ashuein/molpal | 1e17a0c406516ceaeaf273a6983d06206bcfe76f | [
"MIT"
] | 23 | 2020-12-15T16:09:48.000Z | 2022-03-13T11:29:40.000Z | import string
import unittest
import numpy as np
from molpal.acquirer import Acquirer
class TestAcquirer(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.xs = string.ascii_lowercase
cls.y_means = np.arange(len(cls.xs), dtype=np.double)[::-1]
cls.y_vars = np.zeros(len(cls.xs))... | 38.299145 | 79 | 0.622852 |
ccf7f4444c9c4febe83ac3db638f182316e29555 | 1,170 | py | Python | linearExt.py | gcant/pairwise-comparison-BP | f995d99440fd37b2850442413672a8e20b9f5b99 | [
"Apache-2.0"
] | 2 | 2021-10-04T09:48:50.000Z | 2022-01-13T21:24:43.000Z | linearExt.py | gcant/pairwise-comparison-BP | f995d99440fd37b2850442413672a8e20b9f5b99 | [
"Apache-2.0"
] | null | null | null | linearExt.py | gcant/pairwise-comparison-BP | f995d99440fd37b2850442413672a8e20b9f5b99 | [
"Apache-2.0"
] | null | null | null | import ctypes
import numpy as np
import networkx as nx
# C arrays of ints/doubles using numpy
array_int = np.ctypeslib.ndpointer(dtype=ctypes.c_int,ndim=1, flags='CONTIGUOUS')
array_double = np.ctypeslib.ndpointer(dtype=np.double,ndim=1, flags='CONTIGUOUS')
lib = ctypes.cdll.LoadLibrary("./out/LEMP.so")
lib.full_alg... | 27.857143 | 81 | 0.641026 |
f2f9966821a411eef4fb7167f4a20e8faf90a885 | 5,221 | py | Python | python_modules/libraries/dagster-airflow/dagster_airflow_tests/conftest.py | hspak/dagster | 94cff048d5d757d0fe1d83abe236252a1c86bd41 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow_tests/conftest.py | hspak/dagster | 94cff048d5d757d0fe1d83abe236252a1c86bd41 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow_tests/conftest.py | hspak/dagster | 94cff048d5d757d0fe1d83abe236252a1c86bd41 | [
"Apache-2.0"
] | null | null | null | '''Test fixtures for dagster-airflow.
These make very heavy use of fixture dependency and scope. If you're unfamiliar with pytest
fixtures, read: https://docs.pytest.org/en/latest/fixture.html.
'''
# pylint doesn't understand the way that pytest constructs fixture dependnecies
# pylint: disable=redefined-outer-name, u... | 30.005747 | 120 | 0.714039 |
9b45df84786d8b4294f3ee937d3f61b66b05730e | 1,974 | py | Python | lib/pybtex-0.19/pybtex/tests/database_test/data.py | cabeen/bibfmt | a2607506f15249f8e0ee900db103d57afec7dec8 | [
"MIT"
] | 1 | 2021-02-20T19:53:48.000Z | 2021-02-20T19:53:48.000Z | lib/pybtex-0.19/pybtex/tests/database_test/data.py | cabeen/bibfmt | a2607506f15249f8e0ee900db103d57afec7dec8 | [
"MIT"
] | null | null | null | lib/pybtex-0.19/pybtex/tests/database_test/data.py | cabeen/bibfmt | a2607506f15249f8e0ee900db103d57afec7dec8 | [
"MIT"
] | null | null | null | # vim:fileencoding=utf-8
from pybtex.database import Entry, Person
from pybtex.database import BibliographyData
reference_data = BibliographyData(
entries=[
('ruckenstein-diffusion', Entry('article',
fields={
'language': u'english',
'title': u'Predicting the Dif... | 35.25 | 93 | 0.459473 |
befce7838d0c6d6ae667596c75b03e63f01ad478 | 846 | py | Python | main.py | hectorrdz98/imageclassification-cisco | 3f3ab94887e3ccb79853274490426b64b55568dc | [
"Apache-2.0"
] | null | null | null | main.py | hectorrdz98/imageclassification-cisco | 3f3ab94887e3ccb79853274490426b64b55568dc | [
"Apache-2.0"
] | null | null | null | main.py | hectorrdz98/imageclassification-cisco | 3f3ab94887e3ccb79853274490426b64b55568dc | [
"Apache-2.0"
] | null | null | null | import os
import time
import flask
import subprocess
# Create an instance of Flask
app = flask.Flask(__name__)
@app.route("/images", methods=['POST'])
def images():
for file in flask.request.files.values():
filename = os.path.join(".", str(int(time.time())) + "_" + file.filename)
file.save(filenam... | 30.214286 | 144 | 0.634752 |
68422639a0ffa078adca4eb341f99e0138ea79fa | 16,894 | py | Python | clearml/backend_interface/task/populate.py | glemarivero/clearml | 28b85028fe4da3ab963b69e8ac0f7feef73cfcf6 | [
"Apache-2.0"
] | null | null | null | clearml/backend_interface/task/populate.py | glemarivero/clearml | 28b85028fe4da3ab963b69e8ac0f7feef73cfcf6 | [
"Apache-2.0"
] | null | null | null | clearml/backend_interface/task/populate.py | glemarivero/clearml | 28b85028fe4da3ab963b69e8ac0f7feef73cfcf6 | [
"Apache-2.0"
] | null | null | null | import json
import os
from functools import reduce
from logging import getLogger
from typing import Optional, Sequence, Union, Tuple
from six.moves.urllib.parse import urlparse
from pathlib2 import Path
from ...task import Task
from .repo import ScriptInfo
class CreateAndPopulate(object):
def __init__(
... | 48.82659 | 120 | 0.575352 |
05c81881b5c765f006e11e8b5944c8bec7c0772b | 31,217 | py | Python | packages/syft/src/syft/core/tensor/smpc/mpc_tensor.py | souravrhythm/PySyft | 08b44682959970ef395c529e92651fa77284124a | [
"Apache-1.1"
] | 8,428 | 2017-08-10T09:17:49.000Z | 2022-03-31T08:20:14.000Z | packages/syft/src/syft/core/tensor/smpc/mpc_tensor.py | bayegaspard/PySyft | f92dd6567bb16c6c91f4659e0ba109ad3a0e6cd5 | [
"Apache-1.1"
] | 4,779 | 2017-08-09T23:19:00.000Z | 2022-03-29T11:49:36.000Z | packages/syft/src/syft/core/tensor/smpc/mpc_tensor.py | bayegaspard/PySyft | f92dd6567bb16c6c91f4659e0ba109ad3a0e6cd5 | [
"Apache-1.1"
] | 2,307 | 2017-08-10T08:52:12.000Z | 2022-03-30T05:36:07.000Z | # future
from __future__ import annotations
# stdlib
import functools
import itertools
import secrets
from typing import Any
from typing import Callable
from typing import Dict
from typing import Iterable
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
# third par... | 33.280384 | 120 | 0.572925 |
b46d7aaf79ad7c30dae4a1a8ee7f51facaac5943 | 1,381 | py | Python | HTC_lib/VASP/KPOINTS/Write_HSE06_band_str_KPOINTS.py | bitsoal/VASP_HTC_framework | e947227f238fc3ff4d950c1e5fd0a4995b9bf3eb | [
"MIT"
] | 10 | 2018-03-06T01:27:53.000Z | 2021-12-03T07:27:33.000Z | HTC_lib/VASP/KPOINTS/Write_HSE06_band_str_KPOINTS.py | bitsoal/VASP_HTC_framework | e947227f238fc3ff4d950c1e5fd0a4995b9bf3eb | [
"MIT"
] | null | null | null | HTC_lib/VASP/KPOINTS/Write_HSE06_band_str_KPOINTS.py | bitsoal/VASP_HTC_framework | e947227f238fc3ff4d950c1e5fd0a4995b9bf3eb | [
"MIT"
] | 5 | 2018-03-06T02:08:58.000Z | 2021-08-18T02:12:40.000Z |
# coding: utf-8
# In[5]:
import re, os, sys
# In[21]:
def read_band_str_kpoints_from_OUTCAR(cal_loc):
kpoint_list = []
with open(os.path.join(cal_loc, "OUTCAR"), "r") as f:
for line in f:
if "k-point" in line and 'plane waves' in line:
kpoint = line.split(":")[1].spli... | 26.056604 | 68 | 0.615496 |
95949b0241062b4801ccad8a0bbd993c9735e0cb | 502 | py | Python | Python/5KYU/MaximumSubArraySum.py | CasperKristiansson/Code-Wars-Challenges | 5ffe276d2c30c42349dfa1482b2bdf14782ce43e | [
"MIT"
] | null | null | null | Python/5KYU/MaximumSubArraySum.py | CasperKristiansson/Code-Wars-Challenges | 5ffe276d2c30c42349dfa1482b2bdf14782ce43e | [
"MIT"
] | null | null | null | Python/5KYU/MaximumSubArraySum.py | CasperKristiansson/Code-Wars-Challenges | 5ffe276d2c30c42349dfa1482b2bdf14782ce43e | [
"MIT"
] | null | null | null | # https://www.codewars.com/kata/54521e9ec8e60bc4de000d6c/train/python
def max_sequence(arr):
total = 0
for i in range(len(arr)):
for j in range(len(arr), -1, -1):
if(sum(arr[i:j + 1]) > total):
total = sum(arr[i:j + 1])
return total
# Other solutions with O(n) time... | 25.1 | 69 | 0.557769 |
ebea0040ccf72c6b0fe73cc7514aea5681a38acb | 2,060 | py | Python | setup.py | raviraina/pybagit | 86ac67038f57d350dd823c0878328376554b2838 | [
"MIT"
] | null | null | null | setup.py | raviraina/pybagit | 86ac67038f57d350dd823c0878328376554b2838 | [
"MIT"
] | null | null | null | setup.py | raviraina/pybagit | 86ac67038f57d350dd823c0878328376554b2838 | [
"MIT"
] | 1 | 2021-06-07T19:26:01.000Z | 2021-06-07T19:26:01.000Z | try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
longdesc = """
PyBagIt Version 1.5.3
This module helps with creating an managing BagIt-compliant packages. It has
been created to confo... | 27.837838 | 77 | 0.707282 |
9d7c00120a66fb09c07e5619c2544cbe96451947 | 135,435 | py | Python | src/sage/plot/plot.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/plot/plot.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/plot/plot.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | r"""
2D Plotting
Sage provides extensive 2D plotting functionality. The underlying
rendering is done using the matplotlib Python library.
The following graphics primitives are supported:
- :func:`~sage.plot.arrow.arrow` - an arrow from a min point to a max point.
- :func:`~sage.plot.circle.circle` - a circle wit... | 34.461832 | 411 | 0.588917 |
5211f4da0aaad5f64aa281de472912921aa52214 | 2,558 | py | Python | examples/kernel_lsq.py | joshuagornall/jax | c97cd0a526c12ad81988fd58c1c66df4ddd71813 | [
"ECL-2.0",
"Apache-2.0"
] | 17,375 | 2018-11-18T02:15:55.000Z | 2022-03-31T23:49:46.000Z | examples/kernel_lsq.py | joshuagornall/jax | c97cd0a526c12ad81988fd58c1c66df4ddd71813 | [
"ECL-2.0",
"Apache-2.0"
] | 5,018 | 2018-11-22T17:04:07.000Z | 2022-03-31T23:36:25.000Z | examples/kernel_lsq.py | joshuagornall/jax | c97cd0a526c12ad81988fd58c1c66df4ddd71813 | [
"ECL-2.0",
"Apache-2.0"
] | 1,805 | 2018-11-21T10:13:53.000Z | 2022-03-31T23:49:19.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 26.371134 | 74 | 0.685301 |
76ce937377293eda6b9e042c19c685b83a4560d9 | 3,047 | py | Python | tests/afftc_test.py | huonw/sisfft-py | 3cf048022c6641a9c5d60b6db01734fa414e6d7b | [
"MIT"
] | 3 | 2018-10-25T20:52:22.000Z | 2020-07-30T03:19:10.000Z | tests/afftc_test.py | huonw/sisfft-py | 3cf048022c6641a9c5d60b6db01734fa414e6d7b | [
"MIT"
] | null | null | null | tests/afftc_test.py | huonw/sisfft-py | 3cf048022c6641a9c5d60b6db01734fa414e6d7b | [
"MIT"
] | 1 | 2020-05-19T02:59:46.000Z | 2020-05-19T02:59:46.000Z | import numpy as np
import unittest
from sisfft.timer import timer
import sisfft
afftc = sisfft._afftc
#logging.basicConfig(level = logging.INFO)
TEST_REPEATS = 20
TEST_LENGTH = 100
def afftc_(self, beta, delta):
np.random.seed(1)
for _ in range(0, TEST_REPEATS):
v1 = np.random.rand(TEST_LENGTH)
... | 32.763441 | 91 | 0.585822 |
f25b36d42f024b2e081de613c712e84097ae3ad5 | 2,528 | py | Python | thermo/utils/amm.py | janosh/thermo | 0202a47ec8abacfd49b065ddd13ad060b0b9a1a3 | [
"MIT"
] | 9 | 2019-10-08T20:47:30.000Z | 2021-11-20T07:51:25.000Z | thermo/utils/amm.py | janosh/thermo | 0202a47ec8abacfd49b065ddd13ad060b0b9a1a3 | [
"MIT"
] | 4 | 2021-12-10T12:42:20.000Z | 2022-03-01T21:24:18.000Z | thermo/utils/amm.py | janosh/thermo | 0202a47ec8abacfd49b065ddd13ad060b0b9a1a3 | [
"MIT"
] | 3 | 2019-10-28T21:50:24.000Z | 2021-11-10T18:41:20.000Z | import os
import automatminer as amm
import matminer as mm
from automatminer import MatPipe # make MatPipe importable from this file
from thermo.utils.decorators import interruptable
try:
os.remove(os.getcwd() + "/automatminer.log") # delete since not needed
except FileNotFoundError:
pass
featurizers = {... | 33.706667 | 87 | 0.719146 |
925bf7375266f131aec790cdc8df5fbb5a19848a | 22,121 | py | Python | tests/tensorflow/test_transformations.py | generalova-kate/nncf | a2ec7bca7167318c5b1436199a4c7449a9c064e9 | [
"Apache-2.0"
] | null | null | null | tests/tensorflow/test_transformations.py | generalova-kate/nncf | a2ec7bca7167318c5b1436199a4c7449a9c064e9 | [
"Apache-2.0"
] | 1 | 2021-07-23T07:46:52.000Z | 2021-07-23T07:46:52.000Z | tests/tensorflow/test_transformations.py | generalova-kate/nncf | a2ec7bca7167318c5b1436199a4c7449a9c064e9 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 38.139655 | 112 | 0.692012 |
c3d9f0f2a63c243e086caa7277f1ace625824093 | 3,285 | py | Python | experiment_Bayesian_CNN/demo/refactor_debug_dataset.py | slds-lmu/paper_2019_variationalResampleDistributionShift | 3664eea4d243eb828d13ba69112308630d80d244 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-12T02:54:57.000Z | 2021-07-12T02:54:57.000Z | experiment_Bayesian_CNN/demo/refactor_debug_dataset.py | compstat-lmu/paper_2019_variationalResampleDistributionShift | 3664eea4d243eb828d13ba69112308630d80d244 | [
"Apache-2.0",
"MIT"
] | 20 | 2020-01-28T22:18:55.000Z | 2021-09-08T01:21:52.000Z | experiment_Bayesian_CNN/demo/refactor_debug_dataset.py | slds-lmu/paper_2019_variationalResampleDistributionShift | 3664eea4d243eb828d13ba69112308630d80d244 | [
"Apache-2.0",
"MIT"
] | 2 | 2019-12-14T09:17:47.000Z | 2020-02-24T16:55:07.000Z | import torchvision
import torchvision.transforms as transforms
import torch
import torch.utils.data as data
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
import refactor_dataset_class
import Bayesian_config as ... | 38.197674 | 160 | 0.755251 |
f427efc3a5218b4f9de2b1ee3fb1882dddc4edaa | 5,878 | py | Python | docs/source/conf.py | keipertk/Utilities | 5b0ab5e20f374bc7f790523a8548fdcfddcfa311 | [
"Apache-2.0"
] | 1 | 2019-09-29T16:52:01.000Z | 2019-09-29T16:52:01.000Z | docs/source/conf.py | keipertk/Utilities | 5b0ab5e20f374bc7f790523a8548fdcfddcfa311 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | keipertk/Utilities | 5b0ab5e20f374bc7f790523a8548fdcfddcfa311 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
import os
# -- Project information ---------------------------------------... | 31.265957 | 80 | 0.625383 |
c056a8f48224599a4183ee559856fc7501519f5d | 1,296 | py | Python | backend/images/migrations/0001_initial.py | sophiedophie/djangoproject | bad22a6eef032d86cbfe16886bebd4bac948e60c | [
"MIT"
] | null | null | null | backend/images/migrations/0001_initial.py | sophiedophie/djangoproject | bad22a6eef032d86cbfe16886bebd4bac948e60c | [
"MIT"
] | null | null | null | backend/images/migrations/0001_initial.py | sophiedophie/djangoproject | bad22a6eef032d86cbfe16886bebd4bac948e60c | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-04-25 05:42
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(... | 31.609756 | 114 | 0.525463 |
08aceca45ffae227bcd37d63cac9e326c2cf2c59 | 1,973 | py | Python | classes/contrib/mypy/validation/validate_typeclass_def.py | ftaebi/classes | 28d25861ce476adc8259b491492d53c627095d0b | [
"BSD-2-Clause"
] | 475 | 2019-11-03T07:48:43.000Z | 2022-03-29T12:22:44.000Z | classes/contrib/mypy/validation/validate_typeclass_def.py | AVIPAGHADAR1729/classes | ab5ea9f1b3cdbcf87d1f6f4115ed8f42a6cb8700 | [
"BSD-2-Clause"
] | 305 | 2019-11-18T11:52:16.000Z | 2022-03-31T20:11:51.000Z | classes/contrib/mypy/validation/validate_typeclass_def.py | AVIPAGHADAR1729/classes | ab5ea9f1b3cdbcf87d1f6f4115ed8f42a6cb8700 | [
"BSD-2-Clause"
] | 24 | 2020-02-15T18:57:54.000Z | 2022-03-27T22:46:08.000Z | from typing import Union
from mypy.nodes import (
ARG_POS,
EllipsisExpr,
ExpressionStmt,
FuncDef,
PassStmt,
StrExpr,
)
from mypy.plugin import FunctionContext, MethodContext
from mypy.types import CallableType, Instance
from typing_extensions import Final
_Contexts = Union[MethodContext, Funct... | 24.358025 | 73 | 0.657375 |
e3e462e7d14b9bec6530a1b2b4614e2028881032 | 8,095 | py | Python | darwinpush/messagefactories/xml/ScheduleXMLMessageFactory.py | fasteroute/darwinpush | c919049e076cbdf61007fc9cc1c5a0271cde7929 | [
"Apache-2.0"
] | 3 | 2015-08-15T15:38:06.000Z | 2019-08-06T11:09:32.000Z | darwinpush/messagefactories/xml/ScheduleXMLMessageFactory.py | grundleborg/darwinpush | c919049e076cbdf61007fc9cc1c5a0271cde7929 | [
"Apache-2.0"
] | 34 | 2015-07-22T13:47:16.000Z | 2015-08-12T17:40:23.000Z | darwinpush/messagefactories/xml/ScheduleXMLMessageFactory.py | grundleborg/darwinpush | c919049e076cbdf61007fc9cc1c5a0271cde7929 | [
"Apache-2.0"
] | 1 | 2015-08-30T15:26:24.000Z | 2015-08-30T15:26:24.000Z | from darwinpush.messages.ScheduleMessage import *
from dateutil.parser import *
from darwinpush.utils import timezone_for_date_and_time
from darwinpush.xb.raw.sch import OR, OPOR, IP, OPIP, PP, DT, OPDT
from darwinpush.xb.raw.ct import DisruptionReasonType
from datetime import datetime, timedelta
from dateutil.parse... | 35.977778 | 107 | 0.604818 |
0c4396f1cbe19ed6a3c4d95eaadb364573e181be | 981 | py | Python | tests/test_non_neg_omp.py | swasun/RFOMT | 64ba63c01bd04f4f959d18aff27e245d8fff3403 | [
"MIT"
] | 2 | 2021-12-09T23:44:37.000Z | 2021-12-10T10:09:20.000Z | tests/test_non_neg_omp.py | swasun/RFOMT | 64ba63c01bd04f4f959d18aff27e245d8fff3403 | [
"MIT"
] | null | null | null | tests/test_non_neg_omp.py | swasun/RFOMT | 64ba63c01bd04f4f959d18aff27e245d8fff3403 | [
"MIT"
] | null | null | null | from bolsonaro.models.nn_omp import NonNegativeOrthogonalMatchingPursuit
import numpy as np
def test_binary_classif_omp():
N = 1000
L = 100
T = np.random.rand(N, L)
w_star = np.zeros(L)
w_star[:L//2] = np.abs(np.random.rand(L//2))
T /= np.linalg.norm(T, axis=0)
y = T @ w_star
request... | 29.727273 | 143 | 0.673802 |
b35322a47724dbeaae13e70107f86ad52ee1111c | 731 | py | Python | other/TMP.py | RichardLeeK/MachineLearning | 5d4194dc54e5c25beeaf0d16c249bb07cf622364 | [
"MIT"
] | 1 | 2017-08-17T11:30:26.000Z | 2017-08-17T11:30:26.000Z | other/TMP.py | RichardLeeK/MachineLearning | 5d4194dc54e5c25beeaf0d16c249bb07cf622364 | [
"MIT"
] | null | null | null | other/TMP.py | RichardLeeK/MachineLearning | 5d4194dc54e5c25beeaf0d16c249bb07cf622364 | [
"MIT"
] | null | null | null | file = open('new_sample_0703.csv')
lines = file.readlines()
file.close()
pen = open('features.csv', 'w')
sl = lines[0].split(',')
for s in sl:
if 'SpectralAnalysis' in s:
if 'ABP' in s:
pen.write('Spectral,ABP,'+s+'\n')
elif 'ICP' in s:
pen.write('Spectral,ICP,'+s+'\n')
else:
pen.writ... | 22.151515 | 39 | 0.549932 |
5dcf170248a0bc35c0cd973c7ae6599d22576515 | 1,966 | py | Python | aliyun-python-sdk-ccc/aliyunsdkccc/request/v20200701/ListBriefSkillGroupsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ccc/aliyunsdkccc/request/v20200701/ListBriefSkillGroupsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ccc/aliyunsdkccc/request/v20200701/ListBriefSkillGroupsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | # 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... | 35.107143 | 74 | 0.767548 |
fa2e3d618a07f2d50df51f3916b51f975ee09372 | 3,410 | py | Python | Python/Encrypt credentials/Encryption sample/utils.py | AdamRiddick/PowerBI-Developer-Samples | 4032ffd63f7e3133c2320d23dbdb0e7fbb782a37 | [
"MIT"
] | 611 | 2019-05-09T04:56:36.000Z | 2022-03-28T07:48:57.000Z | Python/Encrypt credentials/Encryption sample/utils.py | AdamRiddick/PowerBI-Developer-Samples | 4032ffd63f7e3133c2320d23dbdb0e7fbb782a37 | [
"MIT"
] | 56 | 2017-03-06T12:05:26.000Z | 2019-04-29T22:52:29.000Z | Python/Encrypt credentials/Encryption sample/utils.py | AdamRiddick/PowerBI-Developer-Samples | 4032ffd63f7e3133c2320d23dbdb0e7fbb782a37 | [
"MIT"
] | 599 | 2019-05-08T07:01:04.000Z | 2022-03-29T21:45:55.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
cred_types = {
'KEY': 'Key',
'WINDOWS': 'Windows',
'OAUTH2': 'OAuth2',
'BASIC': 'Basic'
}
class Utils:
def validate_config(app):
''' Returns a message to user for missing configuration
Args:
app... | 39.651163 | 129 | 0.585924 |
77c82bc5f3adb6e0bae8a57e6d62f8f9c689df71 | 22,045 | py | Python | hummingbird/ml/convert.py | rathijit/hummingbird | b634a4e5152757af2ff7a41059b3e52c8140fc04 | [
"MIT"
] | 1 | 2021-05-13T19:14:04.000Z | 2021-05-13T19:14:04.000Z | hummingbird/ml/convert.py | hsaputra/hummingbird | 0ebd6be58880615bc86eab3648056682b40de614 | [
"MIT"
] | null | null | null | hummingbird/ml/convert.py | hsaputra/hummingbird | 0ebd6be58880615bc86eab3648056682b40de614 | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
Hummi... | 46.804671 | 154 | 0.664096 |
a8ffff137f86ceca07334836a572d1025a1574c0 | 874 | py | Python | build/lib/swaglyrics/spotify.py | MatejMecka/SwagLyrics-For-Spotify | 74e329ce675f977ade490846f7faadd064c96380 | [
"MIT"
] | 1 | 2019-05-23T20:24:05.000Z | 2019-05-23T20:24:05.000Z | swaglyrics/spotify.py | MatejMecka/SwagLyrics-For-Spotify | 74e329ce675f977ade490846f7faadd064c96380 | [
"MIT"
] | null | null | null | swaglyrics/spotify.py | MatejMecka/SwagLyrics-For-Spotify | 74e329ce675f977ade490846f7faadd064c96380 | [
"MIT"
] | null | null | null | import win32gui
def get_info_windows():
windows = []
# Older Spotify versions - simply FindWindow for "SpotifyMainWindow"
windows.append(win32gui.GetWindowText(win32gui.FindWindow("SpotifyMainWindow", None)))
# Newer Spotify versions - create an EnumHandler for EnumWindows and flood the list with Chrome_WidgetW... | 21.317073 | 109 | 0.726545 |
6c359d5f59caabc6b12bd5ba1cc82e28b9aec304 | 8,183 | py | Python | mapry/cpp/generate/jsoncpp_header.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 11 | 2019-06-26T05:56:41.000Z | 2021-03-28T16:44:16.000Z | mapry/cpp/generate/jsoncpp_header.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 4 | 2019-10-18T14:43:59.000Z | 2020-04-02T19:12:07.000Z | mapry/cpp/generate/jsoncpp_header.py | Parquery/mapry | 93515307f9eba8447fe64b0ac7cc68b2d07205a7 | [
"MIT"
] | 3 | 2019-06-17T07:39:03.000Z | 2020-04-01T14:01:23.000Z | """Generate the header for de/serialization from/to Jsoncpp values."""
from typing import List, Sequence, Set, Union # pylint: disable=unused-import
from icontract import ensure
import mapry
import mapry.cpp.generate
import mapry.cpp.jinja2_env
import mapry.cpp.naming
import mapry.indention
@ensure(lambda result:... | 32.472222 | 79 | 0.649884 |
50f6eafaa84195f1646bdcd734976dd3705c091c | 641 | py | Python | beginner/02-list-overlap.py | chaudha4/python-projects | baba3235069b7d6b084f28904f0662c043762175 | [
"MIT"
] | null | null | null | beginner/02-list-overlap.py | chaudha4/python-projects | baba3235069b7d6b084f28904f0662c043762175 | [
"MIT"
] | 3 | 2021-11-23T22:19:19.000Z | 2022-03-12T00:52:34.000Z | beginner/02-list-overlap.py | chaudha4/python-projects | baba3235069b7d6b084f28904f0662c043762175 | [
"MIT"
] | null | null | null | """
Take two lists, say for example these two:
a = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
and write a program that returns a list that contains only the elements that are common between the lists
"""
a = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9,... | 22.103448 | 105 | 0.555382 |
f7f2dfdf55f1fde84f99c713b689479454f6e33f | 46,209 | py | Python | salt/modules/win_service.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_service.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_service.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Windows Service module.
.. versionchanged:: 2016.11.0 - Rewritten to use PyWin32
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import fnmatch
import logging
import re
import time
import salt.utils.path
# Import Salt libs
import salt.ut... | 30.90903 | 96 | 0.618819 |
7ca5e303d6e6b0a70f58133627907a26479fa67d | 637 | py | Python | sdapis/migrations/0021_auto_20211023_2104.py | mmtahir-dev/cmput404-socialdistribution | a5a4749c8d9c27ccd062e33be5a4fb2f76697394 | [
"MIT"
] | null | null | null | sdapis/migrations/0021_auto_20211023_2104.py | mmtahir-dev/cmput404-socialdistribution | a5a4749c8d9c27ccd062e33be5a4fb2f76697394 | [
"MIT"
] | 49 | 2021-09-28T21:52:40.000Z | 2021-10-03T22:35:49.000Z | sdapis/migrations/0021_auto_20211023_2104.py | mmtahir-dev/cmput404-socialdistribution | a5a4749c8d9c27ccd062e33be5a4fb2f76697394 | [
"MIT"
] | 1 | 2021-09-27T03:20:36.000Z | 2021-09-27T03:20:36.000Z | # Generated by Django 3.2.8 on 2021-10-24 03:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sdapis', '0020_post_post_id'),
]
operations = [
migrations.RemoveField(
... | 25.48 | 142 | 0.627943 |
30ef77d4215d0bcf60c119a08389ff59a69bafec | 1,870 | py | Python | loss.py | dropinky/GroupProject | dcf22adffb6e7767ba30ab227bbf2c8b1ede770e | [
"MIT"
] | null | null | null | loss.py | dropinky/GroupProject | dcf22adffb6e7767ba30ab227bbf2c8b1ede770e | [
"MIT"
] | null | null | null | loss.py | dropinky/GroupProject | dcf22adffb6e7767ba30ab227bbf2c8b1ede770e | [
"MIT"
] | null | null | null | import torch
from torch import nn
import torch.nn.functional as F
from torchvision import models
class VGG16FeatureExtractor(nn.Module):
def __init__(self):
super().__init__()
vgg16 = models.vgg16(pretrained=True)
self.enc_1 = nn.Sequential(*vgg16.features[:5])
self.enc_2 = nn.Se... | 30.655738 | 132 | 0.611765 |
e7ce425f8e8fc0a2a5cd159ade471d27999bb459 | 728 | py | Python | uw-plugins/php/uwsgiplugin.py | jyotikamboj/container | a2abba963b06429c82025f7479b2ae41e8d3a56f | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-01-14T10:58:43.000Z | 2019-01-14T10:58:43.000Z | uw-plugins/php/uwsgiplugin.py | jyotikamboj/container | a2abba963b06429c82025f7479b2ae41e8d3a56f | [
"MIT",
"BSD-3-Clause"
] | null | null | null | uw-plugins/php/uwsgiplugin.py | jyotikamboj/container | a2abba963b06429c82025f7479b2ae41e8d3a56f | [
"MIT",
"BSD-3-Clause"
] | null | null | null | import os
NAME='php'
ld_run_path = None
PHPPATH = 'php-config'
phpdir = os.environ.get('UWSGICONFIG_PHPDIR')
if phpdir:
ld_run_path = "%s/lib" % phpdir
PHPPATH = "%s/bin/php-config" % phpdir
PHPPATH = os.environ.get('UWSGICONFIG_PHPPATH', PHPPATH)
CFLAGS = [os.popen(PHPPATH + ' --includes').read().rstrip()... | 25.103448 | 81 | 0.671703 |
76415fb86d287dcc4cf3ecce5eea95627b632b9c | 2,981 | py | Python | demo/BERT/helpers/convert_weights.py | kevinch-nv/TensorRT | 73225b9acef41426ec7ef00578f8de985899726b | [
"Apache-2.0"
] | 3 | 2019-11-18T14:04:41.000Z | 2020-06-19T07:35:19.000Z | demo/BERT/helpers/convert_weights.py | kevinch-nv/TensorRT | 73225b9acef41426ec7ef00578f8de985899726b | [
"Apache-2.0"
] | null | null | null | demo/BERT/helpers/convert_weights.py | kevinch-nv/TensorRT | 73225b9acef41426ec7ef00578f8de985899726b | [
"Apache-2.0"
] | 1 | 2019-12-11T01:43:05.000Z | 2019-12-11T01:43:05.000Z | #!/usr/bin/env python3
# Copyright (c) 2019, NVIDIA CORPORATION. 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
#
# ... | 40.283784 | 166 | 0.684334 |
cd3f77985d426e29e36091e06b448642a9d381a3 | 2,922 | py | Python | ancestries.py | shendi-project/shendi | 30a1c0dd29f123269a5fb31caccaf113a94f6ddf | [
"MIT"
] | 3 | 2020-09-02T16:57:16.000Z | 2021-08-22T06:23:39.000Z | ancestries.py | shendi-project/shendi | 30a1c0dd29f123269a5fb31caccaf113a94f6ddf | [
"MIT"
] | 29 | 2020-09-13T13:34:16.000Z | 2020-09-22T11:42:06.000Z | ancestries.py | shendi-project/shendi | 30a1c0dd29f123269a5fb31caccaf113a94f6ddf | [
"MIT"
] | null | null | null | import json
import nethysdb
# I don't know if this is useful, but for now I am leaving it here just in case
class Ancestry(nethysdb.NethysDB):
def __init__(self, link, SourceBook, Page, name, description, YouMight, OthersProbably, PhysicalDescription, Society, AlignmentAndReligion, Adventurers, Names, Hitpoints, S... | 36.987342 | 231 | 0.697125 |
633eed290af5325eec448b70aa18483dc95e05f8 | 263,640 | py | Python | autoprotocol/protocol.py | sreetejreddy/autoprotocol-python | ce32b1c86b0e0e2719931bad39c522ea6ba34a63 | [
"BSD-3-Clause"
] | null | null | null | autoprotocol/protocol.py | sreetejreddy/autoprotocol-python | ce32b1c86b0e0e2719931bad39c522ea6ba34a63 | [
"BSD-3-Clause"
] | null | null | null | autoprotocol/protocol.py | sreetejreddy/autoprotocol-python | ce32b1c86b0e0e2719931bad39c522ea6ba34a63 | [
"BSD-3-Clause"
] | null | null | null | """
Module containing the main `Protocol` object and associated functions
:copyright: 2020 by The Autoprotocol Development Team, see AUTHORS
for more details.
:license: BSD, see LICENSE for more details
"""
import warnings
from .constants import AGAR_CLLD_THRESHOLD, SPREAD_PATH
from .container impor... | 35.550162 | 212 | 0.488905 |
c28ca180cf30536f8896dcfd8956ae8d688e844a | 1,397 | py | Python | sims/s279/plot-jz-extent.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 1 | 2019-12-19T16:21:13.000Z | 2019-12-19T16:21:13.000Z | sims/s279/plot-jz-extent.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | null | null | null | sims/s279/plot-jz-extent.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 2 | 2020-01-08T06:23:33.000Z | 2020-01-08T07:06:50.000Z | import numpy
from pylab import *
import tables
rc('text', usetex=True)
def findXloc(X, fx, val):
cross = []
for i in range(X.shape[0]-1):
if val>fx[i] and val<fx[i+1]:
cross.append(0.5*(X[i]+X[i+1]))
elif val<fx[i] and val>fx[i+1]:
cross.append(0.5*(X[i]+X[i+1])) ... | 22.532258 | 65 | 0.600573 |
f2ece11d0132b9ad0967de59fc926acad68c4053 | 5,492 | py | Python | options/base_options.py | KshingWang/LesionSeg | a3c38aa7481eb7ce6a3b0fe5f9c4b349b8cf0b19 | [
"BSD-3-Clause"
] | 16 | 2020-02-22T02:05:07.000Z | 2021-11-18T14:34:53.000Z | options/base_options.py | KshingWang/LesionSeg | a3c38aa7481eb7ce6a3b0fe5f9c4b349b8cf0b19 | [
"BSD-3-Clause"
] | 9 | 2020-04-30T13:53:39.000Z | 2021-12-15T09:43:26.000Z | options/base_options.py | KshingWang/LesionSeg | a3c38aa7481eb7ce6a3b0fe5f9c4b349b8cf0b19 | [
"BSD-3-Clause"
] | 7 | 2020-02-22T18:25:23.000Z | 2022-01-26T12:06:53.000Z | import argparse
import os
from util import util
import torch
import models
import data
from configurations import *
class BaseOptions():
def __init__(self):
self.initialized = False
def initialize(self, parser):
parser.add_argument('--dataroot', default=PATH_DATASET)
parser.add_argume... | 50.385321 | 223 | 0.641843 |
7f7904395c8a63fe6e64f48c53bf10491a6ef52b | 7,540 | py | Python | 20180617/CombineStackingAndCatBoostKfold/Feature.py | fengjiaxin/Home_Credit_Default_Risk | 3407e76b4e5cfb8dd6056d24675b80fe0e82c123 | [
"Apache-2.0"
] | 26 | 2018-06-13T07:34:16.000Z | 2020-12-07T16:38:25.000Z | 20180617/CombineStackingAndCatBoostKfold/Feature.py | fengjiaxin/Home_Credit_Default_Risk | 3407e76b4e5cfb8dd6056d24675b80fe0e82c123 | [
"Apache-2.0"
] | 1 | 2019-05-02T12:48:31.000Z | 2019-05-25T09:06:22.000Z | 20180617/CombineStackingAndCatBoostKfold/Feature.py | fengjiaxin/Home_Credit_Default_Risk | 3407e76b4e5cfb8dd6056d24675b80fe0e82c123 | [
"Apache-2.0"
] | 6 | 2018-08-02T11:03:33.000Z | 2021-11-09T10:42:11.000Z | # coding:utf-8
import os
import gc
import sys
import importlib
import pandas as pd
from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.ensemble import GradientBoostingClassifier
from xgboost import XGBClassifier
from s... | 39.89418 | 129 | 0.627188 |
819f84abee150481cc46d06b7de8fe299786ef61 | 5,998 | py | Python | model.py | Yuibooo/pytorch-soft-actor-critic | cc17d0732712c404a8a2adc102aab00da0d7c87b | [
"MIT"
] | null | null | null | model.py | Yuibooo/pytorch-soft-actor-critic | cc17d0732712c404a8a2adc102aab00da0d7c87b | [
"MIT"
] | null | null | null | model.py | Yuibooo/pytorch-soft-actor-critic | cc17d0732712c404a8a2adc102aab00da0d7c87b | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
LOG_SIG_MAX = 2
LOG_SIG_MIN = -20
epsilon = 1e-6
# Initialize Policy weights
def weights_init_(m):
if isinstance(m, nn.Linear):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.c... | 33.50838 | 84 | 0.621207 |
e82d5dce623b7b6329497fb5da7586095a07a36c | 22,215 | py | Python | openks/distributed/openks_distributed/gpu/GPUDistributed.py | HIT-SCIR-xuanxuan/OpenKS | a7f2ce0890822113322aad22e98d6c961e63caef | [
"Apache-2.0"
] | 88 | 2020-07-13T05:36:59.000Z | 2022-03-17T21:30:44.000Z | openks/distributed/openks_distributed/gpu/GPUDistributed.py | HIT-SCIR-xuanxuan/OpenKS | a7f2ce0890822113322aad22e98d6c961e63caef | [
"Apache-2.0"
] | 16 | 2021-04-25T03:04:10.000Z | 2022-02-07T02:36:29.000Z | openks/distributed/openks_distributed/gpu/GPUDistributed.py | HIT-SCIR-xuanxuan/OpenKS | a7f2ce0890822113322aad22e98d6c961e63caef | [
"Apache-2.0"
] | 35 | 2020-11-13T15:49:43.000Z | 2022-03-30T07:55:07.000Z | # Copyright (c) 2020 Room 525 Research Group, Zhejiang University.
# All Rights Reserved.
import logging
import paddle.fluid as fluid
import paddle.fluid.io as io
import paddle.fluid.transpiler.distribute_transpiler as dist_transpiler
from paddle.fluid.executor import Executor
from paddle.fluid.parallel_... | 38.434256 | 113 | 0.588026 |
83c0cb455d4a0461ca241652c69e54f15837b488 | 2,069 | py | Python | src/preprocess/vipcup_dicom2nifty.py | cmlab-mira/MedicalPro | 3918c95197fd24406ce2117cc7ff9ce21bb8c620 | [
"MIT"
] | 6 | 2020-02-01T07:19:32.000Z | 2021-05-10T13:55:49.000Z | src/preprocess/vipcup_dicom2nifty.py | cmlab-mira/MedicalPro | 3918c95197fd24406ce2117cc7ff9ce21bb8c620 | [
"MIT"
] | 1 | 2020-06-21T08:33:35.000Z | 2020-06-21T08:33:35.000Z | src/preprocess/vipcup_dicom2nifty.py | cmlab-mira/MedicalPro | 3918c95197fd24406ce2117cc7ff9ce21bb8c620 | [
"MIT"
] | 1 | 2020-11-11T06:24:12.000Z | 2020-11-11T06:24:12.000Z | import logging
import argparse
from pathlib import Path
import dicom2nifti
def main(args):
data_dir = args.data_dir
output_dir = args.output_dir
if output_dir.exists() is False:
output_dir.mkdir(parents=True)
for sub_dir in data_dir.iterdir():
dir_name = sub_dir.name
(output... | 36.946429 | 106 | 0.550507 |
4e6ca70ae0267d7b862cfff119419ebcab36f5b7 | 38,844 | py | Python | GPT2RGA.py | asigalov61/Lars-Ulrich-Challenge | 381880fac426e91954ae0c58448041ead4bdffb2 | [
"Apache-2.0"
] | 6 | 2021-10-09T14:12:10.000Z | 2022-01-25T06:14:46.000Z | GPT2RGA.py | asigalov61/Lars-Ulrich-Challenge | 381880fac426e91954ae0c58448041ead4bdffb2 | [
"Apache-2.0"
] | 1 | 2022-03-27T12:22:39.000Z | 2022-03-27T12:22:39.000Z | GPT2RGA.py | asigalov61/Lars-Ulrich-Challenge | 381880fac426e91954ae0c58448041ead4bdffb2 | [
"Apache-2.0"
] | 2 | 2021-10-09T14:12:17.000Z | 2021-11-04T00:57:07.000Z | #! /usr/bin/python3
r'''###############################################################################
###################################################################################
#
#
# GPT-2 with Relative Global Attention
# Version 0.5
#
# PLEASE NOTE THAT THIS IS A WORK IN PROGRESS
# CHECK BACK FOR UPDATES S... | 37.458052 | 140 | 0.571877 |
6caa1b3e4d44ad185c35d31e48a8de0dc13ff07b | 3,991 | py | Python | alipay/aop/api/request/AlipayOpenMiniDeploypackageQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayOpenMiniDeploypackageQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayOpenMiniDeploypackageQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayOpenMiniDeploypackageQueryModel import AlipayOpenMiniDeploypackageQueryModel
class AlipayOpenMiniDeploypackageQueryRequest(obj... | 27.524138 | 148 | 0.646455 |
8c8a7e91a09e3679b6d7166ed50dde4b9defb052 | 1,229 | py | Python | pyrival/strings/hashing.py | tusshar2000/PyRival | 1d4b29e264088978243a9e72e4bc603acc1fee11 | [
"Apache-2.0"
] | 3 | 2020-05-07T10:48:11.000Z | 2020-08-15T08:31:40.000Z | pyrival/strings/hashing.py | dipta007/PyRival | 4763ce2e1a931438194ea9c5aebc28ef7535c4bc | [
"Apache-2.0"
] | null | null | null | pyrival/strings/hashing.py | dipta007/PyRival | 4763ce2e1a931438194ea9c5aebc28ef7535c4bc | [
"Apache-2.0"
] | 2 | 2021-05-22T13:45:06.000Z | 2022-03-06T18:22:05.000Z | import random
HMOD = 2147483647
HBASE1 = random.randrange(HMOD)
HBASE2 = random.randrange(HMOD)
class Hashing:
def __init__(self, s, mod=HMOD, base1=HBASE1, base2=HBASE2):
self.mod, self.base1, self.base2 = mod, base1, base2
self._len = _len = len(s)
f_hash, s_hash = [0] * (_len + 1), [0]... | 40.966667 | 118 | 0.585028 |
70d7553dc15bd3713ac246afb86a928af7c7e1d6 | 7,890 | py | Python | backend/a_list_33817/settings.py | crowdbotics-apps/a-list-33817 | c220a0e3192bf0573ff504e3ecb26adaa8e1ff42 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/a_list_33817/settings.py | crowdbotics-apps/a-list-33817 | c220a0e3192bf0573ff504e3ecb26adaa8e1ff42 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/a_list_33817/settings.py | crowdbotics-apps/a-list-33817 | c220a0e3192bf0573ff504e3ecb26adaa8e1ff42 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for a_list_33817 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import ... | 30.346154 | 112 | 0.736502 |
7647cd81df62920d836e52b8e914d6b255e43dab | 3,670 | py | Python | non-tts-utilities/ttslua-file-generator/lib/deckutil.py | larikk/TTS-YGO | 8c1718a01e97e9e972ba0c16c47d14c56354b5d5 | [
"MIT"
] | null | null | null | non-tts-utilities/ttslua-file-generator/lib/deckutil.py | larikk/TTS-YGO | 8c1718a01e97e9e972ba0c16c47d14c56354b5d5 | [
"MIT"
] | null | null | null | non-tts-utilities/ttslua-file-generator/lib/deckutil.py | larikk/TTS-YGO | 8c1718a01e97e9e972ba0c16c47d14c56354b5d5 | [
"MIT"
] | null | null | null | import requests
from functools import cmp_to_key
def printDeck(deck):
print("Name", deck['name'])
print("Code", deck['code'])
print("Date", deck['release-date'])
print("Image", deck['image'])
if 'next' in deck:
print("Next", deck['next'])
cards = ""
for card in deck['cards']:
... | 24.965986 | 108 | 0.546322 |
3c362ddad8056e5809e8c76c215c503aab497437 | 2,177 | py | Python | flowx/imbound/_interface/visco/_interface/_redistance_solid.py | Balaras-Group/flowX | 29c1d6209abbfab553997b557794e4d7b06a09a8 | [
"BSD-3-Clause"
] | null | null | null | flowx/imbound/_interface/visco/_interface/_redistance_solid.py | Balaras-Group/flowX | 29c1d6209abbfab553997b557794e4d7b06a09a8 | [
"BSD-3-Clause"
] | 7 | 2020-03-05T20:39:32.000Z | 2020-03-13T01:11:26.000Z | flowx/imbound/_interface/visco/_interface/_redistance_solid.py | Balaras-Group/flowX | 29c1d6209abbfab553997b557794e4d7b06a09a8 | [
"BSD-3-Clause"
] | 1 | 2020-03-09T17:38:00.000Z | 2020-03-09T17:38:00.000Z | import numpy
from numba import jit
def redistance_solid(s, soo, dt, dx, dy, nx, ny):
_jit_redistance_solid(s, soo, dt, dx, dy, nx, ny)
return
@jit(nopython=True)
def _jit_redistance_solid(s, soo, dt, dx, dy, nx, ny):
eps = 1e-14
sgn = soo / numpy.abs(soo + eps)
so = numpy.copy(s)
s[:, :... | 26.228916 | 66 | 0.35232 |
ae65e5f190182de9d6144faa2b51c78075e49d5b | 12,946 | py | Python | fed_experiment.py | LGNRoy/TSFL | bc2a53637bf1c662646815f07e56da41c0466e0e | [
"MIT"
] | null | null | null | fed_experiment.py | LGNRoy/TSFL | bc2a53637bf1c662646815f07e56da41c0466e0e | [
"MIT"
] | null | null | null | fed_experiment.py | LGNRoy/TSFL | bc2a53637bf1c662646815f07e56da41c0466e0e | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import pickle
import torch.utils.data
import torch.nn as nn
from GCN_model.utlis.utils import *
from utils import *
from DataTransformer import transform
def add_args(parser):
"""
parser : argparse.ArgumentParser
return a parser added with args required by ... | 40.080495 | 196 | 0.596941 |
3b94ea132d8d82fdfc9f92dd9539d52ddc3ff2f2 | 7,015 | py | Python | third_party/maya/lib/pxrUsdMayaGL/testenv/testProxyShapeLiveSurface.py | YuqiaoZhang/USD | bf3a21e6e049486441440ebf8c0387db2538d096 | [
"BSD-2-Clause"
] | 88 | 2018-07-13T01:22:00.000Z | 2022-01-16T22:15:27.000Z | third_party/maya/lib/pxrUsdMayaGL/testenv/testProxyShapeLiveSurface.py | YuqiaoZhang/USD | bf3a21e6e049486441440ebf8c0387db2538d096 | [
"BSD-2-Clause"
] | 1 | 2020-07-07T22:39:42.000Z | 2020-07-07T22:39:42.000Z | third_party/maya/lib/pxrUsdMayaGL/testenv/testProxyShapeLiveSurface.py | YuqiaoZhang/USD | bf3a21e6e049486441440ebf8c0387db2538d096 | [
"BSD-2-Clause"
] | 26 | 2018-06-06T03:39:22.000Z | 2021-08-28T23:02:42.000Z | #!/pxrpythonsubst
#
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 37.31383 | 80 | 0.673557 |
7232bc1c958207c5977daa5aeda123682d01a739 | 4,017 | py | Python | generate_csr.py | pagopa/le-azure-acme-tiny | eb1e6a08af72bcc17a971f101c94223093889fb1 | [
"MIT"
] | null | null | null | generate_csr.py | pagopa/le-azure-acme-tiny | eb1e6a08af72bcc17a971f101c94223093889fb1 | [
"MIT"
] | null | null | null | generate_csr.py | pagopa/le-azure-acme-tiny | eb1e6a08af72bcc17a971f101c94223093889fb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import logging
import textwrap
import sys
import cryptography.hazmat.primitives
import cryptography.x509
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.StreamHandler())
LOGGER.setLevel(logging.INFO)
def get_csr(common_name, out, keyout, rsa_key_size):
log... | 36.189189 | 112 | 0.669156 |
4b028708c31ecb3d0a7d4a47ab3ba64a875dc025 | 10,708 | py | Python | GNN/gnn.py | BrandonBian/OSDR-GNN | 0f631d5ddad77df7260c11de3507af014f9447ed | [
"MIT"
] | null | null | null | GNN/gnn.py | BrandonBian/OSDR-GNN | 0f631d5ddad77df7260c11de3507af014f9447ed | [
"MIT"
] | null | null | null | GNN/gnn.py | BrandonBian/OSDR-GNN | 0f631d5ddad77df7260c11de3507af014f9447ed | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn.inits import glorot
from torch_geometric.nn import MessagePassing
from torch_geometric.utils import add_self_loops, softmax, degree
class GIN(MessagePassing):
def __init__(self, emb_dim):
super(GIN, self).__init__()... | 40.407547 | 115 | 0.631117 |
253ae8541403b78175a056e3981770d02ec2b4a9 | 17,584 | py | Python | patrickstar/core/preprocess.py | zhuzilin/PatrickStar | 72daf8dbded07e03d911db6369b075c9bfcd5245 | [
"BSD-3-Clause"
] | null | null | null | patrickstar/core/preprocess.py | zhuzilin/PatrickStar | 72daf8dbded07e03d911db6369b075c9bfcd5245 | [
"BSD-3-Clause"
] | 2 | 2022-03-15T06:57:11.000Z | 2022-03-15T07:55:31.000Z | patrickstar/core/preprocess.py | zhuzilin/PatrickStar | 72daf8dbded07e03d911db6369b075c9bfcd5245 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. 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 copyrig... | 40.422989 | 96 | 0.618574 |
f6338d6b5b80188124ec43f4abcef9d222552160 | 2,370 | py | Python | track_model/train_track_model.py | QUVA-Lab/lang-tracker | 6cb3630471765565b6f2d34a160f0cd51d95a082 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2017-09-13T13:40:59.000Z | 2022-01-25T16:55:19.000Z | track_model/train_track_model.py | zhenyangli/lang-tracker | dddd808a22582573ab0a5e4c3dbf0ba054e42d61 | [
"BSD-3-Clause"
] | 4 | 2017-09-14T01:56:58.000Z | 2021-01-28T00:58:58.000Z | track_model/train_track_model.py | QUVA-Lab/lang-tracker | 6cb3630471765565b6f2d34a160f0cd51d95a082 | [
"BSD-2-Clause-FreeBSD"
] | 9 | 2017-09-28T03:22:08.000Z | 2021-01-19T10:56:44.000Z | import caffe
import numpy as np
import os
import sys
import track_model_train as track_model
import train_config
def compute_accuracy(scores, labels):
is_pos = (labels != 0)
is_neg = np.logical_not(is_pos)
num_all = labels.shape[0]
num_pos = np.sum(is_pos)
num_neg = num_all - num_pos
is_corre... | 35.909091 | 91 | 0.662447 |
e1dcda2647bcaf756ef5188b8343f9bd78166957 | 55,989 | py | Python | python/ccxt/liquid.py | ive-a-dream/ccxt | 1c6ec43f6d577f95610f5e4c01354bb91e8633c1 | [
"MIT"
] | null | null | null | python/ccxt/liquid.py | ive-a-dream/ccxt | 1c6ec43f6d577f95610f5e4c01354bb91e8633c1 | [
"MIT"
] | null | null | null | python/ccxt/liquid.py | ive-a-dream/ccxt | 1c6ec43f6d577f95610f5e4c01354bb91e8633c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 41.229013 | 143 | 0.452089 |
48fd769824ccc88a2917568eb9b92054c317dde7 | 1,319 | py | Python | micropython/examples/pico_display/demo.py | jpwsutton/pimoroni-pico | 2dd70029deca9e19362f4ad6134b8361915f6129 | [
"MIT"
] | null | null | null | micropython/examples/pico_display/demo.py | jpwsutton/pimoroni-pico | 2dd70029deca9e19362f4ad6134b8361915f6129 | [
"MIT"
] | null | null | null | micropython/examples/pico_display/demo.py | jpwsutton/pimoroni-pico | 2dd70029deca9e19362f4ad6134b8361915f6129 | [
"MIT"
] | null | null | null | import time, random
import picodisplay as display
WIDTH = 240
HEIGHT = 135
display_buffer = bytearray(WIDTH * HEIGHT)
display.init(display_buffer)
display.set_backlight(1.0)
i = 0
width = display.get_width()
height = display.get_height()
class Ball:
def __init__(self, x, y, r, dx, dy, pen):
... | 24.425926 | 115 | 0.526914 |
7259396d5574ceea129c1b009bcdf6fcc2691416 | 14,757 | py | Python | cengal/io/net_io/versions/v_0/net_io_abstract.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | 3 | 2018-07-23T18:48:58.000Z | 2021-07-18T14:17:20.000Z | cengal/io/net_io/versions/v_0/net_io_abstract.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | null | null | null | cengal/io/net_io/versions/v_0/net_io_abstract.py | FI-Mihej/Cengal | 516b9780da6ccc9168f8f89d7ba13dc29e24bc0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright © 2016 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>
#
# 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.a... | 34.969194 | 120 | 0.659213 |
58232ae7d6fdc1ebc32a23850fc3b2016e22af2b | 2,037 | py | Python | webtool/server/migrations/0027_booklet.py | wodo/WebTool3 | 1582a03d619434d8a6139f705a1b5860e9b5b8b8 | [
"BSD-2-Clause"
] | 13 | 2018-12-16T21:01:24.000Z | 2019-07-03T06:23:41.000Z | webtool/server/migrations/0027_booklet.py | dav-kempten/WebTool3 | 859f39df67cb0f853c7fe33cb5d08b999d8692fc | [
"BSD-2-Clause"
] | 26 | 2019-07-07T06:44:06.000Z | 2021-09-07T07:28:34.000Z | webtool/server/migrations/0027_booklet.py | dav-kempten/WebTool3 | 859f39df67cb0f853c7fe33cb5d08b999d8692fc | [
"BSD-2-Clause"
] | 3 | 2017-06-18T06:22:52.000Z | 2019-07-03T06:21:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-12-11 07:33
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('server', '0026_auto_20181211_0526'),
]... | 53.605263 | 209 | 0.633775 |
6c3a3d4ae4f4c46fc9dafb815c9cd2a3e33c81da | 6,730 | py | Python | main.py | royd1990/DD2424-Project | 2665f81d1ecdbaca257ef4ac18c59b64dd16ae5a | [
"MIT"
] | null | null | null | main.py | royd1990/DD2424-Project | 2665f81d1ecdbaca257ef4ac18c59b64dd16ae5a | [
"MIT"
] | null | null | null | main.py | royd1990/DD2424-Project | 2665f81d1ecdbaca257ef4ac18c59b64dd16ae5a | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
from torch.utils.data import DataLoader
from tqdm import tqdm
import utils
from model import Model
def train(net, data_loader, train_optimizer, temperature, loss_type, tau_plus):
net.train()
total_loss ... | 43.419355 | 125 | 0.645468 |
daf182375541e1f4c66c579ab0d5d361a3779fab | 5,143 | py | Python | tf_agents/bandits/policies/categorical_policy.py | ayansengupta17/agents | c5a2f1f57d4fd0070eb75204aa0b1663de3e2c0a | [
"Apache-2.0"
] | 2 | 2021-10-30T16:57:37.000Z | 2021-11-17T10:21:17.000Z | tf_agents/bandits/policies/categorical_policy.py | ayansengupta17/agents | c5a2f1f57d4fd0070eb75204aa0b1663de3e2c0a | [
"Apache-2.0"
] | null | null | null | tf_agents/bandits/policies/categorical_policy.py | ayansengupta17/agents | c5a2f1f57d4fd0070eb75204aa0b1663de3e2c0a | [
"Apache-2.0"
] | 2 | 2020-06-05T18:38:16.000Z | 2020-07-08T14:41:42.000Z | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 40.496063 | 80 | 0.722341 |
ef5e3d6c3d7165ee77824c43334cfc873c07267d | 1,621 | py | Python | tests/_tests_scripts/z_distributed_12.py | pdanilov/catalyst | 2ede5354b2a02807b3c1c69fc0718351382c8301 | [
"Apache-2.0"
] | null | null | null | tests/_tests_scripts/z_distributed_12.py | pdanilov/catalyst | 2ede5354b2a02807b3c1c69fc0718351382c8301 | [
"Apache-2.0"
] | null | null | null | tests/_tests_scripts/z_distributed_12.py | pdanilov/catalyst | 2ede5354b2a02807b3c1c69fc0718351382c8301 | [
"Apache-2.0"
] | 1 | 2018-12-21T15:56:21.000Z | 2018-12-21T15:56:21.000Z | import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import TensorDataset
from catalyst import dl
class Projector(nn.Module):
"""
Simpler neural network example - Projector.
"""
def __init__(self, input_size: int):
"""
Init method.
Args:
... | 22.205479 | 67 | 0.613819 |
ab83b84922c1fc225ef942f80a56792bbc817273 | 6,558 | py | Python | superset/common/utils.py | ekmixon/superset | 540277ebb108ccaf7937a173f6cfde90f2e72813 | [
"Apache-2.0"
] | 2 | 2021-09-13T07:20:49.000Z | 2021-11-14T20:06:47.000Z | superset/common/utils.py | ekmixon/superset | 540277ebb108ccaf7937a173f6cfde90f2e72813 | [
"Apache-2.0"
] | 62 | 2020-05-06T22:51:53.000Z | 2022-03-28T20:49:17.000Z | superset/common/utils.py | ekmixon/superset | 540277ebb108ccaf7937a173f6cfde90f2e72813 | [
"Apache-2.0"
] | 1 | 2022-02-07T18:59:01.000Z | 2022-02-07T18:59:01.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... | 36.433333 | 85 | 0.619396 |
fe647177db346bfa38f1a0e6396789fab73fdbb2 | 7,889 | py | Python | main.py | iCurlmyster/Nerual-Network-with-Human-Resource-Analytics | a5d94354be6e9cd4f2c24289e257247d367eef89 | [
"Apache-2.0"
] | null | null | null | main.py | iCurlmyster/Nerual-Network-with-Human-Resource-Analytics | a5d94354be6e9cd4f2c24289e257247d367eef89 | [
"Apache-2.0"
] | null | null | null | main.py | iCurlmyster/Nerual-Network-with-Human-Resource-Analytics | a5d94354be6e9cd4f2c24289e257247d367eef89 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import pandas as pd
import numpy as np
import sys
is_verbose = False
do_plot = False
do_relu = False
do_full = False
if len(sys.argv) > 1:
if "-v" in sys.argv:
is_verbose = True
if "-plot" in sys.argv:
do_plot = True
if "-relu" in sys.argv:
do_relu = True
... | 38.671569 | 154 | 0.699708 |
e5e9f7077e8df48cebaddce82e4c3ff48e23328b | 23,373 | py | Python | category_encoders/tests/test_encoders.py | deil87/categorical-encoding | c867aa09343b55cbcb600958542d6e8b0c405d86 | [
"BSD-3-Clause"
] | null | null | null | category_encoders/tests/test_encoders.py | deil87/categorical-encoding | c867aa09343b55cbcb600958542d6e8b0c405d86 | [
"BSD-3-Clause"
] | null | null | null | category_encoders/tests/test_encoders.py | deil87/categorical-encoding | c867aa09343b55cbcb600958542d6e8b0c405d86 | [
"BSD-3-Clause"
] | null | null | null | import doctest
import math
import os
import random
import sklearn
import pandas as pd
import numpy as np
from datetime import timedelta
from sklearn.utils.estimator_checks import check_transformer_general, check_transformers_unfitted
from unittest2 import TestSuite, TextTestRunner, TestCase # or `from unittest import .... | 45.472763 | 148 | 0.591965 |
bbf8ed787af592ca4a5e3d4a3d0585122b0ecab1 | 4,648 | py | Python | tasks/Scrapy/scrapy_official_newspapers/spiders/USFR_1.py | thefirebanks/policy-data-analyzer | 670a4ea72ab71975b84c4a4ec43d573371c4a986 | [
"RSA-MD"
] | 1 | 2021-05-17T02:30:30.000Z | 2021-05-17T02:30:30.000Z | tasks/Scrapy/scrapy_official_newspapers/spiders/USFR_1.py | thefirebanks/policy-data-analyzer | 670a4ea72ab71975b84c4a4ec43d573371c4a986 | [
"RSA-MD"
] | 2 | 2022-01-13T03:44:13.000Z | 2022-03-12T00:57:48.000Z | tasks/Scrapy/scrapy_official_newspapers/spiders/USFR_1.py | thefirebanks/policy-data-analyzer | 670a4ea72ab71975b84c4a4ec43d573371c4a986 | [
"RSA-MD"
] | 1 | 2021-05-16T20:50:38.000Z | 2021-05-16T20:50:38.000Z | import csv
import datetime
import json
import scrapy
from scrapy_official_newspapers.items import ScrapyOfficialNewspapersItem
from scrapy_official_newspapers.spiders import BaseSpider
class USFR_1(BaseSpider):
name = "USFR_1"
country = "USA"
country_code = "US" # You can find the ISO3166 country code here... | 49.978495 | 166 | 0.664587 |
26136898f383904bfd389de08d8eb1ccfb55142f | 1,901 | py | Python | naiivedisjointsets.py | orionsring/basic_python | 2556d1b3d95334f41cf688f61d4e65bbf38e701a | [
"MIT"
] | null | null | null | naiivedisjointsets.py | orionsring/basic_python | 2556d1b3d95334f41cf688f61d4e65bbf38e701a | [
"MIT"
] | null | null | null | naiivedisjointsets.py | orionsring/basic_python | 2556d1b3d95334f41cf688f61d4e65bbf38e701a | [
"MIT"
] | null | null | null | #!/usr/bin/python
import unittest
import disjoint
class Disjoint:
def __init__(self):
self._sets = []
def createSet(self, repr):
self._sets.apend(repr) #
def mergeSets(self, repr1, repr2):
set1 = self.findset(repr1)
set2 = sefl.findSet(repr2)
... | 26.041096 | 88 | 0.533403 |
8f3d090b54ff1fcf7e54a93c88752bb2068ee90c | 831 | py | Python | corehq/apps/sms/handlers/forwarding.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/sms/handlers/forwarding.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/sms/handlers/forwarding.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | null | null | null | from corehq.apps.sms.models import (
ForwardingRule, FORWARD_ALL, FORWARD_BY_KEYWORD,
)
from corehq.apps.sms.api import send_sms_with_backend
def forwarding_handler(v, text, msg):
rules = ForwardingRule.view("sms/forwarding_rule",
key=[v.domain], include_docs=True).all()
text_words = text.upper().s... | 34.625 | 73 | 0.652226 |
26827ada9161bf8a8f937ba561e7037f89c4bae1 | 373 | py | Python | custom/icds_reports/migrations/0144_merge_20191106_1522.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds_reports/migrations/0144_merge_20191106_1522.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | custom/icds_reports/migrations/0144_merge_20191106_1522.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-11-06 15:22
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('icds_reports', '0143_remove_group_by_thr_view'),
('icds_reports', '0143_add_ucrreconciliati... | 21.941176 | 70 | 0.69437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.