hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7962d62973f32fb0547daccafe95307a6ad8d269 | 8,850 | py | Python | modelscript/metamodels/objects/objects.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 1 | 2019-02-22T14:27:06.000Z | 2019-02-22T14:27:06.000Z | modelscript/metamodels/objects/objects.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 4 | 2015-12-18T10:30:02.000Z | 2015-12-18T10:36:28.000Z | modelscript/metamodels/objects/objects.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | null | null | null | # coding=utf-8
"""Metamodel for object models.
"""
from typing import Dict, Text, Optional, Union, List
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from modelscript.megamodels.models import Placeholder
# from modelscript.metamodels.classes.classes import Class
from modelscript.metamodel... | 32.777778 | 144 | 0.583164 |
7962d6ae8ae454f8c460720e8d41db841a0e1e57 | 2,334 | py | Python | src/databases/mongodb_base.py | baboon-king/2c | 2b1093c9f15c713dac51aec5c1244ec285e49782 | [
"Apache-2.0"
] | null | null | null | src/databases/mongodb_base.py | baboon-king/2c | 2b1093c9f15c713dac51aec5c1244ec285e49782 | [
"Apache-2.0"
] | null | null | null | src/databases/mongodb_base.py | baboon-king/2c | 2b1093c9f15c713dac51aec5c1244ec285e49782 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Created by howie.hu at 2021-04-08.
Description:MongoDB 连接类
Changelog: all notable changes to this file will be documented
"""
from pymongo import MongoClient
from src.utils.tools import md5_encryption
class MongodbBase:
"""
Mongodb连接类
"""
_db = {}
_collecti... | 25.933333 | 74 | 0.595116 |
7962d7d19f58f4f654a25f191ddf9b1f832cf9cb | 771 | py | Python | zeus/models/api_token_repository_access.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | zeus/models/api_token_repository_access.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | zeus/models/api_token_repository_access.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | from zeus.config import db
from zeus.constants import Permission
from zeus.db.types import Enum, GUID
from zeus.db.utils import model_repr
class ApiTokenRepositoryAccess(db.Model):
repository_id = db.Column(
GUID, db.ForeignKey("repository.id", ondelete="CASCADE"), primary_key=True
)
api_token_id ... | 36.714286 | 85 | 0.740597 |
7962d7dca7a7386a1c8112081c388d2412c2a2dc | 2,030 | py | Python | tests/test_layers/test_3d/test_3d.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 1,630 | 2021-10-30T01:00:27.000Z | 2022-03-31T23:02:41.000Z | tests/test_layers/test_3d/test_3d.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 166 | 2021-10-30T01:03:01.000Z | 2022-03-31T14:19:07.000Z | tests/test_layers/test_3d/test_3d.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 253 | 2021-10-30T06:10:29.000Z | 2022-03-31T13:30:06.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from functools import partial
import pytest
import torch
import torch.multiprocessing as mp
from colossalai.core import global_context as gpc
from colossalai.initialize import launch
from colossalai.logging import disable_existing_loggers
from colossalai.utils import fre... | 32.222222 | 114 | 0.725616 |
7962d944d3e1f00179526f2f2d1a1f81eb889691 | 805 | py | Python | soko/transporter/views.py | njugunanduati/soko | 0cebe6e4a71ca12be7674e7a6fa579ff53a6773b | [
"BSD-3-Clause"
] | 1 | 2021-05-06T14:54:20.000Z | 2021-05-06T14:54:20.000Z | soko/transporter/views.py | njugunanduati/soko | 0cebe6e4a71ca12be7674e7a6fa579ff53a6773b | [
"BSD-3-Clause"
] | null | null | null | soko/transporter/views.py | njugunanduati/soko | 0cebe6e4a71ca12be7674e7a6fa579ff53a6773b | [
"BSD-3-Clause"
] | 1 | 2021-05-06T14:55:19.000Z | 2021-05-06T14:55:19.000Z | # -*- coding: utf-8 -*-
"""Transporter views."""
from flask import Blueprint, render_template, request, flash, redirect, url_for, send_file
from flask_login import login_required, current_user
from soko.user.models import User, Document
from soko.products.models import Product, ProductSubType, Purchase
from soko.user.... | 30.961538 | 100 | 0.783851 |
7962daaaad863176db5c0a2be17ed0bd90870768 | 118 | py | Python | 4/42.py | Seaoftrees/Session2019 | 86d61f190979ea9be205a3bbde1deac85de26997 | [
"MIT"
] | null | null | null | 4/42.py | Seaoftrees/Session2019 | 86d61f190979ea9be205a3bbde1deac85de26997 | [
"MIT"
] | null | null | null | 4/42.py | Seaoftrees/Session2019 | 86d61f190979ea9be205a3bbde1deac85de26997 | [
"MIT"
] | null | null | null | n = int(input(">> "))
sum = 0
for i in range(n):
sum = sum + (i+1)
print("1 から " + str(n) + " までの和は " + str(sum)) | 16.857143 | 46 | 0.474576 |
7962db470eee969c38aff0040ca419b806560327 | 44 | py | Python | the_game/exceptions.py | gcmac16/the_game | 07c4b3a280eb358ee23d8ce8f70cf490e1813215 | [
"Apache-2.0"
] | null | null | null | the_game/exceptions.py | gcmac16/the_game | 07c4b3a280eb358ee23d8ce8f70cf490e1813215 | [
"Apache-2.0"
] | null | null | null | the_game/exceptions.py | gcmac16/the_game | 07c4b3a280eb358ee23d8ce8f70cf490e1813215 | [
"Apache-2.0"
] | null | null | null | class NoValidMoveError(Exception):
pass
| 14.666667 | 34 | 0.772727 |
7962dd8c4ecfe3e23ce08d780a9771b46385b48c | 7,325 | py | Python | examples/pwr_run/checkpointing/throughput/final1_inverse/job38.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/final1_inverse/job38.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/final1_inverse/job38.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.127193 | 118 | 0.692696 |
7962e07f642276b8c15229189d56289c9b3cc361 | 3,018 | py | Python | src/livestreamer/plugins/viasat.py | kasper93/livestreamer | 5e58cad6a482e145288a58a3e7be94eea79cca43 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2019-02-18T19:52:06.000Z | 2019-02-18T19:52:06.000Z | src/livestreamer/plugins/viasat.py | kasper93/livestreamer | 5e58cad6a482e145288a58a3e7be94eea79cca43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | src/livestreamer/plugins/viasat.py | kasper93/livestreamer | 5e58cad6a482e145288a58a3e7be94eea79cca43 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | """Plugin for Viasat's on demand content sites, such as tv6play.se."""
import re
from livestreamer.exceptions import PluginError
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import StreamMapper, http, validate
from livestreamer.stream import HDSStream, HLSStream, RTMPStream
from livestreamer.ut... | 28.471698 | 85 | 0.60603 |
7962e186875dcb422709cd3c9eeddb4d649c1f72 | 15,270 | py | Python | napoleon/sphinxcontrib/napoleon/__init__.py | djoshea/sphinxcontrib-matlabdomain | f1ae1e6defc206676d4490665c1cfcc4796b9df0 | [
"BSD-2-Clause"
] | 2 | 2017-04-25T17:00:35.000Z | 2021-02-14T03:57:16.000Z | napoleon/sphinxcontrib/napoleon/__init__.py | djoshea/sphinxcontrib-matlabdomain | f1ae1e6defc206676d4490665c1cfcc4796b9df0 | [
"BSD-2-Clause"
] | null | null | null | napoleon/sphinxcontrib/napoleon/__init__.py | djoshea/sphinxcontrib-matlabdomain | f1ae1e6defc206676d4490665c1cfcc4796b9df0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Rob Ruana
# Licensed under the BSD License, see LICENSE file for details.
"""Sphinx napoleon extension -- support for NumPy and Google style docstrings.
"""
import sys
from six import PY2, iteritems
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring... | 35.929412 | 79 | 0.60799 |
7962e2796adf3bd65824131e8851589208182fa0 | 3,620 | py | Python | jsonschema2popo/js/js.py | NyaMisty/JSONSchema2PoPo2 | d5b95fc07fb092268c2e9ea71d259a369bd213df | [
"MIT"
] | 11 | 2020-05-20T12:59:04.000Z | 2021-07-09T20:43:32.000Z | jsonschema2popo/js/js.py | NyaMisty/JSONSchema2PoPo2 | d5b95fc07fb092268c2e9ea71d259a369bd213df | [
"MIT"
] | 11 | 2020-05-14T16:50:54.000Z | 2022-01-04T03:40:04.000Z | jsonschema2popo/js/js.py | NyaMisty/JSONSchema2PoPo2 | d5b95fc07fb092268c2e9ea71d259a369bd213df | [
"MIT"
] | 4 | 2020-09-23T03:09:25.000Z | 2021-05-31T18:56:16.000Z | import argparse
import os
from typing import Union, Dict, Callable, Any
from jsonschema2popo import version
from jsonschema2popo.classes import Definition, ListNode, ReferenceNode, CodeGenPlugin
from jsonschema2popo.jsonschema2popo import string_to_type
from jsonschema2popo.python.python import Python
class JS(CodeG... | 33.831776 | 87 | 0.575967 |
7962e2d4ed65e0f87126ca65657b5d805b1ac6cf | 2,363 | py | Python | profiletool.py | SimpleProxy/myproject02 | 13d0c657e2e324af78467eb2edfae2d22669573f | [
"MIT"
] | 1 | 2020-10-21T21:32:42.000Z | 2020-10-21T21:32:42.000Z | profiletool.py | kelvesc/myproject02 | 13d0c657e2e324af78467eb2edfae2d22669573f | [
"MIT"
] | null | null | null | profiletool.py | kelvesc/myproject02 | 13d0c657e2e324af78467eb2edfae2d22669573f | [
"MIT"
] | null | null | null | #!/bin/python3
# -*- coding: utf-8 -*-
# file name: profiletool.py
# standart libraries
from time import sleep
from time import process_time_ns as timer_ns
# to call the respective routines
import subprocess as ps
# local imports
import pyfactorial as pyf
import mathfactorial as mtf
def _vector():
return range(... | 22.084112 | 59 | 0.611934 |
7962e35d4807e5d0cba83747f5b16f474068f499 | 3,565 | py | Python | tests/test_metacal.py | CosmoStat/autometacal | 974b2711ca9fd840c551fab30b0775ab2e5b0876 | [
"MIT"
] | 4 | 2021-02-11T13:18:09.000Z | 2022-03-02T13:52:20.000Z | tests/test_metacal.py | CosmoStat/autometacal | 974b2711ca9fd840c551fab30b0775ab2e5b0876 | [
"MIT"
] | 36 | 2021-02-11T18:42:10.000Z | 2022-03-29T23:55:49.000Z | tests/test_metacal.py | CosmoStat/autometacal | 974b2711ca9fd840c551fab30b0775ab2e5b0876 | [
"MIT"
] | 1 | 2021-03-11T23:21:05.000Z | 2021-03-11T23:21:05.000Z | # This module tests our implementation against ngmix
import numpy as np
import ngmix
import galsim
import autometacal
from numpy.testing import assert_allclose
# Generate some data, any old data will do
def make_data(rng, noise, shear):
"""
simulate an exponential object with moffat psf
Parameters
---... | 26.804511 | 80 | 0.597195 |
7962e387a3d0ad566f7de893345af401535c1c5d | 1,561 | py | Python | core/characters/shaman.py | TopKeingt/hordes.io-bots | 6b904e8d6ee3955782bfb55154229064b5857bc2 | [
"MIT"
] | 3 | 2019-04-30T23:49:12.000Z | 2019-11-20T06:05:09.000Z | core/characters/shaman.py | ntdkhiem/hordes.io-bots | 6b904e8d6ee3955782bfb55154229064b5857bc2 | [
"MIT"
] | null | null | null | core/characters/shaman.py | ntdkhiem/hordes.io-bots | 6b904e8d6ee3955782bfb55154229064b5857bc2 | [
"MIT"
] | 9 | 2020-01-15T02:02:24.000Z | 2021-11-06T17:03:19.000Z | from core.bot import Bot
class Shaman(Bot):
_skills = {
"attack": {
"1": {
"key": 3,
"name": "Decay",
"cooldown": 0,
"duration": 1.3,
},
"2": {
"key": 2,
"name": "Equilibrate... | 30.607843 | 94 | 0.473414 |
7962e41c8df16f0bdcb6a11d427aac871efbb45a | 3,423 | py | Python | pylark/api_service_drive_sheet_float_image_create.py | chyroc/pylark | a54cce6b814935fd3c72668b262b54c8ee461484 | [
"Apache-2.0"
] | 7 | 2021-08-18T00:42:05.000Z | 2022-03-14T09:49:15.000Z | pylark/api_service_drive_sheet_float_image_create.py | chyroc/pylark | a54cce6b814935fd3c72668b262b54c8ee461484 | [
"Apache-2.0"
] | null | null | null | pylark/api_service_drive_sheet_float_image_create.py | chyroc/pylark | a54cce6b814935fd3c72668b262b54c8ee461484 | [
"Apache-2.0"
] | 1 | 2022-03-14T09:49:20.000Z | 2022-03-14T09:49:20.000Z | # Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class CreateSheetFloatImageReq(object):
spreadsheet_token: str = attr.ib(
default=... | 40.270588 | 119 | 0.65615 |
7962e461f456649f8d9f2c464088f8d28adcf2ba | 44,676 | py | Python | swift/common/db.py | goroxr/swift | 3ff3076ce6648937993e90334b7a9f532b06806c | [
"Apache-2.0"
] | 1,802 | 2015-01-02T11:25:47.000Z | 2022-03-28T15:02:11.000Z | swift/common/db.py | goroxr/swift | 3ff3076ce6648937993e90334b7a9f532b06806c | [
"Apache-2.0"
] | 15 | 2015-01-04T09:12:39.000Z | 2021-04-15T13:05:37.000Z | swift/common/db.py | masoud91/swift | 19b2e3756521d050a95fb2808d4780d52e7be97f | [
"Apache-2.0"
] | 814 | 2015-01-04T15:14:01.000Z | 2022-03-15T00:15:49.000Z | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 38.348498 | 79 | 0.573977 |
7962e52930deff0a6ff73522520ba9794f31b3d2 | 2,132 | py | Python | src/utils/data_processor.py | vineetjohn/ecom-sigir-task-2018 | 1be3d5670912e43cf21090faf3b4f51ac3bbba9f | [
"MIT"
] | 1 | 2018-08-07T12:38:47.000Z | 2018-08-07T12:38:47.000Z | src/utils/data_processor.py | vineetjohn/ecom-sigir-task-2018 | 1be3d5670912e43cf21090faf3b4f51ac3bbba9f | [
"MIT"
] | null | null | null | src/utils/data_processor.py | vineetjohn/ecom-sigir-task-2018 | 1be3d5670912e43cf21090faf3b4f51ac3bbba9f | [
"MIT"
] | null | null | null | import logging
import re
import spacy
from spacy.lang.en import English
from src.config import global_config
from src.utils import stopword_aggregator
logger = logging.getLogger(global_config.logger_name)
def is_valid_token(token):
return len(token) >= 3 and token not in stopword_aggregator.custom_stopwords
... | 31.820896 | 112 | 0.653377 |
7962e57c9409969dce2f26cddbf8400aecb68737 | 511 | py | Python | examples/plot_global_ozone.py | wolfiex/AC_tools | de5b156ddcc01437bf80b4785d6a327b35d67cc6 | [
"Unlicense"
] | 7 | 2016-10-20T14:55:07.000Z | 2022-03-28T15:35:52.000Z | examples/plot_global_ozone.py | wolfiex/AC_tools | de5b156ddcc01437bf80b4785d6a327b35d67cc6 | [
"Unlicense"
] | 44 | 2016-09-23T14:02:51.000Z | 2022-03-24T09:53:50.000Z | examples/plot_global_ozone.py | wolfiex/AC_tools | de5b156ddcc01437bf80b4785d6a327b35d67cc6 | [
"Unlicense"
] | 9 | 2016-10-24T15:33:51.000Z | 2021-08-06T17:52:49.000Z | import AC_tools as AC
# Download the example data if it is not already downloaded.
from AC_tools.Scripts import get_data_files
# Specify the working directory
wd = "../data"
# Get the GeosChem species data from the wd
my_data = AC.get_GC_output(wd, species='O3')
# Get a 2d slice from the 3d array
my_data = my_data... | 20.44 | 60 | 0.735812 |
7962e5c847d404570993f188243c9aa01119ef24 | 756 | py | Python | indico/modules/events/requests/util.py | UNOG-Indico/UNOG-Indico-v2 | 4fa4393cc1f3b453a69f5e0ea3b52c18337831a5 | [
"MIT"
] | null | null | null | indico/modules/events/requests/util.py | UNOG-Indico/UNOG-Indico-v2 | 4fa4393cc1f3b453a69f5e0ea3b52c18337831a5 | [
"MIT"
] | null | null | null | indico/modules/events/requests/util.py | UNOG-Indico/UNOG-Indico-v2 | 4fa4393cc1f3b453a69f5e0ea3b52c18337831a5 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.core import signals
from indico.util.signals import n... | 31.5 | 111 | 0.761905 |
7962e60bc5f2d58636ed3238f0e4d07bf6c8d2d6 | 2,201 | py | Python | drms/utils.py | exoticDFT/drms | c4d11749139249d7e8808d40747b830116a18f48 | [
"BSD-2-Clause"
] | 10 | 2018-03-06T01:34:22.000Z | 2022-02-22T03:35:10.000Z | drms/utils.py | exoticDFT/drms | c4d11749139249d7e8808d40747b830116a18f48 | [
"BSD-2-Clause"
] | 33 | 2018-08-23T10:17:05.000Z | 2021-09-23T17:45:47.000Z | drms/utils.py | exoticDFT/drms | c4d11749139249d7e8808d40747b830116a18f48 | [
"BSD-2-Clause"
] | 15 | 2018-03-05T17:27:49.000Z | 2021-05-10T22:49:42.000Z | import re
import numpy as np
import pandas as pd
__all__ = ['to_datetime']
def _pd_to_datetime_coerce(arg):
return pd.to_datetime(arg, errors='coerce')
def _pd_to_numeric_coerce(arg):
return pd.to_numeric(arg, errors='coerce')
def _split_arg(arg):
"""
Split a comma-separated string into a list.
... | 29.346667 | 72 | 0.647887 |
7962e68da2fd6f1ce11b586ed4f3536e52e97eb9 | 3,387 | py | Python | example/neural-style/end_to_end/gen_v3.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | 399 | 2017-05-30T05:12:48.000Z | 2022-01-29T05:53:08.000Z | example/neural-style/end_to_end/gen_v3.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | 58 | 2017-05-30T23:25:32.000Z | 2019-11-18T09:30:54.000Z | example/neural-style/end_to_end/gen_v3.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | 107 | 2017-05-30T05:53:22.000Z | 2021-06-24T02:43:31.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... | 37.633333 | 112 | 0.647476 |
7962e68da6de8454b063962e97ba4e5bf37f1008 | 5,943 | py | Python | skfem/assembly/basis/interior_basis.py | HadrienNU/scikit-fem | 39d4cff53790725a865b1f2256dd3358c9ca878e | [
"BSD-3-Clause"
] | null | null | null | skfem/assembly/basis/interior_basis.py | HadrienNU/scikit-fem | 39d4cff53790725a865b1f2256dd3358c9ca878e | [
"BSD-3-Clause"
] | null | null | null | skfem/assembly/basis/interior_basis.py | HadrienNU/scikit-fem | 39d4cff53790725a865b1f2256dd3358c9ca878e | [
"BSD-3-Clause"
] | null | null | null | from typing import Callable, Optional, Tuple
import numpy as np
from numpy import ndarray
from scipy.sparse import coo_matrix
from skfem.element import DiscreteField, Element
from skfem.mapping import Mapping
from skfem.mesh import Mesh
from .basis import Basis
class InteriorBasis(Basis):
"""Basis functions eva... | 33.96 | 80 | 0.535083 |
7962e72938fb594987a2c092df87603dc74d4272 | 3,032 | py | Python | caption_generator/prepare_dataset.py | intohole/caption_generator | 1bdd87d3c77dce6fb75e12391ade2778b15c0895 | [
"MIT"
] | null | null | null | caption_generator/prepare_dataset.py | intohole/caption_generator | 1bdd87d3c77dce6fb75e12391ade2778b15c0895 | [
"MIT"
] | null | null | null | caption_generator/prepare_dataset.py | intohole/caption_generator | 1bdd87d3c77dce6fb75e12391ade2778b15c0895 | [
"MIT"
] | null | null | null | # coding=utf-8
import pickle
from keras.preprocessing import image
from vgg16 import VGG16
import numpy as np
from keras.applications.imagenet_utils import preprocess_input
import os
CUR_DIR = os.path.dirname(__file__)
counter = 0
def load_image(path):
img = image.load_img(path, target_size=... | 32.602151 | 103 | 0.618074 |
7962e76efc30425be8cea96caa56c4ccf14e3722 | 2,369 | py | Python | src/mygrad/nnet/activations/selu.py | Zac-HD/MyGrad | fbc375d28842e1af1ebaf62ca6da479609a6baf6 | [
"MIT"
] | null | null | null | src/mygrad/nnet/activations/selu.py | Zac-HD/MyGrad | fbc375d28842e1af1ebaf62ca6da479609a6baf6 | [
"MIT"
] | 2 | 2017-08-02T01:47:51.000Z | 2017-08-12T22:34:50.000Z | src/mygrad/nnet/activations/selu.py | Zac-HD/MyGrad | fbc375d28842e1af1ebaf62ca6da479609a6baf6 | [
"MIT"
] | null | null | null | import numpy as np
from mygrad import Tensor
from mygrad.operation_base import Operation
__all__ = ["selu"]
_ALPHA = 1.6732632423543772848170429916717
_SCALE = 1.0507009873554804934193349852946
class SELU(Operation):
""" Returns the scaled exponential linear activation (SELU) elementwise along x. The SELU is
... | 27.229885 | 96 | 0.592655 |
7962e80195ada365d8f18bee9b9a009f62833260 | 7,840 | py | Python | xonsh/lazyjson.py | caputomarcos/xonsh | 9ca29d8f2aad9f026af23b83fb7263d0fb702b1a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/lazyjson.py | caputomarcos/xonsh | 9ca29d8f2aad9f026af23b83fb7263d0fb702b1a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xonsh/lazyjson.py | caputomarcos/xonsh | 9ca29d8f2aad9f026af23b83fb7263d0fb702b1a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implements a lazy JSON file class that wraps around json data."""
import io
import json
import weakref
import contextlib
import collections.abc as cabc
def _to_json_with_size(obj, offset=0, sort_keys=False):
if isinstance(obj, str):
s = json.dumps(obj)
o = offset
... | 31.36 | 76 | 0.534311 |
7962e80cdafe4031d432835ac5e4e5c88956aff6 | 19,159 | py | Python | nova/virt/vmwareapi/images.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/images.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/images.py | TMaddox/nova | e5c169d15528a8e2eadb8eca668ea0d183cf8648 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# 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://w... | 39.584711 | 79 | 0.625763 |
7962e85c9b1479fe15fae9c16b026b6a52fda9d9 | 5,326 | py | Python | pynn/trainer/adam_ctc.py | quanpn90/SpeechGAN | b2aa923ac40474bd7a6fa2acfd290eb2770e0972 | [
"MIT"
] | 13 | 2019-10-31T01:33:04.000Z | 2022-02-18T11:18:27.000Z | pynn/trainer/adam_ctc.py | quanpn90/SpeechGAN | b2aa923ac40474bd7a6fa2acfd290eb2770e0972 | [
"MIT"
] | 3 | 2019-11-12T01:42:47.000Z | 2021-05-04T07:46:03.000Z | pynn/trainer/adam_ctc.py | quanpn90/SpeechGAN | b2aa923ac40474bd7a6fa2acfd290eb2770e0972 | [
"MIT"
] | 10 | 2019-10-31T06:03:14.000Z | 2022-02-03T11:08:45.000Z | # Copyright 2019 Thai-Son Nguyen
# Licensed under the Apache License, Version 2.0 (the "License")
import time
import math
import os
import copy
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from pynn.util.decoder import Decoder
from .... | 32.084337 | 114 | 0.588059 |
7962e86b80dfdbc0056a34050d17d7f8f0967299 | 3,139 | py | Python | image_utils.py | ricdezen/opstorkbot | 293ee95dc895f7e0811bb181ceb480ac9ecf8341 | [
"MIT"
] | 1 | 2021-04-20T19:38:48.000Z | 2021-04-20T19:38:48.000Z | image_utils.py | ricdezen/opstorkbot | 293ee95dc895f7e0811bb181ceb480ac9ecf8341 | [
"MIT"
] | null | null | null | image_utils.py | ricdezen/opstorkbot | 293ee95dc895f7e0811bb181ceb480ac9ecf8341 | [
"MIT"
] | null | null | null | import os
from typing import Union
from text_utils import get_text_dimensions
from PIL import Image, ImageDraw, ImageFont, ImageStat
def min_resize(image: Image.Image, min_size: int) -> Image.Image:
"""
:param image: An image to resize.
:param min_size: The size of it's smallest dimension.
:return: A ... | 34.119565 | 119 | 0.612934 |
7962e8f086840358a2d4e6b1e11f70c29f609ffd | 808 | py | Python | connectivity_sets.py | jagatiyakeval/archflow | b50e19d6b6a7cadf77b8dccbe712a1c3d3279ec2 | [
"MIT"
] | null | null | null | connectivity_sets.py | jagatiyakeval/archflow | b50e19d6b6a7cadf77b8dccbe712a1c3d3279ec2 | [
"MIT"
] | null | null | null | connectivity_sets.py | jagatiyakeval/archflow | b50e19d6b6a7cadf77b8dccbe712a1c3d3279ec2 | [
"MIT"
] | null | null | null | from itertools import permutations
import common_utils as cmnutils #type:ignore
from pprint import pprint
#TODO adjcency logic is missing FIXIT
def get_pairs_from_point_dict(id_point_dict):
ids_center_dict = {}
ids_lst = []
for ids,points in id_point_dict.items():
ids_center = cmnutils.g... | 38.47619 | 127 | 0.714109 |
7962ea0887c5db5945e9593d82045fb9e830f249 | 10,025 | py | Python | sknetwork/embedding/louvain_embedding.py | abidlabs/scikit-network | 59e95a5c1e3e93dbce21c20282262e21e99acec0 | [
"BSD-3-Clause"
] | null | null | null | sknetwork/embedding/louvain_embedding.py | abidlabs/scikit-network | 59e95a5c1e3e93dbce21c20282262e21e99acec0 | [
"BSD-3-Clause"
] | null | null | null | sknetwork/embedding/louvain_embedding.py | abidlabs/scikit-network | 59e95a5c1e3e93dbce21c20282262e21e99acec0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
"""
Created on Sep 2020
@author: Quentin Lutz <qlutz@enst.fr>
"""
from typing import Optional, Union
import numpy as np
from scipy import sparse
from sknetwork.clustering.louvain import BiLouvain
from sknetwork.embedding.base import BaseBiEmbedding, BaseEmbedding
from sknetwork.... | 39.781746 | 119 | 0.656359 |
7962ebb1a05d703bf2e9e10e75ebc021b5b5dfcb | 1,370 | py | Python | tests/unit/module/staticsite/options/test_components.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | 134 | 2018-02-26T21:35:23.000Z | 2022-03-03T00:30:27.000Z | tests/unit/module/staticsite/options/test_components.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 937 | 2018-03-08T22:04:35.000Z | 2022-03-30T12:21:47.000Z | tests/unit/module/staticsite/options/test_components.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 70 | 2018-02-26T23:48:11.000Z | 2022-03-02T18:44:30.000Z | """Test runway.module.staticsite.options.components."""
# pylint: disable=no-self-use
# pyright: basic
from __future__ import annotations
from runway.module.staticsite.options.components import StaticSiteOptions
from runway.module.staticsite.options.models import (
RunwayStaticSiteModuleOptionsDataModel,
)
MODULE... | 34.25 | 87 | 0.675912 |
7962ec325234a4e79960e8b006c192ef76bdab56 | 10,986 | py | Python | InvenTree/part/forms.py | onurtatli/InvenTree | 4ce479cf97cc62563ab08ed6123d3c6ca28ba6a3 | [
"MIT"
] | null | null | null | InvenTree/part/forms.py | onurtatli/InvenTree | 4ce479cf97cc62563ab08ed6123d3c6ca28ba6a3 | [
"MIT"
] | null | null | null | InvenTree/part/forms.py | onurtatli/InvenTree | 4ce479cf97cc62563ab08ed6123d3c6ca28ba6a3 | [
"MIT"
] | null | null | null | """
Django Forms for interacting with Part objects
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from InvenTree.forms import HelperForm
from InvenTree.helpers import GetExportFormats
from InvenTree.fields import RoundingDecimalFormField
from mptt.fields import TreeNodeChoiceField
from django im... | 28.02551 | 166 | 0.565356 |
7962ecce7530f563cf653a1d742aa16c5d5b1b01 | 5,788 | py | Python | supersid/ftp_to_stanford.py | kunkleb/supersid | 8a682a48f8cd317e40b9b34bb27aa01d22358ed2 | [
"MIT"
] | 4 | 2021-11-10T03:56:26.000Z | 2021-12-12T23:38:14.000Z | supersid/ftp_to_stanford.py | kunkleb/supersid | 8a682a48f8cd317e40b9b34bb27aa01d22358ed2 | [
"MIT"
] | 51 | 2021-09-02T18:07:28.000Z | 2022-03-25T07:21:19.000Z | supersid/ftp_to_stanford.py | kunkleb/supersid | 8a682a48f8cd317e40b9b34bb27aa01d22358ed2 | [
"MIT"
] | 5 | 2021-09-30T07:27:35.000Z | 2021-12-27T18:09:03.000Z | #!/usr/bin/env python3
"""
Send SID data files to Stanford FTP server.
Name: ftp_to_stanford.py
Author: Eric Gibert
Created: 10-08-2012 as send_to_standford.py
Updated: 31-07-2015
Copyright: (c) eric 2012
Licence: <your licence>
Script's Arguments:
-c|--config supersid.cfg : the configurat... | 37.341935 | 79 | 0.559088 |
7962ede126d112abfa573187cadb07530c85b36e | 3,963 | gyp | Python | src/voice_engine.gyp | roisagiv/webrtc-ndk | b22a896d995a5601dade8a26ad20f6eb166bae80 | [
"BSD-3-Clause"
] | 1 | 2019-12-31T10:36:13.000Z | 2019-12-31T10:36:13.000Z | src/voice_engine.gyp | roisagiv/webrtc-ios | 953395a7d7a0922c825edb2304d2e458f3392686 | [
"BSD-3-Clause"
] | null | null | null | src/voice_engine.gyp | roisagiv/webrtc-ios | 953395a7d7a0922c825edb2304d2e458f3392686 | [
"BSD-3-Clause"
] | 4 | 2015-09-16T11:40:39.000Z | 2019-06-10T01:08:46.000Z | # Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 34.46087 | 79 | 0.58592 |
7962ef2dab591ab4af1a5e5dd913adf395ba2703 | 204 | py | Python | examples/choices.py | kootenpv/cliche | e2c10b9d5b4c2596dff174daac9e92df7eb74062 | [
"MIT"
] | 100 | 2020-02-25T07:35:42.000Z | 2022-03-30T14:48:32.000Z | examples/choices.py | kootenpv/mincli | 176a120bd90c5359e3dd6086da2807f7234925df | [
"MIT"
] | 9 | 2020-03-25T00:40:18.000Z | 2022-01-25T01:50:38.000Z | cells/cliche/entrypoints/example/choices.py | GTrunSec/DevSecOps-Cells-Lab | 5f70b60696497d54bb27d3f1d863076e6978c9bf | [
"MIT"
] | 7 | 2020-03-25T00:32:14.000Z | 2022-02-15T03:34:54.000Z | from cliche import cli, main, Choice
# class Color(Enum):
# BLUE = 1
# RED = 2
@cli
def choices(color: Choice("red", "blue") = "red"):
print(color)
if __name__ == "__main__":
main()
| 12.75 | 50 | 0.578431 |
7962ef32ffcce403296f3515deb2157d7ba3932c | 1,804 | py | Python | pyfr/backends/cuda/provider.py | DengSonic/PyFR | dde524ed56f4a4feca376b51db4b21eb6fa4b113 | [
"BSD-3-Clause"
] | 1 | 2020-08-21T02:50:20.000Z | 2020-08-21T02:50:20.000Z | pyfr/backends/cuda/provider.py | synthetik-technologies/PyFR | 9d4d5e96a8a9d5ca47970ec197b251ae8b0ecdda | [
"BSD-3-Clause"
] | null | null | null | pyfr/backends/cuda/provider.py | synthetik-technologies/PyFR | 9d4d5e96a8a9d5ca47970ec197b251ae8b0ecdda | [
"BSD-3-Clause"
] | 1 | 2020-08-21T02:50:17.000Z | 2020-08-21T02:50:17.000Z | # -*- coding: utf-8 -*-
from pycuda import compiler, driver
from pyfr.backends.base import (BaseKernelProvider,
BasePointwiseKernelProvider, ComputeKernel)
import pyfr.backends.cuda.generator as generator
from pyfr.util import memoize
def get_grid_for_block(block, nrow, ncol=1):
... | 32.8 | 76 | 0.615299 |
7962ef5a48bab7d4dbc97dc1ef72264ef60a840e | 286 | py | Python | dynamic_menu/urls.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 8 | 2019-08-27T20:08:22.000Z | 2021-07-23T22:49:47.000Z | dynamic_menu/urls.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 73 | 2020-03-11T18:07:29.000Z | 2022-03-28T18:07:47.000Z | dynamic_menu/urls.py | oil-rope/oil-and-rope | 6d59c87d4809f120417a90c1624952085486bb06 | [
"MIT"
] | 4 | 2020-02-22T19:44:17.000Z | 2022-03-08T09:42:45.000Z | from django.urls import include, path
from . import views
app_name = 'dynamic_menu'
DYNAMIC_MENU_PATTERNS = [
path('create/', views.DynamicMenuCreateView.as_view(), name='create'),
]
urlpatterns = [
path('dynamic_menu/', include((DYNAMIC_MENU_PATTERNS, 'dynamic_menu'))),
]
| 20.428571 | 76 | 0.723776 |
7962f0368cd1603bc0bc06cad622382182d76798 | 133 | py | Python | app/api/__init__.py | jiejiekuawoshuai/jieji-8rKxeQws | c6161038a4ba162ab915cc53fac1b86e280846c8 | [
"MIT"
] | 1 | 2019-11-28T12:55:48.000Z | 2019-11-28T12:55:48.000Z | app/api/__init__.py | jiejiekuawoshuai/jieji-8rKxeQws | c6161038a4ba162ab915cc53fac1b86e280846c8 | [
"MIT"
] | 1 | 2019-12-08T15:44:54.000Z | 2019-12-10T15:10:05.000Z | app/api/__init__.py | jiejiekuawoshuai/jieji-8rKxeQws | c6161038a4ba162ab915cc53fac1b86e280846c8 | [
"MIT"
] | null | null | null | from flask import Blueprint
api = Blueprint('api', __name__)
from.import users, authentication, comments, decorators, errors, posts
| 26.6 | 70 | 0.789474 |
7962f14aa42f5e09ac15735cd2d1116832b5fce4 | 12,310 | py | Python | Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py | Szhang577/Sensitivity_To_Dual_Graph | a52e689422dc5da59437d22e18e7514119a66ee3 | [
"MIT"
] | null | null | null | Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py | Szhang577/Sensitivity_To_Dual_Graph | a52e689422dc5da59437d22e18e7514119a66ee3 | [
"MIT"
] | null | null | null | Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py | Szhang577/Sensitivity_To_Dual_Graph | a52e689422dc5da59437d22e18e7514119a66ee3 | [
"MIT"
] | null | null | null | import math
import random
import tqdm
import copy
import numpy as np
import statistics
import os
import json
from collections import defaultdict
# import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
from functools import partial
import networkx as nx
from gerrychain import MarkovChain, accept
... | 39.329073 | 164 | 0.62169 |
7962f1d15c4156adbf2888862f159c9c7309d962 | 607 | py | Python | internship_4/users/models.py | Zamy97/internship_4 | 6ba131d5feb33593dd96b0366fac1605ee07923c | [
"MIT"
] | null | null | null | internship_4/users/models.py | Zamy97/internship_4 | 6ba131d5feb33593dd96b0366fac1605ee07923c | [
"MIT"
] | null | null | null | internship_4/users/models.py | Zamy97/internship_4 | 6ba131d5feb33593dd96b0366fac1605ee07923c | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
"""Default user for internship_4."""
#: First and last name do not cover name patterns around the globe
... | 28.904762 | 74 | 0.691928 |
7962f302586609b5fa6e994a46180c6aeea7a0fb | 37,752 | py | Python | salt/channel/server.py | lkubb/salt | 48f8cc9dfe30b90b31050a2646bccd4b5a1b7927 | [
"Apache-2.0"
] | null | null | null | salt/channel/server.py | lkubb/salt | 48f8cc9dfe30b90b31050a2646bccd4b5a1b7927 | [
"Apache-2.0"
] | null | null | null | salt/channel/server.py | lkubb/salt | 48f8cc9dfe30b90b31050a2646bccd4b5a1b7927 | [
"Apache-2.0"
] | null | null | null | """
Encapsulate the different transports available to Salt.
This includes server side transport, for the ReqServer and the Publisher
"""
import binascii
import hashlib
import logging
import os
import shutil
import salt.crypt
import salt.ext.tornado.gen
import salt.master
import salt.payload
import salt.transport.fra... | 41.993326 | 95 | 0.518304 |
7962f50ff3c76cf65f1dbca4d5484b2f2a8b50c0 | 6,274 | py | Python | python/cudf/tests/test_replace.py | JinHai-CN/cudf | fd17f2d4cabe86e11e7f172b5b5903bdd5604d81 | [
"Apache-2.0"
] | null | null | null | python/cudf/tests/test_replace.py | JinHai-CN/cudf | fd17f2d4cabe86e11e7f172b5b5903bdd5604d81 | [
"Apache-2.0"
] | null | null | null | python/cudf/tests/test_replace.py | JinHai-CN/cudf | fd17f2d4cabe86e11e7f172b5b5903bdd5604d81 | [
"Apache-2.0"
] | null | null | null | import pytest
import numpy as np
import pandas as pd
from cudf.dataframe import Series, DataFrame
from cudf.tests.utils import assert_eq
def test_series_replace():
a1 = np.array([0, 1, 2, 3, 4])
# Numerical
a2 = np.array([5, 1, 2, 3, 4])
sr1 = Series(a1)
sr2 = sr1.replace(0, 5)
np.testing.a... | 29.317757 | 77 | 0.58065 |
7962f5c74d129164e4ecf406f4e0028359e9b209 | 1,332 | py | Python | 1-6 Algorithmic Toolbox/Week 3/3-2 fractional_knapsack_fast.py | MLunov/Data-Structures-and-Algorithms-Specialization-San-Diego-HSE | 9b9ae1bfa037b1bb7206da768692216a6e30f9ad | [
"MIT"
] | null | null | null | 1-6 Algorithmic Toolbox/Week 3/3-2 fractional_knapsack_fast.py | MLunov/Data-Structures-and-Algorithms-Specialization-San-Diego-HSE | 9b9ae1bfa037b1bb7206da768692216a6e30f9ad | [
"MIT"
] | null | null | null | 1-6 Algorithmic Toolbox/Week 3/3-2 fractional_knapsack_fast.py | MLunov/Data-Structures-and-Algorithms-Specialization-San-Diego-HSE | 9b9ae1bfa037b1bb7206da768692216a6e30f9ad | [
"MIT"
] | null | null | null | # Uses python3
import sys
def mergeSort(myList, w):
n = len(myList)
if n == 1:
return myList, w
a = mergeSort(myList[:int(n / 2)], w[:int(n / 2)])
b = mergeSort(myList[int(n / 2):], w[int(n / 2):])
i, j, c, d = 0, 0, [], []
for k in range(n):
if a[0][i] >= b[0][j]:
... | 26.117647 | 56 | 0.457958 |
7962f6f5509c38fc5471c41a194d81e95a167f64 | 2,588 | py | Python | model_zoo/official/gnn/gcn/src/dataset.py | i4oolish/mindspore | dac3be31d0f2c0a3516200f47af30980e566601b | [
"Apache-2.0"
] | 2 | 2020-08-12T16:14:40.000Z | 2020-12-04T03:05:57.000Z | model_zoo/official/gnn/gcn/src/dataset.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/gnn/gcn/src/dataset.py | dilingsong/mindspore | 4276050f2494cfbf8682560a1647576f859991e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.212121 | 114 | 0.679289 |
7962f71bd8ef24f5c4aeaded3d20ae58e99a80e8 | 14,317 | py | Python | src/util/surreal_in_extrinc.py | ccj5351/hmr_rgbd | d1dcf81d72c11e1f502f2c494cd86425f384d9cc | [
"MIT"
] | null | null | null | src/util/surreal_in_extrinc.py | ccj5351/hmr_rgbd | d1dcf81d72c11e1f502f2c494cd86425f384d9cc | [
"MIT"
] | 1 | 2020-12-09T07:29:00.000Z | 2020-12-09T07:29:00.000Z | src/util/surreal_in_extrinc.py | ccj5351/hmr_rgbd | d1dcf81d72c11e1f502f2c494cd86425f384d9cc | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*-coding:utf-8-*-
# @file: surreal_in_extrinc.py
# @brief:
# @author: Changjiang Cai, ccai1@stevens.edu, caicj5351@gmail.com
# @version: 0.0.1
# @creation date: 03-07-2019
# @last modified: Thu 18 Jul 2019 04:47:09 PM EDT
import numpy as np
import sys,os
import scipy.io as sio
import cv2
impo... | 38.799458 | 139 | 0.554865 |
7962f7a82adf84eb75a1e5fa05cf93d8c22e70c6 | 2,013 | py | Python | helpers/youtube_video_helper.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | 1 | 2019-05-21T08:10:41.000Z | 2019-05-21T08:10:41.000Z | helpers/youtube_video_helper.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | null | null | null | helpers/youtube_video_helper.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | null | null | null | import re
import urllib.parse as urlparse
# taken from TBA because it Just Works (apparently)
class YouTubeVideoHelper:
@classmethod
def parse_id_from_url(cls, youtube_url):
"""
Attempts to parse a URL for the video ID and timestamp (if present)
Returns None if parsing fails
Oth... | 38.711538 | 102 | 0.563835 |
7962f91f7ffb7969c27ff6aafe103aae5f61ec58 | 1,724 | py | Python | JumpscaleCore/servers/corex/CorexServer.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 1 | 2020-06-21T11:18:52.000Z | 2020-06-21T11:18:52.000Z | JumpscaleCore/servers/corex/CorexServer.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 644 | 2019-08-25T10:19:56.000Z | 2020-12-23T09:41:04.000Z | JumpscaleCore/servers/corex/CorexServer.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 11 | 2019-08-29T21:38:50.000Z | 2020-06-21T11:18:55.000Z | import os
from Jumpscale import j
JSConfigClient = j.baseclasses.object_config
class CorexServer(JSConfigClient):
_SCHEMATEXT = """
@url = jumpscale.servers.corex.1
name** = "default" (S)
port = 1500 (I)
user = "" (S)
password = "" (S)
chroot = f... | 29.724138 | 113 | 0.549304 |
7962f9c2533bb91e50bd7282ecc6909c786bf0da | 254 | py | Python | examples/contour.py | bpedersen2/python-gr | 664f83d11c5d710aa27e117cc1c2899fbd5582a7 | [
"RSA-MD"
] | 25 | 2018-02-23T18:11:51.000Z | 2021-02-16T10:06:47.000Z | examples/contour.py | bpedersen2/python-gr | 664f83d11c5d710aa27e117cc1c2899fbd5582a7 | [
"RSA-MD"
] | 29 | 2018-01-24T16:40:53.000Z | 2022-02-21T15:29:48.000Z | examples/contour.py | bpedersen2/python-gr | 664f83d11c5d710aa27e117cc1c2899fbd5582a7 | [
"RSA-MD"
] | 8 | 2017-11-27T10:28:56.000Z | 2021-11-03T13:10:12.000Z | #!/usr/bin/env python
"""
3D contour plot
"""
import os
import time
import numpy as np
from gr.pygr import *
z = np.loadtxt(os.path.join(os.path.dirname(os.path.realpath(__file__)),
"fecr.dat")).reshape(200, 200)
contour(z)
| 18.142857 | 72 | 0.629921 |
7962faa6c976960f985d149b5a140d284d47d3db | 2,363 | py | Python | cabot_ui/src/cabot_ui/status.py | CMU-cabot/cabot | b53874abd2804f23f62dcc8ff97a5ee39d3fe48c | [
"MIT"
] | 14 | 2020-12-05T17:15:57.000Z | 2022-02-09T05:51:09.000Z | cabot_ui/src/cabot_ui/status.py | CMU-cabot/cabot | b53874abd2804f23f62dcc8ff97a5ee39d3fe48c | [
"MIT"
] | 22 | 2021-02-25T06:56:23.000Z | 2022-03-16T13:15:45.000Z | cabot_ui/src/cabot_ui/status.py | CMU-cabot/cabot | b53874abd2804f23f62dcc8ff97a5ee39d3fe48c | [
"MIT"
] | 7 | 2021-01-05T16:07:59.000Z | 2022-03-24T02:48:14.000Z | # Copyright (c) 2020 Carnegie Mellon University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | 33.757143 | 90 | 0.706729 |
7962fab247a8b939c7304b8e4b520b00bdc06a83 | 357,157 | py | Python | src/sage/graphs/graph.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | null | null | null | src/sage/graphs/graph.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | null | null | null | src/sage/graphs/graph.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
Undirected graphs
This module implements functions and operations involving undirected graphs.
{INDEX_OF_METHODS}
AUTHORS:
- Robert L. Miller (2006-10-22): initial version
- William Stein (2006-12-05): Editing
- Robert L. Miller (2007-01-13): refactoring, adjusting for NetworkX-0.33, ... | 37.308785 | 157 | 0.552625 |
7962fad03f974679aaff9e22a99136da8a6a0db7 | 304 | py | Python | codeforces/math数学/800/1367B奇偶性队列.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/800/1367B奇偶性队列.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/800/1367B奇偶性队列.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# https://codeforces.com/problemset/problem/1367/B
n = int(input())
for _ in range(n):
m = int(input())
l = list(map(int,input().split()))
wc = [0,0]
for i in range(m):
if l[i]%2 != i%2:
wc[i%2] += 1
print(-1 if wc[0]!=wc[1] else wc[0])
| 21.714286 | 50 | 0.513158 |
7962fad18b7cd55491cff4fe7df71c95f48640cd | 1,605 | py | Python | tests/unit/test_engines.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 19 | 2016-01-29T14:37:52.000Z | 2022-03-30T18:08:01.000Z | tests/unit/test_engines.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 223 | 2016-03-02T16:39:41.000Z | 2022-03-03T12:26:35.000Z | tests/unit/test_engines.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 64 | 2016-02-04T19:45:26.000Z | 2021-12-15T02:02:31.000Z | # -*- coding: utf-8 -*-
"""
unit tests for the Salt engines
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.config
import salt.engines as engines
import salt.utils.process
from salt.ext import six
from tests.support.helpers import slowTest
from tests.support.mix... | 29.181818 | 72 | 0.645483 |
7962fad2e63da23fd69dd53bd6aca828ba777c2d | 2,871 | py | Python | profiling/tasks.py | yi-syong/Benga | ef8cff66b8853d03c9615ef36d566cec27b9d9fd | [
"MIT"
] | 2 | 2018-10-22T08:02:09.000Z | 2022-03-15T10:58:34.000Z | profiling/tasks.py | yi-syong/Benga | ef8cff66b8853d03c9615ef36d566cec27b9d9fd | [
"MIT"
] | 81 | 2018-10-26T09:02:49.000Z | 2020-10-27T06:30:02.000Z | profiling/tasks.py | yi-syong/Benga | ef8cff66b8853d03c9615ef36d566cec27b9d9fd | [
"MIT"
] | 4 | 2018-10-22T05:18:20.000Z | 2018-10-26T02:13:55.000Z | from __future__ import absolute_import, unicode_literals
import os
import shutil
import zipfile
import pandas as pd
from celery import shared_task
from django.conf import settings
from django.core.files import File
from profiling.serializers import ProfileSerializer
from profiling.models import Batch, Sequence
from s... | 34.590361 | 91 | 0.722745 |
7962fbb674fb9fa58c465ce6d85ca86e2785a353 | 2,896 | py | Python | kratos/python_scripts/assign_vector_variable_to_constraints_process.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | 2 | 2019-10-25T09:28:10.000Z | 2019-11-21T12:51:46.000Z | kratos/python_scripts/assign_vector_variable_to_constraints_process.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | 13 | 2019-10-07T12:06:51.000Z | 2020-02-18T08:48:33.000Z | kratos/python_scripts/assign_vector_variable_to_constraints_process.py | lcirrott/Kratos | 8406e73e0ad214c4f89df4e75e9b29d0eb4a47ea | [
"BSD-4-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Importing the Kratos Library
import KratosMultiphysics
def Factory(settings, Model):
if not isinstance(settings, KratosMultiphysics.Parameters):
raise Exception("expected... | 45.25 | 135 | 0.654351 |
7962fbee5311a22dd05adf1acb992a047cb89b61 | 3,379 | py | Python | fs_stats.py | grimkor/fs_stats | 01cbca388b8e1b2e43b0baa727d69354cd017f7d | [
"MIT"
] | null | null | null | fs_stats.py | grimkor/fs_stats | 01cbca388b8e1b2e43b0baa727d69354cd017f7d | [
"MIT"
] | null | null | null | fs_stats.py | grimkor/fs_stats | 01cbca388b8e1b2e43b0baa727d69354cd017f7d | [
"MIT"
] | 1 | 2020-09-07T22:52:42.000Z | 2020-09-07T22:52:42.000Z | import asyncio
from enum import Enum, auto
import re
import os
import watchgod
import database
OUTPUT_LOG = os.environ['USERPROFILE'] + r'\AppData\LocalLow\Sirlin Games\Fantasy Strike\output_log.txt'
class State(Enum):
GAME_CLOSED = auto()
NO_MATCH = auto()
MATCH = auto()
class StateMachine():
... | 28.158333 | 135 | 0.636875 |
7962fc087345d1c7269c2f037f12388c6416dc78 | 9,136 | py | Python | pandapower/pf/runpf_pypower.py | yougnen/pandapower | d206bd91e68dd03675f7fe8ddee141621ef437fc | [
"BSD-3-Clause"
] | 2 | 2021-01-04T11:41:15.000Z | 2021-01-04T11:41:26.000Z | pandapower/pf/runpf_pypower.py | yougnen/pandapower | d206bd91e68dd03675f7fe8ddee141621ef437fc | [
"BSD-3-Clause"
] | 3 | 2021-03-29T15:14:13.000Z | 2021-05-29T09:29:19.000Z | pandapower/pf/runpf_pypower.py | yougnen/pandapower | d206bd91e68dd03675f7fe8ddee141621ef437fc | [
"BSD-3-Clause"
] | 1 | 2021-01-27T20:47:33.000Z | 2021-01-27T20:47:33.000Z | # -*- coding: utf-8 -*-
# Copyright 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. ... | 39.042735 | 116 | 0.620731 |
7962fca71b1852e39b25f2f634bacd7fcaee4187 | 6,279 | py | Python | venv/Lib/site-packages/dateparser/data/date_translation_data/be.py | realwaynesun/cryptotradedata | 4bd4d3f80438507fbb2b611a9cf451ed1aa2bde1 | [
"MIT"
] | 2 | 2021-03-27T20:11:56.000Z | 2021-05-04T19:34:44.000Z | venv/Lib/site-packages/dateparser/data/date_translation_data/be.py | realwaynesun/cryptotradedata | 4bd4d3f80438507fbb2b611a9cf451ed1aa2bde1 | [
"MIT"
] | 21 | 2021-02-04T01:37:44.000Z | 2022-03-12T01:00:55.000Z | venv/Lib/site-packages/dateparser/data/date_translation_data/be.py | realwaynesun/cryptotradedata | 4bd4d3f80438507fbb2b611a9cf451ed1aa2bde1 | [
"MIT"
] | 1 | 2021-03-27T19:41:10.000Z | 2021-03-27T19:41:10.000Z | info = {
"name": "be",
"date_order": "DMY",
"january": [
"студзень",
"сту",
"студзеня",
"Стд"
],
"february": [
"люты",
"лют",
"лютага"
],
"march": [
"сакавік",
"сак",
"сакавіка"
],
"april": [
"кра... | 18.41349 | 60 | 0.281573 |
7962fcf371fd9d12e5095719d710e6c27c94dc61 | 1,269 | py | Python | core/polyaxon/client/decorators/offline.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | core/polyaxon/client/decorators/offline.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | core/polyaxon/client/decorators/offline.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 27.586957 | 76 | 0.666667 |
7962fd0a3bb6612f38a0894a20953e30a79e7692 | 93 | py | Python | fileOperate/admin.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | 8 | 2020-07-11T14:11:11.000Z | 2022-01-27T05:06:07.000Z | fileOperate/admin.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | null | null | null | fileOperate/admin.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | 4 | 2020-07-11T14:11:17.000Z | 2022-01-27T05:06:11.000Z | from django.contrib import admin
# Register your models here.
admin.site.site_header="后台登录" | 18.6 | 32 | 0.795699 |
7962fd16572c8868bfc34e42020c5dad3a514b61 | 2,278 | py | Python | benchmark/python/benchmark_hail/run/linalg_benchmarks.py | MariusDanner/hail | 5ca0305f8243b5888931b1afaa1fbfb617dee097 | [
"MIT"
] | 1 | 2020-12-03T11:20:22.000Z | 2020-12-03T11:20:22.000Z | benchmark/python/benchmark_hail/run/linalg_benchmarks.py | MariusDanner/hail | 5ca0305f8243b5888931b1afaa1fbfb617dee097 | [
"MIT"
] | null | null | null | benchmark/python/benchmark_hail/run/linalg_benchmarks.py | MariusDanner/hail | 5ca0305f8243b5888931b1afaa1fbfb617dee097 | [
"MIT"
] | null | null | null | import hail as hl
from .utils import benchmark, recursive_delete
@benchmark()
def block_matrix_nested_multiply():
bm = hl.linalg.BlockMatrix.random(8 * 1024, 8 * 1024).checkpoint(hl.utils.new_temp_file(extension='bm'))
path = hl.utils.new_temp_file(extension='bm')
((bm @ bm) @ bm @ bm @ (bm @ bm)).write(... | 30.783784 | 109 | 0.712467 |
7962ff284948fa46c6beeebc14a85cfa3c9ff4c2 | 381 | py | Python | backend/api/resources/common.py | haroldadmin/transportation-analytics-platform | 366891dc422d3a72287b3224fbf5b0daf3d14751 | [
"Apache-2.0"
] | null | null | null | backend/api/resources/common.py | haroldadmin/transportation-analytics-platform | 366891dc422d3a72287b3224fbf5b0daf3d14751 | [
"Apache-2.0"
] | null | null | null | backend/api/resources/common.py | haroldadmin/transportation-analytics-platform | 366891dc422d3a72287b3224fbf5b0daf3d14751 | [
"Apache-2.0"
] | null | null | null | from flask_restplus import reqparse
# This is for documentation purposes in Swagger only
auth_header_parser = reqparse.RequestParser()
auth_header_parser.add_argument('Authorization',
required=True,
help='Authentication access token. E.g.: Bearer <access_... | 42.333333 | 96 | 0.611549 |
7962ff304460c5c927f54d02e1e39fa2053aeb60 | 26,154 | py | Python | PyCommon/modules/Simulator/hpQPSimulator.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | PyCommon/modules/Simulator/hpQPSimulator.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | PyCommon/modules/Simulator/hpQPSimulator.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | from fltk import *
import copy
import numpy as np
import numpy.linalg as npl
import sys
if '..' not in sys.path:
sys.path.append('..')
import Math.mmMath as mm
import Resource.ysMotionLoader as yf
import Simulator.csVpWorld as cvw
import Simulator.csVpModel as cvm
import GUI.ysSimpleViewer as ysv
import Optimizati... | 43.517471 | 189 | 0.614935 |
7962ff3742c18979e32e55d0c40f1619e6cc3c38 | 4,343 | py | Python | Gobang.py | BIOSmode/Gobang | a9d8c24ec738b04159bc8449fd7900c34fe02c4f | [
"MIT"
] | null | null | null | Gobang.py | BIOSmode/Gobang | a9d8c24ec738b04159bc8449fd7900c34fe02c4f | [
"MIT"
] | null | null | null | Gobang.py | BIOSmode/Gobang | a9d8c24ec738b04159bc8449fd7900c34fe02c4f | [
"MIT"
] | null | null | null | # 初始化棋盘
def InitialChckerBoard(row, col):
Cboard = [['[ ]' for i in range(col)] for j in range(row)]
for i in range(row):
Cboard[0][i] = str(i).center(3)
for i in range(col):
Cboard[i][0] = str(i).rjust(3)
return Cboard
# 显示棋盘
def DisplayCheckerBoard(Cboard):
for i in range(n):
... | 29.344595 | 86 | 0.425282 |
7962ffde42f08e01840c551ea2484f8cb19c46dd | 2,452 | py | Python | stringpatcher/stringpatcher.py | 3ev0/toolshed | 3fd5d82ed932f3da487e286433b0a8ec49adcf02 | [
"Apache-2.0"
] | null | null | null | stringpatcher/stringpatcher.py | 3ev0/toolshed | 3fd5d82ed932f3da487e286433b0a8ec49adcf02 | [
"Apache-2.0"
] | null | null | null | stringpatcher/stringpatcher.py | 3ev0/toolshed | 3fd5d82ed932f3da487e286433b0a8ec49adcf02 | [
"Apache-2.0"
] | null | null | null | import binascii
import logging
import subprocess
import sys
import click
encmap = {"s": "ascii",
"S": "utf8",
"l": "utf_16_le",
"b": "utf_16_be",
"L": "utf_32_le",
"B": "utf_32_be"}
@click.group()
def cli():
""" Script to patch strings in (binary) file.
The script works w... | 36.597015 | 191 | 0.56199 |
7963000b1bcc3f31df15116381b1414c64304135 | 5,469 | py | Python | oneflow/python/experimental/interface_op_read_and_write.py | ncnnnnn/oneflow | f6e81f65eed1d87c3125e7a78247cfaa72220020 | [
"Apache-2.0"
] | 1 | 2020-12-24T09:26:36.000Z | 2020-12-24T09:26:36.000Z | oneflow/python/experimental/interface_op_read_and_write.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/experimental/interface_op_read_and_write.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 37.979167 | 85 | 0.704699 |
79630071725d925326e219ae5b3e065f551e9472 | 804 | py | Python | src/auth.py | ExsoKamabay/mail-checker | 320c3fec5734d8067b1a0e84b93c9afcf89f56ca | [
"MIT"
] | 3 | 2021-03-05T19:08:51.000Z | 2022-01-13T15:44:03.000Z | src/auth.py | ExsoKamabay/mail-checker | 320c3fec5734d8067b1a0e84b93c9afcf89f56ca | [
"MIT"
] | 1 | 2021-06-19T20:36:04.000Z | 2021-06-19T20:36:04.000Z | src/auth.py | ExsoKamabay/mail-checker | 320c3fec5734d8067b1a0e84b93c9afcf89f56ca | [
"MIT"
] | null | null | null | """
NeverBounce API Authentication
"""
from requests.auth import AuthBase
__all__ = ['StaticTokenAuth']
class StaticTokenAuth(AuthBase):
"""Uses a static token to authenticate with NeverBounce's API v4
Args:
api_key (str): A static API token for authentication
"""
def __init__(self, api_key)... | 30.923077 | 79 | 0.672886 |
7963013df89f266b691094ca43e403fb263d7206 | 21,068 | py | Python | configs/common/Options.py | mandaltj/gem5_chips | b9c0c602241ffda7851c1afb32fa01f295bb98fd | [
"BSD-3-Clause"
] | 17 | 2019-02-05T03:44:40.000Z | 2022-03-31T07:34:08.000Z | configs/common/Options.py | mandaltj/gem5_chips | b9c0c602241ffda7851c1afb32fa01f295bb98fd | [
"BSD-3-Clause"
] | null | null | null | configs/common/Options.py | mandaltj/gem5_chips | b9c0c602241ffda7851c1afb32fa01f295bb98fd | [
"BSD-3-Clause"
] | 12 | 2019-03-15T06:29:25.000Z | 2022-02-01T19:37:31.000Z | # Copyright (c) 2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | 53.608142 | 131 | 0.619328 |
7963016b75ec7774da48d8b1177cc73bc86419a5 | 3,425 | py | Python | train_enwik8.py | steven-mi/gpt-neox | 4401339dc71c8ea65349da2ade2fa414d3c469bd | [
"MIT"
] | null | null | null | train_enwik8.py | steven-mi/gpt-neox | 4401339dc71c8ea65349da2ade2fa414d3c469bd | [
"MIT"
] | null | null | null | train_enwik8.py | steven-mi/gpt-neox | 4401339dc71c8ea65349da2ade2fa414d3c469bd | [
"MIT"
] | null | null | null | import argparse
import json
import random
from collections import defaultdict
import deepspeed
import torch
from torch.utils.data import DataLoader
from tqdm.auto import trange
from gpt_neox import (GPTNeoX, AutoregressiveWrapper, TextSamplerDataset, download_dataset,
cycle, prepare_optimizer_pa... | 35.309278 | 95 | 0.64438 |
79630205ce92332e66c0afdcd42b4b82c8b69fc0 | 30,764 | py | Python | tests/wallet/test_singleton_lifecycle_fast.py | hashgreen/chia-blockchain | b1acb5597ba242649d1dc97de7fd605148e33816 | [
"Apache-2.0"
] | 2 | 2022-03-22T22:00:46.000Z | 2022-03-22T22:42:45.000Z | tests/wallet/test_singleton_lifecycle_fast.py | zcomputerwiz/experiments-blockchain | 841754b44494451a9e3e537575eeec431fe533d1 | [
"Apache-2.0"
] | 3 | 2022-03-21T22:00:11.000Z | 2022-03-21T22:00:40.000Z | tests/wallet/test_singleton_lifecycle_fast.py | zcomputerwiz/experiments-blockchain | 841754b44494451a9e3e537575eeec431fe533d1 | [
"Apache-2.0"
] | 1 | 2022-03-20T14:51:39.000Z | 2022-03-20T14:51:39.000Z | from dataclasses import dataclass
from typing import Any, Callable, Dict, List, Optional, Tuple
from blspy import G1Element, G2Element
from clvm_tools import binutils
from chia.types.blockchain_format.program import Program, SerializedProgram
from chia.types.announcement import Announcement
from chia.types.blockchain... | 39.901427 | 120 | 0.730984 |
796302f71286d4b5ff11b07b884c11949e29f31c | 239 | py | Python | eventkit_cloud/utils/services/file.py | venicegeo/eventkit-cloud | 3a9a4fbfea54d48387f3f3b2ab6e71946af9ffb2 | [
"BSD-3-Clause"
] | 1 | 2018-03-30T21:01:15.000Z | 2018-03-30T21:01:15.000Z | eventkit_cloud/utils/services/file.py | venicegeo/eventkit-cloud | 3a9a4fbfea54d48387f3f3b2ab6e71946af9ffb2 | [
"BSD-3-Clause"
] | 46 | 2017-06-27T03:12:57.000Z | 2018-12-28T19:48:35.000Z | eventkit_cloud/utils/services/file.py | venicegeo/eventkit-cloud | 3a9a4fbfea54d48387f3f3b2ab6e71946af9ffb2 | [
"BSD-3-Clause"
] | 7 | 2017-07-28T18:16:34.000Z | 2019-01-18T04:41:55.000Z | import requests
from eventkit_cloud.utils.services.base import GisClient
class FileClient(GisClient):
def check_response(self, head_only=True) -> requests.Response:
return super().check_response(head_only=head_only)
| 26.555556 | 67 | 0.757322 |
7963035be1d6bbdd7297c42f11561f1183a146a4 | 433 | py | Python | Lib/test/xmltests.py | deadsnakes/python2.4 | f493d5415b662e99a73d017bcafe2148c5bc8fb5 | [
"PSF-2.0"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | Lib/test/xmltests.py | deadsnakes/python2.4 | f493d5415b662e99a73d017bcafe2148c5bc8fb5 | [
"PSF-2.0"
] | 1 | 2019-09-03T04:11:46.000Z | 2019-09-03T04:11:46.000Z | Lib/test/xmltests.py | deadsnakes/python2.4 | f493d5415b662e99a73d017bcafe2148c5bc8fb5 | [
"PSF-2.0"
] | 3 | 2019-09-04T02:59:01.000Z | 2021-08-23T06:07:28.000Z | # Convenience test module to run all of the XML-related tests in the
# standard library.
import sys
import test.test_support
test.test_support.verbose = 0
def runtest(name):
__import__(name)
module = sys.modules[name]
if hasattr(module, "test_main"):
module.test_main()
runtest("test.test_minidom... | 21.65 | 68 | 0.73903 |
7963039cbb1a4c2ce12def1ff95b567ceac5af5e | 10,443 | py | Python | renthse/provider/centanet.py | warenix/renthse | 17d4ded4b06ce0253be50acfc7a59e6b6fc2aba2 | [
"MIT"
] | 2 | 2015-06-21T06:33:51.000Z | 2015-06-29T05:23:03.000Z | renthse/provider/centanet.py | warenix/renthse | 17d4ded4b06ce0253be50acfc7a59e6b6fc2aba2 | [
"MIT"
] | null | null | null | renthse/provider/centanet.py | warenix/renthse | 17d4ded4b06ce0253be50acfc7a59e6b6fc2aba2 | [
"MIT"
] | null | null | null | import json
import urllib
import urllib2
import time
import re
from renthse.core.db import HousingDB, House, SOURCE_TYPE_CENTANET
from renthse.core.htmlparser import BaseParser
__author__ = 'warenix'
class ParserCentanet(object):
__db = None
__row_count = 0
__cj = None
__opener = None
__cookie ... | 37.836957 | 168 | 0.568611 |
796304016116448080095e93f8d222fb3bf4fe51 | 4,694 | py | Python | pdil/tool/fossil/_lib/space/agnostic.py | Mikfr83/fossil | 5bba97e6ea05bc59a76dae7f6ea11d09fe09e3bf | [
"BSD-3-Clause"
] | null | null | null | pdil/tool/fossil/_lib/space/agnostic.py | Mikfr83/fossil | 5bba97e6ea05bc59a76dae7f6ea11d09fe09e3bf | [
"BSD-3-Clause"
] | null | null | null | pdil/tool/fossil/_lib/space/agnostic.py | Mikfr83/fossil | 5bba97e6ea05bc59a76dae7f6ea11d09fe09e3bf | [
"BSD-3-Clause"
] | null | null | null | '''
These functions provide a single interface to the version specific implementations.
'''
from __future__ import absolute_import, division, print_function
from pymel.core import group, warning
import pdil
from ..._core import find
from . import bidirectional
from . import common
from . import constraintBased
d... | 32.825175 | 126 | 0.694504 |
796304237bcc972c4a1dc1148d81ee610f3b863f | 13 | py | Python | robots/small/strategies/2019/test/test_curve2/t2.py | memristor/mep2 | bc5cddacba3d740f791f3454b8cb51bda83ce202 | [
"MIT"
] | 5 | 2018-11-27T15:15:00.000Z | 2022-02-10T21:44:13.000Z | robots/small/strategies/2019/test/test_curve2/t2.py | memristor/mep2 | bc5cddacba3d740f791f3454b8cb51bda83ce202 | [
"MIT"
] | 2 | 2018-10-20T15:48:40.000Z | 2018-11-20T05:11:33.000Z | robots/small/strategies/2019/test/test_curve2/t2.py | memristor/mep2 | bc5cddacba3d740f791f3454b8cb51bda83ce202 | [
"MIT"
] | 1 | 2020-02-07T12:44:47.000Z | 2020-02-07T12:44:47.000Z | def run():
| 4.333333 | 10 | 0.461538 |
796304ff590732250e8e7a7fa257bc672fec66e6 | 3,380 | py | Python | cupy/_functional/vectorize.py | ameyachawla99/cupy | 43d78a7d6fbbe0d9ca35177a14da31a483a827ef | [
"MIT"
] | null | null | null | cupy/_functional/vectorize.py | ameyachawla99/cupy | 43d78a7d6fbbe0d9ca35177a14da31a483a827ef | [
"MIT"
] | null | null | null | cupy/_functional/vectorize.py | ameyachawla99/cupy | 43d78a7d6fbbe0d9ca35177a14da31a483a827ef | [
"MIT"
] | null | null | null | import numpy
from cupy import core
from cupyx.jit import _interface
from cupyx.jit import _types
def _get_input_type(arg):
if isinstance(arg, int):
return 'l'
if isinstance(arg, float):
return 'd'
if isinstance(arg, complex):
return 'D'
return arg.dtype.char
class vectorize(... | 34.489796 | 79 | 0.581657 |
796305446cd5a5dd463bbfd2513e2124ace19feb | 426 | py | Python | devtools/scripts/build_cookiecutter_json.py | mikemhenry/openfe | d4c78af62a7ae05b99eb95d173661ac134b7e7b9 | [
"MIT"
] | 14 | 2022-01-24T22:01:19.000Z | 2022-03-31T04:58:35.000Z | devtools/scripts/build_cookiecutter_json.py | mikemhenry/openfe | d4c78af62a7ae05b99eb95d173661ac134b7e7b9 | [
"MIT"
] | 109 | 2022-01-24T18:57:05.000Z | 2022-03-31T20:13:07.000Z | devtools/scripts/build_cookiecutter_json.py | mikemhenry/openfe | d4c78af62a7ae05b99eb95d173661ac134b7e7b9 | [
"MIT"
] | 4 | 2022-01-24T18:45:54.000Z | 2022-02-21T06:28:24.000Z | import sys
import json
release_tag = sys.argv[1]
python_version = sys.argv[2]
ci_os = sys.argv[3]
platform_mapping = {
"ubuntu-latest": "linux-64",
"macOS-latest": "osx-64",
}
data = {
"name": "openfe",
"channel": "conda-forge",
"python": [python_version],
"platform": [platform_mapping[ci_os... | 17.75 | 46 | 0.631455 |
7963057d7beb4ffbe4be2e763278530a56fc4406 | 7,873 | py | Python | elegantrl/evaluator.py | Yonv1943/ElegantRL | 5332e154b2b41c440f2bdbc6c5f8fa024d2cccde | [
"Apache-2.0"
] | 236 | 2020-08-12T08:00:56.000Z | 2021-02-09T03:39:26.000Z | elegantrl/evaluator.py | Yonv1943/ElegantRL | 5332e154b2b41c440f2bdbc6c5f8fa024d2cccde | [
"Apache-2.0"
] | 5 | 2020-08-12T16:55:11.000Z | 2021-01-21T05:24:23.000Z | elegantrl/evaluator.py | Yonv1943/ElegantRL | 5332e154b2b41c440f2bdbc6c5f8fa024d2cccde | [
"Apache-2.0"
] | 50 | 2020-08-12T22:41:01.000Z | 2021-02-09T09:09:23.000Z | import os
import time
import torch
import numpy as np
"""[ElegantRL.2021.09.18](https://github.com/AI4Finance-LLC/ElegantRL)"""
class Evaluator:
def __init__(self, cwd, agent_id, device, eval_env, eval_gap, eval_times1, eval_times2, ):
self.recorder = list() # total_step, r_avg, r_std, obj_c, ...
... | 39.762626 | 113 | 0.606884 |
796306395d53f1ea5ce2376af65abaa7e928ea93 | 346 | py | Python | meilisearch/tests/test_health_meilisearch.py | jtmiclat/meilisearch-python | b6a48a62bb64ae58181550a0ddc793dcdc0a2b06 | [
"MIT"
] | null | null | null | meilisearch/tests/test_health_meilisearch.py | jtmiclat/meilisearch-python | b6a48a62bb64ae58181550a0ddc793dcdc0a2b06 | [
"MIT"
] | null | null | null | meilisearch/tests/test_health_meilisearch.py | jtmiclat/meilisearch-python | b6a48a62bb64ae58181550a0ddc793dcdc0a2b06 | [
"MIT"
] | null | null | null | import meilisearch
from meilisearch.tests import BASE_URL, MASTER_KEY
class TestHealth:
client = meilisearch.Client(BASE_URL, MASTER_KEY)
""" health route """
def test_health(self):
"""Tests an API call to check the health of MeiliSearch"""
response = self.client.health()
assert re... | 28.833333 | 66 | 0.696532 |
79630685e9ba60452a7214ef13e6c5d492c218b2 | 8,895 | py | Python | docs/conf.py | prdonahue/lemur | 267159af1950a77fa298275f234d7e458b91dda9 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | prdonahue/lemur | 267159af1950a77fa298275f234d7e458b91dda9 | [
"Apache-2.0"
] | 1 | 2022-03-29T22:05:53.000Z | 2022-03-29T22:05:53.000Z | docs/conf.py | TinLe/lemur | dfb9e3a0c8f8f1f1bd908b1fcb8596af7c65f739 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# lemur documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 7 18:43:48 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 31.767857 | 98 | 0.715458 |
7963068ec87675f77fa5ec5f4eb679d7eea369eb | 3,142 | py | Python | tests/federation/test_schema.py | zefciu/strawberry | a660fccadcd2e3ff4c1be985708a37eb6164c02c | [
"MIT"
] | null | null | null | tests/federation/test_schema.py | zefciu/strawberry | a660fccadcd2e3ff4c1be985708a37eb6164c02c | [
"MIT"
] | null | null | null | tests/federation/test_schema.py | zefciu/strawberry | a660fccadcd2e3ff4c1be985708a37eb6164c02c | [
"MIT"
] | null | null | null | import textwrap
import typing
import strawberry
def test_entities_type_when_no_type_has_keys():
@strawberry.federation.type()
class Product:
upc: str
name: typing.Optional[str]
price: typing.Optional[int]
weight: typing.Optional[int]
@strawberry.federation.type(extend=Tru... | 21.22973 | 77 | 0.540738 |
796306d8375e7592ff7f2dd6ecd302b2d6885eb9 | 30,068 | py | Python | exchangelib/account.py | RossK1/exchangelib | 5550c2fbcc064943e3b4e150f74a724e0bd0a9f3 | [
"BSD-2-Clause"
] | 1,006 | 2016-07-18T16:42:55.000Z | 2022-03-31T10:43:50.000Z | exchangelib/account.py | RossK1/exchangelib | 5550c2fbcc064943e3b4e150f74a724e0bd0a9f3 | [
"BSD-2-Clause"
] | 966 | 2016-05-13T18:55:43.000Z | 2022-03-31T15:24:56.000Z | exchangelib/account.py | RossK1/exchangelib | 5550c2fbcc064943e3b4e150f74a724e0bd0a9f3 | [
"BSD-2-Clause"
] | 272 | 2016-04-05T02:17:10.000Z | 2022-03-24T08:15:57.000Z | from locale import getlocale
from logging import getLogger
from cached_property import threaded_cached_property
from .autodiscover import discover
from .configuration import Configuration
from .credentials import DELEGATE, IMPERSONATION, ACCESS_TYPES
from .errors import UnknownTimeZone
from .ewsdatetime import EWSTim... | 47.351181 | 120 | 0.691599 |
7963081c1a84dd40df6fe72e91b01d957fe1e89b | 683 | bzl | Python | source/bazel/deps/opencv_extra/get.bzl | luxe/CodeLang-compiler | 78837d90bdd09c4b5aabbf0586a5d8f8f0c1e76a | [
"MIT"
] | 1 | 2019-01-06T08:45:46.000Z | 2019-01-06T08:45:46.000Z | source/bazel/deps/opencv_extra/get.bzl | luxe/CodeLang-compiler | 78837d90bdd09c4b5aabbf0586a5d8f8f0c1e76a | [
"MIT"
] | 264 | 2015-11-30T08:34:00.000Z | 2018-06-26T02:28:41.000Z | source/bazel/deps/opencv_extra/get.bzl | UniLang/compiler | c338ee92994600af801033a37dfb2f1a0c9ca897 | [
"MIT"
] | null | null | null | # Do not edit this file directly.
# It was auto-generated by: code/programs/reflexivity/reflexive_refresh
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
def opencvExtra():
http_archive(
name = "opencv_extra",
b... | 40.176471 | 110 | 0.72328 |
796308db5ef93a88b0039fa4a966feb9b378e19c | 805 | py | Python | setup.py | andrewkoltsov/ebs-deploy | 6308dcdb9f2aff8825597c1e02235056235aeb01 | [
"MIT"
] | 54 | 2015-01-09T22:14:01.000Z | 2020-09-09T01:27:31.000Z | setup.py | andrewkoltsov/ebs-deploy | 6308dcdb9f2aff8825597c1e02235056235aeb01 | [
"MIT"
] | 11 | 2015-01-02T21:07:50.000Z | 2019-11-22T21:32:35.000Z | setup.py | andrewkoltsov/ebs-deploy | 6308dcdb9f2aff8825597c1e02235056235aeb01 | [
"MIT"
] | 23 | 2015-01-02T03:14:17.000Z | 2022-01-02T00:11:20.000Z | from setuptools import setup
setup(
# general meta
name='ebs-deploy',
version='2.0.1',
author='Brian C. Dilley',
author_email='brian.dilley@gmail.com',
description='Python based command line tools for managing '
'Amazon Elastic Beanstalk applications.',
platforms='any',
... | 22.361111 | 63 | 0.62236 |
79630928537384d75b7ef4b8e65402de33111122 | 4,706 | py | Python | bot.py | aemreb/telegram_paybot | f973ddd9029f2844901508fa983aa37b6ca93089 | [
"MIT"
] | 2 | 2021-09-17T10:55:14.000Z | 2021-09-17T10:55:38.000Z | bot.py | aemreb/telegram_paybot | f973ddd9029f2844901508fa983aa37b6ca93089 | [
"MIT"
] | null | null | null | bot.py | aemreb/telegram_paybot | f973ddd9029f2844901508fa983aa37b6ca93089 | [
"MIT"
] | 1 | 2021-05-31T18:23:02.000Z | 2021-05-31T18:23:02.000Z | import logging
import psycopg2
from telegram.ext import Updater, CommandHandler
import os
import strings
PORT = int(os.environ.get('PORT', 5000))
TOKEN = os.getenv("API_KEY", "optional-default")
PROJECT_URL = os.getenv("PROJECT_URL", "optional-default")
# Enable logging
logging.basicConfig(
format='%(asctime)s - ... | 27.682353 | 79 | 0.606035 |
79630b8839e196ad7f6a72e593d07acd38b792fc | 482 | py | Python | python/asyncio/coding_dojang/urlopen.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/coding_dojang/urlopen.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/coding_dojang/urlopen.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from time import time
from urllib.request import Request, urlopen
urls = [
"https://www.google.com/search?q=" + i
for i in ["apple", "pear", "grape", "pineapple", "orange", "strawberry", "pie", "helloworld"]
]
begin = time()
result = []
for url in urls:
request = Request(url, headers={"User-Agent": "Mozil... | 24.1 | 97 | 0.636929 |
79630c191204ee90feed05d59cc4a3226e75b1ad | 476 | py | Python | blog/utils/response_code.py | gganduu/blog | bd64015f196da087922a29e6cd6ed8c808187594 | [
"MIT"
] | null | null | null | blog/utils/response_code.py | gganduu/blog | bd64015f196da087922a29e6cd6ed8c808187594 | [
"MIT"
] | null | null | null | blog/utils/response_code.py | gganduu/blog | bd64015f196da087922a29e6cd6ed8c808187594 | [
"MIT"
] | null | null | null | class RETCODE:
OK = "0" #成功
IMAGECODEERR = "4001" #验证码错误
THROTTLINGERR = "4002" #短信发送频繁
NECESSARYPARAMERR = "4003" #缺少必须的参数
USERERR = "4004" #用户错误
PWDERR = "4005" #密码错误
CPWDERR = "4006" #确认密码错误
MOBILEERR ... | 34 | 43 | 0.441176 |
79630c7276fd34f0f54c699d54ce15af39003fee | 194,513 | py | Python | hydrus/client/gui/pages/ClientGUIManagement.py | SiNevesh/hydrus | 39f3a0589e5d9fe665babb7dc7535cf69d4bc582 | [
"WTFPL"
] | null | null | null | hydrus/client/gui/pages/ClientGUIManagement.py | SiNevesh/hydrus | 39f3a0589e5d9fe665babb7dc7535cf69d4bc582 | [
"WTFPL"
] | null | null | null | hydrus/client/gui/pages/ClientGUIManagement.py | SiNevesh/hydrus | 39f3a0589e5d9fe665babb7dc7535cf69d4bc582 | [
"WTFPL"
] | null | null | null | import os
import random
import typing
from qtpy import QtCore as QC
from qtpy import QtWidgets as QW
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusGlobals as HG
from hydrus.core import HydrusSerialisable
from hyd... | 37.500096 | 420 | 0.60161 |
79630ce41a793451316afd02340eda578bd77186 | 2,398 | py | Python | vpd/models/iht/test_grad_iht.py | yanconglin/VanishingPoint_HoughTransform_GaussianSphere | 0926733b1bd58531c0a50216017aa29a4cd18025 | [
"MIT"
] | 7 | 2022-03-17T10:19:12.000Z | 2022-03-31T03:50:29.000Z | vpd/models/iht/test_grad_iht.py | yanconglin/VanishingPoint_HoughTransform_GaussianSphere | 0926733b1bd58531c0a50216017aa29a4cd18025 | [
"MIT"
] | null | null | null | vpd/models/iht/test_grad_iht.py | yanconglin/VanishingPoint_HoughTransform_GaussianSphere | 0926733b1bd58531c0a50216017aa29a4cd18025 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import gradcheck
import random
import numpy as np
import math
import scipy.io as sio
from iht_cuda import IHT_CUDA
from iht_utils import hough_transform
random.seed(0)
np.random.seed(0)
torch.manual_seed(0)
if torch.cuda.is_avai... | 26.94382 | 124 | 0.693912 |
79630d75da12c15318f3dcb9ad5d1fe59fa14fa6 | 376 | py | Python | tests/utils.py | rohankumardubey/structlog | cad14e066c5f181ecebea5d053bec28b8e215e4a | [
"Apache-2.0",
"MIT"
] | 1,751 | 2015-01-04T05:58:49.000Z | 2022-03-31T02:17:29.000Z | tests/utils.py | rohankumardubey/structlog | cad14e066c5f181ecebea5d053bec28b8e215e4a | [
"Apache-2.0",
"MIT"
] | 336 | 2015-01-06T15:42:06.000Z | 2022-03-16T11:31:00.000Z | tests/utils.py | rohankumardubey/structlog | cad14e066c5f181ecebea5d053bec28b8e215e4a | [
"Apache-2.0",
"MIT"
] | 181 | 2015-01-14T14:45:31.000Z | 2022-03-21T23:17:38.000Z | # SPDX-License-Identifier: MIT OR Apache-2.0
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the MIT License. See the LICENSE file in the root of this
# repository for complete details.
"""
Shared test utilities.
"""
from structlog._log_levels import _NAME_TO_LEVEL
stdlib_log... | 26.857143 | 75 | 0.75266 |
79630db50fe13c6c0580b54feaa0e8087655ecb5 | 937 | py | Python | evaljoint.py | bjliaa/ecc | 0d287d524fe2ec6613fe39b2197774695e5636b6 | [
"CC0-1.0"
] | 2 | 2021-01-20T12:25:21.000Z | 2021-09-13T02:40:47.000Z | evaljoint.py | bjliaa/ecc | 0d287d524fe2ec6613fe39b2197774695e5636b6 | [
"CC0-1.0"
] | null | null | null | evaljoint.py | bjliaa/ecc | 0d287d524fe2ec6613fe39b2197774695e5636b6 | [
"CC0-1.0"
] | null | null | null | import argparse
from accord.c51.evaluatorjoint import evaluator
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Evaluate an AvgJointPolicy model')
parser.add_argument('-env', dest='env_str', help="Environment string.")
parser.add_argument('-start',
... | 34.703704 | 78 | 0.565635 |
79630e950e45a780db5dc6ae2bf4463f9f40668a | 7,212 | py | Python | allennlp/modules/seq2seq_encoders/intra_sentence_attention.py | mhagiwara/allennlp | a05add5293f091e9dbcaa9db0783e782d77714cf | [
"Apache-2.0"
] | null | null | null | allennlp/modules/seq2seq_encoders/intra_sentence_attention.py | mhagiwara/allennlp | a05add5293f091e9dbcaa9db0783e782d77714cf | [
"Apache-2.0"
] | null | null | null | allennlp/modules/seq2seq_encoders/intra_sentence_attention.py | mhagiwara/allennlp | a05add5293f091e9dbcaa9db0783e782d77714cf | [
"Apache-2.0"
] | null | null | null | from overrides import overrides
import torch
from torch.nn import Linear
from allennlp.common.checks import ConfigurationError
from allennlp.modules.matrix_attention.legacy_matrix_attention import LegacyMatrixAttention
from allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder
from allennlp.modules.s... | 50.083333 | 100 | 0.694814 |
79630ee81813a459895b5b41ce148a268291a4d1 | 286 | py | Python | experiments/test_logging.py | falkben/fastapi_experiments | 004eec5693809634bd48ea4d677a6d654aff676e | [
"MIT"
] | 4 | 2020-12-07T20:32:06.000Z | 2022-01-05T19:41:57.000Z | experiments/test_logging.py | falkben/fastapi_experiments | 004eec5693809634bd48ea4d677a6d654aff676e | [
"MIT"
] | 1 | 2020-09-02T17:47:31.000Z | 2020-09-02T18:07:21.000Z | experiments/test_logging.py | falkben/fastapi_experiments | 004eec5693809634bd48ea4d677a6d654aff676e | [
"MIT"
] | 3 | 2020-08-17T15:50:09.000Z | 2021-03-02T18:22:31.000Z | from fastapi.testclient import TestClient
from experiments.logger import app
client = TestClient(app)
def test_hello():
resp = client.get("/hello")
assert resp.status_code == 200
def test_bad_route():
resp = client.get("/bad_route")
assert resp.status_code == 500
| 17.875 | 41 | 0.713287 |
796310d32a336ce01c4dfe0cb6f9bdf419d179bb | 777 | py | Python | kaggle/house/house.py | xiabodan/learning | 16282ffd554a5b5a721a5002361de0c8e725ad79 | [
"Apache-2.0"
] | null | null | null | kaggle/house/house.py | xiabodan/learning | 16282ffd554a5b5a721a5002361de0c8e725ad79 | [
"Apache-2.0"
] | null | null | null | kaggle/house/house.py | xiabodan/learning | 16282ffd554a5b5a721a5002361de0c8e725ad79 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
train_df = pd.read_csv('train.csv', index_col=0)
test_df = pd.read_csv('test.csv', index_col=0)
# step 2: 合并数据
# fig = plt.figure()
train_df.head()
prices = pd.DataFrame({"price":train_df["SalePrice"], "log(price + 1)":np.... | 25.9 | 104 | 0.715573 |
796311610e1e6dcf49214fbf71b9b054f4d3a12f | 23,008 | py | Python | project/src/cpu.py | GWU-CS2021/CSCI6461 | a0b276aa6ba294a1c28132334d64f6326dd2eace | [
"MIT"
] | null | null | null | project/src/cpu.py | GWU-CS2021/CSCI6461 | a0b276aa6ba294a1c28132334d64f6326dd2eace | [
"MIT"
] | null | null | null | project/src/cpu.py | GWU-CS2021/CSCI6461 | a0b276aa6ba294a1c28132334d64f6326dd2eace | [
"MIT"
] | null | null | null | import logging
from .register import Register
from .memory import Memory
from .mfr import *
from .cache import BPB
import traceback
class CPU:
def __init__(self, memory=Memory(2048)):
self.logger = logging.getLogger("cpu")
self.output_log = logging.getLogger("output2")
self.memory = memory... | 39.600688 | 120 | 0.564499 |
7963118e252a22178a39d85eac5591b21330ad96 | 1,098 | py | Python | timer.py | tmart234/BLE-LL | a4acb5de8f81de2f44713a509ee1baf67daf93cf | [
"MIT"
] | 1 | 2022-02-15T23:18:00.000Z | 2022-02-15T23:18:00.000Z | timer.py | tmart234/BLE-LL | a4acb5de8f81de2f44713a509ee1baf67daf93cf | [
"MIT"
] | null | null | null | timer.py | tmart234/BLE-LL | a4acb5de8f81de2f44713a509ee1baf67daf93cf | [
"MIT"
] | 2 | 2020-10-04T22:23:58.000Z | 2021-03-03T13:57:26.000Z | from threading import Timer
class LLTimer():
def __init__(self, timer_name=None, seconds=None, callback=None):
self.timers = None
if self.timer_name and self.seconds is not None:
self.start_timeout(timer_name, seconds, callback)
def start_timeout(self, timer_name, seconds... | 33.272727 | 74 | 0.595628 |
796311be85c4fb9ab3877ae3b1cf8a6ed71a99f6 | 1,969 | py | Python | benchmark/startPyquil3151.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil3151.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil3151.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=47
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(3) # number=16
prog... | 25.24359 | 64 | 0.555612 |
796312895ef3032fdbd6be920d868b3481680da1 | 1,112 | py | Python | boa3/model/decorator.py | CityOfZion/neo3-boa | c31fadce597abd5e0bdea76985e35c7004ab9d39 | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3/model/decorator.py | CityOfZion/neo3-boa | c31fadce597abd5e0bdea76985e35c7004ab9d39 | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3/model/decorator.py | CityOfZion/neo3-boa | c31fadce597abd5e0bdea76985e35c7004ab9d39 | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | import ast
from abc import abstractmethod
from typing import Optional
from boa3.model.expression import IExpression
from boa3.model.method import Method
from boa3.model.symbol import ISymbol
class IDecorator(Method):
@abstractmethod
def validate_parameters(self, *params: IExpression) -> bool:
"""
... | 25.860465 | 81 | 0.666367 |
796312f7fe247edb53c965128dc80b3694417edb | 374 | py | Python | anqier/1/jiaoyu/models.py | duantonghai1984/pyduant | 556cdb4460aaab42412969c17f33784ed8ddd527 | [
"Apache-2.0"
] | null | null | null | anqier/1/jiaoyu/models.py | duantonghai1984/pyduant | 556cdb4460aaab42412969c17f33784ed8ddd527 | [
"Apache-2.0"
] | null | null | null | anqier/1/jiaoyu/models.py | duantonghai1984/pyduant | 556cdb4460aaab42412969c17f33784ed8ddd527 | [
"Apache-2.0"
] | null | null | null | from django.db import models
import datetime
# Create your models here.
class Question(models.Model):
title=models.CharField(max_length=50)
ques=models.CharField(max_length=50)
answer=models.TextField();
name=models.CharField(max_length=50)
phone=models.CharField(max_length=50)
da... | 28.769231 | 62 | 0.743316 |
79631309385f0eec7af7c4b997f7e77a031f4c3c | 4,681 | py | Python | torchreid/utils/rerank.py | mangye16/deep-person-reid | 42eaccea712c3ebcc5273085a3cfea400a4783b8 | [
"MIT"
] | 2 | 2021-05-05T09:17:46.000Z | 2021-08-29T15:16:43.000Z | torchreid/utils/rerank.py | mangye16/deep-person-reid | 42eaccea712c3ebcc5273085a3cfea400a4783b8 | [
"MIT"
] | null | null | null | torchreid/utils/rerank.py | mangye16/deep-person-reid | 42eaccea712c3ebcc5273085a3cfea400a4783b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2/python3
# -*- coding: utf-8 -*-
"""
Source: https://github.com/zhunzhong07/person-re-ranking
Created on Mon Jun 26 14:46:56 2017
@author: luohao
Modified by Houjing Huang, 2017-12-22.
- This version accepts distance matrix instead of raw features.
- The difference of `/` division between pyth... | 40.704348 | 119 | 0.668233 |
79631506adccf47e6f36ae972c462af2ea2fa1d9 | 1,763 | py | Python | Focus_Locality/Sentence_Embedding_Approach/Testing/Profile.py | openeventdata/Focus_Locality_Extraction | a4bd95454535c6a3a81070733cb4742fba468872 | [
"MIT"
] | 2 | 2018-04-20T12:15:34.000Z | 2019-07-28T09:07:53.000Z | Focus_Locality/Sentence_Embedding_Approach/Testing/Profile.py | openeventdata/Focus_Locality_Extraction | a4bd95454535c6a3a81070733cb4742fba468872 | [
"MIT"
] | 7 | 2017-10-13T04:24:26.000Z | 2018-11-08T18:29:56.000Z | Focus_Locality/Sentence_Embedding_Approach/Testing/Profile.py | openeventdata/Focus_Locality_Extraction | a4bd95454535c6a3a81070733cb4742fba468872 | [
"MIT"
] | 3 | 2018-04-16T21:57:18.000Z | 2018-09-26T22:02:56.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: maryam
"""
import SIFpreprocessing_test
import SentenceExtraction_test
from itertools import izip
def main(lang, NER, TextTest, word2vec_Dictionary, loaded_model):
#### test
# lang = 'en'
# TextTest = '''105 words 4 July 2014 03:44 All Africa AFNWS En... | 41.97619 | 684 | 0.68633 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.