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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1af27d72af6c6032e352d0d1c79a53d362e2f597 | 4,595 | py | Python | adb_shell/transport/tcp_transport.py | KOLANICH-libs/adb_shell | bf4d348e3aa0999b24976de9bac442b0e180a27e | [
"Apache-2.0"
] | 268 | 2019-09-25T16:38:51.000Z | 2022-03-31T07:08:17.000Z | adb_shell/transport/tcp_transport.py | KOLANICH-libs/adb_shell | bf4d348e3aa0999b24976de9bac442b0e180a27e | [
"Apache-2.0"
] | 73 | 2019-09-30T14:25:38.000Z | 2022-01-23T23:04:29.000Z | adb_shell/transport/tcp_transport.py | KOLANICH-libs/adb_shell | bf4d348e3aa0999b24976de9bac442b0e180a27e | [
"Apache-2.0"
] | 48 | 2019-11-05T20:37:59.000Z | 2022-03-09T08:12:06.000Z | # Copyright (c) 2021 Jeff Irion and contributors
#
# This file is part of the adb-shell package. It incorporates work
# covered by the following license notice:
#
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file ex... | 30.838926 | 179 | 0.629597 |
b4d3f9fce65ede2ac4c2f5b67dbfcb6f1283487b | 3,439 | py | Python | tests/test_basic_unet.py | Irme/MONAI | dc4bf661831b14f4231cb325cc1b15d38c1e406c | [
"Apache-2.0"
] | null | null | null | tests/test_basic_unet.py | Irme/MONAI | dc4bf661831b14f4231cb325cc1b15d38c1e406c | [
"Apache-2.0"
] | null | null | null | tests/test_basic_unet.py | Irme/MONAI | dc4bf661831b14f4231cb325cc1b15d38c1e406c | [
"Apache-2.0"
] | 1 | 2020-06-11T13:03:02.000Z | 2020-06-11T13:03:02.000Z | # Copyright 2020 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 writing, s... | 30.705357 | 74 | 0.536493 |
0c28b646947d0ead6ac3810220c5fd8939198a64 | 483 | py | Python | myreader/mainsite/migrations/0004_auto_20180910_0838.py | zhaopan-vip/MyReader | 958e1df75bf22893a4b13f4f0bd57c7cf6bae588 | [
"Apache-2.0"
] | null | null | null | myreader/mainsite/migrations/0004_auto_20180910_0838.py | zhaopan-vip/MyReader | 958e1df75bf22893a4b13f4f0bd57c7cf6bae588 | [
"Apache-2.0"
] | 4 | 2021-06-08T19:18:47.000Z | 2022-03-11T23:30:17.000Z | myreader/mainsite/migrations/0004_auto_20180910_0838.py | zhaopaniOS/MyReader | 958e1df75bf22893a4b13f4f0bd57c7cf6bae588 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-10 08:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainsite', '0003_auto_20180907_0338'),
]
operations = [
migrations.AlterUniqueTogether(
name='book',
unique_together={('titl... | 21.954545 | 50 | 0.573499 |
b7d0e3090c4677bb0e4145de07ecbc7a49a3be79 | 81,990 | py | Python | sympy/geometry/polygon.py | AyushGit123/sympy | bd79440abfa41d175737d1a138e63e16f9f51994 | [
"BSD-3-Clause"
] | 1 | 2020-03-30T05:21:06.000Z | 2020-03-30T05:21:06.000Z | sympy/geometry/polygon.py | otoosakyidavid/sympy | 636221ff35c78b980f828a285d0c552fac77aaba | [
"BSD-3-Clause"
] | null | null | null | sympy/geometry/polygon.py | otoosakyidavid/sympy | 636221ff35c78b980f828a285d0c552fac77aaba | [
"BSD-3-Clause"
] | 1 | 2021-02-28T20:26:24.000Z | 2021-02-28T20:26:24.000Z | from __future__ import division, print_function
from sympy.core import Expr, S, Symbol, oo, pi, sympify
from sympy.core.compatibility import as_int, ordered
from sympy.core.symbol import _symbol, Dummy, symbols
from sympy.functions.elementary.complexes import sign
from sympy.functions.elementary.piecewise import Piece... | 28.458868 | 133 | 0.533041 |
b0d41be41cde6cf77d9d38f62d50a2d68fc715fd | 1,148 | py | Python | setup.py | ekopach/notion-py | 3f6a972ac04fad14e1646a865f80df43c74a9500 | [
"MIT"
] | null | null | null | setup.py | ekopach/notion-py | 3f6a972ac04fad14e1646a865f80df43c74a9500 | [
"MIT"
] | null | null | null | setup.py | ekopach/notion-py | 3f6a972ac04fad14e1646a865f80df43c74a9500 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
def get_requirements(fname):
"Takes requirements from requirements.txt and returns a list."
with open(fname) as fp:
reqs = list()
for lib in fp.read().split("\n"):
# Ignore pypi flags and comment... | 30.210526 | 66 | 0.654181 |
2eef24403a9440c10b9406e2161c2061d4dee23e | 1,522 | py | Python | pypy/module/_md5/interp_md5.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | pypy/module/_md5/interp_md5.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | pypy/module/_md5/interp_md5.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z | from rpython.rlib import rmd5
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.gateway import interp2app, unwrap_spec
class W_MD5(Wrappable, rmd5.RMD5):
"""
A subclass of RMD5 that can be exposed to app-level.
"""
def __init__(self... | 26.701754 | 60 | 0.670171 |
d080fe903e5c360451a30a7e40ea3572afd9a5f5 | 5,453 | py | Python | codenew/d2lzh_pytorch/rnn_pytorch.py | zzq12368/Dive-into-DL-PyTorchzzq | f627054a93fb1d453605ab4565b9cfd1e855e9e4 | [
"Apache-2.0"
] | null | null | null | codenew/d2lzh_pytorch/rnn_pytorch.py | zzq12368/Dive-into-DL-PyTorchzzq | f627054a93fb1d453605ab4565b9cfd1e855e9e4 | [
"Apache-2.0"
] | null | null | null | codenew/d2lzh_pytorch/rnn_pytorch.py | zzq12368/Dive-into-DL-PyTorchzzq | f627054a93fb1d453605ab4565b9cfd1e855e9e4 | [
"Apache-2.0"
] | null | null | null | import time
import math
import numpy as np
import torch
from torch import nn, optim
import torch.nn.functional as F
import sys
sys.path.append("..")
import utils as d2l
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
(corpus_indices, char_to_idx, idx_to_char, vocab_size) = d2l.load_data_jay_lyri... | 40.095588 | 99 | 0.618192 |
5b5a95baebf1e71e2e990d1db212cdd381ad16d6 | 234 | py | Python | python_utility/git_observer.py | FunTimeCoding/python-utility | e91df316684a07161aae33576329f9092d2e97e6 | [
"MIT"
] | null | null | null | python_utility/git_observer.py | FunTimeCoding/python-utility | e91df316684a07161aae33576329f9092d2e97e6 | [
"MIT"
] | null | null | null | python_utility/git_observer.py | FunTimeCoding/python-utility | e91df316684a07161aae33576329f9092d2e97e6 | [
"MIT"
] | null | null | null | # TODO: Fetch master branch of a repository repeatedly and detect merges
# into master.
# TODO: Detect tag creation.
# TODO: Detect feature branch creation.
# http://gitpython.readthedocs.io/en/stable/tutorial.html#meet-the-repo-type
| 39 | 76 | 0.777778 |
10c3578b5204750fab93b551ff5fc0b3a1a0c494 | 5,144 | py | Python | voc_annotation.py | TheEvolt/yolo3-pytorch | 4c31e8ab3e619dcd93b9d1dc11b89aa252bca84b | [
"MIT"
] | null | null | null | voc_annotation.py | TheEvolt/yolo3-pytorch | 4c31e8ab3e619dcd93b9d1dc11b89aa252bca84b | [
"MIT"
] | null | null | null | voc_annotation.py | TheEvolt/yolo3-pytorch | 4c31e8ab3e619dcd93b9d1dc11b89aa252bca84b | [
"MIT"
] | null | null | null | import os
import random
import xml.etree.ElementTree as ET
from utils.utils import get_classes
# --------------------------------------------------------------------------------------------------------------------------------#
# annotation_mode用于指定该文件运行时计算的内容
# annotation_mode为0代表整个标签处理过程,包括获得VOCdevkit/VOC2007/Im... | 38.38806 | 131 | 0.488336 |
7e13d0a4bf2a912d978e10457a3af0a64b50a4d1 | 286 | py | Python | discord_slash/__init__.py | PredaaA/discord-py-slash-command | 66deebf6ebbad70cb404f34b26b25e9519478326 | [
"MIT"
] | null | null | null | discord_slash/__init__.py | PredaaA/discord-py-slash-command | 66deebf6ebbad70cb404f34b26b25e9519478326 | [
"MIT"
] | null | null | null | discord_slash/__init__.py | PredaaA/discord-py-slash-command | 66deebf6ebbad70cb404f34b26b25e9519478326 | [
"MIT"
] | null | null | null | """
discord-py-slash-command
~~~~~~~~~~~~~~~~~~~~~~~~
Simple Discord Slash Command extension for discord.py
:copyright: (c) 2020 eunwoo1104
:license: MIT
"""
from .client import SlashCommand
from .model import SlashContext
from .utils import manage_commands
__version__ = "1.0.4.1"
| 17.875 | 53 | 0.702797 |
5bca0ad97a1ea3d37652dd1f5400d7b18f0bffab | 252 | py | Python | boss/boss/doctype/client/client.py | thispl/boss | e93d74eefd7b200fe7d1fabb1ea9d5b13138b632 | [
"MIT"
] | null | null | null | boss/boss/doctype/client/client.py | thispl/boss | e93d74eefd7b200fe7d1fabb1ea9d5b13138b632 | [
"MIT"
] | null | null | null | boss/boss/doctype/client/client.py | thispl/boss | e93d74eefd7b200fe7d1fabb1ea9d5b13138b632 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, TeamPRO and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Client(Document):
pass
| 22.909091 | 49 | 0.769841 |
4c8fe88f953f61ea0411ed6a81cc316e5bf377ca | 1,947 | py | Python | alerta/webhooks/graylog.py | mustafaugurhancar/alerta | 608b2db9117ecb8400c29f30bc549d9a99e9eee7 | [
"Apache-2.0"
] | 1 | 2018-03-30T12:38:47.000Z | 2018-03-30T12:38:47.000Z | alerta/webhooks/graylog.py | mustafaugurhancar/alerta | 608b2db9117ecb8400c29f30bc549d9a99e9eee7 | [
"Apache-2.0"
] | null | null | null | alerta/webhooks/graylog.py | mustafaugurhancar/alerta | 608b2db9117ecb8400c29f30bc549d9a99e9eee7 | [
"Apache-2.0"
] | null | null | null |
from flask import request, g, jsonify
from flask_cors import cross_origin
from alerta.auth.utils import permission
from alerta.exceptions import ApiError, RejectException
from alerta.models.alert import Alert
from alerta.utils.api import process_alert, add_remote_ip
from . import webhooks
def parse_graylog(alert):
... | 30.904762 | 83 | 0.672316 |
2f604854b3279cb1c2562d90c4ed8daebb26e870 | 8,380 | py | Python | splunk_sdk/forwarders/v2beta1/gen_models.py | declanshanaghy/splunk-cloud-sdk-python | c36f5c968512d54f44f95271bc64d82da19aedba | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | splunk_sdk/forwarders/v2beta1/gen_models.py | declanshanaghy/splunk-cloud-sdk-python | c36f5c968512d54f44f95271bc64d82da19aedba | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | splunk_sdk/forwarders/v2beta1/gen_models.py | declanshanaghy/splunk-cloud-sdk-python | c36f5c968512d54f44f95271bc64d82da19aedba | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Splunk, 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 law or agreed to in writing,... | 27.385621 | 233 | 0.590453 |
78fdd99d8b3e09141bf4c07a73d9e966cac14da1 | 6,133 | py | Python | test/lint/check-rpc-mappings.py | btcavenue/btcavenue | 63c135c40dbb1aef3078abb4dffefa04b8ef8217 | [
"MIT"
] | null | null | null | test/lint/check-rpc-mappings.py | btcavenue/btcavenue | 63c135c40dbb1aef3078abb4dffefa04b8ef8217 | [
"MIT"
] | null | null | null | test/lint/check-rpc-mappings.py | btcavenue/btcavenue | 63c135c40dbb1aef3078abb4dffefa04b8ef8217 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Btcavenue Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Check RPC argument consistency."""
from collections import defaultdict
import os
import re
import sy... | 37.625767 | 157 | 0.581934 |
d03f1e0edc7074618ea2f2dab59dcefa928f86e0 | 1,154 | py | Python | copyspecial/copyspecial.py | leejkennedy/google-python-exercises | 57f07892a11b594f11d2b058a0b4aaa1b50872f8 | [
"Apache-2.0"
] | null | null | null | copyspecial/copyspecial.py | leejkennedy/google-python-exercises | 57f07892a11b594f11d2b058a0b4aaa1b50872f8 | [
"Apache-2.0"
] | null | null | null | copyspecial/copyspecial.py | leejkennedy/google-python-exercises | 57f07892a11b594f11d2b058a0b4aaa1b50872f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
"""Copy Special exercise
"""
# +++your code here+++
# Write functions and modify... | 22.192308 | 67 | 0.646447 |
fa05d6b2b316dc2bfc0eb2e8e77a3f5ee9d471c8 | 12,918 | py | Python | Huang2017AdaIN/torch_to_pytorch.py | czczup/URST | 000ec9f7728f12ffad989ec1d07b1dd579514133 | [
"Apache-2.0"
] | 119 | 2021-03-21T18:30:51.000Z | 2022-03-29T07:28:33.000Z | Huang2017AdaIN/torch_to_pytorch.py | czczup/URST | 000ec9f7728f12ffad989ec1d07b1dd579514133 | [
"Apache-2.0"
] | 5 | 2021-04-02T14:26:03.000Z | 2022-01-12T12:59:17.000Z | Huang2017AdaIN/torch_to_pytorch.py | czczup/URST | 000ec9f7728f12ffad989ec1d07b1dd579514133 | [
"Apache-2.0"
] | 16 | 2021-03-21T18:30:53.000Z | 2022-03-29T07:28:34.000Z | from __future__ import print_function
import argparse
from functools import reduce
import torch
assert torch.__version__.split('.')[0] == '0', 'Only working on PyTorch 0.x.x'
import torch.nn as nn
from torch.autograd import Variable
from torchfile import load as load_lua
class LambdaBase(nn.Sequential):
def __i... | 39.993808 | 88 | 0.523378 |
292bf940616f54035206d98118bc33d9b6e9e356 | 2,091 | py | Python | keitaro/resources/integrations.py | Infvmous/keitaro | aeb7555bd8443da995705f26fd42e6e882f64dd4 | [
"MIT"
] | 1 | 2021-07-03T16:40:37.000Z | 2021-07-03T16:40:37.000Z | keitaro/resources/integrations.py | ysomad/keitaro | aeb7555bd8443da995705f26fd42e6e882f64dd4 | [
"MIT"
] | 1 | 2021-01-28T13:06:33.000Z | 2021-01-28T13:06:36.000Z | keitaro/resources/integrations.py | ysomad/keitaro | aeb7555bd8443da995705f26fd42e6e882f64dd4 | [
"MIT"
] | 1 | 2021-02-23T08:10:29.000Z | 2021-02-23T08:10:29.000Z | from keitaro.api import API
from keitaro.utils import remove_key_values
class Integration(API):
def __init__(self, client, endpoint='integrations'):
super(Integration, self).__init__(client, endpoint)
def avscan(self):
"""
Returns AVScan key
"""
return super(Integrati... | 29.450704 | 76 | 0.604495 |
f26815869802761fba8821033e1eeca38a76ffa4 | 4,978 | py | Python | IMDb_framework/runs/map_phr_to_sentence.py | vanessadamario/data_efficiency | fc702d2241d737591163697332e3de1d0a0ed085 | [
"MIT"
] | null | null | null | IMDb_framework/runs/map_phr_to_sentence.py | vanessadamario/data_efficiency | fc702d2241d737591163697332e3de1d0a0ed085 | [
"MIT"
] | null | null | null | IMDb_framework/runs/map_phr_to_sentence.py | vanessadamario/data_efficiency | fc702d2241d737591163697332e3de1d0a0ed085 | [
"MIT"
] | 1 | 2021-12-27T00:46:35.000Z | 2021-12-27T00:46:35.000Z | import os
import numpy as np
from os.path import join
import re
import codecs
import pandas as pd
def clean_str_sst(string):
"""
Tokenize/string cleaning for the SST dataset
:param string: a string element
"""
string = re.sub(r"[^A-Za-z0-9(),!?\'\`]", " ", string)
string = re.sub(r"\s{2,}", " ... | 41.483333 | 119 | 0.616312 |
143c32e9b8c88d6477112f1ca4117fa533cc8598 | 5,648 | py | Python | graphics.py | DougDimmadome7/3D-Graphics-Engine-on-Console | 3fa766cf2af05ea5595277e47dbf17d7fede0e35 | [
"MIT"
] | null | null | null | graphics.py | DougDimmadome7/3D-Graphics-Engine-on-Console | 3fa766cf2af05ea5595277e47dbf17d7fede0e35 | [
"MIT"
] | null | null | null | graphics.py | DougDimmadome7/3D-Graphics-Engine-on-Console | 3fa766cf2af05ea5595277e47dbf17d7fede0e35 | [
"MIT"
] | null | null | null | import math
from shapes import Point, Vector, Surface
from lighting import gradient
class Ray:
def __find_components(self, theta_v: float, theta_h: float) -> list:
"""
Given the horizontal and vertical angle, calculate the vector
components such that the magnitude of the vector is... | 34.024096 | 131 | 0.554356 |
f955b5dbebcc58526ae2eef58239c751e91f2889 | 998 | py | Python | scripts/gray-note-img.py | heavenly-zy/notev | f679025104ae56cfce1a6255401e14e399447278 | [
"MIT"
] | 1 | 2020-04-16T01:59:25.000Z | 2020-04-16T01:59:25.000Z | scripts/gray-note-img.py | heavenly-zy/notev | f679025104ae56cfce1a6255401e14e399447278 | [
"MIT"
] | null | null | null | scripts/gray-note-img.py | heavenly-zy/notev | f679025104ae56cfce1a6255401e14e399447278 | [
"MIT"
] | null | null | null | import sys
import os
from cv2 import cv2
img_dir = "docs/Images/"
bak_dir = "docs/Images_bak/"
img_names = sys.argv[1: ]
if not os.path.exists(bak_dir):
os.mkdir(bak_dir)
W = 800
def process(img_name):
""" 处理一张图片 """
bak_path = os.path.join(bak_dir, img_name)
img_path = os.path.join(img_dir, img_na... | 21.234043 | 67 | 0.582164 |
c714ce5afdb28fa7a16ecf22d475c9329e19f1ed | 822 | py | Python | django/swiper/user/models.py | Feier-4869/swipe | 97207562b8ec294a2bcc62ef30f2001b39c11309 | [
"MIT"
] | null | null | null | django/swiper/user/models.py | Feier-4869/swipe | 97207562b8ec294a2bcc62ef30f2001b39c11309 | [
"MIT"
] | null | null | null | django/swiper/user/models.py | Feier-4869/swipe | 97207562b8ec294a2bcc62ef30f2001b39c11309 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class User(models.Model):
SEX = (
('0', 'male'),
('1', 'female'),
)
phonenum = models.CharField(max_length=50, unique=True, verbose_name='手机号')
nickname = models.CharField(max_length=50, unique=True, verbose_name='昵称')
sex = ... | 32.88 | 79 | 0.683698 |
beaeed3c33e69a04f0fe216dc8f1a087372dd8f6 | 1,451 | py | Python | all_net_def.py | jianganbai/Collision-Classification-and-Matching | c1f7a72e29884bc7225659d49d0677a425e7f8fd | [
"Apache-2.0"
] | null | null | null | all_net_def.py | jianganbai/Collision-Classification-and-Matching | c1f7a72e29884bc7225659d49d0677a425e7f8fd | [
"Apache-2.0"
] | null | null | null | all_net_def.py | jianganbai/Collision-Classification-and-Matching | c1f7a72e29884bc7225659d49d0677a425e7f8fd | [
"Apache-2.0"
] | null | null | null | from torch import nn
class RCNet(nn.Module):
def __init__(self, num_classes=10):
super(RCNet, self).__init__()
self.features = nn.Sequential(
nn.Conv2d(in_channels=4, out_channels=16, kernel_size=1, stride=1, padding=2),
nn.ReLU(inplace=True),
nn.MaxPool2d(kerne... | 30.229167 | 90 | 0.53756 |
a05bd66cacc34d2b9f4c444f65fc71d45f36e914 | 595 | py | Python | tools/find_mxnet.py | jimmy9065/mxnet-ssd | e05b704de0756c4ca996e74f8f3c7dec1fe1f509 | [
"MIT"
] | 866 | 2016-10-07T16:05:13.000Z | 2022-01-19T08:30:31.000Z | tools/find_mxnet.py | whn09/mxnet-ssd | ff15817dbf6d3c6d3fc69fbf6bef4c4d61490159 | [
"MIT"
] | 237 | 2016-10-06T21:19:45.000Z | 2021-07-20T03:52:45.000Z | tools/find_mxnet.py | whn09/mxnet-ssd | ff15817dbf6d3c6d3fc69fbf6bef4c4d61490159 | [
"MIT"
] | 431 | 2016-10-19T10:08:07.000Z | 2021-10-03T00:43:33.000Z | from __future__ import print_function
import os
try:
if os.environ.get('MXNET_EXAMPLE_SSD_DISABLE_PRE_INSTALLED', 0):
raise ImportError
import mxnet as mx
print("Using mxnet as:")
print(mx)
print("Warning: using pre-installed version of mxnet may cause unexpected error...")
print("(expor... | 37.1875 | 103 | 0.729412 |
e9c3e7af98f6cbcb246c1e5c17e1877c32020064 | 4,852 | py | Python | creation/lib/matchPolicy.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | creation/lib/matchPolicy.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | creation/lib/matchPolicy.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module contains the Match Policy related class
#
# Author:
# Parag Mhashilkar
#
import imp
import os
# import imp
import os.path
# import copy
i... | 31.303226 | 109 | 0.597279 |
28470edc2b276b2e14ddfe2320754f54923e114a | 1,315 | py | Python | lib/googlecloudsdk/command_lib/redis/zones_util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/command_lib/redis/zones_util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/googlecloudsdk/command_lib/redis/zones_util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. 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 requir... | 31.309524 | 74 | 0.747529 |
92e8481cac988f42466f1aa1efa78bf61d3f2334 | 3,607 | py | Python | classes/get2dcoords.py | jamflcjamflc/cuatro | 007fabf1f75f87b3631966a10923ddccfe9d56af | [
"Apache-2.0"
] | null | null | null | classes/get2dcoords.py | jamflcjamflc/cuatro | 007fabf1f75f87b3631966a10923ddccfe9d56af | [
"Apache-2.0"
] | 2 | 2021-01-26T19:58:42.000Z | 2021-01-30T22:00:12.000Z | classes/get2dcoords.py | jamflcjamflc/cuatro | 007fabf1f75f87b3631966a10923ddccfe9d56af | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# get2dcoords
# helper class for cuatro
# Alfredo Martin 2021
import numpy as np
from classes.rotate import Rotate
version = 'get2dcoords.v.1.0.0'
class Get2dcoords:
"""the instance of this class reorganizes polygons and colors into data that is ready to be rendered
in 2d:
ligt_po... | 48.093333 | 123 | 0.657887 |
500ee1c8bd5c1fa5b34d97f56e4cc91a5a5aee5a | 1,418 | py | Python | boot.py | minnovation-au/MHM4-Boot | d314173d03ac15317285e78348da07f78cfffe85 | [
"MIT"
] | null | null | null | boot.py | minnovation-au/MHM4-Boot | d314173d03ac15317285e78348da07f78cfffe85 | [
"MIT"
] | null | null | null | boot.py | minnovation-au/MHM4-Boot | d314173d03ac15317285e78348da07f78cfffe85 | [
"MIT"
] | null | null | null | ##################################
### DO NOT EDIT THIS FILE ###
### ###
### MHM4 boot.py V0.2 ###
### Last Updated ###
### Manjunath.R ###
### 25 July 2017 ###
### ###
### Copyright Minnovation 2017 ###
#####... | 25.781818 | 100 | 0.528209 |
e62e5e1630a1a391a17ba239a874014eb0afb6b7 | 6,491 | py | Python | centernet_lightning/models/meta.py | gau-nernst/centernet-lightning | 655d895e888f80f6a643e1b9b14d3d4ccb5e7930 | [
"MIT"
] | 47 | 2021-08-10T09:30:53.000Z | 2022-03-29T07:53:43.000Z | centernet_lightning/models/meta.py | gau-nernst/centernet-lightning | 655d895e888f80f6a643e1b9b14d3d4ccb5e7930 | [
"MIT"
] | 1 | 2021-08-07T13:46:49.000Z | 2021-08-07T13:46:49.000Z | centernet_lightning/models/meta.py | gau-nernst/centernet-lightning | 655d895e888f80f6a643e1b9b14d3d4ccb5e7930 | [
"MIT"
] | 6 | 2021-08-12T02:40:43.000Z | 2022-01-31T16:12:40.000Z | from typing import Any, Dict, List, Union
from functools import partial
import torch
from torch import nn
from torch.optim.lr_scheduler import CosineAnnealingLR, LinearLR, SequentialLR
import pytorch_lightning as pl
from vision_toolbox.backbones import BaseBackbone
from vision_toolbox.necks import BaseNeck
from visio... | 41.082278 | 157 | 0.633493 |
ac11589e1068aebd17e7b2aa5655cfc26cf20c25 | 19,472 | py | Python | src/restaff/helpers/notation_markup/notes.py | ko10ok/scorator | 130250550126bbf863ed0028f99045c17d6249e6 | [
"Apache-2.0"
] | null | null | null | src/restaff/helpers/notation_markup/notes.py | ko10ok/scorator | 130250550126bbf863ed0028f99045c17d6249e6 | [
"Apache-2.0"
] | 10 | 2020-06-20T07:37:27.000Z | 2020-07-05T06:22:07.000Z | src/restaff/helpers/notation_markup/notes.py | ko10ok/scorator | 130250550126bbf863ed0028f99045c17d6249e6 | [
"Apache-2.0"
] | null | null | null | from typing import NamedTuple
import svgwrite
from svgwrite.path import Path
from svgwrite.shapes import Circle, Polyline
from svgwrite.text import Text
from restaff.helpers.svg_drawing import moved_path
from ...types import NotePitch, Note, Point, StaffProperties
note_start_offset = - 0.5
# (multiplier from 1 staf... | 82.160338 | 1,727 | 0.638507 |
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 |
5c644115445f19befe3644f699495db6fc2552a5 | 344 | py | Python | Pythonexer/ExerPython/aprendendopython/ex077.py | felipemcm3/ExerPython | d66c891eb82c0f7fd9c15203fe85a06e96d916b5 | [
"MIT"
] | null | null | null | Pythonexer/ExerPython/aprendendopython/ex077.py | felipemcm3/ExerPython | d66c891eb82c0f7fd9c15203fe85a06e96d916b5 | [
"MIT"
] | null | null | null | Pythonexer/ExerPython/aprendendopython/ex077.py | felipemcm3/ExerPython | d66c891eb82c0f7fd9c15203fe85a06e96d916b5 | [
"MIT"
] | null | null | null | lista = ('morango', 'pessego', 'melancia', 'manga', 'uva', 'carro')
vogal = ('a', 'e', 'i', 'o', 'u')
for y in lista:
print('\nA palavra {} tem vogal '.format(y.upper()), end = ' ')
for x in vogal:
try:
if y.index(x):
print('{}'.format(x), end = ' ')
except ValueErro... | 28.666667 | 67 | 0.465116 |
ed9ba7cea7497dde7e2efb9f1a3c9509938ea10e | 2,472 | py | Python | test.py | adamhamden/MultiModalHumor | 6d66d9e3d654f92c4be615f4b403fa51c9e532a2 | [
"CC0-1.0"
] | null | null | null | test.py | adamhamden/MultiModalHumor | 6d66d9e3d654f92c4be615f4b403fa51c9e532a2 | [
"CC0-1.0"
] | null | null | null | test.py | adamhamden/MultiModalHumor | 6d66d9e3d654f92c4be615f4b403fa51c9e532a2 | [
"CC0-1.0"
] | null | null | null | from data import Data
import torch.optim as optim
from MultiModalHumor.model import *
from config import config, humor_speakers, speakers
from sklearn.metrics import confusion_matrix
config = config()
common_kwargs = dict(path2data='../PATS/data',
speaker=['fallon', 'rock'],
m... | 38.030769 | 107 | 0.614078 |
1d23e1606da8142e44a40ca17d6cf9ec6c9d1cb1 | 1,002 | py | Python | donate_stuff/users/admin.py | Raekker/donate-stuff | afc3c4235e1b72c02c237c27354741388369b710 | [
"MIT"
] | null | null | null | donate_stuff/users/admin.py | Raekker/donate-stuff | afc3c4235e1b72c02c237c27354741388369b710 | [
"MIT"
] | 7 | 2021-05-12T06:13:03.000Z | 2022-03-30T13:09:48.000Z | donate_stuff/users/admin.py | Raekker/donate-stuff | afc3c4235e1b72c02c237c27354741388369b710 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from donate_stuff.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdm... | 28.628571 | 74 | 0.557884 |
0841d9fb2b290cbad942b842769f6c2bdd7aa7d5 | 3,317 | py | Python | plugins/feeds/public/otx_alienvault.py | GDATAAdvancedAnalytics/yeti | fcd3ee3d3d064df772d0392c20c22aad2bc4c8e6 | [
"Apache-2.0"
] | 1,250 | 2017-03-12T16:20:47.000Z | 2022-03-29T02:12:11.000Z | plugins/feeds/public/otx_alienvault.py | GDATAAdvancedAnalytics/yeti | fcd3ee3d3d064df772d0392c20c22aad2bc4c8e6 | [
"Apache-2.0"
] | 540 | 2017-03-20T16:45:35.000Z | 2022-03-22T16:55:02.000Z | plugins/feeds/public/otx_alienvault.py | GDATAAdvancedAnalytics/yeti | fcd3ee3d3d064df772d0392c20c22aad2bc4c8e6 | [
"Apache-2.0"
] | 293 | 2017-03-20T13:59:07.000Z | 2022-03-28T16:00:10.000Z | import logging
import time
from datetime import datetime, timedelta
from core import Feed
from core.config.config import yeti_config
from core.entities import Exploit, Entity
from core.errors import ObservableValidationError
from core.indicators import Yara, Indicator
from core.observables import Hash, Hostname, Url, ... | 33.505051 | 88 | 0.538438 |
d9ea91a493b43b2f9a0037709ca84927df9ab7cd | 533 | py | Python | aaclient/test/test_util.py | mdavidsaver/aaclient | 1ca30d6b988965d6cf1aec97279c71bbd656b2e9 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T16:25:27.000Z | 2022-03-21T16:25:27.000Z | aaclient/test/test_util.py | mdavidsaver/aaclient | 1ca30d6b988965d6cf1aec97279c71bbd656b2e9 | [
"BSD-3-Clause"
] | null | null | null | aaclient/test/test_util.py | mdavidsaver/aaclient | 1ca30d6b988965d6cf1aec97279c71bbd656b2e9 | [
"BSD-3-Clause"
] | 1 | 2022-03-18T18:26:53.000Z | 2022-03-18T18:26:53.000Z | # Copyright 2022 Michael Davidsaver
# SPDX-License-Identifier: BSD
# See LICENSE file
import unittest
from .. import util
class TestWild(unittest.TestCase):
def test_ok(self):
for inp, exp in [
(r"hello", r"hello"),
(r"hello.", r"hello\."),
(r"he?lo.", r"he... | 26.65 | 55 | 0.491557 |
e7ffac7a2b2bd59727ac6968b43c60d1c037a9f8 | 5,358 | py | Python | vulnerabilities/importers/apache_kafka.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/apache_kafka.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/apache_kafka.py | InLaw/vulnerablecode | e93154ce15f577430dda18cabd1feb1dabc7230a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in compliance ... | 44.280992 | 95 | 0.676745 |
14c74de394dc5f18766a3fd72cbe1758717800c4 | 478 | py | Python | config/urls.py | yezz123/Django-Authentication | 3f207660950370aeaf8377f062d4767a0f48fa8c | [
"MIT"
] | 10 | 2021-08-30T08:37:12.000Z | 2021-11-12T01:33:06.000Z | config/urls.py | yezz123/Django-Authentication | 3f207660950370aeaf8377f062d4767a0f48fa8c | [
"MIT"
] | null | null | null | config/urls.py | yezz123/Django-Authentication | 3f207660950370aeaf8377f062d4767a0f48fa8c | [
"MIT"
] | null | null | null | import debug_toolbar
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path("admin/", admin.site.urls),
path("accounts/", include("allauth.urls")),
path("", include("pages.urls")),
]
if settin... | 26.555556 | 69 | 0.715481 |
eca7d9072ba6ca9c2c17846e8cb1f2b0f62a549a | 2,919 | py | Python | etna/analysis/feature_relevance/relevance_table.py | martins0n/etna | 51e9cec5183da2499ca247b0e2db215507246ceb | [
"Apache-2.0"
] | 326 | 2021-11-18T15:30:50.000Z | 2022-03-31T09:44:15.000Z | etna/analysis/feature_relevance/relevance_table.py | martins0n/etna | 51e9cec5183da2499ca247b0e2db215507246ceb | [
"Apache-2.0"
] | 305 | 2021-11-17T10:28:31.000Z | 2022-03-31T18:05:03.000Z | etna/analysis/feature_relevance/relevance_table.py | martins0n/etna | 51e9cec5183da2499ca247b0e2db215507246ceb | [
"Apache-2.0"
] | 29 | 2021-11-21T12:10:48.000Z | 2022-03-31T22:55:06.000Z | from typing import Union
import numpy as np
import pandas as pd
from catboost import CatBoostRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.tree import DecisionTreeRegressor
from sklearn.t... | 34.75 | 114 | 0.713601 |
e51510c21edf911aa7a838721710cad0f1028539 | 24,139 | py | Python | sense/surface/i2em.py | PMarzahn/sense | 332852bf781620a5cc714efb2d86ffaff5275955 | [
"Apache-2.0"
] | 3 | 2018-10-08T13:40:52.000Z | 2021-03-07T07:59:40.000Z | sense/surface/i2em.py | PMarzahn/sense | 332852bf781620a5cc714efb2d86ffaff5275955 | [
"Apache-2.0"
] | 2 | 2017-07-31T12:51:02.000Z | 2017-08-10T22:09:56.000Z | sense/surface/i2em.py | PMarzahn/sense | 332852bf781620a5cc714efb2d86ffaff5275955 | [
"Apache-2.0"
] | 6 | 2018-06-29T10:10:36.000Z | 2022-03-06T20:24:54.000Z | """
implements the I2EM model (see Ulaby (2014), Chapter 10
backscattering model for single scale random surfaces
The code originates from ideas obtained from the supplement
of Ulaby et al (2014)
"""
from . scatter import SurfaceScatter
import numpy as np
from .. util import f2lam
from .. core import Reflectivity
im... | 34.632712 | 206 | 0.540619 |
5a9deca18ef915df2060702a02b3e295638b22e2 | 8,620 | py | Python | app/dashboard/routes.py | wilfredinni/pythoncheatsheet.org | b3c8407cf4468558dcd6b430dac58b12719d91d5 | [
"MIT"
] | 5 | 2019-03-09T07:24:34.000Z | 2021-08-24T14:53:21.000Z | app/dashboard/routes.py | wilfredinni/pythoncheatsheet.org | b3c8407cf4468558dcd6b430dac58b12719d91d5 | [
"MIT"
] | 2 | 2018-05-18T01:07:49.000Z | 2018-05-18T01:26:21.000Z | app/dashboard/routes.py | wilfredinni/pysheetBlog | b3c8407cf4468558dcd6b430dac58b12719d91d5 | [
"MIT"
] | 3 | 2018-06-30T14:56:27.000Z | 2018-09-03T11:17:34.000Z | from flask import render_template, flash, redirect, url_for, request
from flask_login import login_required, current_user
from app.dashboard import bp
from app.dashboard.forms import RegistrationForm, EditProfileForm, PostForm, PinMsgForm
from app.models import User, Post, Tag, PinedMsg
from app import db
import re
fro... | 29.419795 | 87 | 0.631903 |
ba990831837433b4ea128a1b91c17e4fc1f128b0 | 3,525 | py | Python | src/service/gcal/__init__.py | chenhao-ye/snow | df7125af8a17a77c55f0c62ef2f8013c32859e89 | [
"MIT"
] | 4 | 2022-03-13T18:25:23.000Z | 2022-03-19T14:53:24.000Z | src/service/gcal/__init__.py | chenhao-ye/snow | df7125af8a17a77c55f0c62ef2f8013c32859e89 | [
"MIT"
] | 1 | 2022-03-15T15:01:57.000Z | 2022-03-15T15:01:57.000Z | src/service/gcal/__init__.py | chenhao-ye/snow | df7125af8a17a77c55f0c62ef2f8013c32859e89 | [
"MIT"
] | null | null | null | import os.path
import logging
from typing import List, Optional
from google.auth.transport.requests import Request
from google.auth.exceptions import RefreshError
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from .... | 38.736264 | 84 | 0.620709 |
5ba8354b509fd47c03e3f43280968e75003a0c80 | 6,751 | py | Python | bokeh/core/property/tests/test_bases.py | isaacmg/bokeh | 1025d1177b8e636c36f6160da4bd2fbf8ca51962 | [
"BSD-3-Clause"
] | null | null | null | bokeh/core/property/tests/test_bases.py | isaacmg/bokeh | 1025d1177b8e636c36f6160da4bd2fbf8ca51962 | [
"BSD-3-Clause"
] | null | null | null | bokeh/core/property/tests/test_bases.py | isaacmg/bokeh | 1025d1177b8e636c36f6160da4bd2fbf8ca51962 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 32.613527 | 106 | 0.541698 |
21039be4408883265de862be07a936d4383e5ebf | 677 | py | Python | src/icp/apps/user/models.py | project-icp/bee-pollinator-app | 9357755e6d78e1bf8594de1b777d02318bb3e54f | [
"Apache-2.0"
] | 6 | 2016-10-14T18:54:39.000Z | 2021-06-03T21:04:27.000Z | src/icp/apps/user/models.py | project-icp/bee-pollinator-app | 9357755e6d78e1bf8594de1b777d02318bb3e54f | [
"Apache-2.0"
] | 528 | 2016-10-14T17:38:54.000Z | 2022-02-26T10:53:21.000Z | src/icp/apps/user/models.py | project-icp/bee-pollinator-app | 9357755e6d78e1bf8594de1b777d02318bb3e54f | [
"Apache-2.0"
] | 2 | 2016-10-17T18:06:38.000Z | 2020-10-23T09:48:24.000Z | # -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
class UserProfile(models.Model):
"""For additional user properties."""
POLLINATION = 'Pollination'
BEEKEEPERS = 'Beekeepers'
APP_CHOICES = (
... | 23.344828 | 67 | 0.660266 |
7e7630edc47f6c046ced853bf4a5eebc65fd7af2 | 164 | py | Python | easy_logger/config.py | omsobliga/easy-logger | d3ffd7f80c1fe2f5ed8725b859ad68fdfbe7819f | [
"MIT"
] | null | null | null | easy_logger/config.py | omsobliga/easy-logger | d3ffd7f80c1fe2f5ed8725b859ad68fdfbe7819f | [
"MIT"
] | null | null | null | easy_logger/config.py | omsobliga/easy-logger | d3ffd7f80c1fe2f5ed8725b859ad68fdfbe7819f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
DEFAULT_LEVEL = logging.INFO
DEFAULT_FORMAT = '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
| 20.5 | 71 | 0.652439 |
890022300f5c15f52c0c8790e01a36e5059bc606 | 13,544 | py | Python | zerver/lib/test_fixtures.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | 1 | 2020-10-02T07:39:04.000Z | 2020-10-02T07:39:04.000Z | zerver/lib/test_fixtures.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | zerver/lib/test_fixtures.py | myii/zulip | 915d8013271f1823954dd8d4441842842857ab9f | [
"Apache-2.0"
] | null | null | null | import json
import os
import re
import subprocess
import sys
from typing import Any, List, Set
from importlib import import_module
from io import StringIO
import glob
import time
import shutil
from django.db import connections, DEFAULT_DB_ALIAS, ProgrammingError, \
connection
from django.db.utils import Operationa... | 35.642105 | 91 | 0.651359 |
138b8922702fcc66ff21bec541620c878a0f475d | 5,242 | py | Python | bindings/python/pinocchio/visualize/meshcat_visualizer.py | rstrudel/pinocchio | e038c7bf283b1df56a35014455e0e2d6f36e03ac | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | bindings/python/pinocchio/visualize/meshcat_visualizer.py | rstrudel/pinocchio | e038c7bf283b1df56a35014455e0e2d6f36e03ac | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | bindings/python/pinocchio/visualize/meshcat_visualizer.py | rstrudel/pinocchio | e038c7bf283b1df56a35014455e0e2d6f36e03ac | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from .. import libpinocchio_pywrap as pin
from ..shortcuts import buildModelsFromUrdf, createDatas
from . import BaseVisualizer
import os
import numpy as np
class MeshcatVisualizer(BaseVisualizer):
"""A Pinocchio display using Meshcat"""
def getViewerNodeName(self, geometry_object, geometry_type):
"... | 43.683333 | 125 | 0.667493 |
c233f77ee01e800131ddfc15840855a3b42674db | 3,087 | py | Python | nemo/backends/pytorch/module_wrapper.py | vsl9/NeMo | 4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50 | [
"Apache-2.0"
] | 2 | 2021-03-04T16:37:46.000Z | 2021-03-04T16:40:22.000Z | nemo/backends/pytorch/module_wrapper.py | vsl9/NeMo | 4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50 | [
"Apache-2.0"
] | null | null | null | nemo/backends/pytorch/module_wrapper.py | vsl9/NeMo | 4137c2b4e3cba0ec5ca1da7b58b3ff97fdb25e50 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 NVIDIA Corporation
import torch as t
import torch.nn as nn
from ...core import DeviceType, NeuralModule
from ...utils.helpers import rgetattr, rsetattr
class TrainableNeuralModuleWrapper(NeuralModule, nn.Module):
"""This class wraps an instance of Pytorch's nn.Module and
returns NeuralMo... | 32.840426 | 107 | 0.660836 |
1e65c1ce3f077cdd07897da17d414cc27c3da3c4 | 303 | py | Python | contrib/spendfrom/setup.py | GreenCoinX/greencoin | 318995aa6b13a246e780fed3cb30917e36525da2 | [
"MIT"
] | null | null | null | contrib/spendfrom/setup.py | GreenCoinX/greencoin | 318995aa6b13a246e780fed3cb30917e36525da2 | [
"MIT"
] | null | null | null | contrib/spendfrom/setup.py | GreenCoinX/greencoin | 318995aa6b13a246e780fed3cb30917e36525da2 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(name='xgcspendfrom',
version='1.0',
description='Command-line utility for greencoin "coin control"',
author='Gavin Andresen',
author_email='gavin@greencoinfoundation.org',
requires=['jsonrpc'],
scripts=['spendfrom.py'],
)
| 30.3 | 70 | 0.663366 |
9ca99ca019c514319d3fa464e15a1250dbb08385 | 19,827 | py | Python | src/compas_plotters/artists/meshartist.py | duchaoyu/compas | d484500d68d44fd6e227c3bbee20a2edde6e6c96 | [
"MIT"
] | null | null | null | src/compas_plotters/artists/meshartist.py | duchaoyu/compas | d484500d68d44fd6e227c3bbee20a2edde6e6c96 | [
"MIT"
] | null | null | null | src/compas_plotters/artists/meshartist.py | duchaoyu/compas | d484500d68d44fd6e227c3bbee20a2edde6e6c96 | [
"MIT"
] | null | null | null | from typing import Dict
from typing import Tuple
from typing import List
from typing import Union
from typing import Optional
from typing import Any
from typing_extensions import Literal
from matplotlib.collections import LineCollection, PatchCollection
from matplotlib.patches import Polygon as PolygonPatch
from matp... | 33.491554 | 130 | 0.557523 |
681f5c1e4f3347c249b71a047af49e97bbc1003f | 809 | py | Python | iol/__init__.py | abc123me/nasa_dsn | c15cd20097fbf8d1d473e5cd9a1db3840518c69c | [
"MIT"
] | null | null | null | iol/__init__.py | abc123me/nasa_dsn | c15cd20097fbf8d1d473e5cd9a1db3840518c69c | [
"MIT"
] | null | null | null | iol/__init__.py | abc123me/nasa_dsn | c15cd20097fbf8d1d473e5cd9a1db3840518c69c | [
"MIT"
] | null | null | null | #Here to make python recognize this as a package
from iol import baseball
from iol import pygpio
from iol import adlib
from cli import colors
__old_gpio = pygpio.GPIOPin
__old_bb = baseball.BaseballSwitch
__old_adc = adlib.ADC
__emulated = False
def SET_EMULATED(mode):
if(mode):
print(u"\u001b[31mSET IOLIB TO EMULA... | 29.962963 | 87 | 0.781211 |
004803763de5028fe3e48470199a2fac5234160b | 13,661 | py | Python | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/network/arp.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/network/arp.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/network/arp.py | culbertm/NSttyPython | ff9f6aedae3fb8495342cd0fc4247c819cf47397 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2016 Citrix Systems, 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 l... | 27.822811 | 289 | 0.684796 |
ead0749f69c5d57dce2f768c2d6e612020b91718 | 4,259 | py | Python | python/taichi/ui/canvas.py | kxxt/taichi | 15f39b79c258080f1e34fcbdc29646d9ced0a4fe | [
"MIT"
] | 11,699 | 2020-01-09T03:02:46.000Z | 2022-03-31T20:59:08.000Z | python/taichi/ui/canvas.py | kxxt/taichi | 15f39b79c258080f1e34fcbdc29646d9ced0a4fe | [
"MIT"
] | 3,589 | 2020-01-09T03:18:25.000Z | 2022-03-31T19:06:42.000Z | python/taichi/ui/canvas.py | kxxt/taichi | 15f39b79c258080f1e34fcbdc29646d9ced0a4fe | [
"MIT"
] | 1,391 | 2020-01-09T03:02:54.000Z | 2022-03-31T08:44:29.000Z | from .staging_buffer import (copy_colors_to_vbo, copy_vertices_to_vbo,
get_vbo_field, to_u8_rgba)
from .utils import get_field_info
class Canvas:
def __init__(self, canvas) -> None:
self.canvas = canvas #reference to a PyCanvas
def set_background_color(self, color):
... | 47.322222 | 213 | 0.642874 |
78ed68898eac4181d0b1443bd1742e5469cc8424 | 644 | py | Python | dedoc/data_structures/attached_file.py | kirillskor/dedoc | 7793a1be2220a26e7520521306351dfc0a9c8d98 | [
"Apache-2.0"
] | null | null | null | dedoc/data_structures/attached_file.py | kirillskor/dedoc | 7793a1be2220a26e7520521306351dfc0a9c8d98 | [
"Apache-2.0"
] | null | null | null | dedoc/data_structures/attached_file.py | kirillskor/dedoc | 7793a1be2220a26e7520521306351dfc0a9c8d98 | [
"Apache-2.0"
] | null | null | null | from dedoc.attachments_extractors.base_attached_file import BaseAttachedFile
class AttachedFile(BaseAttachedFile):
def __init__(self, original_name: str, tmp_file_path: str):
"""
Holds information about attached files.
:param original_name: Name of the file from which the attachments are ... | 32.2 | 87 | 0.712733 |
5279513c22401eda2c9902ce1797dd96128f874e | 18,118 | py | Python | openmp/mdpic2/mdpic2_py/cmdpic2.py | gcasabona/cuda | 064cfa02398e2402c113d45153d7ba36ae930f7e | [
"W3C"
] | 51 | 2017-03-22T04:06:03.000Z | 2022-01-18T22:48:51.000Z | openmp/mdpic2/mdpic2_py/cmdpic2.py | gcasabona/cuda | 064cfa02398e2402c113d45153d7ba36ae930f7e | [
"W3C"
] | null | null | null | openmp/mdpic2/mdpic2_py/cmdpic2.py | gcasabona/cuda | 064cfa02398e2402c113d45153d7ba36ae930f7e | [
"W3C"
] | 25 | 2017-02-22T05:21:32.000Z | 2022-01-02T14:53:19.000Z | #-----------------------------------------------------------------------
# Skeleton 2-1/2D Darwin OpenMP PIC code
# written by Viktor K. Decyk, Adam Tableman, and Qiyang Hu, UCLA
import math
import numpy
from cmdpush2 import *
from dtimer import *
from complib import *
int_type = numpy.int32
double_type = numpy.float6... | 32.941818 | 73 | 0.68236 |
0457379d198dd507c8e37cc60a820a8188649ff2 | 10,147 | py | Python | easypl/callbacks/predictors/base.py | data-sachez-2511/EasyPL | 5c47f7935a2c88e36deafc7e40e101d02f89b796 | [
"MIT"
] | null | null | null | easypl/callbacks/predictors/base.py | data-sachez-2511/EasyPL | 5c47f7935a2c88e36deafc7e40e101d02f89b796 | [
"MIT"
] | null | null | null | easypl/callbacks/predictors/base.py | data-sachez-2511/EasyPL | 5c47f7935a2c88e36deafc7e40e101d02f89b796 | [
"MIT"
] | null | null | null | import torch
import numpy as np
import pytorch_lightning
from pytorch_lightning.callbacks import Callback
from typing import List, Dict, Any, Tuple
class BaseTestTimeAugmentation(Callback):
"""
Base callback for test-time-augmentation
Attributes
----------
n: int
Number of augmentations.
... | 27.724044 | 101 | 0.528333 |
5dee44396ef8a9829a26b7d7116f2eb4d9ec0a9f | 4,144 | py | Python | openshift/test/test_v1_role_binding.py | flaper87/openshift-restclient-python | 13d5d86ca89035b9f596032e7a34f3cc33bf8f18 | [
"Apache-2.0"
] | null | null | null | openshift/test/test_v1_role_binding.py | flaper87/openshift-restclient-python | 13d5d86ca89035b9f596032e7a34f3cc33bf8f18 | [
"Apache-2.0"
] | null | null | null | openshift/test/test_v1_role_binding.py | flaper87/openshift-restclient-python | 13d5d86ca89035b9f596032e7a34f3cc33bf8f18 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenShift API (with Kubernetes)
OpenShift provides builds, application lifecycle, image content management, and administrative policy on top of Kubernetes. The API allows consistent management of those objects. All API operations are authenticated via an Authorization bearer token that is... | 96.372093 | 3,380 | 0.787886 |
4fff6f0fcfe802f83881662efc7964a21b2210a5 | 19,436 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_deployment_operations_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_deployment_operations_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_deployment_operations_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 44.072562 | 271 | 0.662225 |
a14c144650c7e2398bd9e4b2d3afd783cca08242 | 2,459 | py | Python | DAN-msa/pyErrorPred/dataProcessingUtils.py | AliMahmoudzadeh/RoseTTAFold | 1c95e0b255097ddbfc5d44d4e9f3c0f295206e47 | [
"MIT"
] | 1,493 | 2021-07-01T09:46:31.000Z | 2022-03-29T06:43:47.000Z | DAN-msa/pyErrorPred/dataProcessingUtils.py | AliMahmoudzadeh/RoseTTAFold | 1c95e0b255097ddbfc5d44d4e9f3c0f295206e47 | [
"MIT"
] | 101 | 2021-07-05T15:07:59.000Z | 2022-03-31T03:35:52.000Z | DAN-msa/pyErrorPred/dataProcessingUtils.py | AliMahmoudzadeh/RoseTTAFold | 1c95e0b255097ddbfc5d44d4e9f3c0f295206e47 | [
"MIT"
] | 343 | 2021-07-01T13:44:24.000Z | 2022-03-29T00:21:46.000Z | from pyrosetta import *
import math
import numpy as np
import pandas as pd
import csv
import pkg_resources
####################
# INDEXERS/MAPPERS
####################
# Assigning numbers to 3 letter amino acids.
residues= ['ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU',\
'GLY', 'HIS', 'ILE', 'LEU', 'LYS'... | 36.161765 | 98 | 0.583977 |
c52804d19591cf2858f0b135efac2f7f23a259f5 | 7,834 | py | Python | environments/runner_cb.py | nbro/contextual-bandit-recommender | 0176dad94e0e791327dc2f50e38aa3ab4e327673 | [
"MIT"
] | null | null | null | environments/runner_cb.py | nbro/contextual-bandit-recommender | 0176dad94e0e791327dc2f50e38aa3ab4e327673 | [
"MIT"
] | null | null | null | environments/runner_cb.py | nbro/contextual-bandit-recommender | 0176dad94e0e791327dc2f50e38aa3ab4e327673 | [
"MIT"
] | null | null | null | """
Runner for fully observable reward CB problems.
"""
import os
import numpy as np
import pandas as pd
from datautils.mushroom.sample_data import sample_mushroom
from datautils.preprocessing import load_data
from datautils.synthetic.sample_data import sample_synthetic
from environments.utils import create_if_not_ex... | 37.127962 | 119 | 0.600842 |
462169a65654dd9da7ef3dc55ac8ec7c765cf4d8 | 587 | py | Python | setup.py | nathanhnew/quantfolio | 957520cccc351e1e0968fd72df7a5debad068f78 | [
"MIT"
] | null | null | null | setup.py | nathanhnew/quantfolio | 957520cccc351e1e0968fd72df7a5debad068f78 | [
"MIT"
] | null | null | null | setup.py | nathanhnew/quantfolio | 957520cccc351e1e0968fd72df7a5debad068f78 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="quantfolio",
version="0.1.0",
author="Nathan New",
author_email="nathanhnew@gmail.com",
description="Python Portfolio Optimization Tool",
long_description="Tool for optimizing stock portfolios based on variety of metrics",
url="https:... | 32.611111 | 88 | 0.67632 |
4d632147dbdb86e8fd1b14d3e45c718eb8c5d607 | 1,942 | py | Python | emailProxy.py | xulongzhe/solrTool | 9f1956e6bb8f12ee5390e1dc9b042d8f2ae0023e | [
"Apache-2.0"
] | null | null | null | emailProxy.py | xulongzhe/solrTool | 9f1956e6bb8f12ee5390e1dc9b042d8f2ae0023e | [
"Apache-2.0"
] | null | null | null | emailProxy.py | xulongzhe/solrTool | 9f1956e6bb8f12ee5390e1dc9b042d8f2ae0023e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
import socket
import smtplib
import logging
import sys
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
from email.mime.text import MIMEText
from email.header import Header
reload(sys)
sys.setdefaultencoding('utf-8')
recipients=["xiajibayong@sohu.c... | 27.352113 | 81 | 0.701854 |
959b0da875d1776f81312535de21866f62eb95b2 | 411 | py | Python | venues/migrations/0009_venue_image.py | bsassoli/milan_culture_map | 89996b6f41c985c3b90719fdab2325f4627bcfb2 | [
"MIT"
] | null | null | null | venues/migrations/0009_venue_image.py | bsassoli/milan_culture_map | 89996b6f41c985c3b90719fdab2325f4627bcfb2 | [
"MIT"
] | 14 | 2021-04-08T10:52:11.000Z | 2021-04-22T15:32:12.000Z | venues/migrations/0009_venue_image.py | bsassoli/milan_culture_map | 89996b6f41c985c3b90719fdab2325f4627bcfb2 | [
"MIT"
] | 1 | 2021-04-18T18:40:36.000Z | 2021-04-18T18:40:36.000Z | # Generated by Django 3.1.7 on 2021-04-02 07:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('venues', '0008_auto_20210401_1257'),
]
operations = [
migrations.AddField(
model_name='venue',
name='image',
... | 21.631579 | 80 | 0.600973 |
223506b51c7fc49ee61f1e363da7d5027ad0a32b | 927 | py | Python | application/recommendationrules/dummypage.py | crossgovernmentservices/csl-my-learning-plan | a22b76b5ba0327e426d91dce073c0e0f887b400e | [
"MIT"
] | null | null | null | application/recommendationrules/dummypage.py | crossgovernmentservices/csl-my-learning-plan | a22b76b5ba0327e426d91dce073c0e0f887b400e | [
"MIT"
] | null | null | null | application/recommendationrules/dummypage.py | crossgovernmentservices/csl-my-learning-plan | a22b76b5ba0327e426d91dce073c0e0f887b400e | [
"MIT"
] | null | null | null |
def __constructtargetnode(item):
print(item.targetnode)
return str(min(int(item.targetnode)+1, 5))
def __matchitem(item, matchingitems):
for matchitem in matchingitems:
if (matchitem.educationalFramework == item['educationalFramework']
and __constructtargetnode(matchitem) == item['ta... | 35.653846 | 105 | 0.696872 |
f68c935e6de85bfbae41be50c9f51b2c6851aeb4 | 580 | py | Python | sphinx_gallery/load_style.py | kosik/Sphinx | 379726d9af855302137ff14dbc52ebf76b64a1cc | [
"BSD-3-Clause"
] | 1 | 2021-04-13T11:46:28.000Z | 2021-04-13T11:46:28.000Z | sphinx_gallery/load_style.py | kosik/Sphinx | 379726d9af855302137ff14dbc52ebf76b64a1cc | [
"BSD-3-Clause"
] | 1 | 2019-01-31T15:37:51.000Z | 2019-10-29T09:38:22.000Z | sphinx_gallery/load_style.py | kosik/Sphinx | 379726d9af855302137ff14dbc52ebf76b64a1cc | [
"BSD-3-Clause"
] | null | null | null | """
Only load CSS and modify html_static_path
=========================================
This should not be used at the same time as sphinx_gallery.gen_gallery.
"""
from . import __version__, glr_path_static
def config_inited(app, config):
path = glr_path_static()
if path not in config.html_static_path:
... | 23.2 | 71 | 0.648276 |
7d64eeab3739c49339c9664f8a68005113736c38 | 28,678 | py | Python | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2020_04_01_preview/operations/_managed_hsms_operations.py | pjachowi/azure-sdk-for-python | 372bf6b6b9314d688eca5b5a56df0264c78d6618 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2020_04_01_preview/operations/_managed_hsms_operations.py | pjachowi/azure-sdk-for-python | 372bf6b6b9314d688eca5b5a56df0264c78d6618 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2020_04_01_preview/operations/_managed_hsms_operations.py | pjachowi/azure-sdk-for-python | 372bf6b6b9314d688eca5b5a56df0264c78d6618 | [
"MIT"
] | null | null | null | # 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 ... | 47.876461 | 182 | 0.653044 |
ba478b3fb0d28eff98b33b646d8776742b0cd8d6 | 9,844 | py | Python | tests/kerastuner/engine/metrics_tracking_test.py | stefanvasilev/keras-tuner | 5c402b02af9a2a98ab5eece802f1ec7ca5331379 | [
"Apache-2.0"
] | 1 | 2021-05-07T17:12:41.000Z | 2021-05-07T17:12:41.000Z | tests/kerastuner/engine/metrics_tracking_test.py | stefanvasilev/keras-tuner | 5c402b02af9a2a98ab5eece802f1ec7ca5331379 | [
"Apache-2.0"
] | null | null | null | tests/kerastuner/engine/metrics_tracking_test.py | stefanvasilev/keras-tuner | 5c402b02af9a2a98ab5eece802f1ec7ca5331379 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Keras Tuner 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.784452 | 85 | 0.684681 |
5f03db1ac649a43c134525c744dbfdb9ad20b4cc | 349 | py | Python | Exam-Prep/Exam_22-Aug-20/project/rooms/alone_young.py | geodimitrov/PythonOOP_SoftUni | f1c6718c878b618b3ab3f174cd4d187bd178940b | [
"MIT"
] | 1 | 2021-06-30T11:53:44.000Z | 2021-06-30T11:53:44.000Z | Exam-Prep/Exam_22-Aug-20/project/rooms/alone_young.py | geodimitrov/PythonOOP_SoftUni | f1c6718c878b618b3ab3f174cd4d187bd178940b | [
"MIT"
] | null | null | null | Exam-Prep/Exam_22-Aug-20/project/rooms/alone_young.py | geodimitrov/PythonOOP_SoftUni | f1c6718c878b618b3ab3f174cd4d187bd178940b | [
"MIT"
] | null | null | null | from project.appliances.tv import TV
from project.rooms.room import Room
class AloneYoung(Room):
default_room_members = 1
room_cost = 10
appliances = [TV()]
def __init__(self, family_name: str, salary: float):
super().__init__(family_name,salary, self.default_room_members)
self.calcul... | 29.083333 | 71 | 0.727794 |
16a19250eecfdd508f280598a1a788b913bc15bb | 2,492 | py | Python | fsf-server/modules/EXTRACT_TAR.py | akniffe1/fsf | 15303aa298414397f9aa5d19ca343040a0fe0bbd | [
"Apache-2.0"
] | 259 | 2015-08-06T13:10:11.000Z | 2022-03-19T19:43:00.000Z | fsf-server/modules/EXTRACT_TAR.py | akniffe1/fsf | 15303aa298414397f9aa5d19ca343040a0fe0bbd | [
"Apache-2.0"
] | 46 | 2015-08-13T10:58:11.000Z | 2021-09-14T13:19:42.000Z | fsf-server/modules/EXTRACT_TAR.py | akniffe1/fsf | 15303aa298414397f9aa5d19ca343040a0fe0bbd | [
"Apache-2.0"
] | 58 | 2015-08-06T16:00:40.000Z | 2021-07-27T08:29:22.000Z | #!/usr/bin/env python
#
# Author: Jason Batchelor
# Description: Extract files from TAR archive file
# Date: 11/16/2015
'''
Copyright 2015 Emerson Electric Co.
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 c... | 28.976744 | 113 | 0.610754 |
62b72f5751875ad8f03b753bef7797afe46384d7 | 32,392 | py | Python | paddlenlp/transformers/ernie/modeling.py | zkh2016/PaddleNLP | 33146398dfce1f9582d01146c675c0d8f089275e | [
"Apache-2.0"
] | 1 | 2021-07-17T09:30:35.000Z | 2021-07-17T09:30:35.000Z | paddlenlp/transformers/ernie/modeling.py | zkh2016/PaddleNLP | 33146398dfce1f9582d01146c675c0d8f089275e | [
"Apache-2.0"
] | null | null | null | paddlenlp/transformers/ernie/modeling.py | zkh2016/PaddleNLP | 33146398dfce1f9582d01146c675c0d8f089275e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 appli... | 42.122237 | 129 | 0.616726 |
d1979045dfbbbcac8d34e125d8ef7f411c44573e | 7,164 | py | Python | hoft/core/decorators.py | sys-git/hoft | a59bd3f38a258eb6d7f56a9a79034159b18fd6a4 | [
"MIT"
] | null | null | null | hoft/core/decorators.py | sys-git/hoft | a59bd3f38a258eb6d7f56a9a79034159b18fd6a4 | [
"MIT"
] | 323 | 2017-09-13T07:20:51.000Z | 2022-03-31T12:30:24.000Z | hoft/core/decorators.py | sys-git/hoft | a59bd3f38a258eb6d7f56a9a79034159b18fd6a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Brief description
# @module hoft.core.decorators
# @version 0.1
# @copyright (c) 2017-present Francis Horsman.
from inspect import getargspec, getcallargs
import six
from hoft.core.parsers_in import parse_all_in_args
from hoft.core.parsers_sig import parse_all_sig_... | 36.365482 | 99 | 0.624511 |
0f61c98588c8fd774ed29c9c698d5bca06c76d8b | 384 | py | Python | shadock/tests.py | jibe-b/bioshadock | d4769946be29d74377435734c771fe19136a64a4 | [
"Apache-2.0"
] | null | null | null | shadock/tests.py | jibe-b/bioshadock | d4769946be29d74377435734c771fe19136a64a4 | [
"Apache-2.0"
] | 1 | 2017-05-05T14:02:44.000Z | 2017-05-05T14:26:24.000Z | shadock/tests.py | jibe-b/bioshadock | d4769946be29d74377435734c771fe19136a64a4 | [
"Apache-2.0"
] | null | null | null | import unittest
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def test_my_view(self):
from .views import my_view
request = testing.DummyRequest()
info = my_vie... | 21.333333 | 52 | 0.651042 |
589b72196e945e78da11ec9b6e720e87338b1039 | 112 | py | Python | riskgame/__init__.py | AxisAndAllies/game1 | 77ff6941233a00276e4c4cccbfb19be2a2251eb7 | [
"MIT"
] | null | null | null | riskgame/__init__.py | AxisAndAllies/game1 | 77ff6941233a00276e4c4cccbfb19be2a2251eb7 | [
"MIT"
] | null | null | null | riskgame/__init__.py | AxisAndAllies/game1 | 77ff6941233a00276e4c4cccbfb19be2a2251eb7 | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='risk-v0',
entrypoint='riskgame.envs:RiskEnv'
) | 18.666667 | 42 | 0.732143 |
852f6c12a621330c5b563246ea97859d4d28253b | 2,478 | py | Python | ltc/base/migrations/0001_initial.py | v0devil/jltom | b302a39a187b8e1154c6deda636a4db8b30bb40b | [
"MIT"
] | 4 | 2016-12-30T13:26:59.000Z | 2017-04-26T12:07:36.000Z | ltc/base/migrations/0001_initial.py | v0devil/jltom | b302a39a187b8e1154c6deda636a4db8b30bb40b | [
"MIT"
] | null | null | null | ltc/base/migrations/0001_initial.py | v0devil/jltom | b302a39a187b8e1154c6deda636a4db8b30bb40b | [
"MIT"
] | null | null | null | # Generated by Django 2.2.20 on 2021-05-05 15:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Project',
fields=[
... | 45.888889 | 196 | 0.558111 |
0e37b773295053acbdfdb46849eb0158a0060f26 | 275 | py | Python | apps/addresses/utils.py | goztrk/django-htk | c56bf112e5d627780d2f4288460eae5cce80fa9e | [
"MIT"
] | 206 | 2015-10-15T07:05:08.000Z | 2021-02-19T11:48:36.000Z | apps/addresses/utils.py | goztrk/django-htk | c56bf112e5d627780d2f4288460eae5cce80fa9e | [
"MIT"
] | 8 | 2017-10-16T10:18:31.000Z | 2022-03-09T14:24:27.000Z | apps/addresses/utils.py | goztrk/django-htk | c56bf112e5d627780d2f4288460eae5cce80fa9e | [
"MIT"
] | 61 | 2015-10-15T08:12:44.000Z | 2022-03-10T12:25:06.000Z | # HTK Imports
from htk.utils.enums import get_enum_symbolic_name
def get_unit_type_choices():
from htk.apps.addresses.enums import AddressUnitType
choices = [(unit_type.value, get_enum_symbolic_name(unit_type),) for unit_type in AddressUnitType]
return choices
| 30.555556 | 102 | 0.796364 |
6f9d728b1ce37c22616135bd04f23230348d6813 | 2,893 | py | Python | FWCore/Framework/test/testBitsCount_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | FWCore/Framework/test/testBitsCount_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | FWCore/Framework/test/testBitsCount_cfg.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
process = cms.Process("PROD")
import FWCore.Framework.test.cmsExceptionsFatalOption_cff
process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool(True),
Rethrow = FWCore.Framework.test.cmsExceptionsFatalOption_cff.Rethrow
)
process.maxEvents = cms.untrack... | 25.156522 | 72 | 0.707224 |
40769ff580e17c6a52758314f5d344bf0213cca4 | 3,842 | py | Python | setup.py | steschuser/certreq | 98a0b45bee5f3cddfaa88500d09b83bb2a5645d3 | [
"MIT"
] | null | null | null | setup.py | steschuser/certreq | 98a0b45bee5f3cddfaa88500d09b83bb2a5645d3 | [
"MIT"
] | null | null | null | setup.py | steschuser/certreq | 98a0b45bee5f3cddfaa88500d09b83bb2a5645d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'certreq'
DESCRIPTION = 'python i... | 28.887218 | 86 | 0.640292 |
ef8acef313ec6555a7e0b8961a652cec735b9eaa | 112,968 | py | Python | scipy/linalg/tests/test_lapack.py | Didou09/scipy | 061aca619504e198509969fbe5908d1085966889 | [
"BSD-3-Clause"
] | 1 | 2020-08-04T08:29:47.000Z | 2020-08-04T08:29:47.000Z | scipy/linalg/tests/test_lapack.py | Didou09/scipy | 061aca619504e198509969fbe5908d1085966889 | [
"BSD-3-Clause"
] | null | null | null | scipy/linalg/tests/test_lapack.py | Didou09/scipy | 061aca619504e198509969fbe5908d1085966889 | [
"BSD-3-Clause"
] | null | null | null | #
# Created by: Pearu Peterson, September 2002
#
import sys
import subprocess
import time
from functools import reduce
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_allclose, assert_almost_equal,
assert_array_equal)
import pyt... | 38.621538 | 79 | 0.509773 |
5fce8584e09887ea464c60faeb1051f6d9f5b07c | 7,933 | py | Python | pyaf/TS/Time.py | vishalbelsare/pyaf | 94aeeb0e78bea6a82353cf351bc8bec529e439bb | [
"BSD-3-Clause"
] | null | null | null | pyaf/TS/Time.py | vishalbelsare/pyaf | 94aeeb0e78bea6a82353cf351bc8bec529e439bb | [
"BSD-3-Clause"
] | null | null | null | pyaf/TS/Time.py | vishalbelsare/pyaf | 94aeeb0e78bea6a82353cf351bc8bec529e439bb | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2016 Antoine Carme <Antoine.Carme@Laposte.net>
# All rights reserved.
# This file is part of the Python Automatic Forecasting (PyAF) library and is made available under
# the terms of the 3 Clause BSD license
import pandas as pd
import numpy as np
from enum import IntEnum
from . import Utils as tsuti... | 38.323671 | 128 | 0.61969 |
d29b108dc29e22a5b005439b7bb8222054869c01 | 217 | py | Python | contests/leetcode-b6/a.py | Nightwish-cn/my_leetcode | 40f206e346f3f734fb28f52b9cde0e0041436973 | [
"MIT"
] | 23 | 2020-03-30T05:44:56.000Z | 2021-09-04T16:00:57.000Z | contests/leetcode-b6/a.py | Nightwish-cn/my_leetcode | 40f206e346f3f734fb28f52b9cde0e0041436973 | [
"MIT"
] | 1 | 2020-05-10T15:04:05.000Z | 2020-06-14T01:21:44.000Z | contests/leetcode-b6/a.py | Nightwish-cn/my_leetcode | 40f206e346f3f734fb28f52b9cde0e0041436973 | [
"MIT"
] | 6 | 2020-03-30T05:45:04.000Z | 2020-08-13T10:01:39.000Z | class Solution:
def isMajorityElement(self, nums: List[int], target: int) -> bool:
import collections
ct = collections.Counter(nums)
len1 = len(nums)
return ct[target] > (len1 // 2) | 36.166667 | 70 | 0.608295 |
98650705531955eb233944ea7348fd17cff7d192 | 1,643 | py | Python | scripts/gen_gaussian_cdt.py | banerjeeutsav/sapphire_sim | 85b96ef353a6135c96835841bf539de7df086f43 | [
"MIT"
] | 4 | 2020-03-09T06:05:27.000Z | 2021-09-17T06:49:06.000Z | scripts/gen_gaussian_cdt.py | banerjeeutsav/sapphire_sim | 85b96ef353a6135c96835841bf539de7df086f43 | [
"MIT"
] | null | null | null | scripts/gen_gaussian_cdt.py | banerjeeutsav/sapphire_sim | 85b96ef353a6135c96835841bf539de7df086f43 | [
"MIT"
] | null | null | null | #! /usr/bin/python
###################################################################################################
#
# Python CDT Generator
#
# Author: Utsav Banerjee
# Last Modified: 12-Oct-2019
#
###################################################################################################
import sys, math... | 31 | 133 | 0.517346 |
8cb1c444346e6900cfa2f763a5bc475d052e748d | 591 | py | Python | sequence_search/consumer/gunicorn.py | RNAcentral/sequence_search | e0319e384cc9dea017f165e2c4c5143ee232f9fd | [
"Apache-2.0"
] | 2 | 2019-02-13T16:33:46.000Z | 2019-10-22T16:27:00.000Z | sequence_search/consumer/gunicorn.py | RNAcentral/sequence_search | e0319e384cc9dea017f165e2c4c5143ee232f9fd | [
"Apache-2.0"
] | 110 | 2019-02-15T15:06:05.000Z | 2022-03-04T16:03:38.000Z | sequence_search/consumer/gunicorn.py | RNAcentral/sequence_search | e0319e384cc9dea017f165e2c4c5143ee232f9fd | [
"Apache-2.0"
] | 1 | 2021-06-30T21:39:35.000Z | 2021-06-30T21:39:35.000Z | """
This file allows your to serve your application using gunicorn. gunicorn is not installed by default
by the requirements file adev creates, you'll need to install it yourself and add it to requirements.txt.
To run the app using gunicorn, in the terminal run
pip install gunicorn
gunicorn app.gunicorn:app -... | 31.105263 | 112 | 0.780034 |
7a2ad8795a36a75aa81e33835b6a5f873f8636db | 3,824 | py | Python | ogr/services/pagure/flag.py | shreyaspapi/ogr | 176add79eeb7d71e765550da76c9cdc8aced9e92 | [
"MIT"
] | null | null | null | ogr/services/pagure/flag.py | shreyaspapi/ogr | 176add79eeb7d71e765550da76c9cdc8aced9e92 | [
"MIT"
] | null | null | null | ogr/services/pagure/flag.py | shreyaspapi/ogr | 176add79eeb7d71e765550da76c9cdc8aced9e92 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2018-2019 Red Hat, Inc.
# 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, m... | 34.763636 | 98 | 0.649059 |
f5bcc397eb3bb9e1a885fe2cca431556d03d796e | 2,160 | py | Python | Hub/ecointeraction/classification/migrations/0001_initial.py | maximedaniel/ITAME | ca820337911695fa3625b32dcad5d87ff0b192d0 | [
"MIT"
] | null | null | null | Hub/ecointeraction/classification/migrations/0001_initial.py | maximedaniel/ITAME | ca820337911695fa3625b32dcad5d87ff0b192d0 | [
"MIT"
] | 1 | 2021-06-10T23:19:09.000Z | 2021-06-10T23:19:09.000Z | Hub/ecointeraction/classification/migrations/0001_initial.py | maximedaniel/ITAME | ca820337911695fa3625b32dcad5d87ff0b192d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-05-08 06:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Characte... | 37.894737 | 114 | 0.573611 |
5be2d7df3a468f3864608d93b60d4cb0f0bd1bda | 3,305 | py | Python | zcp/messaging.py | victormonteiro/zcp | a4d808c89c3296fe27a08da5eadcf88ae08418eb | [
"Apache-2.0"
] | 4 | 2017-05-11T07:34:34.000Z | 2021-03-22T13:40:06.000Z | zcp/messaging.py | apolloliu/ZCP | 646e72d44b4445eb4a81ccd67d44b71e1fb9ea66 | [
"Apache-2.0"
] | 7 | 2017-05-02T14:18:27.000Z | 2020-12-15T19:03:42.000Z | zcp/messaging.py | apolloliu/ZCP | 646e72d44b4445eb4a81ccd67d44b71e1fb9ea66 | [
"Apache-2.0"
] | 6 | 2017-05-11T07:34:11.000Z | 2021-03-22T13:37:39.000Z | # Copyright 2017 EasyStack, Inc
# Authors: Hanxi Liu<apolloliuhx@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 37.988506 | 78 | 0.56944 |
dd99b9114aa90ae785efef8f2d974208550babb6 | 226 | py | Python | change_inside/3/antes.py | parzibyte/ejemplos_vim | 1329616bb2344d43e6e90c2a8c0f90ae1e3c52da | [
"MIT"
] | null | null | null | change_inside/3/antes.py | parzibyte/ejemplos_vim | 1329616bb2344d43e6e90c2a8c0f90ae1e3c52da | [
"MIT"
] | null | null | null | change_inside/3/antes.py | parzibyte/ejemplos_vim | 1329616bb2344d43e6e90c2a8c0f90ae1e3c52da | [
"MIT"
] | null | null | null | """
https://parzibyte.me/blog
"""
# Cambia el contenido de la lista para que tenga los números del 1 al 3
lista = [12, 321, 321, 321, 3, 213, 21, 321, 321, 3,
213, 12, 4, 54, 5, 4, 6, 65, 6, 5346, 5436, 5346, 54]
| 32.285714 | 71 | 0.584071 |
891d4ed726e77fd986edee372d297804eaad447d | 385 | py | Python | protera_stability/engine/__init__.py | stepp1/protera-stability | 62f70af00b9475a0b0aeba39fa6ae57f0bb25b34 | [
"MIT"
] | 1 | 2021-11-05T02:14:31.000Z | 2021-11-05T02:14:31.000Z | protera_stability/engine/__init__.py | stepp1/protera-stability | 62f70af00b9475a0b0aeba39fa6ae57f0bb25b34 | [
"MIT"
] | null | null | null | protera_stability/engine/__init__.py | stepp1/protera-stability | 62f70af00b9475a0b0aeba39fa6ae57f0bb25b34 | [
"MIT"
] | null | null | null | from protera_stability.engine.default import get_cfg, setup_train, DefaultTrainer
from protera_stability.engine.lightning_train import (
default_cbs,
DataModule,
LitProteins,
TrainingPl,
)
__all__ = [
"DataModule",
"DefaultTrainer",
"LitProteins",
"TrainingPl",
"default_cbs",
"g... | 19.25 | 81 | 0.698701 |
9a0fd48a2b7f4de3700428c18634fbf6f509ad07 | 533 | py | Python | chatapp/models.py | steve-chen-nyc/django_chat_bot | 8e943cc5eeff2bc87c09e59ff6c3c2a3f4eed187 | [
"MIT"
] | null | null | null | chatapp/models.py | steve-chen-nyc/django_chat_bot | 8e943cc5eeff2bc87c09e59ff6c3c2a3f4eed187 | [
"MIT"
] | 8 | 2019-12-04T23:05:32.000Z | 2022-02-10T08:37:45.000Z | chatapp/models.py | steve-chen-nyc/django_chat_bot | 8e943cc5eeff2bc87c09e59ff6c3c2a3f4eed187 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Client(models.Model):
name = models.CharField(max_length=100)
date_created = models.DateTimeField('date published')
def __str__(self):
return self.name
class Project(models.Model):
client = models.ForeignKey(Client, on_delete=model... | 28.052632 | 64 | 0.724203 |
bf68b38f44575495543aaa359ec1aaff4b839c68 | 54,677 | py | Python | ticdat/utils.py | 8135tao/ticdat | 71aeddce4bfcdb0ab03ee4ee6ffed108bb010848 | [
"BSD-2-Clause"
] | 15 | 2019-05-16T13:22:50.000Z | 2022-02-18T08:07:10.000Z | ticdat/utils.py | qtbgo/ticdat | 71aeddce4bfcdb0ab03ee4ee6ffed108bb010848 | [
"BSD-2-Clause"
] | 86 | 2019-03-13T16:18:07.000Z | 2022-02-07T22:13:15.000Z | ticdat/utils.py | qtbgo/ticdat | 71aeddce4bfcdb0ab03ee4ee6ffed108bb010848 | [
"BSD-2-Clause"
] | 9 | 2020-05-06T15:13:32.000Z | 2022-01-26T15:30:44.000Z | """
general utility module
PEP8
"""
from numbers import Number
from itertools import chain, combinations
from collections import defaultdict
import ticdat
import getopt
import sys
import os
from collections import namedtuple
import datetime as datetime_
try:
import dateutil, dateutil.parser
except:
dateutil = N... | 47.586597 | 120 | 0.6363 |
c4b5032e3213115418558bba443da468d6be2b2f | 555 | py | Python | ex106.py | ClovisA-Dev/ex-anteriores-Python | 61fa7e41033267db1e057d08180c015f30695a83 | [
"MIT"
] | null | null | null | ex106.py | ClovisA-Dev/ex-anteriores-Python | 61fa7e41033267db1e057d08180c015f30695a83 | [
"MIT"
] | null | null | null | ex106.py | ClovisA-Dev/ex-anteriores-Python | 61fa7e41033267db1e057d08180c015f30695a83 | [
"MIT"
] | null | null | null | from time import sleep
def mini_sistema():
sleep(1)
print('\033[7;32;40m~'*30)
print('\033[7;32;40mSISTEMA DE AJUDA PyHELP')
print('\033[7;32;40m~' * 30)
print('\033[m')
while True:
funcao = str(input('Função ou Biblioteca > '))
if funcao != 'fim':
sleep(1)
... | 24.130435 | 54 | 0.49009 |
9d1988e35027ded61acd00933744f6b7278d6e9a | 1,446 | py | Python | api/app/schemas/theq/csr_schema.py | sumesh-aot/queue-management | d8de45c2d94c1a557c8f8d207d73a067709d5abb | [
"Apache-2.0"
] | 1 | 2019-10-04T23:30:14.000Z | 2019-10-04T23:30:14.000Z | api/app/schemas/theq/csr_schema.py | sumesh-aot/queue-management | d8de45c2d94c1a557c8f8d207d73a067709d5abb | [
"Apache-2.0"
] | 59 | 2018-06-27T02:39:35.000Z | 2019-06-20T20:36:09.000Z | api/app/schemas/theq/csr_schema.py | sumesh-aot/queue-management | d8de45c2d94c1a557c8f8d207d73a067709d5abb | [
"Apache-2.0"
] | 2 | 2018-05-21T21:30:22.000Z | 2018-05-23T11:46:43.000Z | '''Copyright 2018 Province of British Columbia
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,... | 32.863636 | 72 | 0.733057 |
d215c1ffb497fe9cb0827e2e0aec7a383842e411 | 5,287 | py | Python | geopandas/io/file.py | BoBednar/geopandas | f89a6e34de2b32c1e2160f0c079b7e50067304eb | [
"BSD-3-Clause"
] | 1 | 2021-02-18T20:52:14.000Z | 2021-02-18T20:52:14.000Z | geopandas/io/file.py | BoBednar/geopandas | f89a6e34de2b32c1e2160f0c079b7e50067304eb | [
"BSD-3-Clause"
] | null | null | null | geopandas/io/file.py | BoBednar/geopandas | f89a6e34de2b32c1e2160f0c079b7e50067304eb | [
"BSD-3-Clause"
] | 1 | 2018-12-16T22:57:23.000Z | 2018-12-16T22:57:23.000Z | import os
import fiona
import numpy as np
import six
from geopandas import GeoDataFrame, GeoSeries
# Adapted from pandas.io.common
if six.PY3:
from urllib.request import urlopen as _urlopen
from urllib.parse import urlparse as parse_url
from urllib.parse import uses_relative, uses_netloc, uses_params
els... | 31.470238 | 77 | 0.643087 |
86d427dc700c37b8b007ba42d8258e0de8ba1bd4 | 2,065 | py | Python | FakeNews/fakenewsFE/test.py | arkochatterjee/X-check-fake-news | 7636e0785134def088a30fd34167236a647ed457 | [
"MIT"
] | 4 | 2020-02-08T16:08:58.000Z | 2021-01-21T18:17:54.000Z | FakeNews/fakenewsFE/test.py | arkochatterjee/X-check-fake-news | 7636e0785134def088a30fd34167236a647ed457 | [
"MIT"
] | null | null | null | FakeNews/fakenewsFE/test.py | arkochatterjee/X-check-fake-news | 7636e0785134def088a30fd34167236a647ed457 | [
"MIT"
] | 1 | 2018-10-13T05:14:25.000Z | 2018-10-13T05:14:25.000Z |
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
import matplotlib.cm as c... | 18.114035 | 115 | 0.723487 |
82f7051042c55ec9fd2e1b42210de20fc226dfdd | 1,448 | py | Python | gff2exonpos.py | sotuamax/gff_script | 6c7ef3c87281ca44ed8ea36ab9cb6cc29ddfee4c | [
"MIT"
] | null | null | null | gff2exonpos.py | sotuamax/gff_script | 6c7ef3c87281ca44ed8ea36ab9cb6cc29ddfee4c | [
"MIT"
] | null | null | null | gff2exonpos.py | sotuamax/gff_script | 6c7ef3c87281ca44ed8ea36ab9cb6cc29ddfee4c | [
"MIT"
] | null | null | null | import argparse
import pysam
def args_parser():
'''parser the argument from terminal command'''
parser=argparse.ArgumentParser(prog = "PROG", formatter_class = argparse.RawDescriptionHelpFormatter, description=" \n\
Usage: python gtf_info.py -gff <gff> -O <output> ")
parser.add_argument("-gff", "--... | 30.808511 | 123 | 0.593232 |
c1db957292abd50b0ee8931490ba8d8e8ffb8edd | 2,427 | py | Python | pcdet/models/detectors/pointpillar.py | CSL-KU/OpenPCDet | 2c5fca0da1521add4b40e6cdfe75d02d4285b83f | [
"Apache-2.0"
] | null | null | null | pcdet/models/detectors/pointpillar.py | CSL-KU/OpenPCDet | 2c5fca0da1521add4b40e6cdfe75d02d4285b83f | [
"Apache-2.0"
] | null | null | null | pcdet/models/detectors/pointpillar.py | CSL-KU/OpenPCDet | 2c5fca0da1521add4b40e6cdfe75d02d4285b83f | [
"Apache-2.0"
] | null | null | null | from .detector3d_template import Detector3DTemplate
import torch
#128 151 178
class PointPillar(Detector3DTemplate):
def __init__(self, model_cfg, num_class, dataset):
super().__init__(model_cfg=model_cfg, num_class=num_class, dataset=dataset)
self.module_list = self.build_networks()
self.v... | 33.246575 | 87 | 0.591265 |
fe3cc81b1e01244175856a76d0366ae37703fe8b | 11,662 | py | Python | tlstool.py | somerovi/tlstool | 95db6264fcc5d63ae7ec8f177d2b0a7b79fe1ae8 | [
"MIT"
] | null | null | null | tlstool.py | somerovi/tlstool | 95db6264fcc5d63ae7ec8f177d2b0a7b79fe1ae8 | [
"MIT"
] | null | null | null | tlstool.py | somerovi/tlstool | 95db6264fcc5d63ae7ec8f177d2b0a7b79fe1ae8 | [
"MIT"
] | null | null | null | import argparse
import logging
import os
import subprocess
import sys
import jinja2
import yaml
CMD = "/usr/bin/openssl"
base_path = os.path.dirname(os.path.realpath(__file__))
VERSION = "1"
logger = logging.getLogger()
def openssl(args, input=None, env=None):
process = subprocess.Popen(
[CMD] + arg... | 33.32 | 89 | 0.56131 |
9408bd8bbce8c06abc5124b282df699d38a7194b | 6,672 | py | Python | hyfed-server/hyfed_server/serializer/hyfed_serializers.py | TUM-AIMED/hyfed | 48c7ee0dda92ebb70cc985dc4c0eedb7403dc823 | [
"Apache-2.0"
] | 11 | 2021-04-13T12:11:16.000Z | 2022-03-21T11:45:07.000Z | hyfed-server/hyfed_server/serializer/hyfed_serializers.py | AnneHartebrodt/hyfed-pca | 57c009d17d00524f216d57f4fd3fb8732c3fccce | [
"Apache-2.0"
] | null | null | null | hyfed-server/hyfed_server/serializer/hyfed_serializers.py | AnneHartebrodt/hyfed-pca | 57c009d17d00524f216d57f4fd3fb8732c3fccce | [
"Apache-2.0"
] | 4 | 2021-04-04T12:17:03.000Z | 2021-05-25T11:11:20.000Z | """
Serializer classes to serialize the models
Copyright 2021 Julian Matschinske, Reza NasiriGerdeh, and Reihaneh TorkzadehMahani. 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 ... | 34.215385 | 126 | 0.685701 |
554a9570e7697c667bd8fbdc4a4807fdddaed091 | 13,208 | py | Python | maro/simulator/core.py | jreynolds01/maro | a61968b9e53ab83e248ec258dd8ea7c05c56bf4c | [
"MIT"
] | 1 | 2021-08-17T17:10:02.000Z | 2021-08-17T17:10:02.000Z | maro/simulator/core.py | afelipeg/maro | 69e212703e49adc6eee0741c12dee06c30c0c82e | [
"MIT"
] | null | null | null | maro/simulator/core.py | afelipeg/maro | 69e212703e49adc6eee0741c12dee06c30c0c82e | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from collections import Iterable
from importlib import import_module
from inspect import getmembers, isclass
from typing import List
from maro.backends.frame import FrameBase, SnapshotList
from maro.data_lib.dump_csv_converter import DumpConvert... | 39.663664 | 116 | 0.639915 |
7bf457d331102b0615696a1c3aa48ea65ea3a25d | 30,108 | py | Python | Lib/distutils/msvc9compiler.py | hashiqizaizai/hashiqizaizai.github.io | 7217400802f6b944dfd1e29d4b00d268957ff769 | [
"bzip2-1.0.6"
] | null | null | null | Lib/distutils/msvc9compiler.py | hashiqizaizai/hashiqizaizai.github.io | 7217400802f6b944dfd1e29d4b00d268957ff769 | [
"bzip2-1.0.6"
] | null | null | null | Lib/distutils/msvc9compiler.py | hashiqizaizai/hashiqizaizai.github.io | 7217400802f6b944dfd1e29d4b00d268957ff769 | [
"bzip2-1.0.6"
] | null | null | null | """distutils.msvc9compiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.
The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
"""
# Written by Perry Stoll
# hacked ... | 39.356863 | 100 | 0.543543 |
ec75048c7672b94151aaf117b189b20137af7e31 | 3,295 | py | Python | ecs/batch-app/main.py | avcaliani/aws-app | d2c2db1f427f049842e867bd65c8bce180071a40 | [
"MIT"
] | null | null | null | ecs/batch-app/main.py | avcaliani/aws-app | d2c2db1f427f049842e867bd65c8bce180071a40 | [
"MIT"
] | null | null | null | ecs/batch-app/main.py | avcaliani/aws-app | d2c2db1f427f049842e867bd65c8bce180071a40 | [
"MIT"
] | null | null | null | import json
import logging as log
from argparse import ArgumentParser
from datetime import datetime
from os import environ
from random import choice
from time import sleep
from uuid import uuid4
import requests
from boto3 import Session
def init_log():
log.basicConfig(
format='[%(asctime)s][%(name)s][%(l... | 31.380952 | 111 | 0.641882 |
12d577e733da19f394298d9384d421fa9b84f54c | 15,688 | py | Python | src/sqlfluff/dialects/dialect_hive.py | DipeshCS/sqlfluff | ca3eb7f037ca68a969c17d844949f947be94a300 | [
"MIT"
] | null | null | null | src/sqlfluff/dialects/dialect_hive.py | DipeshCS/sqlfluff | ca3eb7f037ca68a969c17d844949f947be94a300 | [
"MIT"
] | null | null | null | src/sqlfluff/dialects/dialect_hive.py | DipeshCS/sqlfluff | ca3eb7f037ca68a969c17d844949f947be94a300 | [
"MIT"
] | null | null | null | """The Hive dialect."""
from sqlfluff.core.parser import (
BaseSegment,
Sequence,
Ref,
OneOf,
Bracketed,
Delimited,
StartsWith,
NamedParser,
SymbolSegment,
StringParser,
OptionallyBracketed,
)
from sqlfluff.core.dialects import load_raw_dialect
from sqlfluff.core.parser.seg... | 31.003953 | 97 | 0.5436 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.