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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b688d2fc912daf363481c3494d78f3915c466731 | 1,540 | py | Python | cfod/utilities/fetch.py | chime-frb-open-data/chime-frb-data | 3695e4d151bbf3816c78edacba05bf78e4df9b66 | [
"MIT"
] | 6 | 2019-02-20T08:31:29.000Z | 2021-06-18T16:08:22.000Z | cfod/utilities/fetch.py | chime-frb-open-data/chime-frb-data | 3695e4d151bbf3816c78edacba05bf78e4df9b66 | [
"MIT"
] | 12 | 2019-03-11T07:03:42.000Z | 2022-03-12T01:07:55.000Z | cfod/utilities/fetch.py | chime-frb-open-data/chime-frb-data | 3695e4d151bbf3816c78edacba05bf78e4df9b66 | [
"MIT"
] | 3 | 2019-02-02T21:04:38.000Z | 2020-08-08T08:43:44.000Z | import logging
import urllib.request
from cfod import DATA_DIR
logging.basicConfig(format="%(levelname)s:%(message)s")
log = logging.getLogger(__name__)
def _download(url: str, destination: str) -> None:
"""
Download a file from a URL .
Parameters
----------
url : str
Url to the data pr... | 24.0625 | 94 | 0.631818 |
ed90a25be35053abe761a6505fff9875019bf993 | 810 | py | Python | account/migrations/0006_auto_20200413_2308.py | TolimanStaR/Course-Work | 79dbfcbaef0ae79209295fe8d36b6fd9610e99b8 | [
"MIT"
] | 1 | 2020-03-31T22:09:34.000Z | 2020-03-31T22:09:34.000Z | account/migrations/0006_auto_20200413_2308.py | TolimanStaR/Course-Work | 79dbfcbaef0ae79209295fe8d36b6fd9610e99b8 | [
"MIT"
] | 8 | 2021-03-30T14:20:10.000Z | 2022-03-12T00:52:03.000Z | account/migrations/0006_auto_20200413_2308.py | TolimanStaR/Course-Work | 79dbfcbaef0ae79209295fe8d36b6fd9610e99b8 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2020-04-13 20:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0005_auto_20200413_1719'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='contes... | 42.631579 | 463 | 0.635802 |
0ab4b4b4065ed62e8902613ceaf5aa03ab6ba440 | 292 | py | Python | pypexels/src/errors.py | Lumen5/pypexels_l5 | 45e14edcc5236764075790fbd6aa17e3a0b36097 | [
"MIT"
] | null | null | null | pypexels/src/errors.py | Lumen5/pypexels_l5 | 45e14edcc5236764075790fbd6aa17e3a0b36097 | [
"MIT"
] | null | null | null | pypexels/src/errors.py | Lumen5/pypexels_l5 | 45e14edcc5236764075790fbd6aa17e3a0b36097 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from builtins import str, super
class PexelsError(Exception):
def __init__(self, message):
self.message = str(message) if message else 'Unknown error'
super().__init__(message)
def __str__(self):
return self.message
| 22.461538 | 67 | 0.705479 |
ae62f40264a187d55c485604e8c9b396fdb9b166 | 981 | py | Python | demo/visualizer.py | ayabel/HebSafeHarbor | 4198503d2265f1eb12b5c31d2e1b5db64296229f | [
"MIT"
] | null | null | null | demo/visualizer.py | ayabel/HebSafeHarbor | 4198503d2265f1eb12b5c31d2e1b5db64296229f | [
"MIT"
] | null | null | null | demo/visualizer.py | ayabel/HebSafeHarbor | 4198503d2265f1eb12b5c31d2e1b5db64296229f | [
"MIT"
] | null | null | null | from typing import Dict, List
import pandas as pd
import streamlit as st
from utils import render_entities
def show_entities(text: str, items: pd.DataFrame):
spans = [{"start": item["startPosition"], "end": item["endPosition"], "label": item["entityType"]} for _, item in
items.iterrows()]
doc_d... | 36.333333 | 117 | 0.722732 |
68e0a9f1867be326e38a3d27ddc22f88b8632933 | 9,191 | py | Python | continuous_integration/precommit.py | aas-core-works/aas-core-codegen | afec2cf363b6cb69816e7724a2b58626e2165869 | [
"MIT"
] | 5 | 2021-12-29T12:55:34.000Z | 2022-03-01T17:57:21.000Z | continuous_integration/precommit.py | aas-core-works/aas-core-codegen | afec2cf363b6cb69816e7724a2b58626e2165869 | [
"MIT"
] | 10 | 2021-12-29T02:15:55.000Z | 2022-03-09T11:04:22.000Z | continuous_integration/precommit.py | aas-core-works/aas-core-codegen | afec2cf363b6cb69816e7724a2b58626e2165869 | [
"MIT"
] | 2 | 2021-12-29T01:42:12.000Z | 2022-02-15T13:46:33.000Z | #!/usr/bin/env python3
"""Run pre-commit checks on the repository."""
import argparse
import enum
import os
import pathlib
import shlex
import subprocess
import sys
from typing import Optional, Mapping, Sequence
# pylint: disable=unnecessary-comprehension
class Step(enum.Enum):
"""Enumerate different pre-commi... | 30.333333 | 88 | 0.526385 |
609f7c1fa01b59babf632f50b4298233a409779c | 3,301 | py | Python | main.py | etimesoy/TO-DO-list | d818ec8f9d3cb91d33d711a9d14ce26fef087e5a | [
"MIT"
] | null | null | null | main.py | etimesoy/TO-DO-list | d818ec8f9d3cb91d33d711a9d14ce26fef087e5a | [
"MIT"
] | null | null | null | main.py | etimesoy/TO-DO-list | d818ec8f9d3cb91d33d711a9d14ce26fef087e5a | [
"MIT"
] | null | null | null | import os
import hashlib
from classes import List
from functions import print_list, try_except, except_text, begin
from file_functions import write_data_into_file, read_data_from_file
def main():
"""
Start point of program
:return: nothing
"""
os.system("cls")
print('Добро пожаловать в консол... | 42.87013 | 90 | 0.586792 |
c01a54a7d4aa84465313529af25fe0ea6f5208a6 | 678 | py | Python | examples/links.py | Akuli/tkinder | c360fbfe086ca09cdd856a8636de05b24e1b7093 | [
"MIT"
] | 23 | 2019-01-15T00:07:30.000Z | 2022-01-18T06:19:18.000Z | examples/links.py | Akuli/tkinder | c360fbfe086ca09cdd856a8636de05b24e1b7093 | [
"MIT"
] | 12 | 2019-01-13T19:51:52.000Z | 2021-05-17T17:55:51.000Z | examples/links.py | Akuli/pythotk | c360fbfe086ca09cdd856a8636de05b24e1b7093 | [
"MIT"
] | 7 | 2019-01-13T19:48:26.000Z | 2021-04-21T13:30:21.000Z | import teek
from teek.extras import links
def lol():
teek.dialog.info("Link Example Dialog", "Lol")
window = teek.Window("Link Example")
text = teek.Text(window)
text.pack()
old_end = text.end
text.insert(text.end, "Docs")
links.add_url_link(text, 'https://teek.rtfd.io/', old_end, text.end)
text.insert(text.en... | 22.6 | 76 | 0.716814 |
e4ad5dfcd1dec796dd08b10bf40b057f70873922 | 1,896 | py | Python | Influence Model/learner.py | neo13/Locating-Twitter-Users | 82ea1ae6cc4469ff4ac081c7c35d6044414d4495 | [
"MIT"
] | null | null | null | Influence Model/learner.py | neo13/Locating-Twitter-Users | 82ea1ae6cc4469ff4ac081c7c35d6044414d4495 | [
"MIT"
] | null | null | null | Influence Model/learner.py | neo13/Locating-Twitter-Users | 82ea1ae6cc4469ff4ac081c7c35d6044414d4495 | [
"MIT"
] | null | null | null | #This file is in charge of reading all records from the database
#and calculating the influence for all the locations whose influence
# is currently set to -1, i.e. not calculated.
#import pdb for debuggins purposes
import pdb
#for mathematical functions
import math
#optimization packages for obtaining argmax of inf... | 24 | 94 | 0.720464 |
d321d14e5a2a56a48717f01972fdfc8e1feb6fc5 | 11,017 | py | Python | mistral/db/sqlalchemy/migration/alembic_migrations/versions/001_kilo.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 3 | 2015-08-28T04:57:56.000Z | 2017-03-27T10:59:56.000Z | mistral/db/sqlalchemy/migration/alembic_migrations/versions/001_kilo.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 21 | 2015-04-14T22:41:53.000Z | 2019-02-20T09:30:10.000Z | mistral/db/sqlalchemy/migration/alembic_migrations/versions/001_kilo.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 12 | 2015-08-14T02:27:37.000Z | 2020-12-31T10:09:21.000Z | # Copyright 2015 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 48.10917 | 78 | 0.638649 |
3445f6a0a28dc70f37df8e6a7b1ce10e75781e73 | 269 | py | Python | gallery/admin.py | bethwelkip/Persona_Galleria | ac777ae1e4edff6acc0c9b65ef68b6e21f0a1f80 | [
"MIT"
] | null | null | null | gallery/admin.py | bethwelkip/Persona_Galleria | ac777ae1e4edff6acc0c9b65ef68b6e21f0a1f80 | [
"MIT"
] | null | null | null | gallery/admin.py | bethwelkip/Persona_Galleria | ac777ae1e4edff6acc0c9b65ef68b6e21f0a1f80 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Image, Category, Location
# Register your models here.
class ImageAdmin(admin.ModelAdmin):
filter_horizontal = ('Category', )
admin.site.register(Image)
admin.site.register(Location)
admin.site.register(Category) | 33.625 | 45 | 0.795539 |
495831075e9a7a50c0c84255275a06a9525cfba9 | 2,534 | py | Python | census_parquet/boundary_processing.py | TomAugspurger/census-parquet | c09733bbeb0a7e5dfe386e74152ec7d81120fd91 | [
"MIT"
] | null | null | null | census_parquet/boundary_processing.py | TomAugspurger/census-parquet | c09733bbeb0a7e5dfe386e74152ec7d81120fd91 | [
"MIT"
] | null | null | null | census_parquet/boundary_processing.py | TomAugspurger/census-parquet | c09733bbeb0a7e5dfe386e74152ec7d81120fd91 | [
"MIT"
] | null | null | null | import dask.bag as bag
import dask_geopandas
import geopandas as gpd
import glob
import os
def load_dtype(filename):
print(f'Started {filename}')
gdf = gpd.read_file(filename, driver='SHP')
#dtype conversions
mapping = {
"AFFGEOID": "str",
"AFFGEOID20": "str",
"AIANNHCE": "int... | 26.395833 | 138 | 0.508287 |
a3d7829baffbc1100620c02172dfe99980401d5e | 355 | py | Python | deepdream/try.py | shauray8/Neural-Painter | 5f02721bfbb185899ab88a7e0c941ead744f3165 | [
"MIT"
] | null | null | null | deepdream/try.py | shauray8/Neural-Painter | 5f02721bfbb185899ab88a7e0c941ead744f3165 | [
"MIT"
] | null | null | null | deepdream/try.py | shauray8/Neural-Painter | 5f02721bfbb185899ab88a7e0c941ead744f3165 | [
"MIT"
] | null | null | null | import torch
import torchvision.models as models
import torch.nn as nn
vgg16 = models.vgg16(pretrained = True)
print(vgg16)
for params in vgg16.parameters():
params.requires_grad = False
vgg16.conv = nn.Conv2d(1000, 3, 4, padding=1)
print(vgg16)
path = "../../data/Dog/0.png"
import numpy as np
import matplotl... | 17.75 | 45 | 0.732394 |
cf65fea044db3d8da34c96b6dad095512ceb3419 | 2,607 | py | Python | legacy_python/raw_svg/face.py | smrfeld/convolution-calculator | 8312c6eb2b92f3de1f0e96cb1485060160fc965b | [
"MIT"
] | null | null | null | legacy_python/raw_svg/face.py | smrfeld/convolution-calculator | 8312c6eb2b92f3de1f0e96cb1485060160fc965b | [
"MIT"
] | null | null | null | legacy_python/raw_svg/face.py | smrfeld/convolution-calculator | 8312c6eb2b92f3de1f0e96cb1485060160fc965b | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from typing import Tuple, List
from enum import Enum
from .path import *
class Side(Enum):
TOP = 0
LEFT = 1
FRONT = 2
@dataclass
class FaceDrawOptions:
fill : bool
stroke : bool
line_width : float = 0.1
line_col : Tuple[float,float,float,float] = (0,0,0,1... | 30.670588 | 99 | 0.616417 |
3a3da8b324c466c9173d02c54715c7809cb75a1f | 194 | py | Python | exercicios_python_brasil/estrutura_sequencial/12_peso_ideal_masculino.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_sequencial/12_peso_ideal_masculino.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_sequencial/12_peso_ideal_masculino.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | print('\033[1m>>> PESO IDEAL MASCULINO <<<\033[m')
a = float(input('INFORME A ALTURA (m): '))
peso = (72.7*a)-58
print(f'\033[1m\033[4mRESULTADO\033[m:\nPESO IDEAL: \033[1:33m{peso:.2f}kg')
| 38.8 | 77 | 0.628866 |
ff8ab3fa723ab291a33ab9635191eb36250a42e6 | 954 | py | Python | Python/construct-binary-tree-from-preorder-and-inorder-traversal.py | jxie0755/LeetCode-Solutions | c0c8a77c648503b4b66cae399f8214cbbecd4838 | [
"MIT"
] | 7 | 2019-04-13T13:44:26.000Z | 2021-05-08T07:59:41.000Z | Python/construct-binary-tree-from-preorder-and-inorder-traversal.py | jxie0755/LeetCode-Solutions | c0c8a77c648503b4b66cae399f8214cbbecd4838 | [
"MIT"
] | null | null | null | Python/construct-binary-tree-from-preorder-and-inorder-traversal.py | jxie0755/LeetCode-Solutions | c0c8a77c648503b4b66cae399f8214cbbecd4838 | [
"MIT"
] | 5 | 2019-06-21T13:36:41.000Z | 2021-11-29T04:42:24.000Z | # Time: O(n)
# Space: O(n)
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
# @param preorder, a list of integers
# @param inorder, a list of integers
# @return a tree node
def buildTree(self, preorder, ... | 32.896552 | 111 | 0.618449 |
17e178406ef5b27e04a902239fdbbfcacd305f79 | 975 | py | Python | BtcTransactionProcessor.py | acce1a/CypherpunksCryptoPayServer | 9db32ff842f351b28c1d8d87c849dda402841071 | [
"Unlicense"
] | 1 | 2021-11-04T23:38:22.000Z | 2021-11-04T23:38:22.000Z | BtcTransactionProcessor.py | acce1a/CypherpunksCryptoPayServer | 9db32ff842f351b28c1d8d87c849dda402841071 | [
"Unlicense"
] | null | null | null | BtcTransactionProcessor.py | acce1a/CypherpunksCryptoPayServer | 9db32ff842f351b28c1d8d87c849dda402841071 | [
"Unlicense"
] | null | null | null | from pycoingecko import CoinGeckoAPI
import time
import requests
import pybtc
PRICE = 0.0001 # preço em BTC por chave publicada
class BtcTransactionProcessor(object):
@staticmethod
def is_payment_received(addr):
return balance(addr) <= PRICE
@staticmethod
def gen_wallet():
a = pyb... | 24.375 | 80 | 0.58359 |
ba9028bf3157a6eb7b4580d3c12da9a3356522b5 | 956 | py | Python | Task3/analysis/method_1_2/graph_plot.py | prakank/Traffic_Density_Estimator | a7b53a2eea02d4d64fbcd65d4e220a7584fe0c6a | [
"MIT"
] | 1 | 2021-05-12T07:42:28.000Z | 2021-05-12T07:42:28.000Z | Task3/analysis/method_1_2/graph_plot.py | prakank/Traffic_Density_Estimator | a7b53a2eea02d4d64fbcd65d4e220a7584fe0c6a | [
"MIT"
] | null | null | null | Task3/analysis/method_1_2/graph_plot.py | prakank/Traffic_Density_Estimator | a7b53a2eea02d4d64fbcd65d4e220a7584fe0c6a | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#plt.figure(figsize = (20, 20))
df1 = pd.read_csv("out1.csv")
df2 = pd.read_csv("out2.csv")
plt.plot(df1["Utility"], df1['Runtime(in milliseconds)'])
for i in range (df1["Utility"].size):
plt.annotate("x = " + str(df1["Parameter x... | 20.782609 | 151 | 0.674686 |
67f283afba0f0f6006c697c15ac6584582e6c1fe | 6,787 | py | Python | lib/services/loadbalancer/ncloud_loadbalancer/model/get_load_balancer_instance_list_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/loadbalancer/ncloud_loadbalancer/model/get_load_balancer_instance_list_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/loadbalancer/ncloud_loadbalancer/model/get_load_balancer_instance_list_response.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
loadbalancer
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ncloud_loadbalancer.model.load_balancer_instance import LoadBalancerInstance # noqa: F401,E501
class GetLoadBalancerInstanceListResponse(objec... | 31.421296 | 144 | 0.644173 |
0c7bd0287b2dee8b0f5be5e98d7d7502bdfc51f7 | 537 | py | Python | setup.py | damomeen/nsi_connections | e7edb2107246f4eb133d7fe37f9b85d9cbfe5c90 | [
"Apache-2.0"
] | null | null | null | setup.py | damomeen/nsi_connections | e7edb2107246f4eb133d7fe37f9b85d9cbfe5c90 | [
"Apache-2.0"
] | null | null | null | setup.py | damomeen/nsi_connections | e7edb2107246f4eb133d7fe37f9b85d9cbfe5c90 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
setup(name='nsi_connections',
version='0.1',
author='Damian Parniewicz',
author_email='damian.parniewicz@gmail.com',
package_dir = {'nsi_connections': 'src'},
packages=find_packages(),
description = ("Python daemon which exposes Geant BoD/... | 35.8 | 76 | 0.627561 |
90a224331a0fb27019f9ce7525f3984a4524a7e3 | 3,897 | py | Python | tests/bin/conftest.py | olaaustine/igsr_archive | 7cca14a2ed58845e2101968098859dddeab627fc | [
"Apache-2.0"
] | 1 | 2020-04-16T12:44:24.000Z | 2020-04-16T12:44:24.000Z | tests/bin/conftest.py | olaaustine/igsr_archive | 7cca14a2ed58845e2101968098859dddeab627fc | [
"Apache-2.0"
] | null | null | null | tests/bin/conftest.py | olaaustine/igsr_archive | 7cca14a2ed58845e2101968098859dddeab627fc | [
"Apache-2.0"
] | 2 | 2022-01-11T12:26:52.000Z | 2022-02-22T16:22:34.000Z | import pytest
import os
import pdb
import random
import string
from igsr_archive.file import File
def random_generator(size=600, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
@pytest.fixture(autouse=True)
def env_setup(monkeypatch):
"""
Defining ... | 31.942623 | 106 | 0.623043 |
3d595fbda5c0a536539a9b7fac426ca54e2241af | 1,383 | py | Python | tests/XOR_003/run.py | reey/analytics-builder-blocks-contrib | 85085a12e730eb1e1d3b9281892b324bce6179fe | [
"Apache-2.0"
] | 8 | 2020-03-27T13:20:59.000Z | 2021-12-30T07:28:43.000Z | tests/XOR_003/run.py | reey/analytics-builder-blocks-contrib | 85085a12e730eb1e1d3b9281892b324bce6179fe | [
"Apache-2.0"
] | 5 | 2020-02-28T07:23:26.000Z | 2021-04-14T14:22:46.000Z | tests/XOR_003/run.py | reey/analytics-builder-blocks-contrib | 85085a12e730eb1e1d3b9281892b324bce6179fe | [
"Apache-2.0"
] | 5 | 2020-02-22T12:00:21.000Z | 2021-04-13T16:32:09.000Z | #
# $Copyright (c) 2019 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.$
# This file is licensed under the Apache 2.0 license - see https://www.apache.org/licenses/LICENSE-2.0
#
from pysys.constants import *
from apa... | 43.21875 | 171 | 0.703543 |
5f6e205dc29a2df4e2152d30353a7a2bedb904ee | 3,824 | py | Python | qbittorrent_control.py | cryptbphcoutlook/QBittorrentBot | a5b4f9a25e74830e32df555bda48c316d3e93807 | [
"MIT"
] | 1 | 2021-03-10T13:49:23.000Z | 2021-03-10T13:49:23.000Z | qbittorrent_control.py | cryptbphcoutlook/QBittorrentBot | a5b4f9a25e74830e32df555bda48c316d3e93807 | [
"MIT"
] | null | null | null | qbittorrent_control.py | cryptbphcoutlook/QBittorrentBot | a5b4f9a25e74830e32df555bda48c316d3e93807 | [
"MIT"
] | 2 | 2021-05-28T16:29:28.000Z | 2021-06-15T09:49:55.000Z | import qbittorrentapi
from json_validation import get_configs
def qbittorrent_login(func):
def wrapper(*args, **kwargs):
qbt_client = qbittorrentapi.Client(
host=f'http://{get_configs().qbittorrent.ip}:'
f'{get_configs().qbittorrent.port}',
username=get_configs()... | 27.912409 | 75 | 0.642259 |
0ae3bd344f5e804eebc3f01be32298a5b323a051 | 2,497 | py | Python | project/tcav_score_analyzer/stratified_concept_scores.py | ymetz/local_interpretability | 3b230a425687137f36e3b148f883af961375a57d | [
"MIT"
] | null | null | null | project/tcav_score_analyzer/stratified_concept_scores.py | ymetz/local_interpretability | 3b230a425687137f36e3b148f883af961375a57d | [
"MIT"
] | null | null | null | project/tcav_score_analyzer/stratified_concept_scores.py | ymetz/local_interpretability | 3b230a425687137f36e3b148f883af961375a57d | [
"MIT"
] | null | null | null | import os
import matplotlib.pyplot as plt
import numpy as np
from project.server.explanations.tcav_explainer import load_tcavs
import csv
def run_experiment():
rb_score_dict = load_tcavs(None, None, tcav_file_name="/Users/yannick/Documents/Studium/interVis/project/tcav_score_analyzer/ILSVRC2012inception_v3-tcavs... | 48.960784 | 201 | 0.638767 |
105179661f316419e04d558db71010591ad65761 | 3,084 | py | Python | app/api/api_v1/endpoints/zip.py | VPPR/backend-2 | 454e037f67245cae102f17c902f0494013c94e82 | [
"MIT"
] | 1 | 2021-05-16T15:05:50.000Z | 2021-05-16T15:05:50.000Z | app/api/api_v1/endpoints/zip.py | VPPR/backend-2 | 454e037f67245cae102f17c902f0494013c94e82 | [
"MIT"
] | 6 | 2021-02-22T06:30:49.000Z | 2021-06-26T15:17:24.000Z | app/api/api_v1/endpoints/zip.py | VPPR/backend-2 | 454e037f67245cae102f17c902f0494013c94e82 | [
"MIT"
] | null | null | null | import io
from asyncio import create_task
from zipfile import ZipFile
import pandas
import pyzipper
from fastapi import APIRouter, Body, Depends, File, HTTPException, UploadFile, status
from app.api.api_v1.endpoints.utils import ziputils
from app.api.deps import get_current_user
router = APIRouter()
@router.post("... | 39.538462 | 106 | 0.619974 |
05c6c920b9767f0753e389b25458b3dc261cb005 | 1,838 | py | Python | common/dialogflow_framework/extensions/custom_functions.py | deepmipt/assistant-base | ab2dcbdc4c31cd52ca336022003bf69fa80c9189 | [
"Apache-2.0"
] | 7 | 2020-12-07T19:59:16.000Z | 2020-12-24T16:20:47.000Z | common/dialogflow_framework/extensions/custom_functions.py | deepmipt/assistant-base | ab2dcbdc4c31cd52ca336022003bf69fa80c9189 | [
"Apache-2.0"
] | null | null | null | common/dialogflow_framework/extensions/custom_functions.py | deepmipt/assistant-base | ab2dcbdc4c31cd52ca336022003bf69fa80c9189 | [
"Apache-2.0"
] | null | null | null | import logging
import re
import nltk
import common.dialogflow_framework.utils.state as state_utils
from common.utils import is_yes
logger = logging.getLogger(__name__)
def how_to_draw_response(vars):
response = "Would you like to know how to improve your drawing skills?"
return response
def drawing_request... | 31.689655 | 83 | 0.656148 |
b6980d0ad82539c2d80c99c564a08a1410fcab58 | 554 | py | Python | pi.py | SundarGopal/Pi | 49d684ad92282b31e4b16607a25d981728b63fa2 | [
"Unlicense"
] | 1 | 2020-11-26T12:54:20.000Z | 2020-11-26T12:54:20.000Z | pi.py | SundarGopal/Pi | 49d684ad92282b31e4b16607a25d981728b63fa2 | [
"Unlicense"
] | null | null | null | pi.py | SundarGopal/Pi | 49d684ad92282b31e4b16607a25d981728b63fa2 | [
"Unlicense"
] | null | null | null |
import sys
def Arctan(d, ndigits):
total = term = (10**ndigits) // d
n = 0
while term != 0:
n += 1
term //= -d*d
total += term // (2*n + 1)
return total
if __name__ == '__main__':
xdigits = 10
ndigits = int(input('Enter number of digits you... | 20.518519 | 73 | 0.478339 |
add194283dc84e4a95700174e8cdeb751ed95ee6 | 1,448 | py | Python | tests/iterators/subset_test.py | SSouik/pyutil | d2250fb585679e49eb9056a3051bf239a58c2e8b | [
"MIT"
] | null | null | null | tests/iterators/subset_test.py | SSouik/pyutil | d2250fb585679e49eb9056a3051bf239a58c2e8b | [
"MIT"
] | 21 | 2022-01-05T04:51:33.000Z | 2022-01-28T05:45:57.000Z | tests/iterators/subset_test.py | SSouik/pyutil | d2250fb585679e49eb9056a3051bf239a58c2e8b | [
"MIT"
] | null | null | null | import pytest
from pyutil import subset
def test_subset_with_empty_list():
actual = list(subset([]))
expected = []
assert actual == expected
def test_subset_with_empty_tuple():
actual = list(subset(()))
expected = []
assert actual == expected
def test_subset_when_seq_has_values():
actu... | 22.625 | 63 | 0.65884 |
a73b4b804a1be64e06d10afe31ffd6bfcf5592be | 4,328 | py | Python | contrib/seeds/generate-seeds.py | lexandr0s/BMTP | 2f95933d7495c05f529a525e9b212e8d9246595c | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | lexandr0s/BMTP | 2f95933d7495c05f529a525e9b212e8d9246595c | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | lexandr0s/BMTP | 2f95933d7495c05f529a525e9b212e8d9246595c | [
"MIT"
] | 1 | 2018-07-28T03:08:32.000Z | 2018-07-28T03:08:32.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.362319 | 98 | 0.581562 |
16b2e56a86a80f5da96529c2c8dc626e0463a7e2 | 6,130 | py | Python | game_functions.py | KristjanKuus/python_game | 22edcc3f1f4baed578df32fb88e90c6a7817c100 | [
"MIT"
] | null | null | null | game_functions.py | KristjanKuus/python_game | 22edcc3f1f4baed578df32fb88e90c6a7817c100 | [
"MIT"
] | null | null | null | game_functions.py | KristjanKuus/python_game | 22edcc3f1f4baed578df32fb88e90c6a7817c100 | [
"MIT"
] | null | null | null | import sys
import pygame
from bullet import Bullet
from megusta import Megusta
from game_stats import GameStats
from time import sleep
class Background(pygame.sprite.Sprite):
def __init__(self, image_file, location):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load(image_file)
... | 40.866667 | 88 | 0.715661 |
434c3ba025cbb481da0c8b34e2620c9daa5c0c2a | 6,835 | py | Python | vivarium/library/dict_utils.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/library/dict_utils.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/library/dict_utils.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import collections
import copy
from functools import reduce
import operator
tuple_separator = '___'
def merge_dicts(dicts):
merge = {}
for d in dicts:
merge.update(d)
return merge
def deep_merge_check(dct, merge_dct):
'''
... | 34.004975 | 117 | 0.623409 |
106c103b8cd6b9ee6a9c2a565fa2053ca822f84b | 2,088 | py | Python | DataBaseModels/TransportInfoModels/voyage_model.py | ZhuTou409/oa-flask | c66f0fc4a4f541fd18dc7b08d0313788856a6dfe | [
"MIT"
] | null | null | null | DataBaseModels/TransportInfoModels/voyage_model.py | ZhuTou409/oa-flask | c66f0fc4a4f541fd18dc7b08d0313788856a6dfe | [
"MIT"
] | null | null | null | DataBaseModels/TransportInfoModels/voyage_model.py | ZhuTou409/oa-flask | c66f0fc4a4f541fd18dc7b08d0313788856a6dfe | [
"MIT"
] | null | null | null | from DataBaseModels.model_base import ModelBase
from DataBaseInterface.database_func import DataFuncObj
class VoyageFormKey:
VOYAGE_NAME = "VoyageName"
BOAT_NAME = "BoatName"
START_PORT = "StartPort"
TARGET_PORT = "TargetPort"
BOAT_COMPANY_NAME = "BoatCompanyName"
VOYAGE_FORM_NAME = "Voyage"
c... | 29.408451 | 80 | 0.70067 |
5ade683ec0950b2f48b0f7fe2e2745c249e9deaf | 13,969 | py | Python | contrib/gitian-build.py | DarkPayCoin/darkpay-core | de758cae6c0eff465900ede9c597f41008e9cda9 | [
"MIT"
] | 1 | 2019-09-04T14:01:17.000Z | 2019-09-04T14:01:17.000Z | contrib/gitian-build.py | DarkPayCoin/darkpay-core | de758cae6c0eff465900ede9c597f41008e9cda9 | [
"MIT"
] | null | null | null | contrib/gitian-build.py | DarkPayCoin/darkpay-core | de758cae6c0eff465900ede9c597f41008e9cda9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
def setup():
global args, workdir
programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget']
if args.kvm:
programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
elif args.docker:
dockers = ['docker.io',... | 59.696581 | 236 | 0.657456 |
dec80b1b1792f1f067597f8a66f52b4ca573bb5b | 19,668 | py | Python | designer/core/builder.py | Hackersvilla/kivy-designer | ea4cd78c3049d4e40aebf13c4383657cf1a978e7 | [
"MIT"
] | 783 | 2015-01-02T23:04:43.000Z | 2022-03-31T15:52:47.000Z | designer/core/builder.py | Hackersvilla/kivy-designer | ea4cd78c3049d4e40aebf13c4383657cf1a978e7 | [
"MIT"
] | 297 | 2015-01-05T05:11:38.000Z | 2018-08-27T18:16:57.000Z | designer/core/builder.py | Hackersvilla/kivy-designer | ea4cd78c3049d4e40aebf13c4383657cf1a978e7 | [
"MIT"
] | 252 | 2015-02-20T22:26:21.000Z | 2022-03-29T18:41:58.000Z | import os
import shutil
import sys
import designer
from designer.uix.confirmation_dialog import ConfirmationDialog
from designer.utils import constants
from designer.utils.utils import (
get_current_project,
get_fs_encoding,
get_kd_data_dir,
ignore_proj_watcher)
from kivy.event import EventDispatcher
f... | 32.509091 | 80 | 0.583842 |
64de0e681095a0b2f1aa7507322d3b02f6f60947 | 5,034 | py | Python | messente_api/__init__.py | messente/messente-api-python | 154abca9e6a226a5c97d8052c3f2631765503426 | [
"Apache-2.0"
] | null | null | null | messente_api/__init__.py | messente/messente-api-python | 154abca9e6a226a5c97d8052c3f2631765503426 | [
"Apache-2.0"
] | null | null | null | messente_api/__init__.py | messente/messente-api-python | 154abca9e6a226a5c97d8052c3f2631765503426 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
Messente API
[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers... | 55.933333 | 473 | 0.883592 |
e306d6cd4c456578025d05654f3015eab4def131 | 1,402 | py | Python | b00_steroid/b00_de_00_pp.py | Hoa-Lab/2022_Steroid | 3eabac8ecddce91a08269d0210a39ddde453a961 | [
"MIT"
] | null | null | null | b00_steroid/b00_de_00_pp.py | Hoa-Lab/2022_Steroid | 3eabac8ecddce91a08269d0210a39ddde453a961 | [
"MIT"
] | null | null | null | b00_steroid/b00_de_00_pp.py | Hoa-Lab/2022_Steroid | 3eabac8ecddce91a08269d0210a39ddde453a961 | [
"MIT"
] | null | null | null | import pandas as pd
import multiprocessing as mp
from pathlib import Path
import json
#---------------------------------------------------------
prj='/mnt/c/Users/gus5/Desktop/a01_proj/a14_steroid'
fd_out='./out/b00_de_00_pp'
f_exp='./out/a00_exp_01_clean/data.csv'
f_param=f'{prj}/a00_raw/meta/param_microarray.json'
... | 24.172414 | 74 | 0.553495 |
74957ec9cbb880ecc9cfc7af85fd629041484bc3 | 24,088 | py | Python | sogs/migrations/v_0_1_x.py | Bilb/session-pysogs | eb6f13e26d16f0119e87b41ffb86813c3c177ab9 | [
"MIT"
] | 1 | 2022-03-08T06:34:34.000Z | 2022-03-08T06:34:34.000Z | sogs/migrations/v_0_1_x.py | Bilb/session-pysogs | eb6f13e26d16f0119e87b41ffb86813c3c177ab9 | [
"MIT"
] | null | null | null | sogs/migrations/v_0_1_x.py | Bilb/session-pysogs | eb6f13e26d16f0119e87b41ffb86813c3c177ab9 | [
"MIT"
] | null | null | null | # Migration code for upgrading from a 0.1.x SOGS database. The database structure is completely
# changed, and so this is technically more like an import than a migration.
import os
import logging
import time
from .exc import DatabaseUpgradeRequired
def migrate(conn, *, check_only):
n_rooms = conn.execute("SELE... | 41.67474 | 98 | 0.507763 |
b6aed0d266e6ecf3cfc97bbb96e5f598cccf83d7 | 4,972 | py | Python | pypelines/pipeline.py | Yash-Amin/pypelines | a803f1a8cada6113660532eedc5cfa76cbb38988 | [
"MIT"
] | null | null | null | pypelines/pipeline.py | Yash-Amin/pypelines | a803f1a8cada6113660532eedc5cfa76cbb38988 | [
"MIT"
] | null | null | null | pypelines/pipeline.py | Yash-Amin/pypelines | a803f1a8cada6113660532eedc5cfa76cbb38988 | [
"MIT"
] | null | null | null | """Pipeline"""
from yaml import safe_load
from dataclasses import dataclass
from typing import Dict, Any, List
from pypelines import utils
from pypelines.tasks import run_task
from pypelines.pipeline_options import PipelineOptions
@dataclass
class PipelineParameter:
"""Pipeline parameter"""
name: str = None... | 32.927152 | 82 | 0.586484 |
cde2ab13ea0e7584ebd749632f7f7aabf4a8ad11 | 1,341 | py | Python | etsin_finder/schemas/services.py | CSCfi/fairdata-etsin-qvain | 9cd92dea437e6c2682a6086c677ab729e4381215 | [
"MIT"
] | null | null | null | etsin_finder/schemas/services.py | CSCfi/fairdata-etsin-qvain | 9cd92dea437e6c2682a6086c677ab729e4381215 | [
"MIT"
] | 2 | 2021-11-01T13:09:03.000Z | 2021-11-01T13:09:14.000Z | etsin_finder/schemas/services.py | CSCfi/fairdata-etsin-qvain | 9cd92dea437e6c2682a6086c677ab729e4381215 | [
"MIT"
] | null | null | null | """Validation schemas for service configuration."""
from marshmallow import Schema, fields
from marshmallow.validate import Length
class MetaxServiceConfigurationSchema(Schema):
"""Schema for configuring Metax connection."""
HOST = fields.Str(required=True, validate=Length(min=1))
USER = fields.Str(requi... | 36.243243 | 64 | 0.737509 |
3db2273833f1aa3cf1c9b8c9fa4b3aeb00ccd0d1 | 2,058 | py | Python | boundaries/management/commands/import_states_geojson.py | tiagofassoni/geodjango-boundaries | 8d5dcb76c637e945f34a30f3dbd61a2031e40707 | [
"BSD-3-Clause"
] | null | null | null | boundaries/management/commands/import_states_geojson.py | tiagofassoni/geodjango-boundaries | 8d5dcb76c637e945f34a30f3dbd61a2031e40707 | [
"BSD-3-Clause"
] | null | null | null | boundaries/management/commands/import_states_geojson.py | tiagofassoni/geodjango-boundaries | 8d5dcb76c637e945f34a30f3dbd61a2031e40707 | [
"BSD-3-Clause"
] | 1 | 2018-04-04T05:05:48.000Z | 2018-04-04T05:05:48.000Z | from django.core.management.base import BaseCommand
from django.contrib.gis.geos import GEOSGeometry, MultiPolygon
from boundaries.models import Country, State
import json
import sys
class Command(BaseCommand):
help = 'Import states GeoJSON from whoisonfirst.org'
def add_arguments(self, parser):
pars... | 36.105263 | 75 | 0.540816 |
fa42d8ea4487c4b2a97933db8f09e17912955ec1 | 4,308 | py | Python | beaconrunner/validators/MaliciousValidator.py | SHSR2001/beaconrunner | d4d8db1159ad049eab3feb243f2c672f8c7bf180 | [
"MIT"
] | null | null | null | beaconrunner/validators/MaliciousValidator.py | SHSR2001/beaconrunner | d4d8db1159ad049eab3feb243f2c672f8c7bf180 | [
"MIT"
] | null | null | null | beaconrunner/validators/MaliciousValidator.py | SHSR2001/beaconrunner | d4d8db1159ad049eab3feb243f2c672f8c7bf180 | [
"MIT"
] | 1 | 2022-02-14T11:15:17.000Z | 2022-02-14T11:15:17.000Z | from copy import *
from ..specs import (
Attestation, SignedBeaconBlock,
ValidatorIndex,
SECONDS_PER_SLOT, SLOTS_PER_EPOCH,
get_beacon_proposer_index, compute_proposer_index,
)
from ..validatorlib import (
BRValidator,
honest_attest, honest_propose,
)
from ..malicious import (
MaliciousDa... | 34.464 | 204 | 0.660864 |
08860fbf886bc8790e91b00650e8e969f3a139a2 | 72,455 | py | Python | sdk/python/pulumi_aws/ecs/task_definition.py | RafalSumislawski/pulumi-aws | 7c8a335d327c173aa32c8b3d98816e760db329fa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ecs/task_definition.py | RafalSumislawski/pulumi-aws | 7c8a335d327c173aa32c8b3d98816e760db329fa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/ecs/task_definition.py | RafalSumislawski/pulumi-aws | 7c8a335d327c173aa32c8b3d98816e760db329fa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 51.024648 | 621 | 0.650348 |
a2254d711b439cc413195aad5fcf2291e430bdc4 | 754 | py | Python | stats/items.py | disadone/scrapy-stats | e9eacbaba69914d78da6f31b723223be13fae08c | [
"MIT"
] | 46 | 2015-02-07T17:28:19.000Z | 2021-11-29T23:54:37.000Z | stats/items.py | disadone/scrapy-stats | e9eacbaba69914d78da6f31b723223be13fae08c | [
"MIT"
] | null | null | null | stats/items.py | disadone/scrapy-stats | e9eacbaba69914d78da6f31b723223be13fae08c | [
"MIT"
] | 34 | 2015-03-05T09:33:17.000Z | 2021-05-27T07:37:02.000Z | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class Layer01_Item(scrapy.Item):
year = scrapy.Field()
name = scrapy.Field()
code = scrapy.Field()
class Layer02_Item(scrapy.Item):
yea... | 20.944444 | 51 | 0.653846 |
c6cb259aa746d0158092c1718b43847374af5602 | 4,664 | py | Python | sokoban.py | muji-4ok/sokoban-pygame | d95704a307c087e64a1c067fc93fe20ed1c8e7ae | [
"MIT"
] | null | null | null | sokoban.py | muji-4ok/sokoban-pygame | d95704a307c087e64a1c067fc93fe20ed1c8e7ae | [
"MIT"
] | null | null | null | sokoban.py | muji-4ok/sokoban-pygame | d95704a307c087e64a1c067fc93fe20ed1c8e7ae | [
"MIT"
] | null | null | null | import pygame as p
class Tile:
key = ''
def __repr__(self):
return self.key
def __str__(self):
return repr(self)
class Moveable(Tile):
pass
class Immovable(Tile):
pass
class Wall(Immovable):
key = '#'
class Floor(Moveable):
key = ' '
class Storage(Moveable):
... | 22 | 95 | 0.509863 |
7b44505ef42fe54133cf85c42c5f48df27f3a298 | 4,879 | py | Python | docs/conf.py | davidbailey/RAIL | f4447e1985b589b9b938559463ea37fa2aa72713 | [
"MIT"
] | 2 | 2019-10-07T09:26:30.000Z | 2021-09-30T08:29:34.000Z | docs/conf.py | davidbailey/RAIL | f4447e1985b589b9b938559463ea37fa2aa72713 | [
"MIT"
] | null | null | null | docs/conf.py | davidbailey/RAIL | f4447e1985b589b9b938559463ea37fa2aa72713 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 30.685535 | 80 | 0.643575 |
0019989ef33790438e909b15fd4a73503896bf02 | 871 | py | Python | test/test_director_product_list_response.py | kinow-io/kaemo-python-sdk | 610fce09e3a9e631babf09195b0492959d9e4d56 | [
"Apache-2.0"
] | 1 | 2017-05-03T12:48:22.000Z | 2017-05-03T12:48:22.000Z | test/test_director_product_list_response.py | kinow-io/kaemo-python-sdk | 610fce09e3a9e631babf09195b0492959d9e4d56 | [
"Apache-2.0"
] | null | null | null | test/test_director_product_list_response.py | kinow-io/kaemo-python-sdk | 610fce09e3a9e631babf09195b0492959d9e4d56 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.9
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import A... | 20.255814 | 96 | 0.727899 |
50647d5aaf02c06044913311333598069f31404a | 4,953 | py | Python | datastage/admin/sync_permissions.py | dataflow/DataStage | 2ed7186706c4ad6edc051793c548fd7751a24e20 | [
"MIT"
] | 8 | 2015-02-25T10:58:52.000Z | 2020-04-17T03:11:48.000Z | datastage/admin/sync_permissions.py | dataflow/DataStage | 2ed7186706c4ad6edc051793c548fd7751a24e20 | [
"MIT"
] | null | null | null | datastage/admin/sync_permissions.py | dataflow/DataStage | 2ed7186706c4ad6edc051793c548fd7751a24e20 | [
"MIT"
] | 7 | 2015-02-25T10:58:54.000Z | 2019-11-04T16:19:22.000Z | # ---------------------------------------------------------------------
#
# Copyright (c) 2012 University of Oxford
#
# 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, incl... | 42.698276 | 117 | 0.603069 |
ef3d7113f71b4d105cce85fb768f195ee3eb7eb1 | 25,136 | py | Python | ultra/learning_algorithm/dla_types.py | Taosheng-ty/ULTRA | 2541982cb21e0acccbe66cd4437194e40e0828ef | [
"Apache-2.0"
] | 1 | 2019-12-19T16:28:47.000Z | 2019-12-19T16:28:47.000Z | ultra/learning_algorithm/dla_types.py | Taosheng-ty/ULTRA | 2541982cb21e0acccbe66cd4437194e40e0828ef | [
"Apache-2.0"
] | null | null | null | ultra/learning_algorithm/dla_types.py | Taosheng-ty/ULTRA | 2541982cb21e0acccbe66cd4437194e40e0828ef | [
"Apache-2.0"
] | null | null | null | """Training and testing the dual learning algorithm for unbiased learning to rank.
See the following paper for more information on the dual learning algorithm.
* Qingyao Ai, Keping Bi, Cheng Luo, Jiafeng Guo, W. Bruce Croft. 2018. Unbiased Learning to Rank with Unbiased Propensity Estimation. In Proceedings o... | 55.610619 | 165 | 0.632002 |
dd8fc199e373c26945073f757770d58ac7c18344 | 6,748 | py | Python | photons/gui/equipment/thorlabs_stage.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/gui/equipment/thorlabs_stage.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/gui/equipment/thorlabs_stage.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | """
Widget for a Thorlabs translational/rotational stage.
"""
from msl.qt import (
prompt,
Qt,
QtWidgets,
DoubleSpinBox,
Button,
)
from . import (
BaseWidget,
widget,
)
@widget(manufacturer=r'Thorlabs', model=r'LTS150|LTS300|KDC101|KST101|BSC201')
class ThorlabsStage(BaseWidget):
def... | 35.893617 | 109 | 0.655602 |
f26c5cddcde17bb6711dcecb7b349a35b57a64f5 | 1,069 | py | Python | scripts/issues/issue_bokeh_serve.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | 1 | 2020-05-08T21:44:37.000Z | 2020-05-08T21:44:37.000Z | scripts/issues/issue_bokeh_serve.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | scripts/issues/issue_bokeh_serve.py | Jhsmit/awesome-panel | 53f7754f7c505a2666f6724df26c851ae942ec40 | [
"Apache-2.0"
] | null | null | null | from bokeh.layouts import column
from bokeh.models import Slider
from bokeh.server.server import Server
import awesome_panel.express.bootstrap
def get_app(title="My App"):
def bkapp(doc):
slider = Slider(start=0, end=30, value=0, step=1, title=title)
doc.add_root(column(slider))
... | 28.891892 | 77 | 0.681946 |
0b925a74192af118b33a30d8fd6763bf4f7f08f9 | 1,863 | py | Python | PythonTest/TestLambda.py | qianhk/FeiPython | c87578d3c04b7345a99fef7390c8ea12c6f2c716 | [
"Apache-2.0"
] | null | null | null | PythonTest/TestLambda.py | qianhk/FeiPython | c87578d3c04b7345a99fef7390c8ea12c6f2c716 | [
"Apache-2.0"
] | 15 | 2019-11-18T06:09:50.000Z | 2022-03-02T02:55:54.000Z | PythonTest/TestLambda.py | qianhk/FeiPython | c87578d3c04b7345a99fef7390c8ea12c6f2c716 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from time import sleep
from functools import wraps
import logging
points = [
{'x': 1, 'y': 4}
, {'x': 3, 'y': 2}
, {'x': 2, 'y': 3}
, {'x': 5, 'y': 5}
, {'x': 4, 'y': 1}
]
print ('ori points', points)
points.sort()
print ('after sort', points)
points.sort(ke... | 21.917647 | 99 | 0.599571 |
a80893e38cf6302d2060f1621190170308cb5c31 | 1,371 | py | Python | library/shared/content_providers/vpk_provider.py | REDxEYE/SourceIO | 29568a19da42be91d1dae5babd5ad2bb47f684a0 | [
"MIT"
] | 199 | 2019-04-02T02:30:58.000Z | 2022-03-30T21:29:49.000Z | library/shared/content_providers/vpk_provider.py | LievreAI/SourceIO | 5d70c757b8c4f9aea0fc3a40f6028b12974b3630 | [
"MIT"
] | 113 | 2019-03-03T19:36:25.000Z | 2022-03-31T19:44:05.000Z | library/shared/content_providers/vpk_provider.py | LievreAI/SourceIO | 5d70c757b8c4f9aea0fc3a40f6028b12974b3630 | [
"MIT"
] | 38 | 2019-05-15T16:49:30.000Z | 2022-03-22T03:40:43.000Z | from pathlib import Path
from typing import Union
import glob
from ...shared.vpk.vpk_file import open_vpk
from .content_provider_base import ContentProviderBase
class VPKContentProvider(ContentProviderBase):
def __init__(self, filepath: Path, override_steamid=0):
super().__init__(filepath)
self._o... | 33.439024 | 72 | 0.673231 |
2216e8c4faa1509bb5b572852068a42597927397 | 181,437 | py | Python | src/sage/combinat/binary_tree.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/combinat/binary_tree.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/binary_tree.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:22:38.000Z | 2020-07-23T10:22:38.000Z | # -*- coding: utf-8 -*-
"""
Binary Trees
This module deals with binary trees as mathematical (in particular immutable)
objects.
.. NOTE::
If you need the data-structure for example to represent sets or hash
tables with AVL trees, you should have a look at :mod:`sage.misc.sagex_ds`.
AUTHORS:
- Florent Hiver... | 34.047101 | 140 | 0.455717 |
adabf166e0f6b03ae1cc219ac7f48eb24ce6eb37 | 3,354 | py | Python | Theano/lstm.py | hshindo/POSTagging-benchmark | fe58cd74e8552a383a8c87b0edc0e9af73fafe3a | [
"MIT"
] | 2 | 2016-05-27T13:32:46.000Z | 2016-12-07T17:32:49.000Z | Theano/lstm.py | hshindo/POSTagging-benchmark | fe58cd74e8552a383a8c87b0edc0e9af73fafe3a | [
"MIT"
] | 1 | 2016-12-07T17:34:36.000Z | 2016-12-07T18:55:35.000Z | Theano/lstm.py | hshindo/POSTagging-benchmark | fe58cd74e8552a383a8c87b0edc0e9af73fafe3a | [
"MIT"
] | null | null | null | __author__ = 'hiroki'
import numpy as np
import theano
import theano.tensor as T
from nn_utils import sigmoid, tanh, sample_weights
class LSTM(object):
def __init__(self,
w,
d,
n_layer,
vocab_size,
n_in,
n_hid... | 33.54 | 98 | 0.543232 |
0e9e878f534948a2c06fcd85411494ee59c29a4e | 3,149 | py | Python | libqtile/widget/wttr.py | segatrooper/qtile | 766392fdb09a0501135d7442575ff8d0994a0418 | [
"MIT"
] | null | null | null | libqtile/widget/wttr.py | segatrooper/qtile | 766392fdb09a0501135d7442575ff8d0994a0418 | [
"MIT"
] | null | null | null | libqtile/widget/wttr.py | segatrooper/qtile | 766392fdb09a0501135d7442575ff8d0994a0418 | [
"MIT"
] | 1 | 2020-04-27T22:20:11.000Z | 2020-04-27T22:20:11.000Z | from urllib.parse import quote, urlencode
from libqtile.widget import GenPollUrl, base
class Wttr(GenPollUrl):
"""Display weather widget provided by wttr.in_.
.. _wttr.in: https://github.com/chubin/wttr.in/
To specify your own custom output format, use the special %-notation
(example: 'My_city: %t(... | 30.572816 | 79 | 0.524929 |
46901cd4793b88b0a84865d779be07aec7ccc9db | 921 | py | Python | Python/CSRF_Bypass_POC.py | istvanbohm/securitynotes | 5653cede5e32188b9cc892896bbb5ccb397eac55 | [
"MIT"
] | null | null | null | Python/CSRF_Bypass_POC.py | istvanbohm/securitynotes | 5653cede5e32188b9cc892896bbb5ccb397eac55 | [
"MIT"
] | null | null | null | Python/CSRF_Bypass_POC.py | istvanbohm/securitynotes | 5653cede5e32188b9cc892896bbb5ccb397eac55 | [
"MIT"
] | null | null | null | # Proof of Concept Python code to extract CSRF token from an HTTP response
# After tailoring to the web application the code can be used to harvest data or brute-force login forms.
import sys
import requests
import re
URL = 'https://10.10.10.1/login'
uname = "john"
client = requests.session()
response = client.post... | 30.7 | 105 | 0.715527 |
e3a4991c32967b7ac0521f1065f8cb4aeaedb23c | 943 | py | Python | core/models.py | rodrigondec/Open_CliEng | 83e399a35c1cf96283409ac43a61b2725cd93982 | [
"MIT"
] | 3 | 2019-09-26T13:58:23.000Z | 2020-06-18T16:43:40.000Z | core/models.py | rodrigondec/Open_Clineng | 83e399a35c1cf96283409ac43a61b2725cd93982 | [
"MIT"
] | 24 | 2017-11-20T05:27:32.000Z | 2017-11-29T05:46:56.000Z | core/models.py | rodrigondec/Open_CliEng | 83e399a35c1cf96283409ac43a61b2725cd93982 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.db import models
from polymorphic.models import PolymorphicModel
class Responsavel(PolymorphicModel):
pass
class EmpresaResponsavel(Responsavel):
nome = models.CharField(max_length=50)
cnpj = models.CharField(max_length=20)
email = models.CharF... | 24.815789 | 97 | 0.752916 |
69c0335e43a0ca4161b3c271ae669a95605c7793 | 1,594 | py | Python | bioprocs/scripts/tcga/pGtFiles2Mat.py | pwwang/biopipen | d53b78aa192fd56a5da457463b099b2aa833b284 | [
"MIT"
] | 2 | 2021-09-10T00:17:52.000Z | 2021-10-10T09:53:09.000Z | bioprocs/scripts/tcga/pGtFiles2Mat.py | pwwang/biopipen | d53b78aa192fd56a5da457463b099b2aa833b284 | [
"MIT"
] | 1 | 2021-12-02T07:54:09.000Z | 2021-12-02T07:54:09.000Z | bioprocs/scripts/tcga/pGtFiles2Mat.py | pwwang/biopipen | d53b78aa192fd56a5da457463b099b2aa833b284 | [
"MIT"
] | 2 | 2021-09-10T00:17:54.000Z | 2021-10-10T09:56:40.000Z | from os import path
from bioprocs.utils import logger
infiles = {{i.infiles | repr}}
outfile = {{o.outfile | quote}}
rsmap = {{args.rsmap | : None if not a else a | repr}}
fn2sam = {{args.fn2sample}}
confcut = {{args.confcut | repr}}
def readone(infile, getsnps = True, progress = ''):
logger.info('Reading ' + pro... | 27.964912 | 85 | 0.622334 |
804f7063801f65b7d4059c7bb9715d6795da5faa | 650 | py | Python | dit/utils/table.py | godzilla-but-nicer/dit | 16832f5d657f8d4afb1eb40c8219d9f454f25d23 | [
"BSD-3-Clause"
] | 1 | 2020-03-13T10:30:11.000Z | 2020-03-13T10:30:11.000Z | dit/utils/table.py | mhalawad/dit | d68c54d994b72a9040c2b6f7f6e5986766b10b37 | [
"BSD-3-Clause"
] | null | null | null | dit/utils/table.py | mhalawad/dit | d68c54d994b72a9040c2b6f7f6e5986766b10b37 | [
"BSD-3-Clause"
] | null | null | null | """
"""
from prettytable import UNICODE_LINES, PrettyTable
from ..import ditParams
__all__ = (
'build_table',
)
def build_table(field_names=None, title=None):
"""
Construct a PrettyTable with style set.
Parameters
----------
field_names : list
List of field names.
title : str
... | 17.567568 | 61 | 0.592308 |
45271ee62ccc9b5c93a02e08763b194c4b6de081 | 1,251 | py | Python | scripts_test/resladder.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 1 | 2020-06-02T22:41:46.000Z | 2020-06-02T22:41:46.000Z | scripts_test/resladder.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 12 | 2018-10-23T18:08:37.000Z | 2022-02-24T10:51:34.000Z | scripts_test/resladder.py | boblinchuan/BAG2_TEMPLATES_EC | e0e4a41c1780edb035cd619b9cea2e27e3fc5f51 | [
"BSD-3-Clause"
] | 18 | 2018-07-14T01:36:09.000Z | 2021-05-25T18:38:00.000Z | # -*- coding: utf-8 -*-
import yaml
from bag.core import BagProject
from bag.layout import RoutingGrid, TemplateDB
from abs_templates_ec.resistor.core import ResLadder
def make_tdb(prj, target_lib, specs):
grid_specs = specs['routing_grid']
layers = grid_specs['layers']
spaces = grid_specs['spaces']
... | 25.02 | 88 | 0.676259 |
37a4af2466bc10642456cacfc56913f692008aad | 861 | py | Python | src/keypad_controller/keypad_controller.py | SwatKat1977/secureshed | 9b82f1358bd710dfe4b8c3e49ff11ecb4c77250e | [
"Apache-2.0"
] | null | null | null | src/keypad_controller/keypad_controller.py | SwatKat1977/secureshed | 9b82f1358bd710dfe4b8c3e49ff11ecb4c77250e | [
"Apache-2.0"
] | 2 | 2019-12-03T23:26:25.000Z | 2020-09-16T20:17:25.000Z | src/keypad_controller/keypad_controller.py | SwatKat1977/secureshed | 9b82f1358bd710dfe4b8c3e49ff11ecb4c77250e | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2019-2020 Secure Shed Project Dev Team
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 ag... | 28.7 | 73 | 0.728223 |
51f0b7fa24d6638e1c94ba02d321fabf1a4b5897 | 1,947 | py | Python | src/filter_sam/cli.py | milescsmith/filter_sam | 09ee5a90d54e752baf8a69c9b70936c540862fd1 | [
"BSD-3-Clause"
] | null | null | null | src/filter_sam/cli.py | milescsmith/filter_sam | 09ee5a90d54e752baf8a69c9b70936c540862fd1 | [
"BSD-3-Clause"
] | 1 | 2021-12-28T20:26:24.000Z | 2021-12-28T20:26:24.000Z | src/filter_sam/cli.py | milescsmith/filter_sam | 09ee5a90d54e752baf8a69c9b70936c540862fd1 | [
"BSD-3-Clause"
] | null | null | null | """Console script for filter_sam."""
import sys
from Bio import SeqIO
from typing import Optional
import typer
import pysam
from . import __version__
app = typer.Typer(
name="filter_sam",
help=f"Remove from a SAM/BAM file entries that do not have a corresponding "
"match in a FASTA/FASTQ file",
)
d... | 25.96 | 87 | 0.636364 |
5c261b261524e0d8d7d832ab55093270afa7a03f | 1,154 | py | Python | make-previews.py | shantichat/avacats | 1712e157569b8ae10873a32b130cba5d36e6655a | [
"Unlicense"
] | 4 | 2021-11-03T20:07:02.000Z | 2021-11-05T15:19:41.000Z | make-previews.py | shantichat/avacats | 1712e157569b8ae10873a32b130cba5d36e6655a | [
"Unlicense"
] | null | null | null | make-previews.py | shantichat/avacats | 1712e157569b8ae10873a32b130cba5d36e6655a | [
"Unlicense"
] | null | null | null | import json
import os
from PIL import Image
from pilkit.processors import SmartResize
from pilkit.utils import process_image
def make_previews(root, dest, sizes):
options = {
'progressive': True,
'optimize': True,
'quality': 85,
}
for size in sizes:
os.makedirs(f'{dest}/{... | 22.627451 | 92 | 0.55026 |
45978a12a386c36211724c59dd1014bcfe99bdeb | 610 | py | Python | leasing/tests/models/test_contact.py | suutari-ai/mvj | c39dbc692afcb3b26366783414c2d5a88a57b25a | [
"MIT"
] | 1 | 2021-01-12T08:14:10.000Z | 2021-01-12T08:14:10.000Z | leasing/tests/models/test_contact.py | suutari-ai/mvj | c39dbc692afcb3b26366783414c2d5a88a57b25a | [
"MIT"
] | 249 | 2017-04-18T14:00:13.000Z | 2022-03-30T12:18:03.000Z | leasing/tests/models/test_contact.py | suutari-ai/mvj | c39dbc692afcb3b26366783414c2d5a88a57b25a | [
"MIT"
] | 7 | 2017-04-18T08:43:54.000Z | 2021-07-28T07:29:30.000Z | import pytest
from django.core.exceptions import ValidationError
from leasing.enums import ContactType
@pytest.mark.django_db
def test_contact_business_id_validator(contact_factory):
with pytest.raises(ValidationError) as e:
contact = contact_factory(type=ContactType.BUSINESS, business_id="1234567")
... | 33.888889 | 86 | 0.768852 |
f80b8b9e8ff67a21aa5c376213a7e14544eadaa8 | 4,324 | py | Python | tests/scan_random_sites.py | mediaonegroup/WPWatcher | a8289af766e604e1c8f7d538513bf69dd74bfb50 | [
"Apache-2.0"
] | 27 | 2020-03-22T08:15:19.000Z | 2022-02-09T14:51:25.000Z | tests/scan_random_sites.py | mediaonegroup/WPWatcher | a8289af766e604e1c8f7d538513bf69dd74bfb50 | [
"Apache-2.0"
] | 38 | 2020-04-09T14:59:36.000Z | 2021-04-25T20:10:19.000Z | tests/scan_random_sites.py | mediaonegroup/WPWatcher | a8289af766e604e1c8f7d538513bf69dd74bfb50 | [
"Apache-2.0"
] | 11 | 2020-04-17T01:07:19.000Z | 2021-11-12T00:08:34.000Z | #! /usr/bin/env python3
#
# Wordpress Watcher test script
#
# DISCLAIMER - USE AT YOUR OWN RISK.
#
# THIS TEST MIGHT BE ILLEGAL IN YOUR COUNTRY
import json
import os
import requests
import asyncore
import smtpd
import unittest
import random
import linecache
import concurrent.futures
from wpwatcher.wpscan import WPSca... | 30.885714 | 152 | 0.716698 |
1703563eec6d5553f4fc849590e9ac9afb920fb2 | 13,541 | py | Python | sdk/python/pulumi_azure_native/network/v20190801/local_network_gateway.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190801/local_network_gateway.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190801/local_network_gateway.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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
from... | 66.704433 | 5,317 | 0.718115 |
5a2b02d1db132b4561830afcf4ef60a0237aab8b | 3,165 | py | Python | sl_connect/__init__.py | necator9/detection_method_simple | 64933a370e9f0f19e8af63b7e1fccf8172abbfdb | [
"Apache-2.0"
] | 4 | 2020-11-04T15:12:33.000Z | 2021-11-07T11:50:50.000Z | sl_connect/__init__.py | necator9/detection_method | af42579e9e1162db48646e493ae97ff6ee7c7b98 | [
"Apache-2.0"
] | null | null | null | sl_connect/__init__.py | necator9/detection_method | af42579e9e1162db48646e493ae97ff6ee7c7b98 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Compatible to python 2.7
# Created by Ivan Matveev at 04.08.20
# E-mail: ivan.matveev@hs-anhalt.de
# Interconnection between Smartlighting application (running as a server) and multiple detection algorithm or lamps
# instances (running as clients). The module contains classes to implement ser... | 35.965909 | 115 | 0.675829 |
1f1276dd6bb75b05f438de4cb6999bf032661878 | 540 | py | Python | src/ann/spiking/lif.py | romilly/spiking-jax | 79270ea0e61116ad5853ea9b6c0da429a356a3a6 | [
"MIT"
] | 1 | 2021-12-02T09:10:40.000Z | 2021-12-02T09:10:40.000Z | src/ann/spiking/lif.py | romilly/spiking-jax | 79270ea0e61116ad5853ea9b6c0da429a356a3a6 | [
"MIT"
] | null | null | null | src/ann/spiking/lif.py | romilly/spiking-jax | 79270ea0e61116ad5853ea9b6c0da429a356a3a6 | [
"MIT"
] | null | null | null | """
Simulate a refactory leaky integrate and fire neuron for a single time period
"""
# parameters
from ann.spiking.parameters import *
def step(v, tr, injected_current):
spiking = False
if tr > 0:
next_v = reset_voltage
tr = tr - 1
elif v > threshold:
next_v = reset_voltage
... | 24.545455 | 96 | 0.62037 |
d036e3c89ecb71ea8a0e7a447455a9b44523b349 | 365 | py | Python | py/pyanaconda/codility_2.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/pyanaconda/codility_2.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/pyanaconda/codility_2.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | from itertools import groupby
def nchoose2(n):
return n * (n - 1) / 2
def solution(A):
ans = sum(
[nchoose2(len(list(group))) for key, group in groupby(sorted(A))]
)
return int(ans) if ans <= 1000000000 else 1000000000
test = [0, 1, 2, 5, 2, 4, 5, 6, 6, 6, 1, 3, 5, 5]
# 1 + 1 + (4 choose ... | 19.210526 | 73 | 0.572603 |
845b124a87d92ad64a37d71eaebbab951504a300 | 2,113 | py | Python | views.py | summerandwinter/poempythonweb | 9f25047fb9ceb19400df59ac8b9d212fc688d6c6 | [
"MIT"
] | null | null | null | views.py | summerandwinter/poempythonweb | 9f25047fb9ceb19400df59ac8b9d212fc688d6c6 | [
"MIT"
] | null | null | null | views.py | summerandwinter/poempythonweb | 9f25047fb9ceb19400df59ac8b9d212fc688d6c6 | [
"MIT"
] | null | null | null | # coding: utf-8
from datetime import datetime
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.http import HttpResponseServerError
from django.shortcuts import render
from django.urls import reverse
from django.views import View
from leancloud import Object
from leancloud ... | 29.760563 | 72 | 0.671084 |
de537291ae1c3cd736596b96ce23d1d1f640166b | 68 | py | Python | scripts/userSetup.py | hoover900/curvedeformereditor | a93f7a02cb1880d52567f6b8c46edceb23daff2d | [
"BSD-3-Clause-Clear"
] | null | null | null | scripts/userSetup.py | hoover900/curvedeformereditor | a93f7a02cb1880d52567f6b8c46edceb23daff2d | [
"BSD-3-Clause-Clear"
] | null | null | null | scripts/userSetup.py | hoover900/curvedeformereditor | a93f7a02cb1880d52567f6b8c46edceb23daff2d | [
"BSD-3-Clause-Clear"
] | null | null | null | import curvedeformereditor
print "INITIALIZING curvedeformereditor" | 22.666667 | 40 | 0.897059 |
45989b5702cdb85e47d780497f3104e6c27f4de8 | 519 | py | Python | db/LinksController.py | Naeviant/DigitalPeopleLabs | 78377039c35d61dd5aea9351f9a58e7bdae44937 | [
"MIT"
] | null | null | null | db/LinksController.py | Naeviant/DigitalPeopleLabs | 78377039c35d61dd5aea9351f9a58e7bdae44937 | [
"MIT"
] | null | null | null | db/LinksController.py | Naeviant/DigitalPeopleLabs | 78377039c35d61dd5aea9351f9a58e7bdae44937 | [
"MIT"
] | null | null | null | from db.connection import db
class LinksController:
@staticmethod
def create_link(name, textColour, backgroundColour, url):
db.links.insert_one({
"name": name,
"textColour": textColour,
"backgroundColour": backgroundColour,
"url": url
})
... | 23.590909 | 61 | 0.560694 |
ae0ac6a3ecd43c5b9ea2c6eb18cfeeb50fff2ab0 | 4,647 | py | Python | python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 1 | 2021-11-01T06:28:16.000Z | 2021-11-01T06:28:16.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_mkldnn_conv3d_bias_fuse_pass.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 5 | 2021-12-10T11:20:06.000Z | 2022-02-18T05:18:12.000Z | # 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... | 34.93985 | 80 | 0.566602 |
3a13ee9c652e879762b456f4d0762c9fe6adc35b | 3,774 | py | Python | markdown_generator/publications.py | gdevenyi/gabriel.devenyi.ca | cc001f1dc6ed07ff46c3b5cca66865b977710acc | [
"MIT"
] | null | null | null | markdown_generator/publications.py | gdevenyi/gabriel.devenyi.ca | cc001f1dc6ed07ff46c3b5cca66865b977710acc | [
"MIT"
] | 4 | 2021-08-20T14:16:59.000Z | 2021-08-20T14:25:50.000Z | markdown_generator/publications.py | gdevenyi/gdevenyi.github.io | cc001f1dc6ed07ff46c3b5cca66865b977710acc | [
"MIT"
] | null | null | null | # coding: utf-8
# # Publications markdown generator for academicpages
#
# Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_gen... | 35.942857 | 346 | 0.682565 |
a7fd13da99e70dc441489c9e28e24c07aad1be6d | 3,006 | py | Python | spydrnet/uniquify.py | ganeshgore/spydrnet | 22672b8fc7d63461a71077bd20f29df6d38e96f4 | [
"BSD-3-Clause"
] | 34 | 2020-03-12T15:40:49.000Z | 2022-02-28T07:13:47.000Z | spydrnet/uniquify.py | ganeshgore/spydrnet | 22672b8fc7d63461a71077bd20f29df6d38e96f4 | [
"BSD-3-Clause"
] | 104 | 2020-01-06T20:32:19.000Z | 2022-01-02T00:20:14.000Z | spydrnet/uniquify.py | ganeshgore/spydrnet | 22672b8fc7d63461a71077bd20f29df6d38e96f4 | [
"BSD-3-Clause"
] | 10 | 2020-09-02T20:24:00.000Z | 2022-02-24T16:10:07.000Z | # Copyright 2020 Dallin Skouson, Andrew Keller, Michael Wirthlin
from collections import deque
# from spydrnet.ir import *
"""Code to make definitions unique throughout a netlist.
expected parameters,
uniqify -- Makes all definitions unique below the top instance. definitions that are not referenced below the top ins... | 37.111111 | 201 | 0.721224 |
dd86b96e5b510bc957fe7e5ac79e057319bc8299 | 273 | py | Python | json_doc/__init__.py | ddfs/python-json-doc | a5db1b0b926f49b8eaeafa592982feec86e834a2 | [
"Apache-2.0"
] | null | null | null | json_doc/__init__.py | ddfs/python-json-doc | a5db1b0b926f49b8eaeafa592982feec86e834a2 | [
"Apache-2.0"
] | null | null | null | json_doc/__init__.py | ddfs/python-json-doc | a5db1b0b926f49b8eaeafa592982feec86e834a2 | [
"Apache-2.0"
] | null | null | null | """
JSON-Doc
"""
__author__ = 'Fatih Piristine'
__email__ = 'fatihpiristine@gmail.com'
__version__ = '0.1.3'
from .json_doc import json_doc_get, json_doc_set, json_doc_has, \
json_doc_pop, json_doc_append, json_doc_extend, json_doc_replace, \
json_doc_replace_re
| 22.75 | 71 | 0.758242 |
7fc355d8c2dbaf68b14cafc2da48bb36ff281371 | 3,562 | py | Python | evaluate.py | frgfm/banana-craving-monkey | 6a37ec1fcfca1d7befa4152096448ec6c2259ecf | [
"MIT"
] | null | null | null | evaluate.py | frgfm/banana-craving-monkey | 6a37ec1fcfca1d7befa4152096448ec6c2259ecf | [
"MIT"
] | null | null | null | evaluate.py | frgfm/banana-craving-monkey | 6a37ec1fcfca1d7befa4152096448ec6c2259ecf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import torch
from pathlib import Path
from unityagents import UnityEnvironment
from agent import Agent
def evaluate_agent(agent, env):
"""Agent training function
Args:
agent: agent to train
env: environment to interact with
Returns:
... | 31.245614 | 101 | 0.638405 |
14afe643aacd1e15622a3ab7a96c2c41d5922011 | 2,096 | py | Python | azure-batch/azure/batch/models/job_schedule_update_parameter.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-batch/azure/batch/models/job_schedule_update_parameter.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-batch/azure/batch/models/job_schedule_update_parameter.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.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 ... | 41.92 | 85 | 0.655057 |
6b251597ed3f7a6bbea837a112ee980c05299776 | 10,673 | py | Python | aquests/dbapi/asynmongo.py | hansroh/aquests | 9de84cfff84ff5d5179d16c5c1f7be3487516843 | [
"MIT"
] | 8 | 2017-02-23T19:24:43.000Z | 2018-07-10T20:58:52.000Z | aquests/dbapi/asynmongo.py | hansroh/aquests | 9de84cfff84ff5d5179d16c5c1f7be3487516843 | [
"MIT"
] | 1 | 2017-02-23T19:52:51.000Z | 2017-02-25T04:05:34.000Z | aquests/dbapi/asynmongo.py | hansroh/aquests | 9de84cfff84ff5d5179d16c5c1f7be3487516843 | [
"MIT"
] | null | null | null | from . import asynredis
import socket
import struct
DEBUG = True
MAXINT = 2 ** (struct.Struct('i').size * 8 - 1) - 1
class MongoDBError (Exception):
pass
def _unpack_response(data, op_code, request_id = None):
# this function had been removed from pymong 3.4
if op_code == 1:
response_flag, cursor... | 37.713781 | 132 | 0.600675 |
7ba3866ac67c18495ce68b1b4d5686900e2d0da9 | 10,708 | py | Python | astroML/correlation.py | arjunsavel/astroML | 361cadc56360ca35c760405a341e35ecab6dd585 | [
"BSD-2-Clause"
] | 1 | 2020-10-28T14:45:48.000Z | 2020-10-28T14:45:48.000Z | astroML/correlation.py | awesomemachinelearning/astroML | d378ca41565d1aa39997191d13d46d09d104ff1d | [
"BSD-2-Clause"
] | 1 | 2018-05-18T19:32:15.000Z | 2018-05-18T19:32:15.000Z | astroML/correlation.py | DinoBektesevic/astroML | b4e699bf45a65e233b40d60323c05eafa1d4955e | [
"BSD-2-Clause"
] | 1 | 2019-06-13T00:19:11.000Z | 2019-06-13T00:19:11.000Z | """
Tools for computing two-point correlation functions.
"""
import numpy as np
from sklearn.neighbors import KDTree
from sklearn.utils import check_random_state
def uniform_sphere(RAlim, DEClim, size=1):
"""Draw a uniform sample on a sphere
Parameters
----------
RAlim : tuple
select Right ... | 30.334278 | 75 | 0.613093 |
9ea996d8e3a5da8d386df775fcaf7e0f5dd6e51d | 121 | py | Python | codes_auto/1691.minimum-number-of-days-to-disconnect-island.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/1691.minimum-number-of-days-to-disconnect-island.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/1691.minimum-number-of-days-to-disconnect-island.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=1691 lang=python3
#
# [1691] minimum-number-of-days-to-disconnect-island
#
None
# @lc code=end | 17.285714 | 52 | 0.710744 |
8637b982bdbe6b60f756dce96c316dc5ca54b86d | 6,120 | py | Python | segmentation/utils/eval.py | microsoft/SNR | f3d51b5e3525fe5e1ea364fafdf0e4cc60b1362b | [
"MIT"
] | 44 | 2021-01-12T03:05:12.000Z | 2022-03-28T09:05:47.000Z | segmentation/utils/eval.py | microsoft/SNR | f3d51b5e3525fe5e1ea364fafdf0e4cc60b1362b | [
"MIT"
] | 7 | 2021-03-16T07:13:16.000Z | 2022-02-02T14:52:55.000Z | segmentation/utils/eval.py | microsoft/SNR | f3d51b5e3525fe5e1ea364fafdf0e4cc60b1362b | [
"MIT"
] | 8 | 2021-01-15T15:09:25.000Z | 2021-12-21T13:34:51.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import time
import numpy as np
import torch
from PIL import Image
from datasets.cityscapes_Dataset import name_classes
np.seterr(divide='ignore', invalid='ignore')
synthia_set_16 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 1... | 46.363636 | 120 | 0.637745 |
b213ce85d1f38db81ccda1286164629e87fb835e | 2,073 | py | Python | src/data.py | yaz-saleh/532-group11 | d6dd8c6e495df39209f787887d2b18260798a958 | [
"MIT"
] | 1 | 2021-02-21T12:04:29.000Z | 2021-02-21T12:04:29.000Z | src/data.py | yaz-saleh/532-group11 | d6dd8c6e495df39209f787887d2b18260798a958 | [
"MIT"
] | 28 | 2021-01-13T04:36:51.000Z | 2021-02-13T20:18:51.000Z | src/data.py | yaz-saleh/532-group11 | d6dd8c6e495df39209f787887d2b18260798a958 | [
"MIT"
] | 3 | 2021-01-13T04:28:27.000Z | 2021-01-16T05:31:26.000Z | import pandas as pd
import altair as alt
import numpy as np
def read_data():
## read data
raw = pd.read_csv("data/raw/tmdb_movies_data.csv", parse_dates=True)
## data processing
processed = raw[raw["revenue_adj"] != 0]
processed = processed[processed["budget_adj"] != 0]
## motify release dat... | 32.904762 | 87 | 0.649783 |
4a9afa6c136b357e166d8272199365ecaf0d6e92 | 7,022 | py | Python | src/shift_rotate_util.py | itailang/geometric_adv | 1d7ac83e5d665e8f9147bd23965a60f886e715c4 | [
"MIT"
] | 21 | 2020-12-11T02:34:42.000Z | 2022-02-04T05:40:49.000Z | src/shift_rotate_util.py | itailang/geometric_adv | 1d7ac83e5d665e8f9147bd23965a60f886e715c4 | [
"MIT"
] | 2 | 2020-12-28T08:24:42.000Z | 2021-07-22T08:15:35.000Z | src/shift_rotate_util.py | itailang/geometric_adv | 1d7ac83e5d665e8f9147bd23965a60f886e715c4 | [
"MIT"
] | 1 | 2021-07-11T13:59:40.000Z | 2021-07-11T13:59:40.000Z | import numpy as np
import tensorflow as tf
def scale_object(data, scale):
center = (np.max(data, axis=0) + np.min(data, axis=0)) / 2
data_centered = data - np.expand_dims(center, axis=0)
norm = np.linalg.norm(data_centered, axis=1)
radius = np.max(norm)
data_normed = (data / radius) * scale
r... | 32.813084 | 149 | 0.600826 |
a266f37c4b78f89b850b39eaad53fc585dd43835 | 2,718 | py | Python | NSE_Data_Science_001/NSE01-venv/Lib/site-packages/pylint/checkers/refactoring/__init__.py | Stoned-KING/Python_Projects | 33cd9daf5252e0458b15348268f0c244b03646a7 | [
"MIT"
] | null | null | null | NSE_Data_Science_001/NSE01-venv/Lib/site-packages/pylint/checkers/refactoring/__init__.py | Stoned-KING/Python_Projects | 33cd9daf5252e0458b15348268f0c244b03646a7 | [
"MIT"
] | null | null | null | NSE_Data_Science_001/NSE01-venv/Lib/site-packages/pylint/checkers/refactoring/__init__.py | Stoned-KING/Python_Projects | 33cd9daf5252e0458b15348268f0c244b03646a7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016-2017 Łukasz Rogalski <rogalski.91@gmail.com>
# Copyright (c) 2016 Moises Lopez <moylop260@vauxoo.com>
# Copyright (c) 2016 Alexander Todorov <atodorov@otb.bg>
# Copyright (c) 2017-2018 hippo91 <guillaume.peillex@... | 51.283019 | 85 | 0.770052 |
5e40211a73d2a91343675c4710133d08e12ad335 | 2,375 | py | Python | userbot/__main__.py | xditya/Plus | 743dfb6046db4e903ae66e64e27e11db7b78dca1 | [
"MIT"
] | 1 | 2021-02-16T05:36:03.000Z | 2021-02-16T05:36:03.000Z | userbot/__main__.py | xditya/Plus | 743dfb6046db4e903ae66e64e27e11db7b78dca1 | [
"MIT"
] | null | null | null | userbot/__main__.py | xditya/Plus | 743dfb6046db4e903ae66e64e27e11db7b78dca1 | [
"MIT"
] | null | null | null | from userbot import bot
from sys import argv
import sys
from telethon.errors.rpcerrorlist import PhoneNumberInvalidError
import os
from telethon import TelegramClient
from var import Var
from userbot.utils import load_module
from userbot import LOAD_PLUG, BOTLOG_CHATID, LOGS, PLUG
from pathlib import Path
import asynci... | 31.666667 | 274 | 0.713263 |
e3dfe9fe239a8abd34c81f4a73e58ee96246bf48 | 4,952 | py | Python | test/integration/ggrc/converters/test_import_audit.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-08-26T06:56:01.000Z | 2021-07-08T13:56:20.000Z | test/integration/ggrc/converters/test_import_audit.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-02-02T23:04:30.000Z | 2022-03-02T09:54:47.000Z | test/integration/ggrc/converters/test_import_audit.py | pbedn/ggrc-core | 12ae4720a430730835f1d02def62c0f6ef453521 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2016-08-23T10:51:19.000Z | 2016-08-23T10:51:19.000Z | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Test import of Audit and mapped objects."""
from collections import OrderedDict
from ggrc.models import all_models
from ggrc.converters import errors
from integration.ggrc import TestCase
from integrat... | 34.873239 | 78 | 0.628433 |
272ca60017a2664748bb024e9b20a2a12c4e1578 | 798 | py | Python | setup.py | datopian/ckanext-cloudstorage | d679b7108b2e5c00507d5d57b8cb9488f4125672 | [
"MIT"
] | null | null | null | setup.py | datopian/ckanext-cloudstorage | d679b7108b2e5c00507d5d57b8cb9488f4125672 | [
"MIT"
] | 2 | 2022-02-09T11:44:44.000Z | 2022-02-22T11:41:45.000Z | setup.py | datopian/ckanext-cloudstorage | d679b7108b2e5c00507d5d57b8cb9488f4125672 | [
"MIT"
] | 1 | 2022-01-31T11:27:22.000Z | 2022-01-31T11:27:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='ckanext-cloudstorage',
version='0.1.1',
description='Cloud storage for CKAN',
classifiers=[],
keywords='',
author='Tyler Kennedy',
author_email='tk@tkte.ch',
url='http://github.com/ope... | 24.9375 | 70 | 0.64787 |
18f46e1d5f04d04281ad60cb9951ca2e0d3183ec | 39,062 | py | Python | src/necsuf_tabular_text.py | limorigu/LENS | 407429ad5c9f978ab9c9c6a2d13daf06841e13f6 | [
"CC0-1.0"
] | 4 | 2021-06-11T15:03:30.000Z | 2022-03-11T16:53:55.000Z | src/necsuf_tabular_text.py | limorigu/LENS | 407429ad5c9f978ab9c9c6a2d13daf06841e13f6 | [
"CC0-1.0"
] | null | null | null | src/necsuf_tabular_text.py | limorigu/LENS | 407429ad5c9f978ab9c9c6a2d13daf06841e13f6 | [
"CC0-1.0"
] | null | null | null | import numpy as np
import pandas as pd
from scipy import stats
import itertools
import time
import pdb
from operator import itemgetter
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LinearRegression
import statsmodels.formula.a... | 45.210648 | 117 | 0.557678 |
522711087da817f90367ccec2a462095744b54e9 | 30,984 | py | Python | models/AttModel.py | quanha72/Object-Relation-Transformer-PhoW2V | 3edaec3a4c457590e3f55eff4bf9d939fa7d4f30 | [
"MIT"
] | null | null | null | models/AttModel.py | quanha72/Object-Relation-Transformer-PhoW2V | 3edaec3a4c457590e3f55eff4bf9d939fa7d4f30 | [
"MIT"
] | null | null | null | models/AttModel.py | quanha72/Object-Relation-Transformer-PhoW2V | 3edaec3a4c457590e3f55eff4bf9d939fa7d4f30 | [
"MIT"
] | null | null | null | # This file contains Att2in2, AdaAtt, AdaAttMO, TopDown model
# AdaAtt is from Knowing When to Look: Adaptive Attention via A Visual Sentinel for Image Captioning
# https://arxiv.org/abs/1612.01887
# AdaAttMO is a modified version with maxout lstm
# Att2in is from Self-critical Sequence Training for Image Captioning
... | 44.645533 | 179 | 0.625807 |
08879611d64ba1bc6a5ae4736ff3c9c7b9a06fb2 | 111 | py | Python | server/flask/config/dev.py | eonuallain/dcomp | 49e65b8576ef663b8566566000b24f634ddf33aa | [
"MIT"
] | null | null | null | server/flask/config/dev.py | eonuallain/dcomp | 49e65b8576ef663b8566566000b24f634ddf33aa | [
"MIT"
] | null | null | null | server/flask/config/dev.py | eonuallain/dcomp | 49e65b8576ef663b8566566000b24f634ddf33aa | [
"MIT"
] | null | null | null | DB_HOST='127.0.0.1'
DB_SCHEMA='dcomp'
DB_USER='root'
DB_PASSWORD='admin'
FLASK_HOST='0.0.0.0'
FLASK_DEBUG=True | 15.857143 | 20 | 0.747748 |
7eec424d7940691bc09095c7479b9a1ac120959c | 712 | py | Python | OOP/Shop/project/product_repository.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | 2 | 2022-03-05T13:17:12.000Z | 2022-03-05T13:17:16.000Z | OOP/Shop/project/product_repository.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | OOP/Shop/project/product_repository.py | petel3/Softuni_education | 4fd80f8c6ce6c3d6a838edecdb091dda2ed1084c | [
"MIT"
] | null | null | null | from project.product import Product
class ProductRepository:
def __init__(self):
self.products = []
def add(self,product:Product):
self.products.append(product)
def find(self,product_name):
for product in self.products:
if product.name==product_name:
r... | 25.428571 | 58 | 0.59691 |
6c7e69365f6715ea494bfa0e3aa44b1c062b6706 | 3,048 | py | Python | Algo/SSD/layers/functions/detection.py | ashwath007/aminity-detection | acb885eb4d791acc6e65237445a4fc6830e4d30c | [
"Apache-2.0"
] | 1 | 2021-01-18T11:18:25.000Z | 2021-01-18T11:18:25.000Z | Algo/SSD/layers/functions/detection.py | ashwath007/aminity-detection | acb885eb4d791acc6e65237445a4fc6830e4d30c | [
"Apache-2.0"
] | null | null | null | Algo/SSD/layers/functions/detection.py | ashwath007/aminity-detection | acb885eb4d791acc6e65237445a4fc6830e4d30c | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.autograd import Function
from torch.autograd import Variable
from ..box_utils import decode, nms
from data import v2 as cfg
class Detect(Function):
"""At test time, Detect is the final layer of SSD. Decode location preds,
appl... | 42.333333 | 79 | 0.59416 |
637abca4a8694d38542c70d42f437b6f255a0e94 | 757 | py | Python | clang_test.py | sebsgit/rift | 8c6a19c0d801a75513c517eea06d3b945d2df3b9 | [
"MIT"
] | null | null | null | clang_test.py | sebsgit/rift | 8c6a19c0d801a75513c517eea06d3b945d2df3b9 | [
"MIT"
] | null | null | null | clang_test.py | sebsgit/rift | 8c6a19c0d801a75513c517eea06d3b945d2df3b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
""" Usage: call with <filename>
"""
import sys
import clang.cindex
def find_class_decls(node):
if node.kind == clang.cindex.CursorKind.CLASS_DECL:
print(node.spelling)
# Recurse for children of this node
for c in node.get_children():
if c.kind == clang.cindex.CursorKi... | 31.541667 | 81 | 0.668428 |
a0e90839377f026485341bf632a75414a37f192b | 666 | py | Python | tests/test_imports.py | brl0/imported | 6d55726d3b821dcf0b1f901bbd25044d251670ae | [
"MIT"
] | null | null | null | tests/test_imports.py | brl0/imported | 6d55726d3b821dcf0b1f901bbd25044d251670ae | [
"MIT"
] | null | null | null | tests/test_imports.py | brl0/imported | 6d55726d3b821dcf0b1f901bbd25044d251670ae | [
"MIT"
] | null | null | null | """Test for imported module."""
import imported
def test_get_version(module):
"""Test get_version function."""
assert imported.get_version(module) == "1"
def test_has_version(module):
"""Test has_version function."""
assert imported.has_version(module)
def test_get_imported(context... | 22.2 | 47 | 0.675676 |
2777fdacd4f7fa4e6a3b7828f5006955690cb94c | 7,047 | py | Python | examples/xf23id1_conf.py | dchabot/ophyd_hkl | 60cb3c3a695898d35ad7b513951bf4470a40711f | [
"BSD-3-Clause"
] | null | null | null | examples/xf23id1_conf.py | dchabot/ophyd_hkl | 60cb3c3a695898d35ad7b513951bf4470a40711f | [
"BSD-3-Clause"
] | null | null | null | examples/xf23id1_conf.py | dchabot/ophyd_hkl | 60cb3c3a695898d35ad7b513951bf4470a40711f | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ophyd import EpicsMotor, EpicsScaler, PVPositioner, EpicsSignal
from ophyd import SimDetector
from ophyd import ProsilicaDetector
from ophyd.userapi import *
import logging
from pyOlog.OlogHandler import OlogHandler
# Undulator
epu1_gap = PVPositioner('XF:23ID-ID{EPU:1-Ax:Gap}Pos-SP',
... | 43.233129 | 79 | 0.591315 |
69329f26ba6301e8cc4b82b5e76ea6f90767f01e | 9,042 | py | Python | tests/test_connections.py | mjcaley/spamc | 67c4f2b13d569238ea24794eb5253a1416226a2a | [
"MIT"
] | null | null | null | tests/test_connections.py | mjcaley/spamc | 67c4f2b13d569238ea24794eb5253a1416226a2a | [
"MIT"
] | null | null | null | tests/test_connections.py | mjcaley/spamc | 67c4f2b13d569238ea24794eb5253a1416226a2a | [
"MIT"
] | null | null | null | import asyncio
import ssl
import sys
from pathlib import Path
import pytest
from aiospamc.connections import (
ConnectionManager,
TcpConnectionManager,
UnixConnectionManager,
Timeout,
new_connection_manager,
new_ssl_context,
)
from aiospamc.exceptions import AIOSpamcConnectionFailed, ClientTim... | 27.821538 | 88 | 0.750498 |
01324e02fa7522d87ad8ac0667086dbb66ddf99b | 6,662 | py | Python | tools/create_tiles.py | astutespruce/salcc_blueprint2 | 9dd4dfe47ca13051f1c3a6eca90b17d4b0aefaa1 | [
"MIT"
] | null | null | null | tools/create_tiles.py | astutespruce/salcc_blueprint2 | 9dd4dfe47ca13051f1c3a6eca90b17d4b0aefaa1 | [
"MIT"
] | 7 | 2020-09-04T17:47:11.000Z | 2021-07-20T01:36:04.000Z | tools/create_tiles.py | astutespruce/salcc_blueprint2 | 9dd4dfe47ca13051f1c3a6eca90b17d4b0aefaa1 | [
"MIT"
] | 1 | 2019-08-15T21:38:15.000Z | 2019-08-15T21:38:15.000Z | import os
import json
from datatiles.encoding import encode_tifs
from datatiles.mbtiles import tif_to_mbtiles, render_tif_to_mbtiles
max_zoom = 15
datatiles_tile_size = (
128
) # Note: this must be set into 'imageSize' in the corresponding Leaflet.DataTileLayer in the frontend
data_dir = "/Volumes/data/projects... | 34.340206 | 103 | 0.592014 |
ef26722859b6d5ec8066856185db58baeea41226 | 906 | py | Python | airtest/core/settings.py | laiiihz/Airtest | 07654ee5e4d33c4610c4cdfd7dc5af615a0a411d | [
"Apache-2.0"
] | 1 | 2021-02-01T05:59:21.000Z | 2021-02-01T05:59:21.000Z | airtest/core/settings.py | WangGd0/Airtest | 07654ee5e4d33c4610c4cdfd7dc5af615a0a411d | [
"Apache-2.0"
] | null | null | null | airtest/core/settings.py | WangGd0/Airtest | 07654ee5e4d33c4610c4cdfd7dc5af615a0a411d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from airtest.utils.resolution import cocos_min_strategy
import os
class Settings(object):
DEBUG = False
LOG_DIR = None
LOG_FILE = "log.txt"
RESIZE_METHOD = staticmethod(cocos_min_strategy)
CVSTRATEGY = ["surf", "tpl", "brisk"] # keypoint matching: kaze/brisk/akaze/orb, co... | 39.391304 | 111 | 0.703091 |
564696050a15b7227d1f0757205515c83e35bd68 | 2,665 | py | Python | PythonAPI/examples/start_replaying.py | zakur0/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | [
"MIT"
] | 7,883 | 2017-11-10T16:49:23.000Z | 2022-03-31T18:48:47.000Z | PythonAPI/examples/start_replaying.py | zakur0/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | [
"MIT"
] | 4,558 | 2017-11-10T17:45:30.000Z | 2022-03-31T23:30:02.000Z | PythonAPI/examples/start_replaying.py | zakur0/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | [
"MIT"
] | 2,547 | 2017-11-13T03:22:44.000Z | 2022-03-31T10:39:30.000Z | #!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import glob
import os
import sys
try:
sys.path.append(glob.glob('../carl... | 25.141509 | 117 | 0.585366 |
3d50a925df9b5dafcfcdb2d7bf2853d03cc14cb8 | 8,876 | py | Python | main/views_export.py | geoah/mataroa | 5646af778bca8625b2d5efa4ebcfbe69a5f7dd12 | [
"MIT"
] | null | null | null | main/views_export.py | geoah/mataroa | 5646af778bca8625b2d5efa4ebcfbe69a5f7dd12 | [
"MIT"
] | null | null | null | main/views_export.py | geoah/mataroa | 5646af778bca8625b2d5efa4ebcfbe69a5f7dd12 | [
"MIT"
] | null | null | null | import io
import uuid
import zipfile
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render
from main import models
def prepend_zola_frontmatter(body, post_title, pub_date):
frontmatter = "+++\n"
frontmatter += f'title = "{post_titl... | 40.52968 | 86 | 0.603876 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.