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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
97d0dfc3ddbbe7d0c44715886af8f566ed4510da | 330 | py | Python | drb/dbc.py | vinted/docker-rpm-builder | 2af4d70f3c4da6589ab46e7d5fed46bcd5e5b21e | [
"Apache-2.0"
] | 355 | 2015-01-09T01:53:29.000Z | 2019-02-28T17:50:45.000Z | drb/dbc.py | vinted/docker-rpm-builder | 2af4d70f3c4da6589ab46e7d5fed46bcd5e5b21e | [
"Apache-2.0"
] | 54 | 2015-02-06T17:16:56.000Z | 2019-04-02T16:25:59.000Z | drb/dbc.py | vinted/docker-rpm-builder | 2af4d70f3c4da6589ab46e7d5fed46bcd5e5b21e | [
"Apache-2.0"
] | 59 | 2015-02-06T18:50:58.000Z | 2019-03-05T08:42:39.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# just a runtime assertion which is not deleted at runtime by optimized python parameters.
class PreconditionFailed(Exception):
pass
def precondition(expr, message="", *parameters):
if not expr:
raise PreconditionFailed(message.format(par... | 30 | 90 | 0.748485 |
64d3c93ee7138b4cc545a9244dbf53e5385860dc | 5,755 | py | Python | tests/shellagent_test.py | zhifanz/fanqiang-analysis | 9b306f16d00d62d2630003b1483d85ea4e0b4841 | [
"Apache-2.0"
] | null | null | null | tests/shellagent_test.py | zhifanz/fanqiang-analysis | 9b306f16d00d62d2630003b1483d85ea4e0b4841 | [
"Apache-2.0"
] | null | null | null | tests/shellagent_test.py | zhifanz/fanqiang-analysis | 9b306f16d00d62d2630003b1483d85ea4e0b4841 | [
"Apache-2.0"
] | null | null | null | import io
import os
import pathlib
import jc
import paramiko
import pulumi
import pulumi_aws
import pulumi_alicloud
import pytest
from cryptography.hazmat.primitives.asymmetric import ed25519
from cryptography.hazmat.primitives import serialization
from minerule.shellagent import RemoteCommandError, ShellAgent
clas... | 33.654971 | 88 | 0.667767 |
cf795949530bf1139beab6496d84ae072d00ccd7 | 963 | py | Python | src/neg_sampling.py | NYXFLOWER/TIPExplainer | 093928397e94caaa5a69d2d5ec6512dbab5f2132 | [
"MIT"
] | 21 | 2019-12-11T09:07:39.000Z | 2021-12-07T10:58:19.000Z | src/neg_sampling.py | NYXFLOWER/TIPExplainer | 093928397e94caaa5a69d2d5ec6512dbab5f2132 | [
"MIT"
] | 9 | 2019-10-28T23:24:40.000Z | 2022-02-27T09:46:40.000Z | src/neg_sampling.py | NYXFLOWER/TIPExplainer | 093928397e94caaa5a69d2d5ec6512dbab5f2132 | [
"MIT"
] | 13 | 2019-11-12T14:23:06.000Z | 2022-01-20T03:55:50.000Z | import numpy as np
import torch
def negative_sampling(pos_edge_index, num_nodes):
idx = (pos_edge_index[0] * num_nodes + pos_edge_index[1])
idx = idx.to(torch.device('cpu'))
perm = torch.tensor(np.random.choice(num_nodes**2, idx.size(0)))
mask = torch.from_numpy(np.isin(perm, idx).astype(np.uint8))
... | 35.666667 | 79 | 0.666667 |
2aab91eaab5da5a1c751ac651367d49e6d6a8c1b | 6,389 | py | Python | Obsoletos II/BOLSA_NEW.py | wmpjrufg/META | c7ed148877fb749779ca6992366870dbe6cd53f3 | [
"MIT"
] | null | null | null | Obsoletos II/BOLSA_NEW.py | wmpjrufg/META | c7ed148877fb749779ca6992366870dbe6cd53f3 | [
"MIT"
] | null | null | null | Obsoletos II/BOLSA_NEW.py | wmpjrufg/META | c7ed148877fb749779ca6992366870dbe6cd53f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
################################################################################
# UNIVERSIDADE FEDERAL DE CATALÃO (UFCAT)
# WANDERLEI MALAQUIAS PEREIRA JUNIOR, ENG. CIVIL / PROF (UFCAT)
# ANTOVER PANAZZOLO SARMENTO, ENG. AGRICOLA ... | 43.760274 | 147 | 0.507591 |
2386d9b359afaaafd8bf06df21809895f156d82c | 3,467 | py | Python | src/chessnet/communities.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | src/chessnet/communities.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | src/chessnet/communities.py | nahuelalmeira/chess | 4bde6490483cfa04dfbdc43d5df3075c59c3e568 | [
"MIT"
] | null | null | null | from pathlib import Path
from functools import partial
import pickle
from typing import Dict, Callable, List
import numpy as np
import pandas as pd
from cdlib.algorithms import leiden, label_propagation, louvain
from chessnet.graphs import read_pickle
from chessnet.utils import ARTIFACTS_DIR, Database
def get_algori... | 29.134454 | 84 | 0.648111 |
573666535c3783fd0b0e18272b6779f7af7e742a | 14,317 | py | Python | DeepOnto.kom/relationextraction.py | waelkht/DeepOnto.KOM-ISWC2019 | 5d27a871720f7e9a13eb029401783f0eaa2fc1c4 | [
"MIT"
] | 1 | 2020-10-03T11:56:04.000Z | 2020-10-03T11:56:04.000Z | DeepOnto.kom/relationextraction.py | waelkht/DeepOnto.KOM-ISWC2019 | 5d27a871720f7e9a13eb029401783f0eaa2fc1c4 | [
"MIT"
] | null | null | null | DeepOnto.kom/relationextraction.py | waelkht/DeepOnto.KOM-ISWC2019 | 5d27a871720f7e9a13eb029401783f0eaa2fc1c4 | [
"MIT"
] | null | null | null | from os import remove
from os.path import join
import re
from tqdm import tqdm
import pandas as pd
from textblob import TextBlob
from multiprocessing.pool import Pool
import nltk
import os
import codecs
from nltk.tag.perceptron import PerceptronTagger
from nltk.stem.wordnet import WordNetLemmatizer
_CONCEPT_NET_RELATI... | 41.022923 | 131 | 0.562897 |
5fa7d5cea40928297e68f1ae94cead7dee642c21 | 957 | py | Python | backend/endpoints/migrations/versions/f3f0c5d3c611_add_repository_template_table.py | EficodeEntDemo/pluto | 3eb04821ef8053ea9437319b45f37bb5725bc413 | [
"Apache-2.0"
] | null | null | null | backend/endpoints/migrations/versions/f3f0c5d3c611_add_repository_template_table.py | EficodeEntDemo/pluto | 3eb04821ef8053ea9437319b45f37bb5725bc413 | [
"Apache-2.0"
] | 86 | 2021-09-13T10:29:04.000Z | 2022-03-08T07:07:31.000Z | backend/endpoints/migrations/versions/f3f0c5d3c611_add_repository_template_table.py | EficodeEntDemo/pluto | 3eb04821ef8053ea9437319b45f37bb5725bc413 | [
"Apache-2.0"
] | 2 | 2021-09-13T10:16:25.000Z | 2021-11-15T10:16:05.000Z | """Add repository template table
Revision ID: f3f0c5d3c611
Revises: 2c892503ce55
Create Date: 2021-11-26 15:15:08.375425
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'f3f0c5d3c611'
down_revision = '2c892503ce55'
bran... | 27.342857 | 84 | 0.709509 |
96435f58c9debf71df56d98b1b44566afa046a5e | 3,097 | py | Python | app/app/settings.py | javakat/hello-django | ca72aa9d5b35c0174a9ba8ffad3e393468c44bba | [
"MIT"
] | null | null | null | app/app/settings.py | javakat/hello-django | ca72aa9d5b35c0174a9ba8ffad3e393468c44bba | [
"MIT"
] | null | null | null | app/app/settings.py | javakat/hello-django | ca72aa9d5b35c0174a9ba8ffad3e393468c44bba | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# Bu... | 25.595041 | 91 | 0.697126 |
6382b5043d357af977f9245f8a2fe2a9c8272222 | 16,041 | py | Python | releng/generate_tests.py | zhijianli88/test-infra | b9c4384b32463dc5cee5b46ce2e768dbfeaba40b | [
"Apache-2.0"
] | null | null | null | releng/generate_tests.py | zhijianli88/test-infra | b9c4384b32463dc5cee5b46ce2e768dbfeaba40b | [
"Apache-2.0"
] | null | null | null | releng/generate_tests.py | zhijianli88/test-infra | b9c4384b32463dc5cee5b46ce2e768dbfeaba40b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2017 The Kubernetes 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 appl... | 37.921986 | 100 | 0.623216 |
d2ef126c8710f0920304150f9ea8f18695c56a95 | 290 | py | Python | ex060c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | ex060c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | ex060c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | numero = int(input('Digite um número para calcularmos o fatorial: '))
c = numero
f = 1
print('Calculando o {}! = '.format(numero), end='')
while c > 0:
print('{} '.format(c), end='')
print('x ' if c > 1 else ' = ', end='')
f *= c
c -= 1
print('{}'.format(f))
print('\nFIM') | 24.166667 | 69 | 0.537931 |
21ca7fbb729ab972069963cd392a55c894d4d008 | 20,213 | py | Python | electrum/plugins/trezor/trezor.py | VIPSTARCOIN-electrum/electrum-vips | ebe93c09717ea44c049fcb9c3f366af64dc87b37 | [
"MIT"
] | 2 | 2019-07-17T23:09:42.000Z | 2019-10-25T05:44:04.000Z | electrum/plugins/trezor/trezor.py | VIPSTARCOIN-electrum/electrum-vips | ebe93c09717ea44c049fcb9c3f366af64dc87b37 | [
"MIT"
] | null | null | null | electrum/plugins/trezor/trezor.py | VIPSTARCOIN-electrum/electrum-vips | ebe93c09717ea44c049fcb9c3f366af64dc87b37 | [
"MIT"
] | 3 | 2019-08-10T15:14:29.000Z | 2021-05-26T20:02:02.000Z | import traceback
import sys
from typing import NamedTuple, Any
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import const... | 41.335378 | 127 | 0.627517 |
33b912c3122390398a6d74f4865eccba6ed418ee | 9,377 | py | Python | flumine/streams/streams.py | mberk/flumine | 6216bcc233326cf07852fca9c7d39a18cee265ad | [
"MIT"
] | null | null | null | flumine/streams/streams.py | mberk/flumine | 6216bcc233326cf07852fca9c7d39a18cee265ad | [
"MIT"
] | null | null | null | flumine/streams/streams.py | mberk/flumine | 6216bcc233326cf07852fca9c7d39a18cee265ad | [
"MIT"
] | null | null | null | import time
import logging
from typing import Union, Iterator
from ..strategy.strategy import BaseStrategy
from .marketstream import MarketStream
from .datastream import DataStream
from .historicalstream import HistoricalStream
from .orderstream import OrderStream
from .simulatedorderstream import SimulatedOrderStream... | 39.39916 | 116 | 0.541964 |
7a4a0fd24af2d291e8b8cbf52f0d1cfc05445e9e | 370 | py | Python | tests/test_task_python.py | jduff/devbuddy | 9ae6d66ad79baedbde2fdb70f568b89ddd89d2a4 | [
"MIT"
] | null | null | null | tests/test_task_python.py | jduff/devbuddy | 9ae6d66ad79baedbde2fdb70f568b89ddd89d2a4 | [
"MIT"
] | null | null | null | tests/test_task_python.py | jduff/devbuddy | 9ae6d66ad79baedbde2fdb70f568b89ddd89d2a4 | [
"MIT"
] | null | null | null |
def test_task(cmd, project):
project.write_devyml("""
up:
- python: 3.6.5
""")
cmd.run("bud up")
output = cmd.run("python --version")
assert output == "Python 3.6.5"
output = cmd.run("python -c 'import sys; print(sys.prefix)'")
assert "/.local/share/bud/virtualenvs/" in o... | 24.666667 | 97 | 0.605405 |
a58fe8e0ab2833ab54d939f2362f0d203577a52f | 939 | py | Python | 2020/set_up_prob.py | drcsturm/AdventOfCode | 69a3d9b353e6b69f148d981f1ca58a34262b0cf5 | [
"MIT"
] | null | null | null | 2020/set_up_prob.py | drcsturm/AdventOfCode | 69a3d9b353e6b69f148d981f1ca58a34262b0cf5 | [
"MIT"
] | null | null | null | 2020/set_up_prob.py | drcsturm/AdventOfCode | 69a3d9b353e6b69f148d981f1ca58a34262b0cf5 | [
"MIT"
] | null | null | null | from datetime import datetime
import requests
import sys
def get_input(prob_num, year=2020):
response = requests.get(f"https://adventofcode.com/{year}/day/{prob_num}/input")
with open(f"prob{prob_num}_input.txt", 'w') as f:
f.write(response.text)
def set_up_prob(prob_num):
with open(f"prob{prob_nu... | 34.777778 | 84 | 0.605964 |
73e932234e72d234edc79291f72107904a83081f | 234 | py | Python | custom_cli/custom_script.py | hmtmcse-com/flask-tutorial | e189e1a630dd400630cf856437810a3dbc750a22 | [
"Apache-2.0"
] | 1 | 2021-12-18T14:08:29.000Z | 2021-12-18T14:08:29.000Z | custom_cli/custom_script.py | hmtmcse-com/flask-tutorial | e189e1a630dd400630cf856437810a3dbc750a22 | [
"Apache-2.0"
] | null | null | null | custom_cli/custom_script.py | hmtmcse-com/flask-tutorial | e189e1a630dd400630cf856437810a3dbc750a22 | [
"Apache-2.0"
] | null | null | null | import click
from flask import Flask
from flask.cli import FlaskGroup
def create_app():
app = Flask('CustomScript')
return app
@click.group(cls=FlaskGroup, create_app=create_app)
def cli():
print("Call Custom Script")
| 16.714286 | 51 | 0.730769 |
6a8177bf16aad5a20dc37c6a0cd689b10a784e7b | 120,656 | py | Python | zappa/core.py | johnarnfield/Zappa | f58270afd33e23c1fd8c736c1f56bb5b91648b28 | [
"MIT"
] | null | null | null | zappa/core.py | johnarnfield/Zappa | f58270afd33e23c1fd8c736c1f56bb5b91648b28 | [
"MIT"
] | null | null | null | zappa/core.py | johnarnfield/Zappa | f58270afd33e23c1fd8c736c1f56bb5b91648b28 | [
"MIT"
] | null | null | null | """
Zappa core library. You may also want to look at `cli.py` and `util.py`.
"""
##
# Imports
##
from __future__ import print_function
import getpass
import glob
import hashlib
import json
import logging
import os
import random
import shutil
import string
import subprocess
import tarfile
import tempfile
import time
... | 40.914208 | 181 | 0.553176 |
9e486cb56dd9cbe2a19e389bf19ede9613f7670b | 1,519 | py | Python | venv/Lib/site-packages/pyrogram/types/bots_and_keyboards/__init__.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/types/bots_and_keyboards/__init__.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/types/bots_and_keyboards/__init__.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 36.166667 | 75 | 0.77551 |
82da038444c2f142afc2d46614d01d01ac2cc4dc | 935 | py | Python | offline_messages/migrations/0001_initial.py | dimasciput/django-offline-messages | 275a8c9abb6201a8b6e86d0316e367115705a327 | [
"BSD-3-Clause"
] | null | null | null | offline_messages/migrations/0001_initial.py | dimasciput/django-offline-messages | 275a8c9abb6201a8b6e86d0316e367115705a327 | [
"BSD-3-Clause"
] | null | null | null | offline_messages/migrations/0001_initial.py | dimasciput/django-offline-messages | 275a8c9abb6201a8b6e86d0316e367115705a327 | [
"BSD-3-Clause"
] | 1 | 2021-05-13T19:46:10.000Z | 2021-05-13T19:46:10.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0... | 30.16129 | 114 | 0.597861 |
7bf0665db4b8ebf4c1b0480497447bddc8df5713 | 9,090 | py | Python | GeneratorInterface/SherpaInterface/python/ExtendedSherpaWeights_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | GeneratorInterface/SherpaInterface/python/ExtendedSherpaWeights_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | GeneratorInterface/SherpaInterface/python/ExtendedSherpaWeights_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
SherpaWeightsBlock = cms.PSet(
SherpaWeights = cms.vstring(
'Weight',
'MEWeight',
'WeightNormalisation',
'NTrials'
),
SherpaVariationWeights = cms.vstring(
'MUR0.5_MUF0.5_PDF26... | 39.521739 | 44 | 0.459406 |
9768b77cbfb47b314e5a151ebb7a89e43d7404e7 | 2,671 | py | Python | swat/functions.py | arharvey918/python-swat | 0db2db2d7c049b23391de419950954c8d505b325 | [
"Apache-2.0"
] | 1 | 2019-04-02T14:36:24.000Z | 2019-04-02T14:36:24.000Z | swat/functions.py | arharvey918/python-swat | 0db2db2d7c049b23391de419950954c8d505b325 | [
"Apache-2.0"
] | 1 | 2020-11-27T14:29:46.000Z | 2020-11-27T14:29:46.000Z | swat/functions.py | arharvey918/python-swat | 0db2db2d7c049b23391de419950954c8d505b325 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 25.932039 | 82 | 0.660052 |
393805787fd210944477d637b9210f1fc4888129 | 250 | py | Python | 05. Django REST APIs/puredjangoapi/app/practicalapi/forms.py | rexsimiloluwah/Python-Experiments | 63291ab7fe11e61cce2a936dd41b31f0eb35cc1f | [
"MIT"
] | 1 | 2021-01-21T11:39:07.000Z | 2021-01-21T11:39:07.000Z | 05. Django REST APIs/puredjangoapi/app/practicalapi/forms.py | rexsimiloluwah/Python-Experiments | 63291ab7fe11e61cce2a936dd41b31f0eb35cc1f | [
"MIT"
] | null | null | null | 05. Django REST APIs/puredjangoapi/app/practicalapi/forms.py | rexsimiloluwah/Python-Experiments | 63291ab7fe11e61cce2a936dd41b31f0eb35cc1f | [
"MIT"
] | 1 | 2021-01-21T11:39:19.000Z | 2021-01-21T11:39:19.000Z | from django import forms
from app.models import Movie
class MovieModelForm(forms.ModelForm):
class Meta:
model = Movie
fields = [
"title",
"description",
"rating",
"year"
] | 20.833333 | 38 | 0.516 |
52d4b509df0eb6d72e399ff06b32d1f8c6ae3273 | 9,846 | py | Python | tests/unit/packaging/test_views.py | Denon/warehouse | d2524c7dd369aa5139f510f6dd37caa059e12719 | [
"Apache-2.0"
] | 1 | 2019-06-19T19:58:49.000Z | 2019-06-19T19:58:49.000Z | tests/unit/packaging/test_views.py | Denon/warehouse | d2524c7dd369aa5139f510f6dd37caa059e12719 | [
"Apache-2.0"
] | null | null | null | tests/unit/packaging/test_views.py | Denon/warehouse | d2524c7dd369aa5139f510f6dd37caa059e12719 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 33.951724 | 79 | 0.628986 |
9195718b9b81251c57df520d8e951ae2698a4352 | 7,465 | py | Python | ADM_v4/src/ClusterHelper.py | Horopter/ShortTextClassification | e39b849a2940519f8d049ebfb984228ac920c66c | [
"MIT"
] | null | null | null | ADM_v4/src/ClusterHelper.py | Horopter/ShortTextClassification | e39b849a2940519f8d049ebfb984228ac920c66c | [
"MIT"
] | null | null | null | ADM_v4/src/ClusterHelper.py | Horopter/ShortTextClassification | e39b849a2940519f8d049ebfb984228ac920c66c | [
"MIT"
] | null | null | null | """
Concept Cluster per a document example
[
(
0,
[
('business', {'multi': 234.25893061023473, 'products': 47.466996391615886, 'precision': 308.68441111734654, 'clients': 1000000, 'manufacturing': 64.10708488183323, 'spindle': 395.467134880532}),
('production', {'multi': 233.81061234291516, 'products': 44.... | 29.160156 | 210 | 0.685733 |
b7cf7984fd88de593c3c31f255e40b14a0a0a61b | 5,927 | py | Python | eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs2.egg/EGG-INFO/scripts/bed_rand_intersect.py | psnehal/MethylSig | 5efad71e71ff2515feff2e49579c856ef9a1bbd8 | [
"CC-BY-3.0"
] | null | null | null | eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs2.egg/EGG-INFO/scripts/bed_rand_intersect.py | psnehal/MethylSig | 5efad71e71ff2515feff2e49579c856ef9a1bbd8 | [
"CC-BY-3.0"
] | null | null | null | eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs2.egg/EGG-INFO/scripts/bed_rand_intersect.py | psnehal/MethylSig | 5efad71e71ff2515feff2e49579c856ef9a1bbd8 | [
"CC-BY-3.0"
] | null | null | null | #!/afs/bx.psu.edu/project/pythons/py2.7-linux-x86_64-ucs2/bin/python2.7
"""
From a set of regions and two sets of intervals inside those regions
compute (for each region separately) the overlap between the two sets
of intervals and the overlap in `nsamples` random coverings of the
regions with intervals having the sa... | 36.813665 | 153 | 0.637085 |
f42e8e9a4c94b22a53fff5e40042455dac1d32fd | 183 | py | Python | mayor.py | josaphatsv/EjercicioPython | 269bf5552bc926917ba3e54477e735af4f9c1830 | [
"MIT"
] | null | null | null | mayor.py | josaphatsv/EjercicioPython | 269bf5552bc926917ba3e54477e735af4f9c1830 | [
"MIT"
] | null | null | null | mayor.py | josaphatsv/EjercicioPython | 269bf5552bc926917ba3e54477e735af4f9c1830 | [
"MIT"
] | null | null | null | num1=int(input("Proporciona el numero1: "))
num2=int(input("Proporciona el numero2: "))
if num1>num2:
print("El numero mayor es:",num1)
else:
print("El numero mayor es:",num2) | 30.5 | 43 | 0.688525 |
7d3ba3fa5a5879839ec3f5d26b007d7af05540a6 | 2,416 | py | Python | examples/python/onnx/cifar10_cnn.py | zmxdream/FlexFlow | 7ea50d71a02e853af7ae573d88c911511b3e82e0 | [
"Apache-2.0"
] | 455 | 2018-12-09T01:57:46.000Z | 2022-03-22T01:56:47.000Z | examples/python/onnx/cifar10_cnn.py | zmxdream/FlexFlow | 7ea50d71a02e853af7ae573d88c911511b3e82e0 | [
"Apache-2.0"
] | 136 | 2019-04-19T08:24:27.000Z | 2022-03-28T01:39:19.000Z | examples/python/onnx/cifar10_cnn.py | zmxdream/FlexFlow | 7ea50d71a02e853af7ae573d88c911511b3e82e0 | [
"Apache-2.0"
] | 102 | 2018-12-22T07:38:05.000Z | 2022-03-30T06:04:39.000Z | from flexflow.core import *
from flexflow.keras.datasets import cifar10
from flexflow.onnx.model import ONNXModel, ONNXModelKeras
import argparse
from accuracy import ModelAccuracy
def top_level_task(test_type=1):
ffconfig = FFConfig()
alexnetconfig = NetConfig()
print(alexnetconfig.dataset_path)
print("Pytho... | 34.028169 | 167 | 0.75745 |
2588582ff5cce2f3347fed1b7a01a3b14c7e9af0 | 5,671 | py | Python | apple/full_node/bundle_tools.py | Apple-Network/apple-blockchain | 74351fd5cea80da40a84777c6e1659b845a22d1c | [
"Apache-2.0"
] | 15 | 2021-07-20T15:22:07.000Z | 2022-02-09T04:28:46.000Z | apple/full_node/bundle_tools.py | Apple-Network/apple-blockchain | 74351fd5cea80da40a84777c6e1659b845a22d1c | [
"Apache-2.0"
] | 17 | 2021-07-20T13:58:30.000Z | 2021-10-10T04:24:29.000Z | apple/full_node/bundle_tools.py | Apple-Network/apple-blockchain | 74351fd5cea80da40a84777c6e1659b845a22d1c | [
"Apache-2.0"
] | 4 | 2021-08-18T16:22:11.000Z | 2022-03-15T08:24:01.000Z | import re
from typing import Optional, Tuple, List, Union
from clvm import SExp
from clvm_tools import binutils
from apple.full_node.generator import create_compressed_generator
from apple.types.blockchain_format.program import SerializedProgram, Program
from apple.types.coin_spend import CoinSpend
from apple.types.g... | 42.639098 | 528 | 0.768471 |
20bf6e478ea93323c491135e9a17aa38ec3896be | 1,849 | py | Python | stacks/XIAOMATECH/1.0/services/STREAMLINE/package/scripts/config_utils.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 3 | 2019-08-13T01:44:16.000Z | 2019-12-10T04:05:56.000Z | stacks/XIAOMATECH/1.0/services/STREAMLINE/package/scripts/config_utils.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | null | null | null | stacks/XIAOMATECH/1.0/services/STREAMLINE/package/scripts/config_utils.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 7 | 2019-05-29T17:35:25.000Z | 2021-12-04T07:55:10.000Z | import os
from xml.etree import ElementTree
from resource_management.core.source import InlineTemplate
from resource_management.core.logger import Logger
def merge_env(conf_dict,
content_property_name="content",
property_prefix="content-"):
result = conf_dict[content_property_name]
... | 41.088889 | 126 | 0.663602 |
f911ed01cc163c4b75f670533241631f16688657 | 4,158 | py | Python | oneview_redfish_toolkit/api/enclosure_chassis.py | harish-kumar-nvs-kakumanu/oneview-redfish-toolkit | 4d0c7a26cc64c6261fcd60f57c29bec5d632eac3 | [
"Apache-2.0"
] | null | null | null | oneview_redfish_toolkit/api/enclosure_chassis.py | harish-kumar-nvs-kakumanu/oneview-redfish-toolkit | 4d0c7a26cc64c6261fcd60f57c29bec5d632eac3 | [
"Apache-2.0"
] | null | null | null | oneview_redfish_toolkit/api/enclosure_chassis.py | harish-kumar-nvs-kakumanu/oneview-redfish-toolkit | 4d0c7a26cc64c6261fcd60f57c29bec5d632eac3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (2017) Hewlett Packard Enterprise Development LP
#
# 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... | 35.844828 | 77 | 0.638769 |
db94ee380cdf6cf1965c5252a7fb288962ad1b70 | 761 | py | Python | src/fitness.py | sz-piotr/alhe-rail-network | 877a36b12597c3e26fc07780ef0ec68c765e8979 | [
"MIT"
] | null | null | null | src/fitness.py | sz-piotr/alhe-rail-network | 877a36b12597c3e26fc07780ef0ec68c765e8979 | [
"MIT"
] | null | null | null | src/fitness.py | sz-piotr/alhe-rail-network | 877a36b12597c3e26fc07780ef0ec68c765e8979 | [
"MIT"
] | null | null | null | import math
def makefitness(U, T, cities):
powerplants = list(filter(lambda city: city.has_powerplant, cities))
electicity_costs = [electicity_cost(city, powerplants, U) for city in cities]
def fitness(specimen):
sum = 0
for v1, v2 in specimen.edges():
distance_penalty = distan... | 31.708333 | 81 | 0.65046 |
aeb374c087e909c3083c77283320bbef645a1b9d | 12,413 | py | Python | virtualenv/lib/python3.6/site-packages/py/_path/common.py | coderunn3r/HadoopSpike | 3e57219d0489fae1d755bc4bd97eaf22f1898464 | [
"MIT"
] | 34 | 2015-07-09T04:53:27.000Z | 2021-07-19T05:22:27.000Z | virtualenv/lib/python3.6/site-packages/py/_path/common.py | coderunn3r/HadoopSpike | 3e57219d0489fae1d755bc4bd97eaf22f1898464 | [
"MIT"
] | 6 | 2015-05-30T17:20:45.000Z | 2017-06-12T14:29:23.000Z | virtualenv/lib/python3.6/site-packages/py/_path/common.py | coderunn3r/HadoopSpike | 3e57219d0489fae1d755bc4bd97eaf22f1898464 | [
"MIT"
] | 11 | 2015-09-07T14:26:08.000Z | 2020-04-10T07:20:41.000Z | """
"""
import os, sys
import py
class Checkers:
_depend_on_existence = 'exists', 'link', 'dir', 'file'
def __init__(self, path):
self.path = path
def dir(self):
raise NotImplementedError
def file(self):
raise NotImplementedError
def dotfile(self):
return self.pa... | 31.828205 | 82 | 0.531942 |
e390320e811f1ec3de20b4aecbfa55a5bc7be66f | 1,354 | py | Python | setup.py | honmaple/flask-maple | 1ba9b301ca2ed70ab05fa6860f01468400a7fa15 | [
"BSD-3-Clause"
] | 9 | 2016-11-01T09:00:38.000Z | 2020-05-09T16:24:07.000Z | setup.py | honmaple/flask-maple | 1ba9b301ca2ed70ab05fa6860f01468400a7fa15 | [
"BSD-3-Clause"
] | 1 | 2016-11-01T09:01:25.000Z | 2016-11-05T12:39:14.000Z | setup.py | honmaple/flask-maple | 1ba9b301ca2ed70ab05fa6860f01468400a7fa15 | [
"BSD-3-Clause"
] | 3 | 2016-10-08T13:43:27.000Z | 2019-12-31T09:52:43.000Z | #!/usr/bin/env python
# -*- coding=UTF-8 -*-
# **************************************************************************
# Copyright © 2016 jianglin
# File Name: setup.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2016-04-16 22:19:36 (CST)
# Last Update: Wednesday 2018-11-21 13:52:54 (CST)
# By:... | 35.631579 | 137 | 0.581979 |
8d357f7ca14c2b158dd25fc3a36cc593be75c5a9 | 18,196 | py | Python | adafruit_matrixportal/matrixportal.py | hawkins/Adafruit_CircuitPython_MatrixPortal | b4253b40e6039839ddf142eba71507dd867291e5 | [
"MIT"
] | null | null | null | adafruit_matrixportal/matrixportal.py | hawkins/Adafruit_CircuitPython_MatrixPortal | b4253b40e6039839ddf142eba71507dd867291e5 | [
"MIT"
] | null | null | null | adafruit_matrixportal/matrixportal.py | hawkins/Adafruit_CircuitPython_MatrixPortal | b4253b40e6039839ddf142eba71507dd867291e5 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""
`adafruit_matrixportal.matrixportal`
================================================================================
Helper library for the Adafruit RGB Matrix Shield + Metro M4 Airlift ... | 36.103175 | 107 | 0.593317 |
20bc720ec97f5397cc767e8a57a373f64f427e2e | 1,779 | py | Python | st2reactor/st2reactor/rules/config.py | momokuri-3/st2 | 0a7038723d701b433d7079b843cc76d4bf1ae8c9 | [
"Apache-2.0"
] | 4,920 | 2015-01-01T15:12:17.000Z | 2022-03-31T19:31:15.000Z | st2reactor/st2reactor/rules/config.py | momokuri-3/st2 | 0a7038723d701b433d7079b843cc76d4bf1ae8c9 | [
"Apache-2.0"
] | 3,563 | 2015-01-05T19:02:19.000Z | 2022-03-31T19:23:09.000Z | st2reactor/st2reactor/rules/config.py | momokuri-3/st2 | 0a7038723d701b433d7079b843cc76d4bf1ae8c9 | [
"Apache-2.0"
] | 774 | 2015-01-01T20:41:24.000Z | 2022-03-31T13:25:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | 28.238095 | 74 | 0.754918 |
2eb46196de3dfa72e86b2672b4438490d0a00da2 | 10,803 | py | Python | Gowers_Method/graph_computation.py | ijcruic/Gowers-Method | e7c55c06a4682505b59d56d1019911944c9450ad | [
"MIT"
] | null | null | null | Gowers_Method/graph_computation.py | ijcruic/Gowers-Method | e7c55c06a4682505b59d56d1019911944c9450ad | [
"MIT"
] | null | null | null | Gowers_Method/graph_computation.py | ijcruic/Gowers-Method | e7c55c06a4682505b59d56d1019911944c9450ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Package for implmenting Gower's method for finding latent networks in multi-modal data
author: Iain Cruickshank
license: MIT version 3
acknowledgements: Work supported by National Science Foundation Graduate Research Fellowship (DGE 1745016).
"""
import numpy as np, networkx as... | 41.710425 | 152 | 0.550958 |
fff0920bf65465b980428cb175ce320414415fe0 | 781 | py | Python | tods/tests/sk_interface/feature_analysis/test_ski_StatisticalKurtosis.py | zylMozart/tods | a4c0192b43b438276d2228306c0e9c896d9e3809 | [
"Apache-2.0"
] | null | null | null | tods/tests/sk_interface/feature_analysis/test_ski_StatisticalKurtosis.py | zylMozart/tods | a4c0192b43b438276d2228306c0e9c896d9e3809 | [
"Apache-2.0"
] | null | null | null | tods/tests/sk_interface/feature_analysis/test_ski_StatisticalKurtosis.py | zylMozart/tods | a4c0192b43b438276d2228306c0e9c896d9e3809 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import os
from tods.sk_interface.feature_analysis.StatisticalKurtosis_skinterface import StatisticalKurtosisSKI
from pyod.utils.data import generate_data
import unittest
from sklearn.metrics import roc_auc_score
class StatisticalKurtosisSKI_TestCase(unittest.TestCase):
def s... | 27.892857 | 101 | 0.728553 |
7d3c29f32dfe3359c4334957049e755f8873478d | 109,675 | py | Python | python/ccxt/kucoin.py | XandeTorres/ccxt | 0edbf63ad4151855eccf6864e032d6779b549b40 | [
"MIT"
] | 3 | 2021-12-28T20:13:21.000Z | 2022-02-15T05:29:42.000Z | python/ccxt/kucoin.py | Gitleyla/ccxt | 2b623e09815cbcbaa56592e65cbf3dab0096946b | [
"MIT"
] | null | null | null | python/ccxt/kucoin.py | Gitleyla/ccxt | 2b623e09815cbcbaa56592e65cbf3dab0096946b | [
"MIT"
] | 1 | 2022-03-31T20:19:33.000Z | 2022-03-31T20:19:33.000Z | # -*- 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 hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.er... | 45.301528 | 184 | 0.464181 |
bf2dbc2c8769a4fcb8d7ea6320c7739f50551874 | 855 | py | Python | docker/optimism-scripts/setup_l1.py | beamer-bridge/beamer | 79e9c8abdff1e05febf0ac9af0f4308290010604 | [
"MIT"
] | 2 | 2022-03-29T16:51:52.000Z | 2022-03-30T13:23:23.000Z | docker/optimism-scripts/setup_l1.py | beamer-bridge/beamer | 79e9c8abdff1e05febf0ac9af0f4308290010604 | [
"MIT"
] | 56 | 2022-03-25T09:12:42.000Z | 2022-03-31T14:01:54.000Z | docker/optimism-scripts/setup_l1.py | beamer-bridge/beamer | 79e9c8abdff1e05febf0ac9af0f4308290010604 | [
"MIT"
] | null | null | null | from brownie import Contract, accounts
from .utils import (
L2_CHAIN_ID,
OPTIMISM_PROOF_SUBMITTER,
PROXY_OVM_L1_CROSS_DOMAIN_MESSENGER,
RESOLUTION_REGISTRY,
RESOLVER,
get_contract_address,
)
messenger_address = get_contract_address(PROXY_OVM_L1_CROSS_DOMAIN_MESSENGER)
def main() -> None:
... | 26.71875 | 86 | 0.734503 |
8e23ba943bd65382115e2fdfbc623f7e94155d03 | 47 | py | Python | env/lib/python3.6/site-packages/fuzzywuzzy/__init__.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 78 | 2017-08-19T03:46:13.000Z | 2020-02-19T04:29:45.000Z | env/lib/python3.6/site-packages/fuzzywuzzy/__init__.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 44 | 2019-09-26T10:05:07.000Z | 2021-10-20T09:53:41.000Z | env/lib/python3.6/site-packages/fuzzywuzzy/__init__.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 13 | 2017-08-19T16:46:08.000Z | 2018-11-05T23:11:34.000Z | # -*- coding: utf-8 -*-
__version__ = '0.16.0'
| 15.666667 | 23 | 0.531915 |
956f91edd19302a5e3f829ff014a76b410a2a8fc | 914 | py | Python | bugatti_api/urls.py | API-Imperfect/Bugatti-API-Home | 4a700109017c2a6c3d59743f46a99e0fd59901f2 | [
"MIT"
] | null | null | null | bugatti_api/urls.py | API-Imperfect/Bugatti-API-Home | 4a700109017c2a6c3d59743f46a99e0fd59901f2 | [
"MIT"
] | null | null | null | bugatti_api/urls.py | API-Imperfect/Bugatti-API-Home | 4a700109017c2a6c3d59743f46a99e0fd59901f2 | [
"MIT"
] | null | null | null | """bugatti_api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... | 38.083333 | 88 | 0.71116 |
77d2ceb75671f512064c4bf1bb19479730c3a83d | 3,711 | py | Python | pypy/module/_cffi_backend/moduledef.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-06-02T23:02:09.000Z | 2021-06-02T23:02:09.000Z | pypy/module/_cffi_backend/moduledef.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-03-30T18:08:41.000Z | 2021-03-30T18:08:41.000Z | pypy/module/_cffi_backend/moduledef.py | pymtl/pypy-pymtl3 | d2f66f87686e48aeb1eecabeaa3de1381a149f2c | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | import sys
from pypy.interpreter.mixedmodule import MixedModule
from rpython.rlib import rdynload, clibffi
from rpython.rtyper.lltypesystem import rffi
from . import VERSION
FFI_DEFAULT_ABI = clibffi.FFI_DEFAULT_ABI
try:
FFI_STDCALL = clibffi.FFI_STDCALL
has_stdcall = True
except AttributeError:
has_stdca... | 35.342857 | 76 | 0.637025 |
e18df0e069e8f4b7bf790eab078d0fc8264ec366 | 72 | py | Python | Python/Topics/Files in Python/Open the file/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | 5 | 2020-08-29T15:15:31.000Z | 2022-03-01T18:22:34.000Z | Python/Topics/Files in Python/Open the file/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | null | null | null | Python/Topics/Files in Python/Open the file/main.py | drtierney/hyperskill-problems | b74da993f0ac7bcff1cbd5d89a3a1b06b05f33e0 | [
"MIT"
] | 1 | 2020-12-02T11:13:14.000Z | 2020-12-02T11:13:14.000Z | test_file = open("stars.txt", "w", encoding="utf-16")
test_file.close()
| 24 | 53 | 0.680556 |
101713b06df8cb32f069412e9b988bc02bc41e41 | 123,223 | py | Python | pandas/tests/plotting/test_frame.py | BranYang/pandas | 1033e8b1195d4071253889ada60523832285354c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-05-12T21:50:27.000Z | 2021-05-12T21:50:27.000Z | pandas/tests/plotting/test_frame.py | BranYang/pandas | 1033e8b1195d4071253889ada60523832285354c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/plotting/test_frame.py | BranYang/pandas | 1033e8b1195d4071253889ada60523832285354c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2018-11-27T00:48:03.000Z | 2018-11-27T00:48:03.000Z | # coding: utf-8
""" Test cases for DataFrame.plot """
import pytest
import string
import warnings
from datetime import datetime, date
import pandas as pd
from pandas import (Series, DataFrame, MultiIndex, PeriodIndex, date_range,
bdate_range)
from pandas.core.dtypes.api import is_list_like
from ... | 41.129172 | 79 | 0.551496 |
a05b31552719e345a9ca0c50c1e3d37ee96023a0 | 479 | py | Python | var/spack/repos/builtin/packages/r-jquerylib/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-jquerylib/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-jquerylib/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RJquerylib(RPackage):
"""Obtain 'jQuery' as an HTML Dependency Object."""
cran = "jqu... | 28.176471 | 95 | 0.736952 |
3fbbe8ffe0dc87b64c474597ebc97bfe41621020 | 3,066 | py | Python | zinv/modules/readers/SelectionProducer.py | shane-breeze/zinv-analysis | 496abf9cb0e77831d580be417bcad7845c347704 | [
"MIT"
] | 1 | 2019-02-06T12:15:42.000Z | 2019-02-06T12:15:42.000Z | zinv/modules/readers/SelectionProducer.py | shane-breeze/zinv-analysis | 496abf9cb0e77831d580be417bcad7845c347704 | [
"MIT"
] | 12 | 2019-03-27T15:52:34.000Z | 2020-02-06T12:09:37.000Z | zinv/modules/readers/SelectionProducer.py | shane-breeze/zinv-analysis | 496abf9cb0e77831d580be417bcad7845c347704 | [
"MIT"
] | 1 | 2019-03-14T17:23:33.000Z | 2019-03-14T17:23:33.000Z | import numpy as np
import yaml
import operator
from cachetools import cachedmethod
from cachetools.keys import hashkey
from functools import partial, reduce
from zinv.utils.Lambda import Lambda
def evaluate_selection(ev, source, nsig, name, cutlist):
return reduce(
operator.add, cutlist,
Lambda("... | 37.390244 | 85 | 0.590998 |
45b2b445ba0b9b71cb25bab0e936833d3a310fca | 4,804 | py | Python | bridge_sim/sim/run/opensees/__init__.py | jerbaroo/bridge-sim | c4ec1c18a07a78462ccf3b970a99a1bd7efcc2af | [
"MIT"
] | 2 | 2020-05-12T11:41:49.000Z | 2020-08-10T15:00:58.000Z | bridge_sim/sim/run/opensees/__init__.py | barischrooneyj/bridge-sim | c4ec1c18a07a78462ccf3b970a99a1bd7efcc2af | [
"MIT"
] | 48 | 2020-05-11T23:58:22.000Z | 2020-09-18T20:28:52.000Z | bridge_sim/sim/run/opensees/__init__.py | jerbaroo/bridge-sim | c4ec1c18a07a78462ccf3b970a99a1bd7efcc2af | [
"MIT"
] | 1 | 2020-05-27T12:43:37.000Z | 2020-05-27T12:43:37.000Z | """Run FE simulations with OpenSees."""
import os
import distutils.spawn as spawn
from typing import Callable, List, Optional, Union
from bridge_sim.model import ResponseType, Config, Bridge
from bridge_sim.sim.model import SimParams
from bridge_sim.sim.run import FEMRunner
from bridge_sim.sim.run.opensees.build imp... | 36.120301 | 86 | 0.664654 |
e09d953b4bc8ab843c5bad8ebdf4454f71f9be14 | 4,783 | py | Python | utils.py | TahaK/spatial-transformer | 9718aea100625381ff7217d8d337943dae206919 | [
"MIT"
] | null | null | null | utils.py | TahaK/spatial-transformer | 9718aea100625381ff7217d8d337943dae206919 | [
"MIT"
] | null | null | null | utils.py | TahaK/spatial-transformer | 9718aea100625381ff7217d8d337943dae206919 | [
"MIT"
] | null | null | null | from scipy.misc import imresize
from scipy.ndimage import rotate
import random
import pickle
from skimage import exposure
import os
import numpy as np
def square_image(image, rectroi, mask):
axis = np.argmax(mask.shape)
diff = mask.shape[axis] - mask.shape[abs(1 - axis)]
crop_mask = np.array([... | 31.261438 | 116 | 0.531047 |
cb2c67515275af7d748860597c224365b95c44b0 | 1,669 | py | Python | src/weaver/datasets.py | Holim0711/holim-lightning | 690972c8faa587e7042bc15d4980c363163083e4 | [
"MIT"
] | 1 | 2021-03-03T08:53:49.000Z | 2021-03-03T08:53:49.000Z | src/weaver/datasets.py | Holim0711/holim-lightning | 690972c8faa587e7042bc15d4980c363163083e4 | [
"MIT"
] | 1 | 2021-03-19T09:16:05.000Z | 2021-03-19T09:35:18.000Z | src/weaver/datasets.py | Holim0711/holim-lightning | 690972c8faa587e7042bc15d4980c363163083e4 | [
"MIT"
] | null | null | null | import os
from collections.abc import Iterable
from typing import Union, Callable
from torch.utils.data import Dataset, DataLoader
import torch
__all__ = [
'SimpleDataset',
'get_dataloader',
]
def get_dataloader(
dataset: Dataset,
batch_size: int,
shuffle: bool,
num_workers: int = os.cpu_coun... | 22.863014 | 75 | 0.574596 |
9d1dfdb1748b8dfacaae30cf98561ef2fc97be7a | 36,914 | py | Python | tests/frameworks/test_motor_asyncio.py | humbss/umongo | bbfaafbfff08bc2314e4cf1ffcad266925cc793c | [
"MIT"
] | null | null | null | tests/frameworks/test_motor_asyncio.py | humbss/umongo | bbfaafbfff08bc2314e4cf1ffcad266925cc793c | [
"MIT"
] | null | null | null | tests/frameworks/test_motor_asyncio.py | humbss/umongo | bbfaafbfff08bc2314e4cf1ffcad266925cc793c | [
"MIT"
] | null | null | null | import asyncio
from datetime import datetime
import pytest
from bson import ObjectId
# Check if the required dependancies are met to run this driver's tests
try:
from motor.motor_asyncio import AsyncIOMotorClient
from motor import version_tuple as MOTOR_VERSION
except ImportError as e:
dep_error = str(e)... | 37.860513 | 116 | 0.556835 |
51f67b7651eec1f6219d87892127bfd8850d9188 | 16,597 | py | Python | tests/unit/verification/test_config.py | onecloud/gbp-rally | 7589b1788c4de26bb66c531ef340ba080754f8c3 | [
"Apache-2.0"
] | null | null | null | tests/unit/verification/test_config.py | onecloud/gbp-rally | 7589b1788c4de26bb66c531ef340ba080754f8c3 | [
"Apache-2.0"
] | null | null | null | tests/unit/verification/test_config.py | onecloud/gbp-rally | 7589b1788c4de26bb66c531ef340ba080754f8c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 49.249258 | 79 | 0.602097 |
db88e6ec52872af3c275682945bda629e2981a89 | 9,140 | py | Python | frappe/desk/search.py | Don-Leopardo/frappe | 39097b05a7a9904776a435ee2c3d7a579d429389 | [
"MIT"
] | 3,755 | 2015-01-06T07:47:43.000Z | 2022-03-31T20:54:23.000Z | frappe/desk/search.py | Don-Leopardo/frappe | 39097b05a7a9904776a435ee2c3d7a579d429389 | [
"MIT"
] | 7,369 | 2015-01-01T19:59:41.000Z | 2022-03-31T23:02:05.000Z | frappe/desk/search.py | Don-Leopardo/frappe | 39097b05a7a9904776a435ee2c3d7a579d429389 | [
"MIT"
] | 2,685 | 2015-01-07T17:51:03.000Z | 2022-03-31T23:16:24.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
# Search
import frappe, json
from frappe.utils import cstr, unique, cint
from frappe.permissions import has_permission
from frappe import _, is_whitelisted
import re
import wrapt
UNTRANSLATED_DOCTYPES = ["DocType", "Role"... | 33.236364 | 196 | 0.706018 |
124ab86bd28f14b8ea31a3d0ed9057ff07d53b43 | 523 | py | Python | test/generate_loss_report.py | lcskrishna/fruit-classification-pytorch | bb48a7402248931a1a0af6a68958babd51d9d40e | [
"MIT"
] | 7 | 2019-04-02T17:50:31.000Z | 2022-01-21T01:59:25.000Z | test/generate_loss_report.py | lcskrishna/fruit-classification-pytorch | bb48a7402248931a1a0af6a68958babd51d9d40e | [
"MIT"
] | 2 | 2019-03-29T18:06:14.000Z | 2019-04-03T16:08:44.000Z | test/generate_loss_report.py | lcskrishna/fruit-classification-pytorch | bb48a7402248931a1a0af6a68958babd51d9d40e | [
"MIT"
] | 2 | 2019-05-27T02:39:53.000Z | 2019-06-01T17:04:51.000Z | import argparse
import os
import sys
parser = argparse.ArgumentParser()
parser.add_argument('--log-file', type=str, required=True)
args = parser.parse_args()
log_file = os.path.abspath(args.log_file)
fs = open(log_file, 'r')
lines = fs.readlines()
fs.close()
loss_values = []
for j in range(len(lines)):
line = ... | 19.37037 | 58 | 0.65392 |
b99061196d5d942a15f4c9ebfa92516037898e21 | 1,141 | py | Python | mysite/jxl/views.py | alex-gagnon/jxl_django | 2060a686551f1ed22b96b3ae72572999557bf812 | [
"MIT"
] | null | null | null | mysite/jxl/views.py | alex-gagnon/jxl_django | 2060a686551f1ed22b96b3ae72572999557bf812 | [
"MIT"
] | 5 | 2021-04-08T19:42:19.000Z | 2022-02-10T12:10:02.000Z | mysite/jxl/views.py | alex-gagnon/jxl_django | 2060a686551f1ed22b96b3ae72572999557bf812 | [
"MIT"
] | null | null | null | import os
from django.http import HttpResponse, FileResponse
from django.urls import reverse_lazy
from django.views.generic import FormView
from . import auth
from .forms import JXLForm
from .services import JXL
class HomeView(FormView):
template_name = 'jxl/home.html'
form_class = JXLForm
http_method_n... | 30.837838 | 88 | 0.657318 |
a49c8e449ff4021e3ca282c8ebaf4b84f91140e6 | 3,659 | py | Python | examples/relationship/manytoonefield/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/relationship/manytoonefield/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/relationship/manytoonefield/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from datetime import date
from django.test import TestCase, TransactionTestCase
from .models import Reporter, Article
# Create your tests here.
class SimpleTest(TransactionTestCase):
reset_sequences = True
def test_a_n_plus_1(self):
# 准备数据
r = Reporter.objects.create(first_name='John', last_... | 42.057471 | 101 | 0.624488 |
c841d59b213a4775ec8551bee11690b9dd759b2d | 239 | py | Python | apps/redmine_settings/apps.py | hugoseabra/redmine-task-generator | b5ce1764f1c7588a7c82b25f7dd4bf07d1c105cf | [
"MIT"
] | null | null | null | apps/redmine_settings/apps.py | hugoseabra/redmine-task-generator | b5ce1764f1c7588a7c82b25f7dd4bf07d1c105cf | [
"MIT"
] | 4 | 2021-03-30T14:04:56.000Z | 2021-06-10T19:40:52.000Z | apps/redmine_settings/apps.py | hugoseabra/redmine-task-generator | b5ce1764f1c7588a7c82b25f7dd4bf07d1c105cf | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class RedmineSettingsConfig(AppConfig):
name = 'apps.redmine_settings'
label = 'redmine_settings'
verbose_name = _('Redmine settings')
| 26.555556 | 55 | 0.774059 |
dcf80f9a3fea03a77e8d31659d071008394f0363 | 8,187 | py | Python | integration_tests/test_auth_levels.py | formula-tech/dydx-v3-python | 95800e3620c2b1f53053b78f35de6e4c43dfdc1a | [
"Apache-2.0"
] | 1 | 2022-01-04T10:35:36.000Z | 2022-01-04T10:35:36.000Z | integration_tests/test_auth_levels.py | formula-tech/dydx-v3-python | 95800e3620c2b1f53053b78f35de6e4c43dfdc1a | [
"Apache-2.0"
] | null | null | null | integration_tests/test_auth_levels.py | formula-tech/dydx-v3-python | 95800e3620c2b1f53053b78f35de6e4c43dfdc1a | [
"Apache-2.0"
] | 1 | 2022-01-21T10:49:48.000Z | 2022-01-21T10:49:48.000Z | import os
import time
from web3 import Web3
from dydx3 import Client
from dydx3 import DydxApiError
from dydx3 import SignableWithdrawal
from dydx3 import constants
from dydx3 import generate_private_key_hex_unsafe
from dydx3 import private_key_to_public_key_pair_hex
from dydx3.helpers.request_helpers import random_c... | 32.748 | 78 | 0.633565 |
33b1fc76622dc1efd0356671abe4521b4176f432 | 1,198 | py | Python | Python/Bank/conta.py | GabrielRenan/Projects-to-Learn | 38bd7e1dfa6ff9ef5ae0e7e5bacaaf23147d71c0 | [
"MIT"
] | null | null | null | Python/Bank/conta.py | GabrielRenan/Projects-to-Learn | 38bd7e1dfa6ff9ef5ae0e7e5bacaaf23147d71c0 | [
"MIT"
] | null | null | null | Python/Bank/conta.py | GabrielRenan/Projects-to-Learn | 38bd7e1dfa6ff9ef5ae0e7e5bacaaf23147d71c0 | [
"MIT"
] | null | null | null | class Conta:
def __init__(self, numero, titular,saldo,limite):
self.__numero = numero
self.__titular = titular
self.__saldo = saldo
self.__limite = limite
def extrato(self):
print("Saldo {} do titular {}".format(self.__saldo, self.__titular))
def __po... | 26.043478 | 76 | 0.599332 |
492ed45653138d20da8afeec9dee9ae8e149ceb2 | 31,439 | py | Python | torch/__init__.py | rraminen/pytorch | f7d5d02a1d873ef61b10186225704b2b283a989a | [
"Intel"
] | null | null | null | torch/__init__.py | rraminen/pytorch | f7d5d02a1d873ef61b10186225704b2b283a989a | [
"Intel"
] | null | null | null | torch/__init__.py | rraminen/pytorch | f7d5d02a1d873ef61b10186225704b2b283a989a | [
"Intel"
] | null | null | null |
r"""
The torch package contains data structures for multi-dimensional
tensors and defines mathematical operations over these tensors.
Additionally, it provides many utilities for efficient serializing of
Tensors and arbitrary types, and other useful utilities.
It has a CUDA counterpart, that enables you to run your t... | 39.796203 | 123 | 0.67254 |
8b73cb379136690ada402037f1dce6a02f274337 | 32,819 | py | Python | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_snapshots_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.279688 | 251 | 0.64874 |
a24ed5ee426f6ac0d9483d90d472840028baf179 | 57,408 | py | Python | airflow/bin/cli.py | mrares/incubator-airflow | fae6ea476b6cdaac64e1b192b827ff64ac18affd | [
"Apache-2.0"
] | null | null | null | airflow/bin/cli.py | mrares/incubator-airflow | fae6ea476b6cdaac64e1b192b827ff64ac18affd | [
"Apache-2.0"
] | null | null | null | airflow/bin/cli.py | mrares/incubator-airflow | fae6ea476b6cdaac64e1b192b827ff64ac18affd | [
"Apache-2.0"
] | 1 | 2018-09-04T10:48:50.000Z | 2018-09-04T10:48:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.037665 | 127 | 0.557884 |
8e8a56d55453a23780afdb169a29d02db08a1001 | 922 | py | Python | catkin_ws/src/auto_rc_car_demos/src/auto_rc_car_demos/lidar_calc.py | Tilytu/uw-auto-rc-car | 51ba607a8716d4d369e041fafb74ac5808c13bd8 | [
"MIT"
] | null | null | null | catkin_ws/src/auto_rc_car_demos/src/auto_rc_car_demos/lidar_calc.py | Tilytu/uw-auto-rc-car | 51ba607a8716d4d369e041fafb74ac5808c13bd8 | [
"MIT"
] | 3 | 2021-06-02T14:46:39.000Z | 2021-07-22T14:16:14.000Z | catkin_ws/src/auto_rc_car_demos/src/auto_rc_car_demos/lidar_calc.py | Tilytu/uw-auto-rc-car | 51ba607a8716d4d369e041fafb74ac5808c13bd8 | [
"MIT"
] | 1 | 2021-08-09T17:46:11.000Z | 2021-08-09T17:46:11.000Z | import numpy as np
import math
class LidarCalc:
def __init__(self):
pass
def lidar_data_too_close(self, scan, th1, th2, min_dist):
# Returns fraction of points between angles [th1, th2]
# that are closer than min_dist
if th2 < th1:
temp = th1
th1 = th2
... | 26.342857 | 70 | 0.557484 |
7885c561d4ccfb3f40d6a88fcc960068ffcfa9d1 | 3,064 | py | Python | netlists/simplegrant/netlist.py | tokenspice/tokenspice | 11d7b3b190c5b0220cc6b6e76ec525ceb7fb5f56 | [
"MIT"
] | 81 | 2021-08-01T10:00:15.000Z | 2022-03-30T15:05:52.000Z | netlists/simplegrant/netlist.py | tokenspice/tokenspice | 11d7b3b190c5b0220cc6b6e76ec525ceb7fb5f56 | [
"MIT"
] | 93 | 2021-08-03T16:21:54.000Z | 2022-03-22T05:36:51.000Z | netlists/simplegrant/netlist.py | tokenspice/tokenspice | 11d7b3b190c5b0220cc6b6e76ec525ceb7fb5f56 | [
"MIT"
] | 15 | 2021-08-10T04:02:32.000Z | 2022-03-30T05:51:56.000Z | from typing import List
from enforce_typing import enforce_types
from agents import GrantGivingAgent, GrantTakingAgent
from engine import KPIsBase, SimStateBase, SimStrategyBase
from util.constants import S_PER_HOUR, S_PER_DAY
from util.plotutil import YParam, arrayToFloatList, LINEAR, MULT1, DOLLAR
@enforce_types
... | 30.336634 | 85 | 0.650131 |
253ad7aebcf50abf6470bd1af94d4e0d8863ff07 | 420 | py | Python | pyqt5_learning_001/PyGui002.py | jieqianchen1990/JieqianLearningZone | a22535bf20deb34108c476624df1462134430eaf | [
"BSD-3-Clause"
] | null | null | null | pyqt5_learning_001/PyGui002.py | jieqianchen1990/JieqianLearningZone | a22535bf20deb34108c476624df1462134430eaf | [
"BSD-3-Clause"
] | null | null | null | pyqt5_learning_001/PyGui002.py | jieqianchen1990/JieqianLearningZone | a22535bf20deb34108c476624df1462134430eaf | [
"BSD-3-Clause"
] | null | null | null | from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
import sys
def window():
app = QApplication(sys.argv)
win = QMainWindow()
# win.setGeometry(xpos, ypos, width, height)
win.setGeometry(0, 0, 1920, 1080)
win.setWindowTitle("This is Jieqian's Window")
... | 20 | 66 | 0.680952 |
ec390235efa48d9f15d34aed3b928ae468ca7616 | 8,631 | py | Python | notebooks/recruitment-7/network-severity-prediction-automatic-model.py | anonymous-authorss/DS-Pipeline | 8304adfe7c1b082ad2225d6d5abf16fd30278cd9 | [
"MIT"
] | null | null | null | notebooks/recruitment-7/network-severity-prediction-automatic-model.py | anonymous-authorss/DS-Pipeline | 8304adfe7c1b082ad2225d6d5abf16fd30278cd9 | [
"MIT"
] | null | null | null | notebooks/recruitment-7/network-severity-prediction-automatic-model.py | anonymous-authorss/DS-Pipeline | 8304adfe7c1b082ad2225d6d5abf16fd30278cd9 | [
"MIT"
] | null | null | null |
# coding: utf-8
# ### **Loading Libraries**
# In[ ]:
import numpy as np
from sklearn.ensemble import RandomForestClassifier
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn import preprocessing
import os
print(os.listdir("../input"))
from sklea... | 15.523381 | 461 | 0.698181 |
32eb30ce5c10c062d769ff0934c1c5b22b6a75b3 | 4,099 | py | Python | test/sagemaker_tests/pytorch/training/integration/local/test_distributed_training.py | Yixiao99/deep-learning-containers | 01f078adf5abfb92e802b326511981bdd4a8c85c | [
"Apache-2.0"
] | 7 | 2021-12-18T05:49:22.000Z | 2021-12-28T09:52:32.000Z | test/sagemaker_tests/pytorch/training/integration/local/test_distributed_training.py | Yixiao99/deep-learning-containers | 01f078adf5abfb92e802b326511981bdd4a8c85c | [
"Apache-2.0"
] | 32 | 2021-06-10T21:21:29.000Z | 2021-08-06T22:37:37.000Z | test/sagemaker_tests/pytorch/training/integration/local/test_distributed_training.py | Yixiao99/deep-learning-containers | 01f078adf5abfb92e802b326511981bdd4a8c85c | [
"Apache-2.0"
] | 1 | 2021-04-20T05:05:11.000Z | 2021-04-20T05:05:11.000Z | # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 33.325203 | 99 | 0.714077 |
17a494581884e81fdd8ca37d62deaf83778218cd | 13 | py | Python | reconner/constants.py | kabirkhan/spacy-data-debug | 5df124d5520d5eb9bbdcd45943e325e07ed2aed2 | [
"MIT"
] | null | null | null | reconner/constants.py | kabirkhan/spacy-data-debug | 5df124d5520d5eb9bbdcd45943e325e07ed2aed2 | [
"MIT"
] | null | null | null | reconner/constants.py | kabirkhan/spacy-data-debug | 5df124d5520d5eb9bbdcd45943e325e07ed2aed2 | [
"MIT"
] | null | null | null | NONE = 'NONE' | 13 | 13 | 0.615385 |
8aae2c760ae46089be115df0d21f60c64efc445f | 4,035 | py | Python | mxdc/conf/__init__.py | michel4j/mxdc | 844f0854cc696553c8a51f8e9b5b06a8e4345261 | [
"BSD-3-Clause"
] | 2 | 2018-10-23T19:05:40.000Z | 2021-03-18T20:06:32.000Z | mxdc/conf/__init__.py | michel4j/mxdc | 844f0854cc696553c8a51f8e9b5b06a8e4345261 | [
"BSD-3-Clause"
] | null | null | null | mxdc/conf/__init__.py | michel4j/mxdc | 844f0854cc696553c8a51f8e9b5b06a8e4345261 | [
"BSD-3-Clause"
] | null | null | null | import glob
import os
import sys
import gi
import ipaddress
gi.require_version('Gio', '2.0')
import msgpack
from gi.repository import Gio
from mxdc.utils import misc
from mxdc.utils.log import get_module_logger
logger = get_module_logger(__name__)
APP_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)... | 29.669118 | 108 | 0.633457 |
ea028a07be5f54db877f56999874a6aeeebed423 | 3,860 | py | Python | monai/data/png_writer.py | tatuanb/monai_V1 | 41e492b61c78bb3c303f38b03fe9fdc74a3c2e96 | [
"Apache-2.0"
] | 1 | 2020-11-13T23:13:23.000Z | 2020-11-13T23:13:23.000Z | monai/data/png_writer.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 2 | 2020-11-13T23:15:00.000Z | 2020-11-16T14:54:08.000Z | monai/data/png_writer.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 1 | 2021-11-14T06:54:44.000Z | 2021-11-14T06:54:44.000Z | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 44.367816 | 103 | 0.653109 |
da19c55c9a0b1a21f695ffee01b892cd07b2f5af | 4,995 | py | Python | tests/test_vision_transform.py | ysterin/fastai | 9a20ea683eab94dab4914453fe440f7eb981bf1f | [
"Apache-2.0"
] | 1 | 2022-03-13T21:41:13.000Z | 2022-03-13T21:41:13.000Z | tests/test_vision_transform.py | ysterin/fastai | 9a20ea683eab94dab4914453fe440f7eb981bf1f | [
"Apache-2.0"
] | null | null | null | tests/test_vision_transform.py | ysterin/fastai | 9a20ea683eab94dab4914453fe440f7eb981bf1f | [
"Apache-2.0"
] | 1 | 2018-09-11T15:50:20.000Z | 2018-09-11T15:50:20.000Z | import pytest
from fastai.vision import *
def bbox2pic(corners, size):
pic = torch.zeros(1, size,size)
pic[0, corners[0]:corners[2], corners[1]:corners[3]] = 1.
return Image(pic)
def points2pic(points, size):
points = points.clamp(min=0,max=size-1)
pic = torch.zeros(1, size,size)
for p in poin... | 40.942623 | 117 | 0.57958 |
5ec9326953ca9a9fe28c39651401d8bb9ef9e57b | 883 | py | Python | bigflow_python/python/bigflow/test/__init__.py | tushushu/bigflow | ab494e49a02b446bb2f504a2652f866c924c1baf | [
"Apache-2.0"
] | 1,236 | 2017-11-14T11:10:10.000Z | 2022-03-08T11:54:41.000Z | bigflow_python/python/bigflow/test/__init__.py | tushushu/bigflow | ab494e49a02b446bb2f504a2652f866c924c1baf | [
"Apache-2.0"
] | 38 | 2017-11-14T16:29:12.000Z | 2020-01-23T08:32:04.000Z | bigflow_python/python/bigflow/test/__init__.py | tushushu/bigflow | ab494e49a02b446bb2f504a2652f866c924c1baf | [
"Apache-2.0"
] | 184 | 2017-11-27T07:23:36.000Z | 2022-03-14T02:54:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
#
# Copyright (c) 2015 Baidu, Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | 32.703704 | 74 | 0.616082 |
2f720d08c5f6fbdc649e3f9439cb953a28311452 | 5,394 | py | Python | asposecadcloud/models/resolution_setting.py | aspose-cad-cloud/aspose-cad-cloud-python | 737751419cada42b5aa746ec7e275b72a475b721 | [
"MIT"
] | 2 | 2021-03-31T23:44:37.000Z | 2021-04-01T03:15:00.000Z | asposecadcloud/models/resolution_setting.py | aspose-cad-cloud/aspose-cad-cloud-python | 737751419cada42b5aa746ec7e275b72a475b721 | [
"MIT"
] | null | null | null | asposecadcloud/models/resolution_setting.py | aspose-cad-cloud/aspose-cad-cloud-python | 737751419cada42b5aa746ec7e275b72a475b721 | [
"MIT"
] | null | null | null | # coding: utf-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="ResolutionSetting.py">
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obt... | 35.721854 | 93 | 0.628105 |
d8bdcf8299448490fa1086a54096d15d15e74095 | 5,012 | py | Python | UniSim/unisim/agents.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | UniSim/unisim/agents.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | UniSim/unisim/agents.py | RDC4Smart-Mobility/UniSim | 872a22ccdac859b9a12f11a9f5d20467e9db18ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import, unicode_literals
from .api import API
from .wrappers import BaseClient
class Entity(object):
pass
class Routine(object):
def __init__(self):
self.acceptable_range = 100
def accept(self):
fro... | 29.139535 | 87 | 0.595371 |
62e34fca54e3cfcd312f88dad7987f3c55a30856 | 2,382 | py | Python | serveur.py | ManuSquall/squalltalk | 8293a2297647c53ff13e2120d6e9ee907f12fa3b | [
"CC0-1.0"
] | 4 | 2021-04-01T03:07:33.000Z | 2022-03-30T07:11:21.000Z | serveur.py | ManuSquall/squalltalk | 8293a2297647c53ff13e2120d6e9ee907f12fa3b | [
"CC0-1.0"
] | null | null | null | serveur.py | ManuSquall/squalltalk | 8293a2297647c53ff13e2120d6e9ee907f12fa3b | [
"CC0-1.0"
] | null | null | null | import socket
import threading
T=[]
#affichage à envoyer aux clients
chaine_vide=" "
chaine_vide=chaine_vide.encode("utf8")
# thread de reception pour recevoir les messages des clients
# recevoir les messages des clients!
class THR(threading.Thread):
def __init__(self, socket):
threading.Thread.__ini... | 26.466667 | 80 | 0.447943 |
c57975c5897a56c11a6f86d6826dc44d5379276d | 1,492 | py | Python | 058-bmp-stegano/taski_zrodla/revengeofbits/src/level4/mklevel4.py | gynvael/stream | 2d1a3f25b2f83241b39dab931d9ff03fca81d26e | [
"MIT"
] | 152 | 2016-02-04T10:40:46.000Z | 2022-03-03T18:25:54.000Z | 058-bmp-stegano/taski_zrodla/revengeofbits/src/level4/mklevel4.py | gynvael/stream | 2d1a3f25b2f83241b39dab931d9ff03fca81d26e | [
"MIT"
] | 4 | 2016-03-11T23:49:46.000Z | 2017-06-16T18:58:53.000Z | 058-bmp-stegano/taski_zrodla/revengeofbits/src/level4/mklevel4.py | gynvael/stream | 2d1a3f25b2f83241b39dab931d9ff03fca81d26e | [
"MIT"
] | 48 | 2016-01-31T19:13:36.000Z | 2021-09-03T19:50:17.000Z | #!/usr/bin/python
import os, sys
from struct import pack, unpack
PATH = os.path.dirname(os.path.realpath(__file__))
sys.path.append(PATH)
import settings
def rb(d, off):
return d[off]
def rw(d, off):
return unpack("<H", str(d[off:off+2]))[0]
def rd(d, off):
return unpack("<I", str(d[off:off+4]))[0]
def db(v)... | 16.954545 | 61 | 0.544906 |
24466d454f94cbccb40c15ba1da38e732e87c212 | 4,949 | py | Python | u2net_train.py | hhaAndroid/u2net | fff1db4edb3c9675b82926980ce1d5dfa98c0a1e | [
"Apache-2.0"
] | 1 | 2021-01-09T07:40:08.000Z | 2021-01-09T07:40:08.000Z | u2net_train.py | hhaAndroid/u2net | fff1db4edb3c9675b82926980ce1d5dfa98c0a1e | [
"Apache-2.0"
] | null | null | null | u2net_train.py | hhaAndroid/u2net | fff1db4edb3c9675b82926980ce1d5dfa98c0a1e | [
"Apache-2.0"
] | null | null | null | import torch
import torchvision
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import torch.optim as optim
import torchvision.transforms as standard_transforms
import numpy as np
impor... | 30.176829 | 173 | 0.658517 |
6a144b57a83e1284c4d967b3ad38d2a61c2aa1e5 | 5,255 | py | Python | sdk/python/pulumi_azure_native/documentdb/v20210315/get_table_resource_table.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20210315/get_table_resource_table.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20210315/get_table_resource_table.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 37.007042 | 505 | 0.648906 |
638da1500b76ccfb517fe8608d74748d89f316d4 | 906 | py | Python | tests/test_endpoint.py | wikimedia/mediawiki-services-similar-users | dcae8be6ce57d6eecbdbf4e2e3e8dddcbaf17da9 | [
"MIT"
] | null | null | null | tests/test_endpoint.py | wikimedia/mediawiki-services-similar-users | dcae8be6ce57d6eecbdbf4e2e3e8dddcbaf17da9 | [
"MIT"
] | null | null | null | tests/test_endpoint.py | wikimedia/mediawiki-services-similar-users | dcae8be6ce57d6eecbdbf4e2e3e8dddcbaf17da9 | [
"MIT"
] | null | null | null | import json
import pytest
from conftest import TEST_USER, TEST_USER_MISSING
def get_url(client, credentials, url="/", headers=None):
if not headers:
headers = {"Authorization": f"Basic {credentials}"}
return client.get(url, headers=headers)
def test_forbid_access_root(client, credentials):
rv = ... | 27.454545 | 62 | 0.697572 |
3a76c8090abaf9d19cfe479a6f9d6ee53ae2d5a4 | 1,253 | py | Python | preprocess/loader.py | Zepyhrus/mtcnn-tensorflow | 6fb6f5cabc28486d2e627f3e2e03727cf4cbd5e0 | [
"MIT"
] | null | null | null | preprocess/loader.py | Zepyhrus/mtcnn-tensorflow | 6fb6f5cabc28486d2e627f3e2e03727cf4cbd5e0 | [
"MIT"
] | null | null | null | preprocess/loader.py | Zepyhrus/mtcnn-tensorflow | 6fb6f5cabc28486d2e627f3e2e03727cf4cbd5e0 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[ ]:
import numpy as np
import sys
import cv2
class TestLoader:
#制作迭代器
def __init__(self, imdb, batch_size=1, shuffle=False):
self.imdb = imdb
self.batch_size = batch_size
self.shuffle = shuffle
self.size = len(imdb)
self.cur = 0... | 19.578125 | 58 | 0.542698 |
8181bc40cb0271fccaa76b4156b8d86f6fa96c42 | 406 | py | Python | Q1_LongestWord.py | ICEJ-jr/MyHackathonCodes | 001de2cadcd56b5d3c9bbbe93ce6baaaeadd5455 | [
"MIT"
] | null | null | null | Q1_LongestWord.py | ICEJ-jr/MyHackathonCodes | 001de2cadcd56b5d3c9bbbe93ce6baaaeadd5455 | [
"MIT"
] | null | null | null | Q1_LongestWord.py | ICEJ-jr/MyHackathonCodes | 001de2cadcd56b5d3c9bbbe93ce6baaaeadd5455 | [
"MIT"
] | null | null | null | lst = ['Hello','world','hi','bye']
def LngWrd(lst):
'''Takes a list of words as argument Returns the longest word in the list.'''
lngwrd = lst[0] # Assumes that the longest word so far is the first item
for i in lst:
if len(i) >= len(lngwrd):
lngwrd = i # updates the the long... | 31.230769 | 82 | 0.591133 |
a920ee805848ef2c746d1e258d6e106da9fd4964 | 10,139 | py | Python | src/config/contrail_issu/contrail_issu/issu_contrail_config.py | atsgen/contrail-controller | 6f552316d9bacab29deb7d2507a49fcc96f70b52 | [
"Apache-2.0"
] | null | null | null | src/config/contrail_issu/contrail_issu/issu_contrail_config.py | atsgen/contrail-controller | 6f552316d9bacab29deb7d2507a49fcc96f70b52 | [
"Apache-2.0"
] | null | null | null | src/config/contrail_issu/contrail_issu/issu_contrail_config.py | atsgen/contrail-controller | 6f552316d9bacab29deb7d2507a49fcc96f70b52 | [
"Apache-2.0"
] | 1 | 2020-12-18T18:22:53.000Z | 2020-12-18T18:22:53.000Z | #!/usr/bin/python
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
import sys
if sys.version_info[0] < 3:
reload(sys) # noqa
sys.setdefaultencoding('UTF8')
from six.moves import configparser
from six import string_types
import argparse
import logging
from pysandesh.gen_py.sandesh.ttypes imp... | 34.253378 | 92 | 0.641385 |
c003892729f5397c538dda1cbe6bed1f9fad7990 | 916 | py | Python | ciphers/diffie.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | ciphers/diffie.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | ciphers/diffie.py | hank-chou/python | a9f729fa263bce599d2774f3f6afb5a18bcc9862 | [
"MIT"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | from typing import Optional
def find_primitive(n: int) -> Optional[int]:
for r in range(1, n):
li = []
for x in range(n - 1):
val = pow(r, x, n)
if val in li:
break
li.append(val)
else:
return r
return None
if __name__ =... | 27.757576 | 64 | 0.548035 |
5cf718919af1d3266ffeee8ce8d174c179fe78aa | 1,244 | py | Python | cifar10_test.py | tarunn2799/PyTorch_CIFAR10 | e407e3cb836d9757d40ec6f39a43d9570087c892 | [
"MIT"
] | 1 | 2020-08-29T14:10:33.000Z | 2020-08-29T14:10:33.000Z | cifar10_test.py | tarunn2799/PyTorch_CIFAR10 | e407e3cb836d9757d40ec6f39a43d9570087c892 | [
"MIT"
] | null | null | null | cifar10_test.py | tarunn2799/PyTorch_CIFAR10 | e407e3cb836d9757d40ec6f39a43d9570087c892 | [
"MIT"
] | null | null | null | import os, shutil
import torch
from argparse import ArgumentParser
from pytorch_lightning import Trainer
from cifar10_module import CIFAR10_Module
def main(hparams):
# If only train on 1 GPU. Must set_device otherwise PyTorch always store model on GPU 0 first
if type(hparams.gpus) == str:
if len(hp... | 44.428571 | 98 | 0.697749 |
477503bf722d1fd08a2b3cb59df91d889d3d6a3c | 1,000 | py | Python | transformers/cmap/python-flask-server/setup.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 5 | 2020-08-28T09:30:16.000Z | 2021-12-29T16:00:26.000Z | transformers/cmap/python-flask-server/setup.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 19 | 2021-04-26T22:19:16.000Z | 2022-03-09T21:09:55.000Z | transformers/cmap/python-flask-server/setup.py | mapleknight/molecular-data-provider | 111418ed7efab3c393c22116854fd322ff367fb9 | [
"MIT"
] | 8 | 2020-07-09T18:50:57.000Z | 2022-01-20T16:01:33.000Z | # coding: utf-8
import sys
from setuptools import setup, find_packages
NAME = "cmap-transformer"
VERSION = "2.1.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = [
"connexion>=2.0.2",
"swagger-ui-bundle... | 25 | 110 | 0.698 |
065580809540735708a0a0b7a659f8006787dc5b | 336 | py | Python | Where am I/catkin_ws/build/catkin_generated/order_packages.py | matthewashley1/Udacity---Robotics-Software-Engineer-Nanodegree | 8c46b0e9bf4223ac6daed4c27a17c62abfb9df3f | [
"MIT"
] | null | null | null | Where am I/catkin_ws/build/catkin_generated/order_packages.py | matthewashley1/Udacity---Robotics-Software-Engineer-Nanodegree | 8c46b0e9bf4223ac6daed4c27a17c62abfb9df3f | [
"MIT"
] | null | null | null | Where am I/catkin_ws/build/catkin_generated/order_packages.py | matthewashley1/Udacity---Robotics-Software-Engineer-Nanodegree | 8c46b0e9bf4223ac6daed4c27a17c62abfb9df3f | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/order_packages.context.py.in
source_root_dir = "/home/robond/Documents/Project3/catkin_ws/src"
whitelisted_packages = "".split(';') if "" != "" else []
blacklisted_packages = "".split(';') if "" != "" else []
underlay_workspaces = "/opt/ros/kinetic".split(';') if "/opt/ros/kinetic... | 56 | 87 | 0.681548 |
ae0096437e091820ad09df1f2c386bfe2aa5f072 | 3,435 | py | Python | test/examples/test_kronecker_multitask_gp_regression.py | yushangdi/gpytorch | 3234046ecb672965af8765d47eb016f85b729bb0 | [
"MIT"
] | 2 | 2019-04-19T00:35:49.000Z | 2019-04-19T02:51:49.000Z | test/examples/test_kronecker_multitask_gp_regression.py | yushangdi/gpytorch | 3234046ecb672965af8765d47eb016f85b729bb0 | [
"MIT"
] | null | null | null | test/examples/test_kronecker_multitask_gp_regression.py | yushangdi/gpytorch | 3234046ecb672965af8765d47eb016f85b729bb0 | [
"MIT"
] | 1 | 2019-04-19T00:42:35.000Z | 2019-04-19T00:42:35.000Z | #!/usr/bin/env python3
from math import pi
import os
import random
import torch
import unittest
import gpytorch
from gpytorch.kernels import RBFKernel, MultitaskKernel
from gpytorch.means import ConstantMean, MultitaskMean
from gpytorch.likelihoods import MultitaskGaussianLikelihood
from gpytorch.distributions import... | 36.157895 | 120 | 0.668413 |
201900420fa17a40305a41d2d7bebc271fe21f3f | 331 | py | Python | pythonbrasil/exercicios/funcoes/FC resp 04.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | pythonbrasil/exercicios/funcoes/FC resp 04.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | pythonbrasil/exercicios/funcoes/FC resp 04.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | '''
Faça um programa, com uma função que necessite de um argumento. A função
retorna o valor de caractere ‘P’, se seu argumento for positivo, e ‘N’, se
seu argumento for zero ou negativo.
'''
def PosNeg(a,b):
x = a + b
if x >= 0:
print('P')
else:
if x < 0:
print('N')
... | 20.6875 | 74 | 0.540785 |
2a7180adfd587346d61ed5948149c3e99dcf6250 | 30,050 | py | Python | tests/unit/aiplatform/test_metadata_resources.py | kthytang/python-aiplatform | e82c1792293396045a1032df015a3700fc38609b | [
"Apache-2.0"
] | null | null | null | tests/unit/aiplatform/test_metadata_resources.py | kthytang/python-aiplatform | e82c1792293396045a1032df015a3700fc38609b | [
"Apache-2.0"
] | null | null | null | tests/unit/aiplatform/test_metadata_resources.py | kthytang/python-aiplatform | e82c1792293396045a1032df015a3700fc38609b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.292271 | 107 | 0.688153 |
66ad2b0a1ff6da454eac6302296263a309799b02 | 266 | py | Python | examples/speech_recognition/models/__init__.py | nedo0shki/fairseq-editor | a0f09787bc0d302be5833ec0dad3e568440f4551 | [
"MIT"
] | 5,129 | 2019-09-30T11:21:03.000Z | 2022-03-31T22:35:12.000Z | examples/speech_recognition/models/__init__.py | ayu1812/fairseq | a87cafda718c7706e6f1694f0d39fc589ed2b264 | [
"MIT"
] | 604 | 2019-10-05T00:39:46.000Z | 2022-03-31T11:12:07.000Z | examples/speech_recognition/models/__init__.py | ayu1812/fairseq | a87cafda718c7706e6f1694f0d39fc589ed2b264 | [
"MIT"
] | 1,034 | 2019-09-30T15:01:32.000Z | 2022-03-31T06:14:50.000Z | import importlib
import os
for file in os.listdir(os.path.dirname(__file__)):
if file.endswith('.py') and not file.startswith('_'):
model_name = file[:file.find('.py')]
importlib.import_module('examples.speech_recognition.models.' + model_name)
| 33.25 | 83 | 0.703008 |
c0d5615ca27fcad58d111d7a89ae202a08f611a6 | 2,602 | py | Python | maskrcnn_benchmark/utils/visualize.py | YanhuaCheng/maskrcnn-benchmark | 4bdea73f9c12ba11b82be0d51c32a5b2ab3317b9 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/utils/visualize.py | YanhuaCheng/maskrcnn-benchmark | 4bdea73f9c12ba11b82be0d51c32a5b2ab3317b9 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/utils/visualize.py | YanhuaCheng/maskrcnn-benchmark | 4bdea73f9c12ba11b82be0d51c32a5b2ab3317b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#encoding=utf8
#########################################################################
# Author:
# Created Time: Thu Jul 4 17:27:38 2019
# File Name: visualize.py
# Description:
#########################################################################
import os
import random
import numpy as np... | 39.424242 | 130 | 0.578786 |
2fdd2c9243277058ed56b685ed89da8fe5e06e11 | 7,264 | py | Python | lib/JumpScale/sal/sshd/SSHD.py | Jumpscale/jumpscale_core8 | f80ac9b1ab99b833ee7adb17700dcf4ef35f3734 | [
"Apache-2.0"
] | 8 | 2016-04-14T14:04:57.000Z | 2020-06-09T00:24:34.000Z | lib/JumpScale/sal/sshd/SSHD.py | Jumpscale/jumpscale_core8 | f80ac9b1ab99b833ee7adb17700dcf4ef35f3734 | [
"Apache-2.0"
] | 418 | 2016-01-25T10:30:00.000Z | 2021-09-08T12:29:13.000Z | lib/JumpScale/sal/sshd/SSHD.py | Jumpscale/jumpscale_core8 | f80ac9b1ab99b833ee7adb17700dcf4ef35f3734 | [
"Apache-2.0"
] | 9 | 2016-04-21T07:21:17.000Z | 2022-01-24T10:35:54.000Z | from JumpScale import j
OP_ADD = '+'
OP_DEL = '-'
OP_ERS = '--'
class SSHError(Exception):
pass
class SSHD:
def __init__(self):
self.__jslocation__ = "j.sal.sshd"
SSH_ROOT = j.tools.path.get('/root/.ssh')
SSH_AUTHORIZED_KEYS = j.tools.path.get(SSH_ROOT).joinpath('authorized_keys')
d... | 36.32 | 184 | 0.57076 |
dfae2cc68ab5dc6dd207be0f26ca7bfc81a5246f | 2,934 | py | Python | cmd/publish.py | IamBusy/yugong | 6f15b61641d9a8a9f910b694d869ea9d20230d88 | [
"Apache-2.0"
] | 1 | 2018-08-06T08:53:35.000Z | 2018-08-06T08:53:35.000Z | cmd/publish.py | IamBusy/yugong | 6f15b61641d9a8a9f910b694d869ea9d20230d88 | [
"Apache-2.0"
] | null | null | null | cmd/publish.py | IamBusy/yugong | 6f15b61641d9a8a9f910b694d869ea9d20230d88 | [
"Apache-2.0"
] | 1 | 2018-06-06T16:58:10.000Z | 2018-06-06T16:58:10.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
@author: william
@contact: 1342247033@qq.com
@site: http://www.xiaolewei.com
@file: publish.py
@time: 07/03/2018 00:45
"""
import sys
import time
import json
from core import db, config, logger
from publisher.toutiao.publisher import ToutiaoPublisher
from publisher.toutiao... | 32.6 | 95 | 0.588957 |
4b94a6ca59f75748f70d6ec73c37991bcd702d2b | 961 | py | Python | poetry_scripts.py | threecifanggen/python-functional-programming | bd17281e5f24db826266f509bc54b25362c0d2a1 | [
"MIT"
] | 3 | 2021-10-05T09:12:36.000Z | 2021-11-30T07:11:58.000Z | poetry_scripts.py | threecifanggen/python-functional-programming | bd17281e5f24db826266f509bc54b25362c0d2a1 | [
"MIT"
] | 14 | 2021-10-11T05:31:15.000Z | 2021-12-16T12:52:47.000Z | poetry_scripts.py | threecifanggen/python-functional-programming | bd17281e5f24db826266f509bc54b25362c0d2a1 | [
"MIT"
] | null | null | null | import os
from fppy import __version__
def docs():
"""生成DOC
"""
build_dir = 'docs/build/'+ __version__
source_dir = 'docs/source'
build_main_dir = 'docs/build/main'
os.system((
f'sphinx-build -b html {source_dir} {build_dir}'
))
os.system((
f'sphinx-build -b html {so... | 23.439024 | 61 | 0.552549 |
0ced19ff4f2ab3ff72a40eb29bd8a90dc84ddb30 | 4,537 | py | Python | api/jobs/reaper.py | Racheltrq/Anubis | 20eabe5651cee4ca5dc2f2b9bb531724aad1cf37 | [
"MIT"
] | 65 | 2021-06-27T07:18:27.000Z | 2021-09-17T16:58:24.000Z | api/jobs/reaper.py | Racheltrq/Anubis | 20eabe5651cee4ca5dc2f2b9bb531724aad1cf37 | [
"MIT"
] | 114 | 2021-06-27T08:37:43.000Z | 2021-10-24T00:51:01.000Z | api/jobs/reaper.py | Racheltrq/Anubis | 20eabe5651cee4ca5dc2f2b9bb531724aad1cf37 | [
"MIT"
] | 15 | 2021-06-27T07:26:51.000Z | 2021-10-06T18:42:39.000Z | import json
import traceback
from datetime import datetime, timedelta
from typing import List
from anubis.lms.assignments import get_recent_assignments
from anubis.lms.submissions import init_submission
from anubis.models import (
db,
Submission,
Course,
)
from anubis.utils.data import with_context
from an... | 27.005952 | 108 | 0.624862 |
83d5929835cabadcce69e8c551b7d41bfa814bea | 753 | py | Python | tests/vagrant/test_carddav.py | mathstuf/pycarddav | 8bfdbef79c11ed9b14304773d26b1542d16ef2b2 | [
"MIT"
] | null | null | null | tests/vagrant/test_carddav.py | mathstuf/pycarddav | 8bfdbef79c11ed9b14304773d26b1542d16ef2b2 | [
"MIT"
] | null | null | null | tests/vagrant/test_carddav.py | mathstuf/pycarddav | 8bfdbef79c11ed9b14304773d26b1542d16ef2b2 | [
"MIT"
] | null | null | null | # vim: set fileencoding=utf-8 :
import vagrant
import pytest
import pycarddav.carddav as carddav
HANZ_BASE = 'http://localhost:8080/davical/caldav.php/hanz/addresses/'
LENNA_BASE = 'http://localhost:8080/davical/caldav.php/lenna/addresses/'
def test_url_does_not_exist():
vbox = vagrant.Vagrant()
vbox.up()
... | 25.1 | 72 | 0.699867 |
32861b866f75fd4cd2f91efe895af40b4211afdd | 13,706 | py | Python | tests/core/pyspec/eth2spec/test/altair/transition/test_transition.py | mcdee/consensus-specs | f74f3c37adba44f05b1cde1a973d72e269608c18 | [
"CC0-1.0"
] | 1 | 2022-03-26T06:18:04.000Z | 2022-03-26T06:18:04.000Z | tests/core/pyspec/eth2spec/test/altair/transition/test_transition.py | mcdee/consensus-specs | f74f3c37adba44f05b1cde1a973d72e269608c18 | [
"CC0-1.0"
] | null | null | null | tests/core/pyspec/eth2spec/test/altair/transition/test_transition.py | mcdee/consensus-specs | f74f3c37adba44f05b1cde1a973d72e269608c18 | [
"CC0-1.0"
] | null | null | null | import random
from eth2spec.test.context import (
ForkMeta,
with_fork_metas,
)
from eth2spec.test.helpers.constants import (
ALL_PRE_POST_FORKS,
)
from eth2spec.test.helpers.state import (
next_epoch_via_signed_block,
)
from eth2spec.test.helpers.attestations import next_slots_with_attestations
from eth... | 37.550685 | 118 | 0.700204 |
2a2d04017aed188352aba0718170fdeda3b3307c | 898 | py | Python | scraper/src/helpers.py | Haroenv/docs-scraper | 1dd8caacbef7f5d71c3ecd1d3a5bbd68fabf540b | [
"MIT"
] | 97 | 2020-03-28T23:00:14.000Z | 2022-03-20T06:29:13.000Z | scraper/src/helpers.py | Haroenv/docs-scraper | 1dd8caacbef7f5d71c3ecd1d3a5bbd68fabf540b | [
"MIT"
] | 149 | 2020-03-01T17:31:05.000Z | 2022-03-30T04:06:29.000Z | scraper/src/helpers.py | ssaylo/meilisearch | 80c565440723a7442a39dc15af5c752eecb28b71 | [
"MIT"
] | 18 | 2020-05-03T18:00:52.000Z | 2022-02-10T16:32:14.000Z | import json
import unicodedata
from builtins import input
from cssselect import HTMLTranslator
def confirm(message="Confirm"):
prompt = message + ' [y/n]:\n'
while True:
ans = input(prompt)
if ans not in ['y', 'Y', 'n', 'N']:
print('please enter y or n.')
continue
... | 19.521739 | 69 | 0.564588 |
8e1b8cdcb55079ca79f7962e5f3aaee2821add54 | 1,852 | py | Python | configs/SETR/SETR_MLA_768x768_80k_cityscapes_bs_8_MS.py | cocolord/mmsegmentation | 45db7269d7aa40f8aac5ddaabf7e1b4b01353ca5 | [
"Apache-2.0"
] | 1 | 2021-05-27T11:28:16.000Z | 2021-05-27T11:28:16.000Z | configs/SETR/SETR_MLA_768x768_80k_cityscapes_bs_8_MS.py | cocolord/mmsegmentation | 45db7269d7aa40f8aac5ddaabf7e1b4b01353ca5 | [
"Apache-2.0"
] | null | null | null | configs/SETR/SETR_MLA_768x768_80k_cityscapes_bs_8_MS.py | cocolord/mmsegmentation | 45db7269d7aa40f8aac5ddaabf7e1b4b01353ca5 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/setr_mla.py',
'../_base_/datasets/cityscapes_768x768_multi_scale.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_80k.py'
]
model = dict(
backbone=dict(img_size=768,pos_embed_interp=True, drop_rate=0.,mla_channels=256,mla_index=(5,11,17,23)),
decode_hea... | 30.866667 | 108 | 0.62419 |
4539ff2276b06b338d20129f917c53bd740f877e | 4,659 | py | Python | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_dedicated_bearer_deactivation_invalid_lbi.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 849 | 2020-07-17T09:15:03.000Z | 2022-03-31T17:11:52.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_dedicated_bearer_deactivation_invalid_lbi.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 8,386 | 2020-06-23T23:35:30.000Z | 2022-03-31T23:31:28.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_dedicated_bearer_deactivation_invalid_lbi.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 406 | 2020-06-28T17:02:35.000Z | 2022-03-31T22:03:55.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 33.76087 | 78 | 0.571367 |
745f201b4ece1a726062ee6195b400822f15019f | 5,500 | py | Python | models/hovernet/net_desc.py | shikhar-srivastava/hover_net | d4e8e129a4ad72f5d574a78c036449b496421529 | [
"MIT"
] | 222 | 2019-07-02T05:44:56.000Z | 2022-03-29T07:04:24.000Z | models/hovernet/net_desc.py | shikhar-srivastava/hover_net | d4e8e129a4ad72f5d574a78c036449b496421529 | [
"MIT"
] | 190 | 2019-06-28T16:17:21.000Z | 2022-03-29T14:32:48.000Z | models/hovernet/net_desc.py | shikhar-srivastava/hover_net | d4e8e129a4ad72f5d574a78c036449b496421529 | [
"MIT"
] | 124 | 2019-06-26T02:53:51.000Z | 2022-03-19T19:14:13.000Z | import math
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .net_utils import (DenseBlock, Net, ResidualBlock, TFSamepaddingLayer,
UpSample2x)
from .utils import crop_op, crop_to_shape
####
class HoVerNet(Net):
... | 35.714286 | 94 | 0.506909 |
acd2d5fb251cd114e0785771bc2c458c5ca37ccb | 250 | py | Python | reqherd/webservice/schemas/base.py | zthurman/reqherd | 6b35c4f22d4e28c363f82a5f3331657f8244a589 | [
"Apache-2.0"
] | null | null | null | reqherd/webservice/schemas/base.py | zthurman/reqherd | 6b35c4f22d4e28c363f82a5f3331657f8244a589 | [
"Apache-2.0"
] | null | null | null | reqherd/webservice/schemas/base.py | zthurman/reqherd | 6b35c4f22d4e28c363f82a5f3331657f8244a589 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from datetime import datetime
from pydantic import BaseModel
class BaseRequirementSchema(BaseModel):
doc_prefix: Optional[str] = None
definition: Optional[str] = None
modified_date: Optional[datetime] = None
| 25 | 44 | 0.78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.