hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ff1e63bfe9d1089667daed1c4cbb385d5f6c2ed2 | 6,707 | py | Python | jesse/services/project_maker/project_template/config.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-03-25T09:25:49.000Z | 2021-03-25T09:25:49.000Z | jesse/services/project_maker/project_template/config.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | null | null | null | jesse/services/project_maker/project_template/config.py | noenfugler/jesse | 217a3168620a755c1a9576d9deb27105db7dccf8 | [
"MIT"
] | 1 | 2021-09-28T16:23:40.000Z | 2021-09-28T16:23:40.000Z | config = {
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# PostgreSQL Database
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# PostgreSQL is used as the database to store data such as candles.
# # # # # # # # # # # # # # # # # # # # # # # # # # #... | 33.873737 | 82 | 0.391979 |
ebab252286552ce06263d8987646f934cd7eea9a | 7,153 | py | Python | paddlex/ppdet/modeling/losses/jde_loss.py | MichaelZhero/PaddleX | bedaa2a1cbefc9078cc00faa10dd4b9de655b1e7 | [
"Apache-2.0"
] | 1 | 2021-11-12T03:17:02.000Z | 2021-11-12T03:17:02.000Z | paddlex/ppdet/modeling/losses/jde_loss.py | MichaelZhero/PaddleX | bedaa2a1cbefc9078cc00faa10dd4b9de655b1e7 | [
"Apache-2.0"
] | null | null | null | paddlex/ppdet/modeling/losses/jde_loss.py | MichaelZhero/PaddleX | bedaa2a1cbefc9078cc00faa10dd4b9de655b1e7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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... | 39.087432 | 83 | 0.614008 |
e7e4b5a35b0a9bea027958ef4ef96d413a1c2878 | 5,931 | py | Python | graph.py | mahendrakariya/neuralnet_cifar10 | d6f4f84324e15b9527e47f7f4c5a900850d07989 | [
"Apache-2.0"
] | null | null | null | graph.py | mahendrakariya/neuralnet_cifar10 | d6f4f84324e15b9527e47f7f4c5a900850d07989 | [
"Apache-2.0"
] | null | null | null | graph.py | mahendrakariya/neuralnet_cifar10 | d6f4f84324e15b9527e47f7f4c5a900850d07989 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
BATCH_SIZE = 128
HIDDEN_SIZE = 200
HIDDEN_SIZE_2 = HIDDEN_SIZE // 2
INITIAL_LEARNING_RATE = 0.0001
DECAY_STEPS = 3438 # 4560 #3438 (382*9)
LEARNING_RATE_DECAY_FACTOR = 0.1
MOVING_AVERAGE_DECAY = 0.9999
def inference(images):
with tf.variable_scope('conv1') as scope:
kernel = tf... | 42.669065 | 117 | 0.683359 |
82b331e15079ea0bfece29e043f5d39846bcefbe | 21,664 | py | Python | ceilometer/tests/unit/network/services/test_lbaas.py | andymcc/ceilometer | fa3b047eb17152b30829eadd9220f12ca9949b4f | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/unit/network/services/test_lbaas.py | andymcc/ceilometer | fa3b047eb17152b30829eadd9220f12ca9949b4f | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/unit/network/services/test_lbaas.py | andymcc/ceilometer | fa3b047eb17152b30829eadd9220f12ca9949b4f | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2014 Cisco 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 law or agreed to in writ... | 42.478431 | 76 | 0.537851 |
ba323774a59b547fd8a938faf28e9dfff1cccac3 | 15,039 | py | Python | deepkt/agents/base.py | persai-lab/EDM2020-DMKT | ded1e76a5908432f5b927fc3bda7c0e059e2bc00 | [
"MIT"
] | 4 | 2021-05-28T13:15:18.000Z | 2021-12-15T22:29:28.000Z | deepkt/agents/base.py | persai-lab/EDM2021-DMKT | ded1e76a5908432f5b927fc3bda7c0e059e2bc00 | [
"MIT"
] | null | null | null | deepkt/agents/base.py | persai-lab/EDM2021-DMKT | ded1e76a5908432f5b927fc3bda7c0e059e2bc00 | [
"MIT"
] | null | null | null | """
The Base Agent class, where all other agents inherit from, that contains definitions for all the necessary functions
"""
import logging
import torch
import shutil
import numpy as np
from sklearn import metrics
import pickle
import torch.nn as nn
from tensorboardX.writer import SummaryWriter
from deepkt.utils.metri... | 44.758929 | 116 | 0.587606 |
e8aa74c5fe301a4826d146850852432194386fa6 | 397 | py | Python | store/migrations/0007_alter_product_slug.py | LhermannSauer/online-store_Django-project_-codewithMosh | 5c00588caadfefba65b6d0bab4fae5058cdddee4 | [
"MIT"
] | null | null | null | store/migrations/0007_alter_product_slug.py | LhermannSauer/online-store_Django-project_-codewithMosh | 5c00588caadfefba65b6d0bab4fae5058cdddee4 | [
"MIT"
] | null | null | null | store/migrations/0007_alter_product_slug.py | LhermannSauer/online-store_Django-project_-codewithMosh | 5c00588caadfefba65b6d0bab4fae5058cdddee4 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-02 01:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0006_alter_product_collection'),
]
operations = [
migrations.AlterField(
model_name='product',
name='slug',... | 20.894737 | 58 | 0.602015 |
be681f7296bcf49ab215efeda4f2ca8630296468 | 36,381 | py | Python | catamount/tests/full/tf_speech_attention.py | baidu-research/catamount | 4591f797bb9a8a70598c6d5a85551a6ec92ef7e3 | [
"Apache-2.0"
] | 13 | 2018-12-18T04:09:22.000Z | 2020-08-17T22:51:25.000Z | dl_modifier/tests/full/tf_speech_attention.py | nikkkkhil/dl_modifier | d9c3f7c31db54e51aa5fa2bca2688f337a7f318f | [
"Apache-2.0"
] | 6 | 2018-12-20T00:21:00.000Z | 2019-08-01T02:01:12.000Z | dl_modifier/tests/full/tf_speech_attention.py | nikkkkhil/dl_modifier | d9c3f7c31db54e51aa5fa2bca2688f337a7f318f | [
"Apache-2.0"
] | 4 | 2018-11-23T19:14:25.000Z | 2019-10-28T07:53:03.000Z | import numpy as np
import pickle
import sympy
import sys
sys.setrecursionlimit(50000)
from catamount.api import utils
import catamount.frameworks.tensorflow
from catamount.ops.constant import *
from catamount.ops.unknown_op import UnknownOp
from catamount.ops.variable import *
is_pytest_run = False
def test_tf_spe... | 65.788427 | 247 | 0.681015 |
5137e386269eb5d03ccf0fe3773cf9258124be38 | 96 | py | Python | Python/Programming Fundamentals/Basic Syntax/01. Biggest three numbers.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | Python/Programming Fundamentals/Basic Syntax/01. Biggest three numbers.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | Python/Programming Fundamentals/Basic Syntax/01. Biggest three numbers.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | a = int(input())
b = int(input())
c = int(input())
max_num = max(a, b, c)
print(max_num) | 13.714286 | 23 | 0.541667 |
8f5df65a696ee07dcd7bdd3ef4c72b5b9e357d3e | 1,978 | py | Python | homeassistant/components/media_player/const.py | markusxyz/core | d12c6dea5759f99bbea335392d8c9479776d84d5 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/media_player/const.py | markusxyz/core | d12c6dea5759f99bbea335392d8c9479776d84d5 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/media_player/const.py | markusxyz/core | d12c6dea5759f99bbea335392d8c9479776d84d5 | [
"Apache-2.0"
] | 1 | 2020-05-14T06:22:16.000Z | 2020-05-14T06:22:16.000Z | """Proides the constants needed for component."""
ATTR_APP_ID = "app_id"
ATTR_APP_NAME = "app_name"
ATTR_INPUT_SOURCE = "source"
ATTR_INPUT_SOURCE_LIST = "source_list"
ATTR_MEDIA_ALBUM_ARTIST = "media_album_artist"
ATTR_MEDIA_ALBUM_NAME = "media_album_name"
ATTR_MEDIA_ARTIST = "media_artist"
ATTR_MEDIA_CHANNEL = "medi... | 29.522388 | 60 | 0.827604 |
c68de737437a8b22f00d66202982159c45b625d2 | 11,917 | py | Python | aiida_optimize/engines/_nelder_mead.py | greschd/aiida_optimize | 4c7bc76e4ad7e40f6105e60f34b7a20e1ab3a122 | [
"Apache-2.0"
] | null | null | null | aiida_optimize/engines/_nelder_mead.py | greschd/aiida_optimize | 4c7bc76e4ad7e40f6105e60f34b7a20e1ab3a122 | [
"Apache-2.0"
] | null | null | null | aiida_optimize/engines/_nelder_mead.py | greschd/aiida_optimize | 4c7bc76e4ad7e40f6105e60f34b7a20e1ab3a122 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
#
# The additional license terms given in ADDITIONAL_TERMS.txt appl... | 31.949062 | 120 | 0.623479 |
f7a207469cfd89f2b386f13df1c3672e7985c977 | 1,922 | py | Python | essmc2/transforms/tensor.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | 69 | 2021-11-01T11:18:13.000Z | 2022-03-28T04:27:17.000Z | essmc2/transforms/tensor.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | 6 | 2021-11-01T09:28:13.000Z | 2022-02-11T09:49:58.000Z | essmc2/transforms/tensor.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | 16 | 2021-11-11T06:26:18.000Z | 2022-03-20T13:32:15.000Z | # Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved.
import numpy as np
import torch
from .registry import TRANSFORMS
def to_tensor(data):
if isinstance(data, torch.Tensor):
return data
elif isinstance(data, np.ndarray):
return torch.from_numpy(data)
elif isinstance(data,... | 28.264706 | 98 | 0.610822 |
199ad5e8c590edc9e2410f13466eb3b903479da5 | 1,181 | py | Python | mysite/wsgi.py | wipxj3/EventTicket_v2 | 236bc06c31126f528dad09f61fc0220bf7cf0d42 | [
"MIT"
] | 2 | 2019-05-17T14:53:27.000Z | 2021-07-26T19:47:35.000Z | mysite/wsgi.py | zurawiki/thecrimsom | cd185ac936fc3f2de5ebfb2ffff9af52f7a83adb | [
"MIT"
] | null | null | null | mysite/wsgi.py | zurawiki/thecrimsom | cd185ac936fc3f2de5ebfb2ffff9af52f7a83adb | [
"MIT"
] | 1 | 2017-03-21T03:53:31.000Z | 2017-03-21T03:53:31.000Z | """
WSGI config for mysite project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | 38.096774 | 79 | 0.806943 |
0c404e798951b43f0454d356795ea619c516ca89 | 1,109 | py | Python | drpexport.py | Johnr24/DaVinciResolve-ExportProjects | db0f8d38d674468722a3786cfacd9ab30cbb0057 | [
"MIT"
] | null | null | null | drpexport.py | Johnr24/DaVinciResolve-ExportProjects | db0f8d38d674468722a3786cfacd9ab30cbb0057 | [
"MIT"
] | null | null | null | drpexport.py | Johnr24/DaVinciResolve-ExportProjects | db0f8d38d674468722a3786cfacd9ab30cbb0057 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# DaVinci Resolve V16 export to DRP all projects in the current folder.
# Copyright 2019 Igor Riđanović, www.metafide.com, www.hdhead.com -
# With tweaks for Python 3.6 John Rogers 2021
#this is the way that readme.txt suggests loading the python module and works for me... | 24.644444 | 99 | 0.713255 |
50222f02926bcad6b80fa0a1227b00b7b0ee84f1 | 1,817 | py | Python | dvc/dependency/__init__.py | franekp/dvc | e380a4a8586da643bf4e0d2281b13aee0d5e5207 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/__init__.py | franekp/dvc | e380a4a8586da643bf4e0d2281b13aee0d5e5207 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/__init__.py | franekp/dvc | e380a4a8586da643bf4e0d2281b13aee0d5e5207 | [
"Apache-2.0"
] | null | null | null | import schema
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from dvc.exceptions import DvcException
from dvc.config import Config
from dvc.dependency.base import DependencyBase
from dvc.dependency.s3 import DependencyS3
from dvc.dependency.gs import DependencyGS
fro... | 27.953846 | 92 | 0.70721 |
45a854ebe4b3c3978029a7432ce3cbdca0ebaf99 | 1,141 | py | Python | Gauss/MetGauss.py | IsoT0P0S/Metodo-GaussJordan | d135c68254263ff850868715455b813eda5b3596 | [
"MIT"
] | null | null | null | Gauss/MetGauss.py | IsoT0P0S/Metodo-GaussJordan | d135c68254263ff850868715455b813eda5b3596 | [
"MIT"
] | null | null | null | Gauss/MetGauss.py | IsoT0P0S/Metodo-GaussJordan | d135c68254263ff850868715455b813eda5b3596 | [
"MIT"
] | null | null | null | import numpy as npm
A = npm.array([[1,2],[1,4]])
B = npm.array([[3],[5]])
AB = npm.concatenate((A,B),axis=1)
AB0 = npm.copy(AB)
tamano = npm.shape(AB)
n = tamano[0]
m = tamano[1]
for i in range(0,n-1,1):
columna = abs(AB[i:,i])
dondemax = npm.argmax(columna)
if (dondemax !=0):
temporal ... | 19.016667 | 42 | 0.561788 |
0f17dff7a84f71db78c1380651775e285c6ad2b2 | 2,948 | py | Python | debug-section/already_passing_tests.py | tkornuta/python-sandbox | 00e03cd3f49ebb014611d67aad886aaff04c058f | [
"Apache-2.0"
] | null | null | null | debug-section/already_passing_tests.py | tkornuta/python-sandbox | 00e03cd3f49ebb014611d67aad886aaff04c058f | [
"Apache-2.0"
] | null | null | null | debug-section/already_passing_tests.py | tkornuta/python-sandbox | 00e03cd3f49ebb014611d67aad886aaff04c058f | [
"Apache-2.0"
] | 1 | 2020-07-09T05:49:02.000Z | 2020-07-09T05:49:02.000Z | from __future__ import print_function
from webcrawler import WebCrawler
from loggers import *
import html_helper
import unittest
test_case_html = """
<!DOCTYPE html>
<html>
<body>
<h1>Test Case 1</h1>
<p>I am a paragraph! <a href="javascript:doThing">blah</a></p>
<p>Sometimes I am <a href="./cynical.h... | 40.944444 | 149 | 0.701493 |
4067d1e535d6543127ba794a7f89e0026e9469d2 | 10,218 | py | Python | homeassistant/components/broadlink/switch.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | homeassistant/components/broadlink/switch.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 52 | 2020-07-14T14:12:26.000Z | 2022-03-31T06:24:02.000Z | homeassistant/components/broadlink/switch.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 2 | 2017-09-03T16:06:02.000Z | 2021-01-12T15:07:52.000Z | """Support for Broadlink switches."""
from abc import ABC, abstractmethod
import logging
from broadlink.exceptions import BroadlinkException
import voluptuous as vol
from homeassistant.components.switch import (
DEVICE_CLASS_OUTLET,
DEVICE_CLASS_SWITCH,
PLATFORM_SCHEMA,
SwitchEntity,
)
from homeassist... | 30.141593 | 86 | 0.637698 |
d19a93e9cd58cd77060618c6ee2657e55c558c26 | 5,959 | py | Python | ImgAnn/convert.py | nipdep/img-ann | a144136de981dc3dc28f4ed5c206ca9e195ad274 | [
"MIT"
] | 2 | 2021-01-14T11:23:52.000Z | 2021-08-30T03:15:20.000Z | ImgAnn/convert.py | nipdep/img-ann | a144136de981dc3dc28f4ed5c206ca9e195ad274 | [
"MIT"
] | 4 | 2020-12-16T16:48:56.000Z | 2021-07-01T02:48:07.000Z | ImgAnn/convert.py | nipdep/img-ann | a144136de981dc3dc28f4ed5c206ca9e195ad274 | [
"MIT"
] | 1 | 2021-07-01T01:07:28.000Z | 2021-07-01T01:07:28.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .operators.imgdata import ImgData
from .operators import coco, csv, pascalvoc
import logging
import os
# set logger
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class Convertor:
""" convert method implementation class ""... | 36.335366 | 116 | 0.639201 |
c0f37ebf2b3997fcd728c5a9c93ed47c5865338a | 639 | py | Python | gupb/controller/__init__.py | Lipskoe/GUPB | 0dd0e6ff2603465aa1ebb514a7745eb09726b447 | [
"MIT"
] | 6 | 2020-10-06T14:29:45.000Z | 2020-10-18T22:45:39.000Z | gupb/controller/__init__.py | Lipskoe/GUPB | 0dd0e6ff2603465aa1ebb514a7745eb09726b447 | [
"MIT"
] | 8 | 2020-10-10T10:36:21.000Z | 2022-01-02T14:10:07.000Z | gupb/controller/__init__.py | Lipskoe/GUPB | 0dd0e6ff2603465aa1ebb514a7745eb09726b447 | [
"MIT"
] | 17 | 2020-10-08T19:08:45.000Z | 2022-01-17T02:40:30.000Z | from abc import abstractmethod
from typing import Protocol
from gupb.model import arenas
from gupb.model import characters
class Controller(Protocol):
@abstractmethod
def reset(self, arena_description: arenas.ArenaDescription) -> None:
raise NotImplementedError
@abstractmethod
def decide(se... | 23.666667 | 83 | 0.733959 |
ba2b2f7e6638f73a58005ef1b1abc5791582e221 | 315 | py | Python | users/migrations/0002_remove_profile_email.py | wadi-1000/Therapi | f18268be821d7a73b6e0cc0f10dad91efbd05dba | [
"MIT"
] | null | null | null | users/migrations/0002_remove_profile_email.py | wadi-1000/Therapi | f18268be821d7a73b6e0cc0f10dad91efbd05dba | [
"MIT"
] | null | null | null | users/migrations/0002_remove_profile_email.py | wadi-1000/Therapi | f18268be821d7a73b6e0cc0f10dad91efbd05dba | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-09-29 12:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='profile',
name='email',
),
]
| 17.5 | 47 | 0.574603 |
4335b4c0d77752f25a02081ababc27baabc917ad | 1,783 | py | Python | hamilton.py | bturkoglu/hamilton-path-using-python-with-turkey-cities | c627b2077fe3de9427806886ad3cd26ac2a4d5ab | [
"MIT"
] | 1 | 2022-02-23T16:09:39.000Z | 2022-02-23T16:09:39.000Z | hamilton.py | bturkoglu/hamilton-path-using-python-with-turkey-cities | c627b2077fe3de9427806886ad3cd26ac2a4d5ab | [
"MIT"
] | null | null | null | hamilton.py | bturkoglu/hamilton-path-using-python-with-turkey-cities | c627b2077fe3de9427806886ad3cd26ac2a4d5ab | [
"MIT"
] | null | null | null | import itertools
def dosyaoku():
baslik = True
with open(dosya,'r') as f:
for line in f:
satir = line.strip().split(sep='\t')
print('satir:',satir)
if baslik:
baslik = False
for s in satir:
sehirler.append(s)
print('Sehirler:',sehirler)
continue
sehir = satir[0]... | 22.858974 | 94 | 0.668536 |
dadf313b8e4f35583ea5039667e383401e29cffe | 3,222 | py | Python | mmdetection/mmdet/models/roi_heads/roi_extractors/generic_roi_extractor.py | lizhaoliu-Lec/Conformer | 577cff26b78b338f035c075727c408fca3272208 | [
"Apache-2.0"
] | null | null | null | mmdetection/mmdet/models/roi_heads/roi_extractors/generic_roi_extractor.py | lizhaoliu-Lec/Conformer | 577cff26b78b338f035c075727c408fca3272208 | [
"Apache-2.0"
] | null | null | null | mmdetection/mmdet/models/roi_heads/roi_extractors/generic_roi_extractor.py | lizhaoliu-Lec/Conformer | 577cff26b78b338f035c075727c408fca3272208 | [
"Apache-2.0"
] | null | null | null | from mmcv.cnn.bricks import build_plugin_layer
from mmcv.runner import force_fp32
from mmdet.models.builder import ROI_EXTRACTORS
from .base_roi_extractor import BaseRoIExtractor
@ROI_EXTRACTORS.register_module()
class GenericRoIExtractor(BaseRoIExtractor):
"""Extract RoI features from all level feature maps lev... | 38.357143 | 79 | 0.629112 |
f4d9cb02880f5f130f70dc4bd3e9255902c26d52 | 7,033 | py | Python | pyhonScripts/transform_vnp_html_cmd_v4.py | markfawcett/business-papers | 2f1d71079cd33a722ac8f419c76cd7a4227b482d | [
"BSD-3-Clause"
] | null | null | null | pyhonScripts/transform_vnp_html_cmd_v4.py | markfawcett/business-papers | 2f1d71079cd33a722ac8f419c76cd7a4227b482d | [
"BSD-3-Clause"
] | 5 | 2020-06-27T18:11:38.000Z | 2021-05-21T16:31:02.000Z | pyhonScripts/transform_vnp_html_cmd_v4.py | markfawcett/business-papers | 2f1d71079cd33a722ac8f419c76cd7a4227b482d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/python3
# module needed to parse command line arguments
import sys
# for parsing and sorting XML
from lxml import html # type: ignore
from lxml.etree import SubElement, iselement # type: ignore
# stuff needed for working with file paths
# from os import path
from pathlib import Path
# regular expres... | 37.609626 | 161 | 0.664439 |
7c867f47524787bce4ebb07b2ed4bf83258427ed | 895 | py | Python | Fax/Forwarding Incoming Faxes to Email with Python/app.py | Slamhaus/guides | 1bcf2997f52a0d2440ae447b2986c70695fa24ef | [
"MIT"
] | 1 | 2022-01-19T22:10:28.000Z | 2022-01-19T22:10:28.000Z | Fax/Forwarding Incoming Faxes to Email with Python/app.py | Slamhaus/guides | 1bcf2997f52a0d2440ae447b2986c70695fa24ef | [
"MIT"
] | 1 | 2022-02-21T10:39:36.000Z | 2022-02-21T10:39:36.000Z | Fax/Forwarding Incoming Faxes to Email with Python/app.py | Slamhaus/guides | 1bcf2997f52a0d2440ae447b2986c70695fa24ef | [
"MIT"
] | 3 | 2022-01-14T19:01:44.000Z | 2022-03-31T00:51:52.000Z | import os
import requests
import pprint
from flask import Flask, request
app = Flask(__name__)
# Listen on route '/fax-webhook' for incoming GET/POST requests when a fax comes in
@app.route('/fax-webhook', methods=['POST'])
def fax_webhook():
# Forward incoming form data to email
send_email(pprint.pformat(r... | 24.861111 | 83 | 0.639106 |
a3354f0f72729a8ff81ffb98fdca1c1c42dd849d | 3,448 | py | Python | trains/binding/frameworks/pytorch_bind.py | HubBucket-Team/trains | c817255a88e5c793b3fbc5b74eb9d5b1fc54ec2b | [
"Apache-2.0"
] | 1 | 2019-08-19T04:17:13.000Z | 2019-08-19T04:17:13.000Z | trains/binding/frameworks/pytorch_bind.py | VonRosenchild/trains | c817255a88e5c793b3fbc5b74eb9d5b1fc54ec2b | [
"Apache-2.0"
] | null | null | null | trains/binding/frameworks/pytorch_bind.py | VonRosenchild/trains | c817255a88e5c793b3fbc5b74eb9d5b1fc54ec2b | [
"Apache-2.0"
] | 1 | 2019-08-19T04:17:15.000Z | 2019-08-19T04:17:15.000Z | import sys
import six
from pathlib2 import Path
from ...binding.frameworks.base_bind import PatchBaseModelIO
from ..frameworks import _patched_call, WeightsFileHandler, _Empty
from ..import_bind import PostImportHookPatching
from ...config import running_remotely
from ...model import Framework
class PatchPyTorchMod... | 33.475728 | 113 | 0.604118 |
a6d0dfcbbc999c2d0671c1c39bdd1ed0f81a9bdf | 5,194 | py | Python | src/signal_scope/signalScopeSetup.py | TLasguignes/signal_scope | ad2690df9c7a5f1502c5e7807568b7f4050fcc10 | [
"BSD-3-Clause"
] | null | null | null | src/signal_scope/signalScopeSetup.py | TLasguignes/signal_scope | ad2690df9c7a5f1502c5e7807568b7f4050fcc10 | [
"BSD-3-Clause"
] | null | null | null | src/signal_scope/signalScopeSetup.py | TLasguignes/signal_scope | ad2690df9c7a5f1502c5e7807568b7f4050fcc10 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import glob
import time
import traceback
from PythonQt import QtGui
class LocalTimeHelper(object):
def _getResolverFunction(self):
return lambda x: time.time()*1e6
class LookupHelper(object):
def __init__(self, lookups=()):
self._lookups = lookups
def __getitem__(self, i):... | 26.100503 | 108 | 0.614555 |
8e6497b9eb8cbc98e054158db3a3b08697328963 | 13,111 | py | Python | gluon/newcron.py | pav0n/web2py_ohka | 2d8302e4d1bffc8c845f9e37638a86bb691a8107 | [
"BSD-3-Clause"
] | 2 | 2017-02-02T00:31:48.000Z | 2017-08-08T22:36:25.000Z | gluon/newcron.py | sloe/sloe_web2py | a1524d4da46ff851429a1de2022d852f8f2c8e53 | [
"BSD-3-Clause"
] | null | null | null | gluon/newcron.py | sloe/sloe_web2py | a1524d4da46ff851429a1de2022d852f8f2c8e53 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Created by Attila Csipa <web2py@csipa.in.rs>
| Modified by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Cron-style interface
"""
import sys
import os
import thr... | 34.32199 | 79 | 0.530089 |
1d03c9aee09c188288a56fb7ce9845598d7e9034 | 16 | py | Python | SoapLibrary/version.py | rfabbris/Robot-Framework-SOAP-Library | b1c79aed3cfb63a70f301aca33de9256c0d215bb | [
"MIT"
] | null | null | null | SoapLibrary/version.py | rfabbris/Robot-Framework-SOAP-Library | b1c79aed3cfb63a70f301aca33de9256c0d215bb | [
"MIT"
] | null | null | null | SoapLibrary/version.py | rfabbris/Robot-Framework-SOAP-Library | b1c79aed3cfb63a70f301aca33de9256c0d215bb | [
"MIT"
] | null | null | null | VERSION = "0.6"
| 8 | 15 | 0.5625 |
d45fd4235e3322c64585fb87a3ba0acdd1282ade | 3,754 | py | Python | passives.py | arthur-hav/hexrl | 31e86e5ba3c2893c16e038fe4809e2f3cc652090 | [
"MIT"
] | 2 | 2018-08-13T11:34:42.000Z | 2018-08-19T05:51:29.000Z | passives.py | arthur-hav/hexrl | 31e86e5ba3c2893c16e038fe4809e2f3cc652090 | [
"MIT"
] | 5 | 2018-08-17T12:03:55.000Z | 2018-08-23T12:03:09.000Z | passives.py | arthur-hav/hexrl | 31e86e5ba3c2893c16e038fe4809e2f3cc652090 | [
"MIT"
] | 4 | 2018-08-17T11:50:31.000Z | 2018-09-22T08:32:58.000Z | class Passive:
def __init__(self, image_name, **kwargs):
self.image_name = image_name
for k, v in kwargs.items():
setattr(self, k, v)
def apply_to(self, creature):
pass
def get_short_desc(self):
pass
class RegenerationPassive(Passive):
def apply_to(self, cre... | 30.770492 | 108 | 0.607352 |
1f0772bcb3692ba1355a1a7392722d7b6e1152b7 | 923 | py | Python | torchimagefilter/kernel.py | pmeier/torchimagefilter | a614c0f8167341d7b3c4bdfaefeaf9bddcf05dae | [
"BSD-3-Clause"
] | null | null | null | torchimagefilter/kernel.py | pmeier/torchimagefilter | a614c0f8167341d7b3c4bdfaefeaf9bddcf05dae | [
"BSD-3-Clause"
] | null | null | null | torchimagefilter/kernel.py | pmeier/torchimagefilter | a614c0f8167341d7b3c4bdfaefeaf9bddcf05dae | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import torch
__all__ = ["radius_to_size", "gauss_kernel", "box_kernel"]
def radius_to_size(radius: int) -> int:
return 2 * radius + 1
def _normalize_kernel(kernel: torch.Tensor) -> torch.Tensor:
return kernel / torch.sum(kernel)
def box_kernel(radius: int, normalize: bool = True) -> to... | 27.969697 | 82 | 0.660888 |
8d8d7eccce8ccf7a09e545739de81071f5b4b6ca | 374 | py | Python | src/commands/set_timer.py | PDmatrix/VkBot | e5619204d7740fce8ca4a40b49f7a37ba61eba39 | [
"MIT"
] | 1 | 2018-11-15T18:51:20.000Z | 2018-11-15T18:51:20.000Z | src/commands/set_timer.py | PDmatrix/VkBot | e5619204d7740fce8ca4a40b49f7a37ba61eba39 | [
"MIT"
] | null | null | null | src/commands/set_timer.py | PDmatrix/VkBot | e5619204d7740fce8ca4a40b49f7a37ba61eba39 | [
"MIT"
] | 1 | 2018-09-25T21:05:07.000Z | 2018-09-25T21:05:07.000Z | from src import command_system
from src import db_context
def set_timer(user_id):
db_context.set_timer_to_user(user_id)
return "Таймер установлен!"
rep_command = command_system.Command()
rep_command.keys = ['установить', 'установить таймер', 'set', 'set timer']
rep_command.description = 'Установить таймер'
... | 24.933333 | 74 | 0.778075 |
46ed423245fdd15b66c9ba22dde6f78694074fab | 18,637 | py | Python | tools/external_converter_v2/parser/kill_fluid/fluid_layer_param_transmit.py | mengkai94/Anakin | 9424277cf9ae180a14aff09560d3cd60a49c76d2 | [
"Apache-2.0"
] | null | null | null | tools/external_converter_v2/parser/kill_fluid/fluid_layer_param_transmit.py | mengkai94/Anakin | 9424277cf9ae180a14aff09560d3cd60a49c76d2 | [
"Apache-2.0"
] | 3 | 2018-06-22T09:08:44.000Z | 2018-07-04T08:38:30.000Z | tools/external_converter_v2/parser/kill_fluid/fluid_layer_param_transmit.py | mengkai94/Anakin | 9424277cf9ae180a14aff09560d3cd60a49c76d2 | [
"Apache-2.0"
] | null | null | null | from ..operations import OpsParam, OpsRegister
from ..logger import *
from ..proto import *
from fluid_helper import *
def ParserFeedDecorator(OpName):
def warpper(Parser):
def warpper_args(args):
Parser(args)
OpsRegister()[OpName].feed_node_attr(args[0])
args[2].set_name(OpName)
args[0].set_op(args[2]... | 37.95723 | 94 | 0.729302 |
5973917957b294f7a2b5ddd0a791cc8b4c57c1d1 | 291 | py | Python | lang/py/pylib/code/textwrap/textwrap_dedent.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | lang/py/pylib/code/textwrap/textwrap_dedent.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | lang/py/pylib/code/textwrap/textwrap_dedent.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""
"""
__version__ = "$Id$"
#end_pymotw_header
import textwrap
from textwrap_example import sample_text
dedented_text = textwrap.dedent(sample_text)
print 'Dedented:'
print dedented_text
| 16.166667 | 55 | 0.756014 |
92c104d45a7b0db492e61c7cf4bf10a2f5c21f2f | 309 | py | Python | Chapter 08/2/8.py | icaksh/Python-Projects-Protek | dfd56ea5afc637a8850911a9296131652de383c5 | [
"MIT"
] | null | null | null | Chapter 08/2/8.py | icaksh/Python-Projects-Protek | dfd56ea5afc637a8850911a9296131652de383c5 | [
"MIT"
] | null | null | null | Chapter 08/2/8.py | icaksh/Python-Projects-Protek | dfd56ea5afc637a8850911a9296131652de383c5 | [
"MIT"
] | null | null | null | def averageHarga(x):
listHarga = list(x.values())
jumlahan = 0
pembagi = 0
for i in listHarga:
jumlahan = jumlahan + i
pembagi += 1
average = jumlahan/pembagi
return average
buah ={'apel' : 5000, 'jeruk' : 8500, 'mangga' : 7800, 'duku' :6500}
print(averageHarga(buah)) | 25.75 | 68 | 0.608414 |
5a89bf13cc351a70fd38fca01ab09e23be272127 | 20,638 | py | Python | mmhuman3d/utils/transforms.py | ykk648/mmhuman3d | 26af92bcf6abbe1855e1a8a48308621410f9c047 | [
"Apache-2.0"
] | 472 | 2021-12-03T03:12:55.000Z | 2022-03-31T01:33:13.000Z | mmhuman3d/utils/transforms.py | ykk648/mmhuman3d | 26af92bcf6abbe1855e1a8a48308621410f9c047 | [
"Apache-2.0"
] | 127 | 2021-12-03T05:00:14.000Z | 2022-03-31T13:47:33.000Z | mmhuman3d/utils/transforms.py | ykk648/mmhuman3d | 26af92bcf6abbe1855e1a8a48308621410f9c047 | [
"Apache-2.0"
] | 37 | 2021-12-03T03:23:22.000Z | 2022-03-31T08:41:58.000Z | from typing import Union
import numpy
import torch
from pytorch3d.transforms import (
axis_angle_to_matrix,
axis_angle_to_quaternion,
euler_angles_to_matrix,
matrix_to_euler_angles,
matrix_to_quaternion,
matrix_to_rotation_6d,
quaternion_to_axis_angle,
quaternion_to_matrix,
rotation... | 37.591985 | 79 | 0.637901 |
183738330f17bd6c8c8139a885b108b77ccd94c8 | 1,394 | py | Python | nix/entity_with_sources.py | gicmo/nixpy | 015bef00af764f3f773fb0e8fe5afa660669adf8 | [
"BSD-3-Clause"
] | null | null | null | nix/entity_with_sources.py | gicmo/nixpy | 015bef00af764f3f773fb0e8fe5afa660669adf8 | [
"BSD-3-Clause"
] | null | null | null | nix/entity_with_sources.py | gicmo/nixpy | 015bef00af764f3f773fb0e8fe5afa660669adf8 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2014, German Neuroinformatics Node (G-Node)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted under the terms of the BSD License. See
# LICENSE file in the root of the Project.
from __future__ import (absolute_import, division,... | 27.88 | 91 | 0.753228 |
25e521cde364d7969a1029d5f4d17960bfcaa467 | 1,726 | py | Python | salt/transport/local.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/transport/local.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/transport/local.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt Libs
import salt.utils.files
from salt.transport.client import ReqChannel
log = logging.getLogger(__name__)
class LocalChannel(ReqChannel):
'''
Local channel fo... | 30.280702 | 99 | 0.488413 |
9056bf20ad5e88455a4a8cac66a57a3aaad8dc3a | 10,107 | py | Python | hypercube/generate_movement.py | NextCenturyCorporation/mcs-scene-generator | e0a6ee778359cadd2de682a5006581b7a6134431 | [
"Apache-2.0"
] | 4 | 2021-02-04T03:57:52.000Z | 2022-02-08T18:19:58.000Z | hypercube/generate_movement.py | NextCenturyCorporation/mcs-scene-generator | e0a6ee778359cadd2de682a5006581b7a6134431 | [
"Apache-2.0"
] | 68 | 2021-05-06T08:52:46.000Z | 2022-03-23T16:46:03.000Z | hypercube/generate_movement.py | NextCenturyCorporation/mcs-scene-generator | e0a6ee778359cadd2de682a5006581b7a6134431 | [
"Apache-2.0"
] | 1 | 2021-02-04T03:21:57.000Z | 2021-02-04T03:21:57.000Z | import json
from generator.occluders import OCCLUDER_BUFFER
from .intuitive_physics_hypercubes import (
MAX_TARGET_Z,
MIN_TARGET_Z,
MOVEMENT_JSON_FILENAME,
STEP_Z,
object_x_to_occluder_x,
retrieve_off_screen_position_x,
validate_in_view,
)
from .movements import (
DEEP_EXIT_LIST,
D... | 39.326848 | 79 | 0.605125 |
51da0d12e5b0ee288bfeed2d2f7e52a6f05ec06b | 2,372 | py | Python | modules/miscellaneous.py | DMCTruong/MoosikBot | d00e231ab4d3beed8e1b454bff0400bee3d8c823 | [
"MIT"
] | 1 | 2017-08-07T02:36:39.000Z | 2017-08-07T02:36:39.000Z | modules/miscellaneous.py | DMCTruong/Discord-Bot | d00e231ab4d3beed8e1b454bff0400bee3d8c823 | [
"MIT"
] | null | null | null | modules/miscellaneous.py | DMCTruong/Discord-Bot | d00e231ab4d3beed8e1b454bff0400bee3d8c823 | [
"MIT"
] | null | null | null | ##########################################################################################
# Program Name : Discord Bot
# Author : DMCTruong
# Last Updated : August 31, 2017
# License : MIT
# Description : A general purpose bot written for Discord
#########################... | 37.650794 | 114 | 0.563238 |
c982d802edaa443c07a8c6c9d750627fd0a36f3f | 5,502 | py | Python | generate.py | NILOIDE/stylegan2-ada-pytorch | 7a3f2f4e1e7aa38a78e34c0f6a16297e8704cef7 | [
"BSD-Source-Code"
] | null | null | null | generate.py | NILOIDE/stylegan2-ada-pytorch | 7a3f2f4e1e7aa38a78e34c0f6a16297e8704cef7 | [
"BSD-Source-Code"
] | null | null | null | generate.py | NILOIDE/stylegan2-ada-pytorch | 7a3f2f4e1e7aa38a78e34c0f6a16297e8704cef7 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... | 41.368421 | 132 | 0.631952 |
d1571512bdaae08e093a5df7b641d32f6f852bfe | 1,398 | py | Python | edexOsgi/com.raytheon.uf.common.dataplugin.gfe/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py | srcarter3/awips2 | 37f31f5e88516b9fd576eaa49d43bfb762e1d174 | [
"Apache-2.0"
] | null | null | null | edexOsgi/com.raytheon.uf.common.dataplugin.gfe/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py | srcarter3/awips2 | 37f31f5e88516b9fd576eaa49d43bfb762e1d174 | [
"Apache-2.0"
] | null | null | null | edexOsgi/com.raytheon.uf.common.dataplugin.gfe/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py | srcarter3/awips2 | 37f31f5e88516b9fd576eaa49d43bfb762e1d174 | [
"Apache-2.0"
] | 1 | 2021-10-30T00:03:05.000Z | 2021-10-30T00:03:05.000Z | ##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non... | 29.744681 | 98 | 0.680258 |
6883b815aa54ee7552dd33912fb6b490f1ddc978 | 1,447 | py | Python | Plugins/Extensions/GetChinese/SplitSentence.py | yingshaoxo/xiaoya | 559ff798dfc1016e3d04a69d86d035b1dec70b57 | [
"MIT"
] | 1 | 2021-02-24T02:41:31.000Z | 2021-02-24T02:41:31.000Z | Plugins/Extensions/GetChinese/SplitSentence.py | yingshaoxo/Xiaoya | 559ff798dfc1016e3d04a69d86d035b1dec70b57 | [
"MIT"
] | null | null | null | Plugins/Extensions/GetChinese/SplitSentence.py | yingshaoxo/Xiaoya | 559ff798dfc1016e3d04a69d86d035b1dec70b57 | [
"MIT"
] | null | null | null | import re
def handle_break(obj):
text = obj.group(0)
if re.match(r'^\s+$', text)==None:
return re.sub(r'\s*', '', text)
else:
return text
def fix_break(text):
text = re.sub(r'[^。!?…;:”"》】]\s+', handle_break, text)
return text
def list_to_text(_list, num_of_line):
text = ... | 20.671429 | 100 | 0.574292 |
49996320e67c38315400c72ba8fbad38a6ffb5af | 16,969 | py | Python | pykeops/numpy/generic/generic_red.py | kshitij12345/keops | fcc6c77bd1caa52787df4e58d76b8bbe94f4f7a1 | [
"MIT"
] | 1 | 2021-04-20T09:04:21.000Z | 2021-04-20T09:04:21.000Z | pykeops/numpy/generic/generic_red.py | kshitij12345/keops | fcc6c77bd1caa52787df4e58d76b8bbe94f4f7a1 | [
"MIT"
] | null | null | null | pykeops/numpy/generic/generic_red.py | kshitij12345/keops | fcc6c77bd1caa52787df4e58d76b8bbe94f4f7a1 | [
"MIT"
] | null | null | null | import numpy as np
from pykeops.common.get_options import get_tag_backend
from pykeops.common.keops_io import LoadKeOps
from pykeops.common.operations import preprocess, postprocess
from pykeops.common.parse_type import get_sizes, complete_aliases, get_optional_flags
from pykeops.common.utils import axis2cat
from pyke... | 53.361635 | 211 | 0.573399 |
eeaef555627bd5bd522f125d985f7cd6bdc4e40e | 1,714 | py | Python | nipype/interfaces/afni/tests/test_auto_MaskTool.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_MaskTool.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_MaskTool.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import MaskTool
def test_MaskTool_inputs():
input_map = dict(args=dict(argstr='%s',
),
count=dict(argstr='-count',
position=2,
),
datum=dict(argstr='-datum %s',
),
dilate_inputs=d... | 24.485714 | 67 | 0.618436 |
cbc383eea911c2da864498f8e92406f3e08963ca | 50,282 | py | Python | server.py | aurickq/rgserver | f391a686c4056ab2568cce4b8fbe31e81797ce80 | [
"MIT"
] | null | null | null | server.py | aurickq/rgserver | f391a686c4056ab2568cce4b8fbe31e81797ce80 | [
"MIT"
] | null | null | null | server.py | aurickq/rgserver | f391a686c4056ab2568cce4b8fbe31e81797ce80 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import ast
import difflib
import hashlib
import json
import math
import os
import py_compile
import random
import re
import string
import subprocess
import sys
import time
import urllib
import urlparse
import web
import web.form
import pygments
import pygments.lexers
import pygments.lexers.text
impo... | 33.928475 | 108 | 0.538384 |
5f3d0992e153e04bf904f0104f25958ef43073aa | 1,547 | py | Python | src/worker/utils.py | hwang595/Draco | 8472912cce82e6d74087a402fd417e7a837517ab | [
"MIT"
] | 21 | 2018-09-19T06:30:57.000Z | 2022-03-25T22:44:39.000Z | src/worker/utils.py | hwang595/Draco | 8472912cce82e6d74087a402fd417e7a837517ab | [
"MIT"
] | 3 | 2018-12-31T05:44:22.000Z | 2021-09-09T15:59:46.000Z | src/worker/utils.py | hwang595/Draco | 8472912cce82e6d74087a402fd417e7a837517ab | [
"MIT"
] | 12 | 2018-09-19T06:30:59.000Z | 2021-12-13T09:53:54.000Z | from __future__ import print_function
from mpi4py import MPI
import numpy as np
import sys
sys.path.append("..")
from nn_ops import NN_Trainer
from compress_gradient import compress
from datasets.utils import get_batch
from util import *
import torch
from torch.autograd import Variable
import time
from datetime impo... | 30.333333 | 84 | 0.681319 |
db132ebb9b1c1e907b1cd264c4199e336c7c4d95 | 6,502 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200501/virtual_hub_bgp_connection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200501/virtual_hub_bgp_connection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200501/virtual_hub_bgp_connection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"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
from ... import _utilities, _tables
__a... | 39.889571 | 287 | 0.63319 |
277cc02c2f80eb0206763fcc047ac15c5858bb7f | 259 | py | Python | mmdet/core/utils/__init__.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | mmdet/core/utils/__init__.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | mmdet/core/utils/__init__.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | from .dist_utils import DistOptimizerHook, allreduce_grads
from .misc import multi_apply, tensor2imgs, unmap, enumerate_by_image
__all__ = [
'allreduce_grads', 'DistOptimizerHook', 'tensor2imgs', 'unmap',
'multi_apply', 'enumerate_by_image'
]
| 32.375 | 70 | 0.752896 |
067d5bedca44f4f2ca349eed27fd501fa3fda654 | 8,652 | py | Python | layers/ddcconv1d.py | bshishov/DeepForecasting | a562ed5fa39c097f8dd4f41ae65b52bf887f8f33 | [
"MIT"
] | 4 | 2018-12-06T08:55:20.000Z | 2020-04-11T20:30:38.000Z | layers/ddcconv1d.py | bshishov/DeepForecasting | a562ed5fa39c097f8dd4f41ae65b52bf887f8f33 | [
"MIT"
] | null | null | null | layers/ddcconv1d.py | bshishov/DeepForecasting | a562ed5fa39c097f8dd4f41ae65b52bf887f8f33 | [
"MIT"
] | 2 | 2020-04-09T14:43:37.000Z | 2020-08-04T22:34:13.000Z | import tensorflow as tf
import numpy as np
def get_shape(spec: str, spec_shape: dict):
return tuple(spec_shape[dim] for dim in spec)
def expand_transform(x, input_spec: str, output_spec: str, output_spec_shape: dict, numpy=False):
assert len(output_spec) == len(output_spec_shape)
if numpy:
tile... | 39.506849 | 125 | 0.633264 |
defde838be23a116f4b1b8302697347554ee7744 | 4,115 | py | Python | src/server/webserver.py | reddcoin-project/ReddConnect | 5c212683de6b80b81fd15ed05239c3a1b46c3afd | [
"BSD-3-Clause"
] | 5 | 2015-01-30T08:47:59.000Z | 2022-01-22T19:27:03.000Z | src/server/webserver.py | reddcoin-project/ReddConnect | 5c212683de6b80b81fd15ed05239c3a1b46c3afd | [
"BSD-3-Clause"
] | 2 | 2017-12-28T21:36:48.000Z | 2017-12-28T21:36:57.000Z | src/server/webserver.py | reddcoin-project/ReddConnect | 5c212683de6b80b81fd15ed05239c3a1b46c3afd | [
"BSD-3-Clause"
] | 1 | 2019-01-05T15:51:37.000Z | 2019-01-05T15:51:37.000Z | """
This implements resources for twisted webservers using the wsgi
interface of django. This alleviates the need of running e.g. an
apache server to serve Evennia's web presence (although you could do
that too if desired).
The actual servers are started inside server.py as part of the Evennia
application.
(Lots of t... | 30.481481 | 79 | 0.672175 |
6c865e0def5bd37609acc97b0f4a3dded8b9e0b1 | 4,736 | py | Python | data/jd/segment_word.py | zhangxiangxiao/Glyph | df6ef326215657a2f76c4c6fb469ff85760a9afa | [
"BSD-3-Clause"
] | 165 | 2017-09-01T07:54:04.000Z | 2022-03-28T18:59:03.000Z | data/jd/segment_word.py | zhangxiangxiao/Glyph | df6ef326215657a2f76c4c6fb469ff85760a9afa | [
"BSD-3-Clause"
] | 3 | 2019-04-27T10:25:51.000Z | 2019-05-13T13:49:17.000Z | data/jd/segment_word.py | zhangxiangxiao/Glyph | df6ef326215657a2f76c4c6fb469ff85760a9afa | [
"BSD-3-Clause"
] | 38 | 2017-12-28T01:09:54.000Z | 2021-09-09T08:10:04.000Z | #!/usr/bin/python3
'''
Convert Chinese datasets to Index of Words
Copyright 2016 Xiang Zhang
Usage: python3 segment_word.py -i [input] -l [list] -o [output] [-r]
'''
#Input file
INPUT = '../data/dianping/train.csv'
#Output file
OUTPUT = '../data/dianping/train_word.csv'
# List file
LIST = '../data/dianping/train_wor... | 30.954248 | 80 | 0.580025 |
71150cf4c906c9fc1dc521163905b34298258d5b | 1,503 | py | Python | razorpay/resources/qrcode.py | captn3m0/razorpay | 0352f2d81696984c96e51c55a81178c663be320f | [
"MIT"
] | 3 | 2015-11-18T10:28:07.000Z | 2015-11-21T01:17:35.000Z | razorpay/resources/qrcode.py | captn3m0/razorpay | 0352f2d81696984c96e51c55a81178c663be320f | [
"MIT"
] | null | null | null | razorpay/resources/qrcode.py | captn3m0/razorpay | 0352f2d81696984c96e51c55a81178c663be320f | [
"MIT"
] | null | null | null | from .base import Resource
from ..constants.url import URL
class Qrcode(Resource):
def __init__(self, client=None):
super(Qrcode, self).__init__(client)
self.base_url = URL.QRCODE_URL
def fetch(self, qrcode_id, data={}, **kwargs):
""""
Fetch a Qr code
Args:
... | 24.639344 | 74 | 0.539587 |
8b4e72a1dd06b62062ace0671bf05beef7def8a1 | 14,349 | py | Python | tensornetwork/backends/tensorflow/tensorflow_backend.py | jeff-bezos-amazon/TensorNetwork | 79337eeb4d0accf263a3bbc27e16de0d6be547df | [
"Apache-2.0"
] | null | null | null | tensornetwork/backends/tensorflow/tensorflow_backend.py | jeff-bezos-amazon/TensorNetwork | 79337eeb4d0accf263a3bbc27e16de0d6be547df | [
"Apache-2.0"
] | null | null | null | tensornetwork/backends/tensorflow/tensorflow_backend.py | jeff-bezos-amazon/TensorNetwork | 79337eeb4d0accf263a3bbc27e16de0d6be547df | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorNetwork Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 37.27013 | 80 | 0.638233 |
71e8eaf78fc000dd5398fb58b7f810a6bc4b7f76 | 2,033 | py | Python | modules/vulnerabilities/other/netgear-wnap320-rce.py | cckuailong/pocsploit | fe4a3154e59d2bebd55ccfdf62f4f7efb21b5a2a | [
"MIT"
] | 106 | 2022-03-18T06:51:09.000Z | 2022-03-31T19:11:41.000Z | modules/vulnerabilities/other/netgear-wnap320-rce.py | cckuailong/pocsploit | fe4a3154e59d2bebd55ccfdf62f4f7efb21b5a2a | [
"MIT"
] | 5 | 2022-03-27T07:37:32.000Z | 2022-03-31T13:56:11.000Z | modules/vulnerabilities/other/netgear-wnap320-rce.py | cckuailong/pocsploit | fe4a3154e59d2bebd55ccfdf62f4f7efb21b5a2a | [
"MIT"
] | 30 | 2022-03-21T01:27:08.000Z | 2022-03-31T12:28:01.000Z | import requests
from plugins.oob import verify_request, gen_oob_domain
# Vuln Base Info
def info():
return {
"author": "cckuailong",
"name": '''NETGEAR WNAP320 Access Point - Remote Code Execution (Unauthenticated)''',
"description": '''vulnerabilities in the web-based management interfac... | 28.633803 | 226 | 0.587801 |
36373d9c32e9bddccf8bd3513e1a8c409e6932b8 | 989 | py | Python | config/env.py | WYL-BruceLong/webinfo-crawler | 5f8a88a1b3f5c6da1c0276a3cac474d460c70b1c | [
"MIT"
] | 1 | 2019-07-18T09:24:56.000Z | 2019-07-18T09:24:56.000Z | config/env.py | WYL-BruceLong/webinfo-crawler | 5f8a88a1b3f5c6da1c0276a3cac474d460c70b1c | [
"MIT"
] | null | null | null | config/env.py | WYL-BruceLong/webinfo-crawler | 5f8a88a1b3f5c6da1c0276a3cac474d460c70b1c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*-: coding: utf-8 -*-
"""
:author: lubosson
:date: 2019-04-11
:desc:
"""
import logging as log
from config.settings import MysqlConfig
ENV = 'development' # 环境变量
class MysqlEnviron:
mapping = {
'development': MysqlConfig.get('development'),
'testing': MysqlConfig.get('test... | 20.604167 | 65 | 0.618807 |
0f934c649aff8590efa819f86f4fa2eb860d2413 | 6,406 | py | Python | openTCS-CommAdapter-HTTP/src/test/java/httpserver3.py | touchmii/OpenTCS-4 | e3973bd72da63011369a1935de7303bf11bc2a1f | [
"MIT"
] | 21 | 2021-07-31T09:35:59.000Z | 2022-03-25T18:23:45.000Z | openTCS-CommAdapter-HTTP/src/test/java/httpserver3.py | wmhui007/OpenTCS-4 | 768dc0aebf63b5ac79f869dabcb35f9ebfb4deee | [
"MIT"
] | 2 | 2021-01-21T12:39:47.000Z | 2021-07-29T09:56:22.000Z | openTCS-CommAdapter-HTTP/src/test/java/httpserver3.py | wmhui007/OpenTCS-4 | 768dc0aebf63b5ac79f869dabcb35f9ebfb4deee | [
"MIT"
] | 17 | 2020-09-24T00:09:50.000Z | 2021-07-07T12:20:41.000Z | #!/usr/bin/env python3
"""A simple HTTP server with REST and json for python 3.
addrecord takes utf8-encoded URL parameters
getrecord returns utf8-encoded json.
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import argparse
import re
import cgi
import json
import threading
import asyncio
import time
f... | 35.588889 | 108 | 0.592257 |
10a7892165cc7739c54e6985c3da25891e499a5b | 1,466 | py | Python | tests/func/test_utils.py | trappitsch/rttools | 2aa56470020d1932b8abc2e1e84d211bbb2b2b5a | [
"MIT"
] | null | null | null | tests/func/test_utils.py | trappitsch/rttools | 2aa56470020d1932b8abc2e1e84d211bbb2b2b5a | [
"MIT"
] | null | null | null | tests/func/test_utils.py | trappitsch/rttools | 2aa56470020d1932b8abc2e1e84d211bbb2b2b5a | [
"MIT"
] | null | null | null | """Test for routiens in utils.py."""
import pytest
import numpy as np
import rttools.utils as utils
def test_kron_delta():
"""Ensure that 1 is returned if two indexes are the same, zero otherwise."""
assert utils.kron_delta(1, 1) == 1
assert utils.kron_delta(1, 2) == 0
def test_kron_delta_array():
... | 29.918367 | 80 | 0.648022 |
185a7177c1c034c4525c9ab0892f2193bae500bf | 7,051 | py | Python | neural_net.py | crsavage0630/CS-7641-Assignment2 | cff1d188046c23eb23221db0aa3d3d771d3d6b1c | [
"MIT"
] | null | null | null | neural_net.py | crsavage0630/CS-7641-Assignment2 | cff1d188046c23eb23221db0aa3d3d771d3d6b1c | [
"MIT"
] | null | null | null | neural_net.py | crsavage0630/CS-7641-Assignment2 | cff1d188046c23eb23221db0aa3d3d771d3d6b1c | [
"MIT"
] | null | null | null | import mlrose_hiive as mlrose
import numpy as np
import pandas as pd
from time import clock
import os
import argparse
import data.DataProcessors as dp
import seaborn as sns
import matplotlib.pyplot as plt
os.environ['seed'] = '45604'
randomSeed = 45604
verbose = True
from sklearn.metrics import accuracy_score, log_l... | 43.257669 | 326 | 0.649695 |
84041676d8f6716501aee64c8590d14471c44408 | 8,999 | py | Python | CS/CSC384/A2/multiagent/submission_autograder.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | 2 | 2021-09-13T13:50:09.000Z | 2021-12-14T07:03:07.000Z | CS/CSC384/A2/multiagent/submission_autograder.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC384/A2/multiagent/submission_autograder.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | 2 | 2021-10-02T21:43:37.000Z | 2022-01-08T17:46:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from codecs import open
import os, ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context
"""
CS 188 Local Subm... | 290.290323 | 8,086 | 0.927436 |
83b9e3ae9428bd64e025fe51872801c48b9831c4 | 2,933 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 ... | 44.439394 | 129 | 0.684964 |
eaa9ea91796b203b680481b10a621fbec141c03c | 631 | py | Python | pipeline/playground/feature_server.py | shawntsai/insight-project | 67b7ad25c51b0065f958ee499653c91213263cfc | [
"MIT"
] | 3 | 2018-02-12T02:48:12.000Z | 2018-08-01T10:17:09.000Z | pipeline/playground/feature_server.py | shawntsai/insight-project | 67b7ad25c51b0065f958ee499653c91213263cfc | [
"MIT"
] | null | null | null | pipeline/playground/feature_server.py | shawntsai/insight-project | 67b7ad25c51b0065f958ee499653c91213263cfc | [
"MIT"
] | 1 | 2018-04-07T06:34:53.000Z | 2018-04-07T06:34:53.000Z | import sys
import json
import feature_utils as fu
from flask import Flask
from flask import jsonify
from flask import request
app = Flask(__name__)
@app.route('/')
def hello():
return 'hello world'
@app.route('/profiling', methods=['POST'])
def profiling():
data = json.loads(request.data)
if 'id' not in ... | 21.033333 | 54 | 0.681458 |
bed896d10aa972b6636f03f718978f641749541c | 4,747 | py | Python | bot/cogs/setup_all.py | tescomealdealll/PixeL | ad38b1105a465bf08bd652e61e3e12d4ed9d2872 | [
"MIT"
] | null | null | null | bot/cogs/setup_all.py | tescomealdealll/PixeL | ad38b1105a465bf08bd652e61e3e12d4ed9d2872 | [
"MIT"
] | null | null | null | bot/cogs/setup_all.py | tescomealdealll/PixeL | ad38b1105a465bf08bd652e61e3e12d4ed9d2872 | [
"MIT"
] | null | null | null | import discord
import traceback
import app_util
from bot.extras.emojis import Emo
from bot.views.msg_view import sub_view_msg
from bot.views.youtube_view import sub_view_youtube
from bot.views.receiver_view import sub_view_receiver
from bot.views.pingrole_view import sub_view_pingrole
from bot.views.reception_view impo... | 37.377953 | 103 | 0.585001 |
5042e03a589ab98f123485fab08bd0b8b656d832 | 2,315 | py | Python | cirq-core/cirq/interop/quirk/cells/swap_cell_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | 1 | 2021-04-29T15:30:32.000Z | 2021-04-29T15:30:32.000Z | cirq-core/cirq/interop/quirk/cells/swap_cell_test.py | bradyb/Cirq | 610b0d4ea3a7862169610797266734c844ddcc1f | [
"Apache-2.0"
] | 4 | 2022-01-16T14:12:15.000Z | 2022-02-24T03:58:46.000Z | cirq-core/cirq/interop/quirk/cells/swap_cell_test.py | bradyb/Cirq | 610b0d4ea3a7862169610797266734c844ddcc1f | [
"Apache-2.0"
] | 2 | 2021-09-22T11:16:46.000Z | 2021-09-23T12:55:22.000Z | # Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.95082 | 97 | 0.68121 |
5ce2d59ce71b5c4af9c41aee596e6057d3a33e83 | 32,302 | py | Python | run_token_cls.py | rxian/domain-alignment | c523a6d193fa644520235535d5b03858930a2a97 | [
"MIT"
] | null | null | null | run_token_cls.py | rxian/domain-alignment | c523a6d193fa644520235535d5b03858930a2a97 | [
"MIT"
] | null | null | null | run_token_cls.py | rxian/domain-alignment | c523a6d193fa644520235535d5b03858930a2a97 | [
"MIT"
] | null | null | null | """
Fine-tuning a 🤗 Transformers model on token classification tasks (NER, POS, CHUNKS).
Adapted from https://github.com/huggingface/transformers/blob/master/examples/pytorch/token-classification/run_ner_no_trainer.py
"""
import argparse
import logging
import numpy as np
import torch
from torch.optim import AdamW
f... | 56.177391 | 250 | 0.674664 |
bf2e05047680922b9006cab4acbaa385f85c5b57 | 17,737 | py | Python | histomicstk/utils/girder_convenience_utils.py | basanto/HistomicsTK | f3dbd93a7f31c7825574f9ccf0b86e09e9fee360 | [
"Apache-2.0"
] | 3 | 2022-02-23T09:43:53.000Z | 2022-03-21T22:32:05.000Z | histomicstk/utils/girder_convenience_utils.py | basanto/HistomicsTK | f3dbd93a7f31c7825574f9ccf0b86e09e9fee360 | [
"Apache-2.0"
] | null | null | null | histomicstk/utils/girder_convenience_utils.py | basanto/HistomicsTK | f3dbd93a7f31c7825574f9ccf0b86e09e9fee360 | [
"Apache-2.0"
] | 3 | 2020-04-22T19:40:18.000Z | 2021-02-03T07:31:45.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 12 13:19:18 2019
@author: tageldim
"""
# import os
import os
import girder_client
import json
from histomicstk.workflows.workflow_runner import Workflow_runner, \
Slide_iterator, Annotation_iterator
# import warnings
# warnings.simplefilter('once', UserWarning)
def... | 30.062712 | 79 | 0.634718 |
fa7dbda69466124a2fcd097de4441ea80b91dd93 | 16,401 | py | Python | notion/client.py | AndreCNF/notion-py | 9ae836ec0f49d86de53d68f32bde6c65ba262511 | [
"MIT"
] | null | null | null | notion/client.py | AndreCNF/notion-py | 9ae836ec0f49d86de53d68f32bde6c65ba262511 | [
"MIT"
] | null | null | null | notion/client.py | AndreCNF/notion-py | 9ae836ec0f49d86de53d68f32bde6c65ba262511 | [
"MIT"
] | null | null | null | import hashlib
import json
import re
import uuid
from requests import Session, HTTPError
from requests.cookies import cookiejar_from_dict
from urllib.parse import urljoin
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from getpass import getpass
from time import sleep
... | 34.311715 | 121 | 0.59283 |
cb6761195cd0c56e0ecd633df1dcc3c8f429852c | 59,361 | py | Python | src/pilot/assign_role.py | kamlesh6808/JetPack | 54871b307cc7385939dd89f9bb5e9ed9bb3036fe | [
"Apache-2.0"
] | 1 | 2019-04-01T16:01:01.000Z | 2019-04-01T16:01:01.000Z | src/pilot/assign_role.py | kamlesh6808/JetPack | 54871b307cc7385939dd89f9bb5e9ed9bb3036fe | [
"Apache-2.0"
] | null | null | null | src/pilot/assign_role.py | kamlesh6808/JetPack | 54871b307cc7385939dd89f9bb5e9ed9bb3036fe | [
"Apache-2.0"
] | 1 | 2021-07-15T15:26:53.000Z | 2021-07-15T15:26:53.000Z | #!/usr/bin/python3
# Copyright (c) 2016-2021 Dell Inc. or its subsidiaries.
#
# 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 requ... | 39.078999 | 110 | 0.603241 |
f07de8aeac764fd94669f1ab488b9c68166c7eef | 1,712 | py | Python | setup.py | aboedo/sqlalchemy-redshift | bf81bb81e42987bb81345845fede560d9184302f | [
"MIT"
] | 1 | 2019-06-04T21:01:13.000Z | 2019-06-04T21:01:13.000Z | setup.py | aboedo/sqlalchemy-redshift | bf81bb81e42987bb81345845fede560d9184302f | [
"MIT"
] | 1 | 2020-05-23T10:54:44.000Z | 2020-05-23T10:54:44.000Z | setup.py | aboedo/sqlalchemy-redshift | bf81bb81e42987bb81345845fede560d9184302f | [
"MIT"
] | 1 | 2020-12-24T10:20:24.000Z | 2020-12-24T10:20:24.000Z | from setuptools import setup
readme = open('README.rst').read()
history = open('CHANGES.rst').read().replace('.. :changelog:', '')
setup(
name='sqlalchemy-redshift',
version='0.5.1.dev0',
description='Amazon Redshift Dialect for sqlalchemy',
long_description=readme + '\n\n' + history,
author='Matt... | 36.425532 | 78 | 0.623832 |
3d26bcd39754fa5a4d960e31e422509bacafe3e1 | 9,754 | py | Python | azure-mgmt-web/azure/mgmt/web/operations/top_level_domains_operations.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"MIT"
] | null | null | null | azure-mgmt-web/azure/mgmt/web/operations/top_level_domains_operations.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"MIT"
] | null | null | null | azure-mgmt-web/azure/mgmt/web/operations/top_level_domains_operations.py | CharaD7/azure-sdk-for-python | 9fdf0aac0cec8a15a5bb2a0ea27dd331dbfa2f5c | [
"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 ... | 42.780702 | 144 | 0.64107 |
57d4293119434933890062351231051c24898e74 | 3,038 | py | Python | tests/test_lexer.py | rolandmueller/rita-dsl | d0457fcf220baaf7fa8f647bab36b5ff5ea9367b | [
"MIT"
] | 66 | 2019-07-17T05:23:04.000Z | 2022-03-15T12:06:06.000Z | tests/test_lexer.py | rolandmueller/rita-dsl | d0457fcf220baaf7fa8f647bab36b5ff5ea9367b | [
"MIT"
] | 90 | 2019-07-18T10:21:13.000Z | 2021-11-09T19:54:57.000Z | tests/test_lexer.py | rolandmueller/rita-dsl | d0457fcf220baaf7fa8f647bab36b5ff5ea9367b | [
"MIT"
] | 3 | 2020-08-20T06:57:11.000Z | 2022-03-03T16:11:45.000Z | from rita.lexer import RitaLexer
def test_tokenize_any_macro_wo_args_wo_type():
lex = RitaLexer()
lex.build()
tokens = list(lex.tokenize("ANY"))
assert len(tokens) == 1
token = tokens[0]
assert token.type == "KEYWORD"
assert token.value == "ANY"
def test_tokenize_any_macro_wo_args_w_typ... | 21.7 | 68 | 0.580645 |
ce628f6b73038d25734b518f198268fdc0f3418b | 3,550 | py | Python | src/sonic_ax_impl/bin/sysDescr_pass.py | RayWang910012/sonic-snmpagent | 701ec1aba1b92f9d850c9227b9b1185b53ebad27 | [
"Apache-2.0"
] | 13 | 2016-03-09T20:38:16.000Z | 2021-02-04T17:39:27.000Z | src/sonic_ax_impl/bin/sysDescr_pass.py | RayWang910012/sonic-snmpagent | 701ec1aba1b92f9d850c9227b9b1185b53ebad27 | [
"Apache-2.0"
] | 167 | 2017-02-01T23:16:11.000Z | 2022-03-31T02:22:08.000Z | src/sonic_ax_impl/bin/sysDescr_pass.py | xumia/sonic-snmpagent | 4e063e4ade89943f2413a767f24564aecfa2cd1c | [
"Apache-2.0"
] | 89 | 2016-03-09T20:38:18.000Z | 2022-03-09T09:16:13.000Z | #! /usr/bin/python3 -u
#################################################################################
# Copyright 2016 Cumulus Networks LLC, all rights reserved
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | 31.696429 | 104 | 0.676056 |
8b0b587e6aac13144a399107fa63de1831d89c61 | 2,082 | py | Python | client-app/client-app.py | realmoriss/grow4u | ac507ec3eeb376e2b89de0b9d031c69edf3d9195 | [
"MIT"
] | null | null | null | client-app/client-app.py | realmoriss/grow4u | ac507ec3eeb376e2b89de0b9d031c69edf3d9195 | [
"MIT"
] | null | null | null | client-app/client-app.py | realmoriss/grow4u | ac507ec3eeb376e2b89de0b9d031c69edf3d9195 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import serial
import io
import datetime
import time
import pymysql
def readCmd(sio: io.TextIOWrapper, cmd: str):
dt_out = sio.write(cmd + "\n")
sio.flush()
if dt_out==0:
raise Exception("Unable to write to device.")
if sio.readline().strip()!=cmd:
rais... | 31.545455 | 185 | 0.604227 |
b4c564c286d735c965066d58ac400b21841dba54 | 1,600 | py | Python | _GTW/_OMP/_DNS/UI_Spec.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | 6 | 2016-12-10T17:51:10.000Z | 2021-10-11T07:51:48.000Z | _GTW/_OMP/_DNS/UI_Spec.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | null | null | null | _GTW/_OMP/_DNS/UI_Spec.py | Tapyr/tapyr | 4235fba6dce169fe747cce4d17d88dcf4a3f9f1d | [
"BSD-3-Clause"
] | 3 | 2020-03-29T07:37:03.000Z | 2021-01-21T16:08:40.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 Dr. Ralf Schlatterbeck All rights reserved
# Reichergasse 131, A-3411 Weidling, Austria. rsc@runtux.com
# ****************************************************************************
# This module is part of the package GTW.OMP.DNS.
#
# This module is licensed under the... | 20.253165 | 78 | 0.453125 |
9d8fe33d2697e6d6b12b4601e6c6a486454a5264 | 1,438 | py | Python | tests/test_005_add_items_to_list.py | Sudipta96/AnyDo-Web-UI-Automation | 207aa3240a0bbdb6839e43c470258597efd95e44 | [
"MIT"
] | null | null | null | tests/test_005_add_items_to_list.py | Sudipta96/AnyDo-Web-UI-Automation | 207aa3240a0bbdb6839e43c470258597efd95e44 | [
"MIT"
] | null | null | null | tests/test_005_add_items_to_list.py | Sudipta96/AnyDo-Web-UI-Automation | 207aa3240a0bbdb6839e43c470258597efd95e44 | [
"MIT"
] | null | null | null | from tests.base_test import BaseTest
from configurations.config import TestData, Test_Data_005
from pages.login_page import LoginPage
from pages.add_items_to_list import AddItemsToListPage
from utils.customLogger import LogGeneration
import time
class Test_005_AddItemsToList(BaseTest):
username = TestData.userna... | 29.958333 | 75 | 0.648122 |
0d9387ad5e0500460f0d58ba5a6bf478bbb8934d | 9,850 | py | Python | hbase_script.py | abhishekzgithub/hbase | 05aad6188a42c897ef38b5a56c85b1bb0725de3a | [
"MIT"
] | null | null | null | hbase_script.py | abhishekzgithub/hbase | 05aad6188a42c897ef38b5a56c85b1bb0725de3a | [
"MIT"
] | null | null | null | hbase_script.py | abhishekzgithub/hbase | 05aad6188a42c897ef38b5a56c85b1bb0725de3a | [
"MIT"
] | null | null | null | import happybase
import pandas as pd
import os,time
import datetime
timenow=datetime.datetime.now().strftime("%y-%m-%d-%H-%M")
hbaseip = input("Please provide the IP ADDRESS of the hbase==-->")
namespace = input("NAMESPACE of the hbase==-->")
encoding = 'utf-8'
filepath=os.getcwd()
filename=namespace+"_data.xlsx"
d... | 38.779528 | 107 | 0.564264 |
de4c2ae95fa21dae4aa25c0e57b59bf17c34e470 | 2,580 | py | Python | app/core/models.py | nimkh1987/recipe-app-api | 5347379095dc917023e7d1e2a5444c00075591d8 | [
"MIT"
] | null | null | null | app/core/models.py | nimkh1987/recipe-app-api | 5347379095dc917023e7d1e2a5444c00075591d8 | [
"MIT"
] | null | null | null | app/core/models.py | nimkh1987/recipe-app-api | 5347379095dc917023e7d1e2a5444c00075591d8 | [
"MIT"
] | null | null | null | import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, \
BaseUserManager, PermissionsMixin
from django.conf import settings
def recipe_image_file_path(instance, filename):
"""Generate file path for new recipe image"""
ext = filename.split('.')[-1]
f... | 28.351648 | 76 | 0.682171 |
45a47899246694816554ef65ba2b7453737665cf | 63 | py | Python | hello.py | sabbate/cs3240-labdemo | d4e9a57eb494b028eff1c0400a54d2ac65785bd7 | [
"MIT"
] | null | null | null | hello.py | sabbate/cs3240-labdemo | d4e9a57eb494b028eff1c0400a54d2ac65785bd7 | [
"MIT"
] | null | null | null | hello.py | sabbate/cs3240-labdemo | d4e9a57eb494b028eff1c0400a54d2ac65785bd7 | [
"MIT"
] | null | null | null | from helper import greeting
greeting("Hello from hello.py"); | 21 | 32 | 0.761905 |
202b5616ed8fda6092551f20607f9b7606a81173 | 25,306 | py | Python | river/compose/pipeline.py | dataJSA/river | 93497bba53d11d21e862acfd656b3fba7cf05c9b | [
"BSD-3-Clause"
] | null | null | null | river/compose/pipeline.py | dataJSA/river | 93497bba53d11d21e862acfd656b3fba7cf05c9b | [
"BSD-3-Clause"
] | null | null | null | river/compose/pipeline.py | dataJSA/river | 93497bba53d11d21e862acfd656b3fba7cf05c9b | [
"BSD-3-Clause"
] | null | null | null | import collections
import contextlib
import functools
import io
import itertools
import types
import typing
from xml.etree import ElementTree as ET
import pandas as pd
from river import base, utils
from . import func, union
__all__ = ["Pipeline"]
@contextlib.contextmanager
def warm_up_mode():
"""A context man... | 31.992415 | 99 | 0.59725 |
adc600dab3143008d40e69c791945859c7412622 | 746 | py | Python | app/main/util/email_verification.py | mukul-mehta/Syphus | 572d47b6b8dcdd13bd3a956b2a116a8fa3641087 | [
"MIT"
] | 4 | 2019-08-15T02:12:52.000Z | 2020-01-05T17:48:46.000Z | app/main/util/email_verification.py | mukul-mehta/Syphus | 572d47b6b8dcdd13bd3a956b2a116a8fa3641087 | [
"MIT"
] | 74 | 2019-08-14T20:34:33.000Z | 2020-04-29T20:29:38.000Z | app/main/util/email_verification.py | NiHighlism/Minerva | 4d95b215f0e5f1b1f768267c0a2dfea014e4baa1 | [
"MIT"
] | 10 | 2019-08-14T19:35:14.000Z | 2020-01-25T19:04:57.000Z | from flask import current_app
from itsdangerous import URLSafeTimedSerializer
def generate_confirmation_token(email):
serializer = URLSafeTimedSerializer(current_app.config['SECRET_KEY'])
return serializer.dumps(
email, salt=current_app.config['SECURITY_PASSWORD_SALT'])
# expiration is in seconds
# T... | 29.84 | 74 | 0.726542 |
c5efa56a68f97298e28f942258ebf5848f06254e | 1,248 | py | Python | crawl_image.py | ksvbka/face-mask-detector | c7ec54e2935a9988424b1645c46016a563b47b70 | [
"MIT"
] | 23 | 2020-12-17T11:45:53.000Z | 2022-03-19T06:59:11.000Z | crawl_image.py | 3112ik09/face-mask-detector | dc33f64ddbdc6ec7d56b7f7a4fe98bbbf186354f | [
"MIT"
] | 1 | 2021-05-07T13:05:03.000Z | 2021-05-17T00:59:56.000Z | crawl_image.py | 3112ik09/face-mask-detector | dc33f64ddbdc6ec7d56b7f7a4fe98bbbf186354f | [
"MIT"
] | 7 | 2021-01-07T14:46:13.000Z | 2022-01-07T09:31:22.000Z | import argparse
from tqdm import tqdm
from google_images_search import GoogleImagesSearch
GCS_CX = '495179597de2e4ab6'
GCS_DEVELOPER_KEY = 'AIzaSyD4dFGSan50nEmXh2Jnm4l6JHCAgEATWJc'
def crawl_image(query_text, save_dir, num=10, fileType='jpg|png', imgSize='MEDIUM'):
gis = GoogleImagesSearch(GCS_DEVELOPER_KEY, GCS_... | 37.818182 | 108 | 0.684295 |
688a4105a307981e68c2a3db137e5bbbaf84f99f | 444 | py | Python | app/teams/managers.py | kmnkit/web-todo | e06e42f5b68b2b9473fad820857634a9c5c0dadf | [
"MIT"
] | null | null | null | app/teams/managers.py | kmnkit/web-todo | e06e42f5b68b2b9473fad820857634a9c5c0dadf | [
"MIT"
] | null | null | null | app/teams/managers.py | kmnkit/web-todo | e06e42f5b68b2b9473fad820857634a9c5c0dadf | [
"MIT"
] | null | null | null | from django.db.models import Q, Manager
class CustomMemberManager(Manager):
"""Additional Manager function"""
def add_member(self, user, team):
self.create(user=user, team=team)
def remove_member(self, user, team):
self.delete(user=user, team=team)
def set_nickname(self, user, team,... | 26.117647 | 54 | 0.655405 |
1210422231e52709cdecd6dacce22f5f2ff97494 | 1,410 | py | Python | [1] BEGINNER/2787 - Xadrez.py | tiago040/URI-SOLUTIONS | 519d3950252a6002e8926416b2f8217ba08fe721 | [
"MIT"
] | 1 | 2022-03-15T03:03:26.000Z | 2022-03-15T03:03:26.000Z | [1] BEGINNER/2787 - Xadrez.py | tiago040/URI-SOLUTIONS | 519d3950252a6002e8926416b2f8217ba08fe721 | [
"MIT"
] | null | null | null | [1] BEGINNER/2787 - Xadrez.py | tiago040/URI-SOLUTIONS | 519d3950252a6002e8926416b2f8217ba08fe721 | [
"MIT"
] | null | null | null | '''
No tabuleiro de xadrez, a casa na linha 1, coluna 1 (canto superior esquerdo) é sempre branca e as cores das casas se alternam entre branca e preta, de acordo com o padrão conhecido como... xadrez! Dessa forma, como o tabuleiro tradicional tem oito linhas e oito colunas, a casa na linha 8, coluna 8 (canto inferior ... | 39.166667 | 577 | 0.656738 |
9b2877d408e8b38a6b5a4165ed29599657e30a52 | 49,069 | py | Python | tensorflow_datasets/core/dataset_builder.py | Jaidon-Smith/datasets | a2cc0bdb91243a123dafd03478be51e2b0436a98 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_builder.py | Jaidon-Smith/datasets | a2cc0bdb91243a123dafd03478be51e2b0436a98 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/core/dataset_builder.py | Jaidon-Smith/datasets | a2cc0bdb91243a123dafd03478be51e2b0436a98 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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... | 39.223821 | 154 | 0.691129 |
56ca498cec1c047b8bf0f3c8e3b13290e6207c10 | 57,029 | py | Python | packages/gtmcore/gtmcore/gitlib/tests/git_interface_mixin.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/gitlib/tests/git_interface_mixin.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | packages/gtmcore/gtmcore/gitlib/tests/git_interface_mixin.py | jjwatts/gigantum-client | 88ce0475fb6880322bdd06d987c494e29064f278 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 FlashX, LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | 37.968708 | 138 | 0.628172 |
d00f49e92d6e31dd9476628571c27cc57d9d9bf4 | 70 | py | Python | tests/RME/__init__.py | UofU-Cryosphere/weather_forecast_retrieval | b06fe2e09b49ace9eba55bf424c1b2d1e358858c | [
"CC0-1.0"
] | 6 | 2017-12-20T22:42:24.000Z | 2021-08-07T03:32:27.000Z | tests/RME/__init__.py | UofU-Cryosphere/weather_forecast_retrieval | b06fe2e09b49ace9eba55bf424c1b2d1e358858c | [
"CC0-1.0"
] | 26 | 2019-03-07T17:47:13.000Z | 2021-06-25T15:43:27.000Z | tests/RME/__init__.py | UofU-Cryosphere/weather_forecast_retrieval | b06fe2e09b49ace9eba55bf424c1b2d1e358858c | [
"CC0-1.0"
] | 3 | 2019-03-08T07:28:59.000Z | 2021-02-12T21:59:12.000Z | from .RME_test_case import RMETestCase
__all__ = [
RMETestCase
]
| 11.666667 | 38 | 0.742857 |
c5256733b825192d80bddd8f6ad0ecea8e00975a | 114 | py | Python | utils/nn_utils.py | isse-augsburg/adaptive-spreading | 3e423f888ff07257111fc95c3276024c4c44036d | [
"MIT"
] | null | null | null | utils/nn_utils.py | isse-augsburg/adaptive-spreading | 3e423f888ff07257111fc95c3276024c4c44036d | [
"MIT"
] | null | null | null | utils/nn_utils.py | isse-augsburg/adaptive-spreading | 3e423f888ff07257111fc95c3276024c4c44036d | [
"MIT"
] | null | null | null |
def count_trainable_parameters(model):
return sum(p.numel() for p in model.parameters() if p.requires_grad)
| 22.8 | 72 | 0.754386 |
0c2f399d296a66003bde4226e83d80fd01902ae5 | 15,579 | py | Python | pytezos/michelson/micheline.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | null | null | null | pytezos/michelson/micheline.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | null | null | null | pytezos/michelson/micheline.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | null | null | null | from typing import Dict
from datetime import datetime
from os.path import join
from decimal import Decimal
from collections import namedtuple, defaultdict
from functools import lru_cache
from pytezos.encoding import forge_public_key, forge_address, forge_base58
from pytezos.michelson.formatter import micheline_to_mich... | 36.314685 | 100 | 0.554978 |
990296b3be357c15f0c87a6a18ea2e562b92a93c | 478 | py | Python | OM300Ch7.py | JoshChima/OM300_Mastered | db17c8ca1eb1045b8b96fde34f193767d038629f | [
"MIT"
] | null | null | null | OM300Ch7.py | JoshChima/OM300_Mastered | db17c8ca1eb1045b8b96fde34f193767d038629f | [
"MIT"
] | null | null | null | OM300Ch7.py | JoshChima/OM300_Mastered | db17c8ca1eb1045b8b96fde34f193767d038629f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
BEP = lambda fcX, fcY, vcX, vcY: (fcY - fcX)/(vcY-vcX)
TotCost = lambda fc,vc,nu: fc+(vc*nu)
Profit = lambda fc,vc,nu,ppu: ppu*nu-TotCost(fc,vc,nu)
GPEbe = BEP(150000,200000,18,14)
FMSbe = BEP(200000,480000,14,13)
DMbe = BEP(480000, 200000, 13, 14)
Miy = BEP(65000,26000,12.5,18.5... | 23.9 | 54 | 0.700837 |
50e77822ba329f7da4568ea683c46b0afa2c316f | 4,158 | py | Python | remo/reports/tests/test_util.py | Mozilla-GitHub-Standards/6f6b18ac63685c6bf60fff95a3bbcc598378c77ceb14c7404172c570dd1e971d | 23ca8d46496b491fbdb2b8a72c91e75372932f23 | [
"BSD-3-Clause"
] | 27 | 2015-01-02T18:47:56.000Z | 2021-08-14T11:48:24.000Z | remo/reports/tests/test_util.py | Mozilla-GitHub-Standards/6f6b18ac63685c6bf60fff95a3bbcc598378c77ceb14c7404172c570dd1e971d | 23ca8d46496b491fbdb2b8a72c91e75372932f23 | [
"BSD-3-Clause"
] | 450 | 2015-01-02T12:29:50.000Z | 2020-10-27T21:41:38.000Z | remo/reports/tests/test_util.py | Mozilla-GitHub-Standards/6f6b18ac63685c6bf60fff95a3bbcc598378c77ceb14c7404172c570dd1e971d | 23ca8d46496b491fbdb2b8a72c91e75372932f23 | [
"BSD-3-Clause"
] | 81 | 2015-01-10T23:59:32.000Z | 2021-08-19T17:08:56.000Z | from datetime import timedelta
from django.core.urlresolvers import reverse
from django.utils.timezone import now
import mock
from nose.tools import eq_, ok_
from remo.base.templatetags.helpers import urlparams
from remo.base.tests import RemoTestCase
from remo.base.utils import month2number
from remo.profiles.tests... | 41.58 | 78 | 0.626263 |
a9ae97f5867a1dd53a79283681048adfd98b461c | 2,050 | py | Python | weather_app.py | rucsoft/weather | ad522c3688ebe4eeaaa671f2bdf3dcff9c2cabf2 | [
"MIT"
] | null | null | null | weather_app.py | rucsoft/weather | ad522c3688ebe4eeaaa671f2bdf3dcff9c2cabf2 | [
"MIT"
] | null | null | null | weather_app.py | rucsoft/weather | ad522c3688ebe4eeaaa671f2bdf3dcff9c2cabf2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import datetime
import matplotlib as plt
import scrapy
import requests
import lxml
from io import StringIO, BytesIO
today=(datetime.date.today()+datetime.timedelta(1)).isoformat()
tomorrow=(datetime.date.today()+datetime.timedelta(2)).is... | 30.147059 | 234 | 0.685854 |
a5a542483967e09f9001092e2c3d0033fe79a9f2 | 1,878 | py | Python | tests/conftest.py | haeena/python-slack-events-api-asgi | 6f4f0b207707468d10f165ba90c775bb7defd00e | [
"MIT"
] | 2 | 2020-01-16T04:23:43.000Z | 2020-09-04T23:47:35.000Z | tests/conftest.py | haeena/python-slack-events-api-asgi | 6f4f0b207707468d10f165ba90c775bb7defd00e | [
"MIT"
] | 2 | 2020-01-14T17:05:29.000Z | 2020-01-29T20:06:38.000Z | tests/conftest.py | haeena/slackevent-responder | 6f4f0b207707468d10f165ba90c775bb7defd00e | [
"MIT"
] | null | null | null | import random
import unicodedata
import pytest
from slackevent_responder import SlackEventApp
from .helpers.helpers import create_signature, load_event_fixture
@pytest.fixture(scope="session")
def signing_secret():
# I'm not completely sure, but it seems to be something like...
ss_letters = "0123456789abcd... | 25.726027 | 82 | 0.687433 |
0ee45e2aff32ac359ff272f10427bf0ce34c60b7 | 3,277 | py | Python | OddsAndEnds/ALOSPALSARTiles/addENVIHeader_GMW_ScanSAR.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | 4 | 2020-09-16T10:45:15.000Z | 2021-05-06T04:34:32.000Z | OddsAndEnds/ALOSPALSARTiles/addENVIHeader_GMW_ScanSAR.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | null | null | null | OddsAndEnds/ALOSPALSARTiles/addENVIHeader_GMW_ScanSAR.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | 2 | 2020-07-06T18:03:40.000Z | 2022-02-15T12:45:34.000Z | #! /usr/bin/env python
"""
add_gmw_palsar_header.py
Adds ENVI header file to Global Mangrove Watch
format PALSAR FBD files.
Dan Clewley
"""
from __future__ import print_function
import os
import sys
import re
import glob
import argparse
def create_envi_headers(inFileDIR):
"""
Create ENVI header
for all ... | 26.216 | 120 | 0.639609 |
10e462b6dd5ddb8328a2598ce44333f54990c567 | 3,714 | py | Python | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_online_meeting_detail_response.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_online_meeting_detail_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/show_online_meeting_detail_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowOnlineMeetingDetailResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribut... | 27.716418 | 92 | 0.585353 |
dee735e19b2d453b9c5faf07b665b5a11aa801c3 | 456 | py | Python | others/typical90/typical90j.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | 1 | 2019-08-21T00:49:34.000Z | 2019-08-21T00:49:34.000Z | others/typical90/typical90j.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | others/typical90/typical90j.py | c-yan/atcoder | 940e49d576e6a2d734288fadaf368e486480a948 | [
"MIT"
] | null | null | null | from sys import stdin
from itertools import accumulate
readline = stdin.readline
N = int(readline())
a = [[0] * (N + 1) for _ in range(2)]
for i in range(N):
C, P = map(int, readline().split())
a[C - 1][i + 1] = P
a = [list(accumulate(x)) for x in a]
Q = int(readline())
result = []
for _ in range(Q):
A... | 21.714286 | 75 | 0.552632 |
a6d48ebc86eb92488fda6ed4d879cb254d1d5f78 | 249 | py | Python | tests/test_console.py | benjmcarr/hypermodern-ben | 415cb323c4cd901547a15c66aef3cb9e02f3a33c | [
"MIT"
] | null | null | null | tests/test_console.py | benjmcarr/hypermodern-ben | 415cb323c4cd901547a15c66aef3cb9e02f3a33c | [
"MIT"
] | null | null | null | tests/test_console.py | benjmcarr/hypermodern-ben | 415cb323c4cd901547a15c66aef3cb9e02f3a33c | [
"MIT"
] | null | null | null | import click.testing
import pytest
from hypermodern_ben import console
@pytest.fixture
def runner():
return click.testing.CliRunner()
def test_main_succeeds(runner):
result = runner.invoke(console.main)
assert result.exit_code == 0
| 16.6 | 40 | 0.759036 |
8742135da59e5f509a934bd19e78cd4e6a23263e | 22,749 | py | Python | pandas/tests/groupby/test_nth.py | tyvich/pandas | 22de58e63f9271d4ddb2bf49d008c5a9550c5cc4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/groupby/test_nth.py | tyvich/pandas | 22de58e63f9271d4ddb2bf49d008c5a9550c5cc4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/groupby/test_nth.py | tyvich/pandas | 22de58e63f9271d4ddb2bf49d008c5a9550c5cc4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
Series,
Timestamp,
isna,
)
import pandas._testing as tm
def test_first_last_nth(df):
# tests for first / last / nth
grouped = df.groupby("A")
first = grouped.first()
expecte... | 31.077869 | 87 | 0.527364 |
e603827ea9d27820295884c357c0cdceb0ff59d7 | 11,849 | py | Python | games/spiel.py | Wu-Chenyang/PO-MuZero | c2b6f87c01a195d6f1cbe297e826974120bba3d3 | [
"MIT"
] | null | null | null | games/spiel.py | Wu-Chenyang/PO-MuZero | c2b6f87c01a195d6f1cbe297e826974120bba3d3 | [
"MIT"
] | null | null | null | games/spiel.py | Wu-Chenyang/PO-MuZero | c2b6f87c01a195d6f1cbe297e826974120bba3d3 | [
"MIT"
] | null | null | null | import datetime
import os
import numpy
import torch
from .abstract_game import AbstractGame
# This is a Game wrapper for open_spiel games. It allows you to run any game in the open_spiel library.
try:
import pyspiel
except ImportError:
import sys
sys.exit("You need to install open_spiel by running pip... | 40.302721 | 244 | 0.657693 |
469cf1e494198570402e1698fdafacc011861f9f | 25,476 | py | Python | laxy_backend/serializers.py | MonashBioinformaticsPlatform/laxy | fa9cfc3d9b2738ec0b9f471ddf4a4235cb6eb594 | [
"Apache-2.0"
] | 1 | 2020-11-19T15:10:42.000Z | 2020-11-19T15:10:42.000Z | laxy_backend/serializers.py | MonashBioinformaticsPlatform/laxy | fa9cfc3d9b2738ec0b9f471ddf4a4235cb6eb594 | [
"Apache-2.0"
] | 177 | 2018-10-28T23:01:24.000Z | 2022-02-26T06:35:29.000Z | laxy_backend/serializers.py | MonashBioinformaticsPlatform/laxy | fa9cfc3d9b2738ec0b9f471ddf4a4235cb6eb594 | [
"Apache-2.0"
] | 2 | 2019-03-14T10:06:19.000Z | 2020-08-24T19:41:28.000Z | import json
from collections import OrderedDict
from django.contrib.contenttypes.models import ContentType
from pathlib import Path
from urllib.parse import urlparse
import pydash
from django.db import transaction
from rest_framework import serializers
from django.core.validators import URLValidator
from rest_framewo... | 31.805243 | 105 | 0.627532 |
038c743436bc9587d9f628c227d391966aac0ba1 | 10,569 | py | Python | var/spack/repos/builtin/packages/converge/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/converge/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/converge/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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)
import glob
import os
from spack import *
class Converge(Package):
"""CONVERGE is a revolutionary computational flu... | 47.608108 | 131 | 0.600341 |
9eb6bf0e41398f024786afbbeb62e3c1dd3d59ad | 11,173 | py | Python | govauction_load/page_objects.py | lesiavl/selenium_perfomance_tests | 83cb1d734d6723cc5b6d6a8aa37b6598f06cbcfe | [
"Apache-2.0"
] | null | null | null | govauction_load/page_objects.py | lesiavl/selenium_perfomance_tests | 83cb1d734d6723cc5b6d6a8aa37b6598f06cbcfe | [
"Apache-2.0"
] | null | null | null | govauction_load/page_objects.py | lesiavl/selenium_perfomance_tests | 83cb1d734d6723cc5b6d6a8aa37b6598f06cbcfe | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import selenium.webdriver.support.ui as ui
from selenium.common.exceptions import NoSuchElementException, TimeoutException, ElementNotVisibleException
from locators ... | 45.234818 | 151 | 0.721113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.