hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9170343444c1172d149626528603249b2f63831c | 370 | py | Python | count_files.py | xuannianc/keras-retinanet | d1da39592042927aaf3b3eb905a308c327983bed | [
"Apache-2.0"
] | null | null | null | count_files.py | xuannianc/keras-retinanet | d1da39592042927aaf3b3eb905a308c327983bed | [
"Apache-2.0"
] | null | null | null | count_files.py | xuannianc/keras-retinanet | d1da39592042927aaf3b3eb905a308c327983bed | [
"Apache-2.0"
] | null | null | null | import csv
vat_filenames = set()
train_csv_filename = 'train_annotations.csv'
val_csv_filename = 'val_annotations.csv'
for csv_filename in [train_csv_filename, val_csv_filename]:
for line in csv.reader(open(csv_filename)):
vat_filename = line[0].split('/')[-1]
vat_filenames.add(vat_filename)
pr... | 30.833333 | 59 | 0.735135 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 0.127027 |
917058eae76c95edb3644d77520d9eb1f3e8a1e9 | 8,908 | py | Python | liberaforms/views/admin.py | ngi-nix/liberaforms | 5882994736292e7ab34c4c9207805b307478a6c7 | [
"MIT"
] | 3 | 2021-09-02T16:45:42.000Z | 2022-02-21T19:06:25.000Z | liberaforms/views/admin.py | ngi-nix/liberaforms | 5882994736292e7ab34c4c9207805b307478a6c7 | [
"MIT"
] | 2 | 2021-08-17T04:13:10.000Z | 2021-09-14T22:48:21.000Z | liberaforms/views/admin.py | ngi-nix/liberaforms | 5882994736292e7ab34c4c9207805b307478a6c7 | [
"MIT"
] | 1 | 2021-08-17T07:13:15.000Z | 2021-08-17T07:13:15.000Z | """
This file is part of LiberaForms.
# SPDX-FileCopyrightText: 2020 LiberaForms.org
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
import os, json
from flask import g, request, render_template, redirect
from flask import session, flash, Blueprint
from flask import send_file, after_this_request
from flask_babel imp... | 36.064777 | 84 | 0.635608 | 0 | 0 | 0 | 0 | 7,869 | 0.883363 | 0 | 0 | 2,180 | 0.244724 |
91705feef5320bb231c5d61b510ee6321361c934 | 29,405 | py | Python | python/zephyr/datasets/score_dataset.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | 18 | 2021-05-27T04:40:38.000Z | 2022-02-08T19:46:31.000Z | python/zephyr/datasets/score_dataset.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | null | null | null | python/zephyr/datasets/score_dataset.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | 2 | 2021-11-07T12:42:00.000Z | 2022-03-01T12:51:54.000Z | import os, copy
import cv2
from functools import partial
import numpy as np
import torch
import torchvision
from torch.utils.data import Dataset
from zephyr.data_util import to_np, vectorize, img2uint8
from zephyr.utils import torch_norm_fast
from zephyr.utils.mask_edge import getRendEdgeScore
from zephyr... | 44.218045 | 167 | 0.534875 | 28,703 | 0.976127 | 0 | 0 | 0 | 0 | 0 | 0 | 4,461 | 0.151709 |
91708273d963214e9092983f15d8ef3340677e15 | 814 | py | Python | em Python/Roteiro7/Roteiro7__testes_dijkstra.py | GuilhermeEsdras/Grafos | b6556c3d679496d576f65b798a1a584cd73e40f4 | [
"MIT"
] | null | null | null | em Python/Roteiro7/Roteiro7__testes_dijkstra.py | GuilhermeEsdras/Grafos | b6556c3d679496d576f65b798a1a584cd73e40f4 | [
"MIT"
] | null | null | null | em Python/Roteiro7/Roteiro7__testes_dijkstra.py | GuilhermeEsdras/Grafos | b6556c3d679496d576f65b798a1a584cd73e40f4 | [
"MIT"
] | null | null | null | from Roteiro7.Roteiro7__funcoes import GrafoComPesos
# .:: Arquivo de Testes do Algoritmo de Dijkstra ::. #
# --------------------------------------------------------------------------- #
grafo_aula = GrafoComPesos(
['E', 'A', 'B', 'C', 'D'],
{
'E-A': 1,
'E-C': 10,
'A-B': 2,
'B... | 22.611111 | 79 | 0.395577 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 343 | 0.421376 |
9170b4be66538fa8e6767525842e58971759fde7 | 356 | py | Python | QScreenCast/spyder/api.py | awinia-github/QScreenCast | 09d343cae0a1c7f86faf28e08a62bd09976aaf2e | [
"MIT"
] | null | null | null | QScreenCast/spyder/api.py | awinia-github/QScreenCast | 09d343cae0a1c7f86faf28e08a62bd09976aaf2e | [
"MIT"
] | null | null | null | QScreenCast/spyder/api.py | awinia-github/QScreenCast | 09d343cae0a1c7f86faf28e08a62bd09976aaf2e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © Tom Hören
# Licensed under the terms of the MIT License
# ----------------------------------------------------------------------------
"""
Python QtScreenCaster Spyder API.
"""
class ScreenResolutions... | 25.428571 | 78 | 0.38764 | 58 | 0.162011 | 0 | 0 | 0 | 0 | 0 | 0 | 301 | 0.840782 |
917377628f552efbcce428798dd528e6e5fe7134 | 4,196 | py | Python | setup.py | aaron19950321/ICOM | d5bd0705776c505dd1df0a1c76a07fee2d218394 | [
"PSF-2.0",
"BSD-3-Clause"
] | 5 | 2018-10-09T13:39:31.000Z | 2020-03-26T18:39:49.000Z | setup.py | aaron19950321/ICOM | d5bd0705776c505dd1df0a1c76a07fee2d218394 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | setup.py | aaron19950321/ICOM | d5bd0705776c505dd1df0a1c76a07fee2d218394 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2018-10-09T13:39:36.000Z | 2018-10-09T23:18:39.000Z | import os, os.path
import subprocess
from distutils.core import setup
from py2exe.build_exe import py2exe
PROGRAM_NAME = 'icom_app'
PROGRAM_DESC = 'simple icom app'
NSIS_SCRIPT_TEMPLATE = r"""
!define py2exeOutputDirectory '{output_dir}\'
!define exe '{program_name}.exe'
; Uses solid LZMA compression. Ca... | 30.18705 | 81 | 0.580076 | 1,956 | 0.466158 | 0 | 0 | 0 | 0 | 0 | 0 | 2,041 | 0.486416 |
91762cf01e789ac760eedf4942c7a866b5214252 | 632 | py | Python | src/lingcomp/farm/features.py | CharlottePouw/interpreting-complexity | b9a73c0aff18e4c6b4209a6511d00639494c70da | [
"Apache-2.0"
] | 2 | 2020-12-18T12:26:22.000Z | 2020-12-19T18:47:07.000Z | src/lingcomp/farm/features.py | CharlottePouw/interpreting-complexity | b9a73c0aff18e4c6b4209a6511d00639494c70da | [
"Apache-2.0"
] | null | null | null | src/lingcomp/farm/features.py | CharlottePouw/interpreting-complexity | b9a73c0aff18e4c6b4209a6511d00639494c70da | [
"Apache-2.0"
] | 1 | 2021-05-19T13:39:45.000Z | 2021-05-19T13:39:45.000Z | import torch
from farm.data_handler.samples import Sample
from farm.modeling.prediction_head import RegressionHead
class FeaturesEmbeddingSample(Sample):
def __init__(self, id, clear_text, tokenized=None, features=None, feat_embeds=None):
super().__init__(id, clear_text, tokenized, features)
self.... | 31.6 | 88 | 0.724684 | 511 | 0.808544 | 0 | 0 | 0 | 0 | 0 | 0 | 92 | 0.14557 |
9176396ea025090d1e564363b18149e19bf37323 | 5,057 | py | Python | manager/tests/api_view_test_classes.py | UN-ICC/icc-digital-id-manager | aca0109b3202b292145326ec5523ee8f24691a83 | [
"Apache-2.0"
] | 3 | 2021-02-03T16:37:19.000Z | 2022-02-07T09:59:03.000Z | manager/tests/api_view_test_classes.py | UN-ICC/icc-digital-id-manager | aca0109b3202b292145326ec5523ee8f24691a83 | [
"Apache-2.0"
] | null | null | null | manager/tests/api_view_test_classes.py | UN-ICC/icc-digital-id-manager | aca0109b3202b292145326ec5523ee8f24691a83 | [
"Apache-2.0"
] | 2 | 2021-02-10T16:03:31.000Z | 2022-02-07T08:50:16.000Z | import pytest
from rest_framework import status
from rest_framework.test import APIClient
class TestBase:
__test__ = False
path = None
get_data = {}
put_data = {}
post_data = {}
delete_data = {}
requires_auth = True
implements_retrieve = False
implements_create = False
implemen... | 31.02454 | 84 | 0.721376 | 4,287 | 0.847736 | 0 | 0 | 714 | 0.14119 | 0 | 0 | 90 | 0.017797 |
9176ff87702ba5b114dba78865e902b3d3390b83 | 2,259 | py | Python | dashboard/dashboard.py | TrustyJAID/Toxic-Cogs | 870d92067ba2a99b9ade2f957f945b95fdbc80f7 | [
"MIT"
] | null | null | null | dashboard/dashboard.py | TrustyJAID/Toxic-Cogs | 870d92067ba2a99b9ade2f957f945b95fdbc80f7 | [
"MIT"
] | null | null | null | dashboard/dashboard.py | TrustyJAID/Toxic-Cogs | 870d92067ba2a99b9ade2f957f945b95fdbc80f7 | [
"MIT"
] | null | null | null | from collections import defaultdict
import discord
from redbot.core import Config, checks, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import box, humanize_list, inline
from abc import ABC
# ABC Mixins
from dashboard.abc.abc import MixinMeta
from dashboard.abc.mixin impor... | 30.945205 | 110 | 0.657371 | 1,391 | 0.615759 | 0 | 0 | 0 | 0 | 150 | 0.066401 | 411 | 0.181939 |
91773a1b99193243fe941616b2fc5339f203eb98 | 410 | py | Python | algorithms/162.Find-Peak-Element/Python/solution_2.py | hopeness/leetcode | 496455fa967f0704d729b4014f92f52b1d69d690 | [
"MIT"
] | null | null | null | algorithms/162.Find-Peak-Element/Python/solution_2.py | hopeness/leetcode | 496455fa967f0704d729b4014f92f52b1d69d690 | [
"MIT"
] | null | null | null | algorithms/162.Find-Peak-Element/Python/solution_2.py | hopeness/leetcode | 496455fa967f0704d729b4014f92f52b1d69d690 | [
"MIT"
] | null | null | null | """
https://leetcode.com/problems/find-peak-element/submissions/
"""
from typing import List
class Solution:
def findPeakElement(self, nums: List[int]) -> int:
l, r = 0, len(nums)-1
while l < r:
lmid = (l + r) // 2
rmid = lmid + 1
if nums[lmid] < nums[rmid]:
... | 22.777778 | 60 | 0.473171 | 314 | 0.765854 | 0 | 0 | 0 | 0 | 0 | 0 | 68 | 0.165854 |
9177bf15b6da687a6ae646c46fc3addf65d8004a | 2,684 | py | Python | data_loader.py | vinbigdata-medical/MIDL2021-Xray-Classification | 51359126d07573053059c36e3cd95a7fd7100e0e | [
"MIT"
] | 4 | 2021-04-14T08:04:08.000Z | 2021-08-10T10:15:00.000Z | data_loader.py | vinbigdata-medical/MIDL2021-Xray-Classification | 51359126d07573053059c36e3cd95a7fd7100e0e | [
"MIT"
] | 1 | 2022-01-13T12:51:31.000Z | 2022-01-13T12:51:31.000Z | data_loader.py | vinbigdata-medical/MIDL2021-Xray-Classification | 51359126d07573053059c36e3cd95a7fd7100e0e | [
"MIT"
] | null | null | null | from torchvision.datasets import ImageFolder
from torchvision import transforms
import random
import os
import torch
from torch.utils.data.dataloader import DataLoader
from utils import constants, get_default_device
from image_folder_with_path import ImageFolderWithPaths
def to_device(data, device):
"""Move tensor... | 37.277778 | 118 | 0.770492 | 421 | 0.156855 | 153 | 0.057004 | 0 | 0 | 0 | 0 | 713 | 0.265648 |
9177c031d705388dfe8031bad5b727ad1032aa9e | 4,254 | py | Python | calliope/test/test_analysis.py | sjpfenninger/calliope | a4e49c3b7d37f908bafc84543510eec0b4cf5d9f | [
"Apache-2.0"
] | 1 | 2019-11-11T15:50:16.000Z | 2019-11-11T15:50:16.000Z | calliope/test/test_analysis.py | mhdella/calliope | a4e49c3b7d37f908bafc84543510eec0b4cf5d9f | [
"Apache-2.0"
] | null | null | null | calliope/test/test_analysis.py | mhdella/calliope | a4e49c3b7d37f908bafc84543510eec0b4cf5d9f | [
"Apache-2.0"
] | 1 | 2019-11-11T15:50:18.000Z | 2019-11-11T15:50:18.000Z | # import matplotlib
# matplotlib.use('Qt5Agg') # Prevents `Invalid DISPLAY variable` errors
import pytest
import tempfile
from calliope import Model
from calliope.utils import AttrDict
from calliope import analysis
from . import common
from .common import assert_almost_equal, solver, solver_io
import matplotlib.p... | 36.672414 | 99 | 0.603197 | 3,846 | 0.90409 | 0 | 0 | 1,378 | 0.32393 | 0 | 0 | 1,410 | 0.331453 |
917a6b3b8a05d7c695e7c6d3cb38a9324f5ab905 | 302 | py | Python | mol/data/reader.py | TzuTingWei/mol | 9499925443f389d8e960b6d656f2953d21df3e3b | [
"MIT"
] | null | null | null | mol/data/reader.py | TzuTingWei/mol | 9499925443f389d8e960b6d656f2953d21df3e3b | [
"MIT"
] | null | null | null | mol/data/reader.py | TzuTingWei/mol | 9499925443f389d8e960b6d656f2953d21df3e3b | [
"MIT"
] | null | null | null | import os
from mol.util import read_xyz
dirname = os.path.dirname(os.path.abspath(__file__))
filename = os.path.join(dirname, 'look_and_say.dat')
with open(filename, 'r') as handle:
look_and_say = handle.read()
def get_molecule(filename):
return read_xyz(os.path.join(dirname, filename + ".xyz"))
| 25.166667 | 58 | 0.748344 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0.089404 |
917a93c6b5689f031c6779f12176c0d60e186575 | 13,198 | py | Python | cinder/tests/unit/targets/test_spdknvmf.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2015-04-02T21:44:36.000Z | 2016-04-29T21:19:04.000Z | cinder/tests/unit/targets/test_spdknvmf.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2016-04-29T21:45:26.000Z | 2016-05-04T19:41:23.000Z | cinder/tests/unit/targets/test_spdknvmf.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 4 | 2016-01-27T00:25:52.000Z | 2021-03-25T19:54:08.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 32.268949 | 78 | 0.539855 | 7,610 | 0.576603 | 0 | 0 | 0 | 0 | 0 | 0 | 4,113 | 0.311638 |
917afbcd55aefac0dcfd4785b8010a4e43b0d1c3 | 4,204 | py | Python | server/algos/euler/transformer.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 2 | 2017-11-27T21:55:21.000Z | 2017-12-30T03:34:40.000Z | server/algos/euler/transformer.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 30 | 2017-09-06T12:00:08.000Z | 2018-06-20T22:47:46.000Z | server/algos/euler/transformer.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 1 | 2021-04-05T13:59:37.000Z | 2021-04-05T13:59:37.000Z | """ This is algos.euler.transformer module.
This module is responsible for transforming raw candle data into training
samples usable to the Euler algorithm.
"""
import datetime
import decimal
from algos.euler.models import training_samples as ts
from core.models import instruments
from datasource.models import... | 35.033333 | 80 | 0.674833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,084 | 0.495718 |
917b4bfe42198de5b3e0fb37cbc4743cf9cac201 | 142 | py | Python | diagrams/outscale/__init__.py | analyticsftw/diagrams | 217af329a323084bb98031ac1768bc2353e6d9b6 | [
"MIT"
] | 17,037 | 2020-02-03T01:30:30.000Z | 2022-03-31T18:09:15.000Z | diagrams/outscale/__init__.py | analyticsftw/diagrams | 217af329a323084bb98031ac1768bc2353e6d9b6 | [
"MIT"
] | 529 | 2020-02-03T10:43:41.000Z | 2022-03-31T17:33:08.000Z | diagrams/outscale/__init__.py | analyticsftw/diagrams | 217af329a323084bb98031ac1768bc2353e6d9b6 | [
"MIT"
] | 1,068 | 2020-02-05T11:54:29.000Z | 2022-03-30T23:28:55.000Z | from diagrams import Node
class _Outscale(Node):
_provider = "outscale"
_icon_dir = "resources/outscale"
fontcolor = "#ffffff"
| 15.777778 | 36 | 0.690141 | 113 | 0.795775 | 0 | 0 | 0 | 0 | 0 | 0 | 39 | 0.274648 |
917b8eb1f8726a411ad6e99afecc5eaca421cc08 | 1,793 | py | Python | misc/python/mango/application/main_driver/logstream.py | pymango/pymango | b55f831f0194b214e746b2dfb4d9c6671a1abc38 | [
"BSD-2-Clause"
] | 3 | 2020-05-11T03:23:17.000Z | 2021-03-16T09:01:48.000Z | misc/python/mango/application/main_driver/logstream.py | pymango/pymango | b55f831f0194b214e746b2dfb4d9c6671a1abc38 | [
"BSD-2-Clause"
] | null | null | null | misc/python/mango/application/main_driver/logstream.py | pymango/pymango | b55f831f0194b214e746b2dfb4d9c6671a1abc38 | [
"BSD-2-Clause"
] | 2 | 2017-03-04T11:03:40.000Z | 2020-08-01T10:01:36.000Z | __doc__ = \
"""
=======================================================================================
Main-driver :obj:`LogStream` variables (:mod:`mango.application.main_driver.logstream`)
=======================================================================================
.. currentmodule:: mango.application.ma... | 25.985507 | 108 | 0.665365 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,115 | 0.621863 |
917c31411ccb8a75122b971cca9ce661e5940151 | 9,680 | py | Python | ucdev/cy7c65211/header.py | luftek/python-ucdev | 8d3c46d25551f1237e6a2f7a90d54c24bcb1d4f9 | [
"MIT"
] | 11 | 2015-07-08T01:28:01.000Z | 2022-01-26T14:29:47.000Z | ucdev/cy7c65211/header.py | luftek/python-ucdev | 8d3c46d25551f1237e6a2f7a90d54c24bcb1d4f9 | [
"MIT"
] | 5 | 2017-12-07T15:04:00.000Z | 2021-06-02T14:47:14.000Z | ucdev/cy7c65211/header.py | tai/python-ucdev | 8d3c46d25551f1237e6a2f7a90d54c24bcb1d4f9 | [
"MIT"
] | 4 | 2017-02-18T18:20:13.000Z | 2022-03-23T16:21:20.000Z | # -*- coding: utf-8-unix -*-
import platform
######################################################################
# Platform specific headers
######################################################################
if platform.system() == 'Linux':
src = """
typedef bool BOOL;
"""
#############################... | 25.882353 | 70 | 0.71095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9,609 | 0.992665 |
917c654b7225932aa925e3dba908d54b0c600e75 | 565 | py | Python | deep_qa/layers/wrappers/output_mask.py | richarajpal/deep_qa | d918335a1bed71b9cfccf1d5743321cee9c61952 | [
"Apache-2.0"
] | 459 | 2017-02-08T13:40:17.000Z | 2021-12-12T12:57:48.000Z | deep_qa/layers/wrappers/output_mask.py | richarajpal/deep_qa | d918335a1bed71b9cfccf1d5743321cee9c61952 | [
"Apache-2.0"
] | 176 | 2017-01-26T01:19:41.000Z | 2018-04-22T19:16:01.000Z | deep_qa/layers/wrappers/output_mask.py | richarajpal/deep_qa | d918335a1bed71b9cfccf1d5743321cee9c61952 | [
"Apache-2.0"
] | 154 | 2017-01-26T01:00:30.000Z | 2021-02-05T10:44:42.000Z | from overrides import overrides
from ..masked_layer import MaskedLayer
class OutputMask(MaskedLayer):
"""
This Layer is purely for debugging. You can wrap this on a layer's output to get the mask
output by that layer as a model output, for easier visualization of what the model is actually
doing.
... | 26.904762 | 98 | 0.695575 | 490 | 0.867257 | 0 | 0 | 181 | 0.320354 | 0 | 0 | 296 | 0.523894 |
917d1911394719c31fdc868c9c05aa1015cc7576 | 1,316 | py | Python | ljmc/energy.py | karnesh/Monte-Carlo-LJ | f33f08c247df963ca48b9d9f8456e26c0bb19923 | [
"MIT"
] | null | null | null | ljmc/energy.py | karnesh/Monte-Carlo-LJ | f33f08c247df963ca48b9d9f8456e26c0bb19923 | [
"MIT"
] | null | null | null | ljmc/energy.py | karnesh/Monte-Carlo-LJ | f33f08c247df963ca48b9d9f8456e26c0bb19923 | [
"MIT"
] | null | null | null | """
energy.py
function that computes the inter particle energy
It uses truncated 12-6 Lennard Jones potential
All the variables are in reduced units.
"""
def distance(atom1, atom2):
"""
Computes the square of inter particle distance
Minimum image convention is applied for distance calculatio... | 19.352941 | 101 | 0.544833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 504 | 0.382979 |
917d24af3dd098f693a886046f82e8514c7bd83a | 2,628 | py | Python | CEST/Evaluation/lorenzian.py | ludgerradke/bMRI | dcf93749bb2fba3700e6bcfde691355d55090951 | [
"MIT"
] | null | null | null | CEST/Evaluation/lorenzian.py | ludgerradke/bMRI | dcf93749bb2fba3700e6bcfde691355d55090951 | [
"MIT"
] | null | null | null | CEST/Evaluation/lorenzian.py | ludgerradke/bMRI | dcf93749bb2fba3700e6bcfde691355d55090951 | [
"MIT"
] | null | null | null | import numpy as np
import math
from scipy.optimize import curve_fit
def calc_lorentzian(CestCurveS, x_calcentires, mask, config):
(rows, colums, z_slices, entires) = CestCurveS.shape
lorenzian = {key: np.zeros((rows, colums, z_slices), dtype=float) for key in config.lorenzian_keys}
for k in range(z_slice... | 45.310345 | 117 | 0.459665 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 264 | 0.100457 |
917ddc860e3cb5987c6d77cf2eda4923d9234d7a | 7,572 | py | Python | components/network_models_LSTU.py | neuralchen/CooGAN | 3155cbb5a283226474356d3a9f01918609ddd4ec | [
"MIT"
] | 12 | 2020-12-09T07:04:12.000Z | 2022-03-01T03:30:46.000Z | components/network_models_LSTU.py | neuralchen/CooGAN | 3155cbb5a283226474356d3a9f01918609ddd4ec | [
"MIT"
] | null | null | null | components/network_models_LSTU.py | neuralchen/CooGAN | 3155cbb5a283226474356d3a9f01918609ddd4ec | [
"MIT"
] | 4 | 2020-12-23T03:57:53.000Z | 2022-03-28T13:56:14.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################
# File: network_models_LSTU.py
# Created Date: Tuesday February 25th 2020
# Author: Chen Xuanhong
# Email: chenxuanhongzju@outlook.com
# Last Modified: Tuesday, 25th February 2020 9:57:06 pm
# Modified By: Chen ... | 39.233161 | 118 | 0.58822 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,386 | 0.183043 |
917e0cc4efaf369d4d17aeaeb0fc5c964a039793 | 760 | py | Python | slender/tests/list/test_keep_if.py | torokmark/slender | 3bf815e22f7802ba48706f31ba608cf609e23e68 | [
"Apache-2.0"
] | 1 | 2020-01-10T21:51:46.000Z | 2020-01-10T21:51:46.000Z | slender/tests/list/test_keep_if.py | torokmark/slender | 3bf815e22f7802ba48706f31ba608cf609e23e68 | [
"Apache-2.0"
] | null | null | null | slender/tests/list/test_keep_if.py | torokmark/slender | 3bf815e22f7802ba48706f31ba608cf609e23e68 | [
"Apache-2.0"
] | null | null | null |
from unittest import TestCase
from expects import expect, equal, raise_error
from slender import List
class TestKeepIf(TestCase):
def test_keep_if_if_func_is_none(self):
e = List([1, 2, 3, 4, 5])
expect(e.keep_if(None).to_list()).to(equal([1, 2, 3, 4, 5]))
def test_keep_if_if_func_is_valid... | 28.148148 | 76 | 0.628947 | 650 | 0.855263 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0.006579 |
9181932ab3632366f38b401fcbe5e47425259914 | 6,809 | py | Python | test/functional/bchn-txbroadcastinterval.py | 1Crazymoney/bitcoin-cash-node | 8f82823b3c5d4bcb401b0e4e6b464c1228f936e1 | [
"MIT"
] | 1 | 2021-11-24T03:54:05.000Z | 2021-11-24T03:54:05.000Z | test/functional/bchn-txbroadcastinterval.py | 1Crazymoney/bitcoin-cash-node | 8f82823b3c5d4bcb401b0e4e6b464c1228f936e1 | [
"MIT"
] | null | null | null | test/functional/bchn-txbroadcastinterval.py | 1Crazymoney/bitcoin-cash-node | 8f82823b3c5d4bcb401b0e4e6b464c1228f936e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Cash Node developers
# Author matricz
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test that inv messages are sent according to
an exponential distribution with scale -... | 46.958621 | 110 | 0.679101 | 6,101 | 0.89602 | 0 | 0 | 0 | 0 | 0 | 0 | 2,949 | 0.433103 |
91820c594379b0529582b42b9cc165d4cd520738 | 33,871 | py | Python | tests/compute/test_sampler.py | buaaqt/dgl | 64f6f3c1a8c2c3e08ec0750b902f3e2c63fd2cd7 | [
"Apache-2.0"
] | 1 | 2020-07-21T03:03:15.000Z | 2020-07-21T03:03:15.000Z | tests/compute/test_sampler.py | buaaqt/dgl | 64f6f3c1a8c2c3e08ec0750b902f3e2c63fd2cd7 | [
"Apache-2.0"
] | null | null | null | tests/compute/test_sampler.py | buaaqt/dgl | 64f6f3c1a8c2c3e08ec0750b902f3e2c63fd2cd7 | [
"Apache-2.0"
] | null | null | null | import backend as F
import numpy as np
import scipy as sp
import dgl
from dgl import utils
import unittest
from numpy.testing import assert_array_equal
np.random.seed(42)
def generate_rand_graph(n):
arr = (sp.sparse.random(n, n, density=0.1, format='coo') != 0).astype(np.int64)
return dgl.DGLGraph(arr, readon... | 46.783149 | 103 | 0.575507 | 0 | 0 | 0 | 0 | 2,105 | 0.062148 | 0 | 0 | 2,843 | 0.083936 |
9183b4d3330e5dc6c4da3188d85901cf1703c4d4 | 3,178 | py | Python | plugins/voila/voila/__init__.py | srinivasreddych/aws-orbit-workbench | 2d154addff58d26f5459a73c06148aaf5e9fad46 | [
"Apache-2.0"
] | 94 | 2021-03-19T19:55:11.000Z | 2022-03-31T19:50:01.000Z | plugins/voila/voila/__init__.py | srinivasreddych/aws-orbit-workbench | 2d154addff58d26f5459a73c06148aaf5e9fad46 | [
"Apache-2.0"
] | 410 | 2021-03-19T18:04:48.000Z | 2022-03-22T13:56:53.000Z | plugins/voila/voila/__init__.py | srinivasreddych/aws-orbit-workbench | 2d154addff58d26f5459a73c06148aaf5e9fad46 | [
"Apache-2.0"
] | 24 | 2021-03-19T23:16:23.000Z | 2022-03-04T01:05:18.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 37.833333 | 116 | 0.701385 | 0 | 0 | 0 | 0 | 2,164 | 0.680931 | 0 | 0 | 1,022 | 0.321586 |
91848acd7c9a76b40212893d24a66f1267e0b221 | 4,316 | py | Python | tools/generate_driver_list.py | aarunsai81/netapp | 8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba | [
"Apache-2.0"
] | 11 | 2015-08-25T13:11:18.000Z | 2020-10-15T11:29:20.000Z | tools/generate_driver_list.py | aarunsai81/netapp | 8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba | [
"Apache-2.0"
] | 5 | 2018-01-25T11:31:56.000Z | 2019-05-06T23:13:35.000Z | tools/generate_driver_list.py | aarunsai81/netapp | 8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba | [
"Apache-2.0"
] | 11 | 2015-02-20T18:48:24.000Z | 2021-01-30T20:26:18.000Z | #! /usr/bin/env python
#
# 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... | 30.609929 | 78 | 0.621177 | 835 | 0.193466 | 0 | 0 | 0 | 0 | 0 | 0 | 1,455 | 0.337118 |
9184ffff91bd0e91c571446c2eb2a2d6fb77ed63 | 126 | py | Python | Disp_pythonScript.py | maniegley/python | 0e3a98cbff910cc78b2c0386a9cca6c5bb20eefc | [
"MIT"
] | 1 | 2019-05-04T03:20:44.000Z | 2019-05-04T03:20:44.000Z | Disp_pythonScript.py | maniegley/python | 0e3a98cbff910cc78b2c0386a9cca6c5bb20eefc | [
"MIT"
] | null | null | null | Disp_pythonScript.py | maniegley/python | 0e3a98cbff910cc78b2c0386a9cca6c5bb20eefc | [
"MIT"
] | null | null | null | import sys
f = open("/home/vader/Desktop/test.py", "r")
#read all file
python_script = f.read()
print(python_script)
| 15.75 | 44 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.365079 |
9185566c87d7284eaa28e018591be112687ee8a6 | 2,001 | py | Python | email_file.py | grussr/email-file-attachment | afa65b679b3c88b419643e216b9942fdefeaf9fc | [
"MIT"
] | null | null | null | email_file.py | grussr/email-file-attachment | afa65b679b3c88b419643e216b9942fdefeaf9fc | [
"MIT"
] | null | null | null | email_file.py | grussr/email-file-attachment | afa65b679b3c88b419643e216b9942fdefeaf9fc | [
"MIT"
] | null | null | null | import smtplib
import argparse
from os.path import basename
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate
import configparser
import json
def send_mail(send_from, send_to, subject, te... | 32.274194 | 155 | 0.696152 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 295 | 0.147426 |
91860dad187d68b19d0b7553594210d867a8ccc4 | 70 | py | Python | logs/constants.py | gonzatorte/sw-utils | 767ec4aa8cbe1e0143f601482024ba1d9b76da64 | [
"MIT"
] | null | null | null | logs/constants.py | gonzatorte/sw-utils | 767ec4aa8cbe1e0143f601482024ba1d9b76da64 | [
"MIT"
] | null | null | null | logs/constants.py | gonzatorte/sw-utils | 767ec4aa8cbe1e0143f601482024ba1d9b76da64 | [
"MIT"
] | null | null | null | import logging
TRACE_LVL = int( (logging.DEBUG + logging.INFO) / 2 )
| 17.5 | 53 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9186884237c62f08e8e5c91cdb86f2cf165aa0f6 | 173 | py | Python | examples/simple_lakehouse/simple_lakehouse/repo.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | examples/simple_lakehouse/simple_lakehouse/repo.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-06-21T18:30:02.000Z | 2021-06-25T21:18:39.000Z | examples/simple_lakehouse/simple_lakehouse/repo.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | from dagster import repository
from simple_lakehouse.pipelines import simple_lakehouse_pipeline
@repository
def simple_lakehouse():
return [simple_lakehouse_pipeline]
| 21.625 | 64 | 0.849711 | 0 | 0 | 0 | 0 | 74 | 0.427746 | 0 | 0 | 0 | 0 |
9186f6c899c8a19e537fae60a274b21c711b183a | 7,649 | py | Python | demos/odyssey/dodyssey.py | steingabelgaard/reportlab | b9a537e8386fb4b4b80e9ec89e0cdf392dbd6f61 | [
"BSD-3-Clause"
] | 55 | 2019-09-21T02:45:18.000Z | 2021-12-10T13:38:51.000Z | demos/odyssey/dodyssey.py | cnauroth/reportlab | 377d4ff58491dc6de48551e730c3d7f72db783e5 | [
"BSD-3-Clause"
] | 4 | 2019-09-26T03:16:50.000Z | 2021-12-10T13:40:49.000Z | demos/odyssey/dodyssey.py | cnauroth/reportlab | 377d4ff58491dc6de48551e730c3d7f72db783e5 | [
"BSD-3-Clause"
] | 26 | 2019-09-25T03:54:30.000Z | 2022-03-21T14:03:12.000Z | #Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
__version__='3.3.0'
__doc__=''
#REPORTLAB_TEST_SCRIPT
import sys, copy, os
from reportlab.platypus import *
_NEW_PARA=os.environ.get('NEW_PARA','0')[0] in ('y','Y','1')
_REDCAP=int(os.environ.get('REDCAP','0'))
_CALLBACK=os.environ.get('CA... | 31.093496 | 104 | 0.587397 | 0 | 0 | 2,457 | 0.321218 | 0 | 0 | 0 | 0 | 1,310 | 0.171264 |
9187649de93ea28a41bff761a58a3a5d39922848 | 764 | py | Python | tests/test_fred_fred_view.py | Traceabl3/GamestonkTerminal | 922353cade542ce3f62701e10d816852805b9386 | [
"MIT"
] | null | null | null | tests/test_fred_fred_view.py | Traceabl3/GamestonkTerminal | 922353cade542ce3f62701e10d816852805b9386 | [
"MIT"
] | null | null | null | tests/test_fred_fred_view.py | Traceabl3/GamestonkTerminal | 922353cade542ce3f62701e10d816852805b9386 | [
"MIT"
] | null | null | null | """ econ/fred_view.py tests """
import unittest
from unittest import mock
from io import StringIO
import pandas as pd
# pylint: disable=unused-import
from gamestonk_terminal.econ.fred_view import get_fred_data # noqa: F401
fred_data_mock = """
,GDP
2019-01-01,21115.309
2019-04-01,21329.877
2019-07-01,21540.325
2019-... | 24.645161 | 80 | 0.747382 | 337 | 0.441099 | 0 | 0 | 290 | 0.379581 | 0 | 0 | 320 | 0.418848 |
9187aae337945bbf532915814ef30a4e08766d0c | 10,938 | py | Python | python27/1.0/lib/linux/gevent/pool.py | jt6562/XX-Net | 7b78e4820a3c78c3ba3e75b3917129d17f00e9fc | [
"BSD-2-Clause"
] | 2 | 2017-04-24T03:04:45.000Z | 2017-09-19T03:38:37.000Z | python27/1.0/lib/linux/gevent/pool.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | null | null | null | python27/1.0/lib/linux/gevent/pool.py | TDUncle/XX-Net | 24b2af60dc0abc1c26211813064bb14c1e22bac8 | [
"BSD-2-Clause"
] | 1 | 2019-04-19T09:11:54.000Z | 2019-04-19T09:11:54.000Z | # Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details.
"""Managing greenlets in a group.
The :class:`Group` class in this module abstracts a group of running greenlets.
When a greenlet dies, it's automatically removed from the group.
The :class:`Pool` which a subclass of :class:`Group` provides a way to li... | 31.162393 | 132 | 0.598555 | 9,886 | 0.903822 | 0 | 0 | 0 | 0 | 0 | 0 | 1,935 | 0.176906 |
9187b814b570a612e2b93ab230ce46d039efd3f1 | 4,974 | py | Python | lecarb/estimator/lw/lw_tree.py | anshumandutt/AreCELearnedYet | e2286c3621dea8e4961057b6197c1e14e75aea5a | [
"MIT"
] | 34 | 2020-12-14T01:21:29.000Z | 2022-03-29T04:52:46.000Z | lecarb/estimator/lw/lw_tree.py | anshumandutt/AreCELearnedYet | e2286c3621dea8e4961057b6197c1e14e75aea5a | [
"MIT"
] | 5 | 2020-12-28T16:06:22.000Z | 2022-01-19T18:28:53.000Z | lecarb/estimator/lw/lw_tree.py | anshumandutt/AreCELearnedYet | e2286c3621dea8e4961057b6197c1e14e75aea5a | [
"MIT"
] | 12 | 2021-02-08T17:50:13.000Z | 2022-03-28T11:09:06.000Z | import time
import logging
from typing import Dict, Any, Tuple
import pickle
import numpy as np
import xgboost as xgb
from .common import load_lw_dataset, encode_query, decode_label
from ..postgres import Postgres
from ..estimator import Estimator
from ..utils import evaluate, run_test
from ...dataset.dataset import ... | 34.783217 | 130 | 0.65963 | 836 | 0.168074 | 0 | 0 | 0 | 0 | 0 | 0 | 1,125 | 0.226176 |
9187ef6ed78f1f18095fecd6ea3ce015376d4dfc | 2,525 | py | Python | fsim/utils.py | yamasampo/fsim | 30100789b03981dd9ea11c5c2e17a3c53910f724 | [
"MIT"
] | null | null | null | fsim/utils.py | yamasampo/fsim | 30100789b03981dd9ea11c5c2e17a3c53910f724 | [
"MIT"
] | null | null | null | fsim/utils.py | yamasampo/fsim | 30100789b03981dd9ea11c5c2e17a3c53910f724 | [
"MIT"
] | null | null | null |
import os
import configparser
from warnings import warn
def read_control_file(control_file):
# Initialize ConfigParser object
config = configparser.ConfigParser(
strict=True,
comment_prefixes=('/*', ';', '#'),
inline_comment_prefixes=('/*', ';', '#')
)
# Parse control file
... | 32.371795 | 98 | 0.613861 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 911 | 0.360792 |
918946b8867e4746cc6439a71e8ab2ad6d7dc6a7 | 2,950 | py | Python | src/pymortests/function.py | mahgadalla/pymor | ee2806b4c93748e716294c42454d611415da7b5e | [
"Unlicense"
] | 1 | 2021-07-26T12:58:50.000Z | 2021-07-26T12:58:50.000Z | src/pymortests/function.py | mahgadalla/pymor | ee2806b4c93748e716294c42454d611415da7b5e | [
"Unlicense"
] | null | null | null | src/pymortests/function.py | mahgadalla/pymor | ee2806b4c93748e716294c42454d611415da7b5e | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2017 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
import pytest
from pymor.core.pickle import dumps, loads
from pymor.functions.... | 38.815789 | 108 | 0.671186 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 439 | 0.148814 |
918a293306bf241e1a965c6b6c86f2b524157237 | 4,603 | py | Python | Code/userIDCrawler.py | CarberZ/social-media-mining | 41aee64a41244a0692987b75b30dedbd0552be49 | [
"MIT"
] | 2 | 2018-10-16T23:09:00.000Z | 2018-11-14T04:08:00.000Z | Code/userIDCrawler.py | CarberZ/social-media-mining | 41aee64a41244a0692987b75b30dedbd0552be49 | [
"MIT"
] | 1 | 2018-11-14T04:06:13.000Z | 2018-11-14T04:15:56.000Z | Code/userIDCrawler.py | CarberZ/social-media-mining | 41aee64a41244a0692987b75b30dedbd0552be49 | [
"MIT"
] | 1 | 2018-11-14T04:06:31.000Z | 2018-11-14T04:06:31.000Z |
'''
step 1
get the userID and their locations
put them all into a database
'''
from bs4 import BeautifulSoup
import urllib
import sqlite3
from selenium import webdriver
import time
import re
from urllib import request
import random
import pickle
import os
import pytesseract
url_dog = "http... | 30.483444 | 138 | 0.550728 | 3,821 | 0.830111 | 0 | 0 | 0 | 0 | 0 | 0 | 1,553 | 0.337389 |
918a3b0f516ea68dd89954d9a42756ad875c22c6 | 33 | py | Python | src/stoat/core/structure/__init__.py | saarkatz/guppy-struct | b9099353312c365cfd788dbd2d168a9c844765be | [
"Apache-2.0"
] | 1 | 2021-12-07T11:59:11.000Z | 2021-12-07T11:59:11.000Z | src/stoat/core/structure/__init__.py | saarkatz/stoat-struct | b9099353312c365cfd788dbd2d168a9c844765be | [
"Apache-2.0"
] | null | null | null | src/stoat/core/structure/__init__.py | saarkatz/stoat-struct | b9099353312c365cfd788dbd2d168a9c844765be | [
"Apache-2.0"
] | null | null | null | from .structure import Structure
| 16.5 | 32 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
918a81c6af8725a4b95ff16551cc06a18c633a21 | 709 | py | Python | tbase/network/polices_test.py | iminders/TradeBaselines | 26eb87f2bcd5f6ff479149219b38b17002be6a40 | [
"MIT"
] | 16 | 2020-03-19T15:12:28.000Z | 2021-12-20T06:02:32.000Z | tbase/network/polices_test.py | iminders/TradeBaselines | 26eb87f2bcd5f6ff479149219b38b17002be6a40 | [
"MIT"
] | 14 | 2020-03-23T03:57:00.000Z | 2021-12-20T05:53:33.000Z | tbase/network/polices_test.py | iminders/TradeBaselines | 26eb87f2bcd5f6ff479149219b38b17002be6a40 | [
"MIT"
] | 7 | 2020-03-25T00:30:18.000Z | 2021-01-31T18:45:09.000Z | import unittest
import numpy as np
from tbase.common.cmd_util import set_global_seeds
from tbase.network.polices import RandomPolicy
class TestPolices(unittest.TestCase):
@classmethod
def setUpClass(self):
set_global_seeds(0)
def test_random_policy(self):
policy = RandomPolicy(2)
... | 25.321429 | 65 | 0.671368 | 522 | 0.736248 | 0 | 0 | 66 | 0.093089 | 0 | 0 | 30 | 0.042313 |
918a8725328fa6920f55c21e0bb7c5f7406c3135 | 36,887 | py | Python | keystone/tests/unit/core.py | knikolla/keystone | 50f0a50cf4d52d3f61b64713bd4faa7a4626ae53 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/core.py | knikolla/keystone | 50f0a50cf4d52d3f61b64713bd4faa7a4626ae53 | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/core.py | knikolla/keystone | 50f0a50cf4d52d3f61b64713bd4faa7a4626ae53 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 34.217996 | 79 | 0.619676 | 18,973 | 0.514355 | 871 | 0.023613 | 5,361 | 0.145336 | 0 | 0 | 11,002 | 0.298262 |
918dd351f71913e5bfee0b534327c85070c34d0b | 17,327 | py | Python | PyISY/Nodes/__init__.py | sneelco/PyISY | f1f916cd7951b1b6a5235bb36444c695fe3294e1 | [
"Apache-2.0"
] | null | null | null | PyISY/Nodes/__init__.py | sneelco/PyISY | f1f916cd7951b1b6a5235bb36444c695fe3294e1 | [
"Apache-2.0"
] | null | null | null | PyISY/Nodes/__init__.py | sneelco/PyISY | f1f916cd7951b1b6a5235bb36444c695fe3294e1 | [
"Apache-2.0"
] | null | null | null |
from .group import Group
from .node import (Node, parse_xml_properties, ATTR_ID)
from time import sleep
from xml.dom import minidom
class Nodes(object):
"""
This class handles the ISY nodes. This class can be used as a dictionary to
navigate through the controller's structure to objects of type
:cla... | 36.324948 | 100 | 0.48612 | 17,189 | 0.992036 | 0 | 0 | 1,033 | 0.059618 | 0 | 0 | 3,677 | 0.212212 |
918e36c7c2d321203012c2cecdfb70b87e94940f | 1,329 | py | Python | easyCore/Utils/Logging.py | easyScience/easyCore | 5d16d5b27803277d0c44886f94dab599f764ae0b | [
"BSD-3-Clause"
] | 2 | 2021-11-02T10:22:45.000Z | 2022-02-18T23:41:19.000Z | easyCore/Utils/Logging.py | easyScience/easyCore | 5d16d5b27803277d0c44886f94dab599f764ae0b | [
"BSD-3-Clause"
] | 114 | 2020-06-30T08:52:27.000Z | 2022-03-30T20:47:56.000Z | easyCore/Utils/Logging.py | easyScience/easyCore | 5d16d5b27803277d0c44886f94dab599f764ae0b | [
"BSD-3-Clause"
] | 1 | 2022-03-04T13:01:09.000Z | 2022-03-04T13:01:09.000Z | # SPDX-FileCopyrightText: 2021 easyCore contributors <core@easyscience.software>
# SPDX-License-Identifier: BSD-3-Clause
# © 2021 Contributors to the easyCore project <https://github.com/easyScience/easyCore>
__author__ = 'github.com/wardsimon'
__version__ = '0.1.0'
import logging
class Logger:
def __init__... | 36.916667 | 91 | 0.645598 | 1,038 | 0.780451 | 0 | 0 | 0 | 0 | 0 | 0 | 813 | 0.611278 |
91903bbb82369647bc8ec6646143a89d378edc88 | 234 | py | Python | iqoptionapi/http/billing.py | mustx1/MYIQ | 3afb597aa8a8abc278b7d70dad46af81789eae3e | [
"MIT"
] | 3 | 2021-06-05T06:58:01.000Z | 2021-11-25T23:52:18.000Z | iqoptionapi/http/billing.py | mustx1/MYIQ | 3afb597aa8a8abc278b7d70dad46af81789eae3e | [
"MIT"
] | 5 | 2022-01-20T00:32:49.000Z | 2022-02-16T23:12:10.000Z | iqoptionapi/http/billing.py | mustx1/MYIQ | 3afb597aa8a8abc278b7d70dad46af81789eae3e | [
"MIT"
] | 2 | 2020-11-10T19:03:38.000Z | 2020-12-07T10:42:36.000Z | """Module for IQ option billing resource."""
from iqoptionapi.http.resource import Resource
class Billing(Resource):
"""Class for IQ option billing resource."""
# pylint: disable=too-few-public-methods
url = "billing"
| 21.272727 | 47 | 0.709402 | 138 | 0.589744 | 0 | 0 | 0 | 0 | 0 | 0 | 136 | 0.581197 |
919092189581e9b39163223362020fad3bbd08e7 | 3,416 | py | Python | defaultsob/core.py | honewatson/defaults | c6a845ec1f25fc82e7645dfee60dd2df1cfa4e81 | [
"0BSD"
] | null | null | null | defaultsob/core.py | honewatson/defaults | c6a845ec1f25fc82e7645dfee60dd2df1cfa4e81 | [
"0BSD"
] | null | null | null | defaultsob/core.py | honewatson/defaults | c6a845ec1f25fc82e7645dfee60dd2df1cfa4e81 | [
"0BSD"
] | null | null | null | # -*- coding: utf-8 -*-
def ordered_set(iter):
"""Creates an ordered set
@param iter: list or tuple
@return: list with unique values
"""
final = []
for i in iter:
if i not in final:
final.append(i)
return final
def class_slots(ob):
"""Get object attributes from... | 27.772358 | 77 | 0.624415 | 1,030 | 0.301522 | 0 | 0 | 0 | 0 | 0 | 0 | 1,749 | 0.512002 |
9190a55060e46f0f4d728a8eb6583235a5fc4dcf | 3,140 | py | Python | tests/bot_test.py | item4/yui | 8628d0d54b94ada3cbe7d1b0f624063258bad10a | [
"MIT"
] | 36 | 2017-06-12T01:09:46.000Z | 2021-01-31T17:57:41.000Z | tests/bot_test.py | item4/yui | 8628d0d54b94ada3cbe7d1b0f624063258bad10a | [
"MIT"
] | 145 | 2017-06-21T13:31:29.000Z | 2021-06-20T01:01:30.000Z | tests/bot_test.py | item4/yui | 8628d0d54b94ada3cbe7d1b0f624063258bad10a | [
"MIT"
] | 21 | 2017-07-24T15:53:19.000Z | 2021-12-23T04:18:31.000Z | import asyncio
from collections import defaultdict
from datetime import timedelta
import pytest
from yui.api import SlackAPI
from yui.bot import Bot
from yui.box import Box
from yui.types.slack.response import APIResponse
from yui.utils import json
from .util import FakeImportLib
def test_bot_init(event_loop, monk... | 27.787611 | 75 | 0.605414 | 0 | 0 | 0 | 0 | 2,217 | 0.706051 | 2,196 | 0.699363 | 805 | 0.256369 |
9190bf228865d048848fd87f601781ac36e5057a | 2,901 | py | Python | scripts/marker_filter.py | CesMak/aruco_detector_ocv | bb45e39664247779cbbbc8d37b89c4556b4984d6 | [
"BSD-3-Clause"
] | 12 | 2019-03-12T08:47:07.000Z | 2022-02-09T03:59:39.000Z | scripts/marker_filter.py | vprooks/simple_aruco_detector | 40cb7354d7da67028c91b4c4652e8c4a1d2abbbb | [
"MIT"
] | 3 | 2020-07-02T04:25:10.000Z | 2021-08-31T15:56:13.000Z | scripts/marker_filter.py | CesMak/aruco_detector_ocv | bb45e39664247779cbbbc8d37b89c4556b4984d6 | [
"BSD-3-Clause"
] | 11 | 2019-10-25T17:36:44.000Z | 2022-02-16T17:12:38.000Z | #!/usr/bin/env python
import numpy as np
import rospy
import geometry_msgs.msg
import tf2_ros
from tf.transformations import quaternion_slerp
def translation_to_numpy(t):
return np.array([t.x, t.y, t.z])
def quaternion_to_numpy(q):
return np.array([q.x, q.y, q.z, q.w])
if __name__ == '__main__':
rosp... | 36.2625 | 109 | 0.666322 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 311 | 0.107204 |
9190f1884667aaeb95f3ee0745ae12dfce3341d8 | 3,713 | py | Python | src/backbone/utils.py | hankyul2/FaceDA | 73006327df3668923d4206f81d4976ca1240329d | [
"Apache-2.0"
] | 20 | 2021-11-26T18:05:30.000Z | 2022-02-15T12:21:10.000Z | src/backbone/utils.py | hankyul2/FaceDA | 73006327df3668923d4206f81d4976ca1240329d | [
"Apache-2.0"
] | null | null | null | src/backbone/utils.py | hankyul2/FaceDA | 73006327df3668923d4206f81d4976ca1240329d | [
"Apache-2.0"
] | 1 | 2022-02-15T12:21:17.000Z | 2022-02-15T12:21:17.000Z | import os
import subprocess
from pathlib import Path
from torch.hub import load_state_dict_from_url
import numpy as np
model_urls = {
# ResNet
'resnet18': 'https://download.pytorch.org/models/resnet18-f37072fd.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-b627a593.pth',
'resnet50':... | 50.175676 | 127 | 0.720442 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,194 | 0.590897 |
91918e0b4360daa841c2dd658213e7f9249510fa | 702 | py | Python | crawler1.py | pjha1994/Scrape_reddit | 2a00a83854085e09f0cf53aef81969025876039b | [
"Apache-2.0"
] | null | null | null | crawler1.py | pjha1994/Scrape_reddit | 2a00a83854085e09f0cf53aef81969025876039b | [
"Apache-2.0"
] | null | null | null | crawler1.py | pjha1994/Scrape_reddit | 2a00a83854085e09f0cf53aef81969025876039b | [
"Apache-2.0"
] | null | null | null | import requests
from bs4 import BeautifulSoup
def recursiveUrl(url, link, depth):
if depth == 5:
return url
else:
print(link['href'])
page = requests.get(url + link['href'])
soup = BeautifulSoup(page.text, 'html.parser')
newlink = soup.find('a')
if len(newlink) =... | 27 | 62 | 0.602564 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 68 | 0.096866 |
9191a318c08b49c9339f1e4504f721d3f2d1d83b | 2,428 | py | Python | chime2/tests/normal/models/seir_test.py | BrianThomasRoss/CHIME-2 | f084ab552fac5e50841a922293b74d653450790b | [
"BSD-3-Clause"
] | null | null | null | chime2/tests/normal/models/seir_test.py | BrianThomasRoss/CHIME-2 | f084ab552fac5e50841a922293b74d653450790b | [
"BSD-3-Clause"
] | null | null | null | chime2/tests/normal/models/seir_test.py | BrianThomasRoss/CHIME-2 | f084ab552fac5e50841a922293b74d653450790b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T23:08:52.000Z | 2020-11-19T23:08:52.000Z | """Tests for SEIR model in this repo
* Compares conserved quantities
* Compares model against SEIR wo social policies in limit to SIR
"""
from pandas import Series
from pandas.testing import assert_frame_equal, assert_series_equal
from bayes_chime.normal.models import SEIRModel, SIRModel
from pytest import fixture
fro... | 28.232558 | 81 | 0.710461 | 0 | 0 | 0 | 0 | 270 | 0.111203 | 0 | 0 | 667 | 0.274712 |
91928996da1f5de4298b9395563c76e7f7e3542f | 4,681 | py | Python | Libraries/mattsLibraries/mathOperations.py | mrware91/PhilTransA-TRXS-Limits | 5592c6c66276cd493d10f066aa636aaf600d3a00 | [
"MIT"
] | null | null | null | Libraries/mattsLibraries/mathOperations.py | mrware91/PhilTransA-TRXS-Limits | 5592c6c66276cd493d10f066aa636aaf600d3a00 | [
"MIT"
] | 2 | 2018-06-19T00:01:27.000Z | 2018-10-16T18:33:24.000Z | Libraries/mattsLibraries/mathOperations.py | mrware91/PhilTransA-TRXS-Limits | 5592c6c66276cd493d10f066aa636aaf600d3a00 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.interpolate import interp1d
from pyTools import *
################################################################################
#~~~~~~~~~Log ops
################################################################################
def logPolyVal(p,x):
ord = p.order()
logs = []
... | 32.734266 | 129 | 0.470626 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,190 | 0.254219 |
9192d6d1ce77aea0159f3db895468368ec72c08a | 592 | py | Python | setup.py | avryhof/ambient_api | 08194b5d8626801f2c2c7369adacb15eace54802 | [
"MIT"
] | 20 | 2018-12-24T15:40:49.000Z | 2022-01-10T18:58:41.000Z | setup.py | avryhof/ambient_api | 08194b5d8626801f2c2c7369adacb15eace54802 | [
"MIT"
] | 10 | 2018-08-17T02:01:45.000Z | 2021-01-08T23:34:59.000Z | setup.py | avryhof/ambient_api | 08194b5d8626801f2c2c7369adacb15eace54802 | [
"MIT"
] | 14 | 2018-06-13T23:40:12.000Z | 2022-01-05T06:34:13.000Z | from setuptools import setup
setup(
name="ambient_api",
version="1.5.6",
packages=["ambient_api"],
url="https://github.com/avryhof/ambient_api",
license="MIT",
author="Amos Vryhof",
author_email="amos@vryhofresearch.com",
description="A Python class for accessing the Ambient Weather API... | 29.6 | 72 | 0.640203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 345 | 0.58277 |
9192df0712738e90f6f197873c3a465c79101722 | 585 | py | Python | tests/llvm/static/test_main_is_found/test_main_is_found.py | ganeshutah/FPChecker | 53a471429762ace13f69733cb2f8b7227fc15b9f | [
"Apache-2.0"
] | 19 | 2019-09-28T16:15:45.000Z | 2022-02-15T15:11:28.000Z | tests/llvm/static/test_main_is_found/test_main_is_found.py | tanmaytirpankar/FPChecker | d3fe4bd9489c5705df58a67dbbc388ac1ebf56bf | [
"Apache-2.0"
] | 16 | 2020-02-01T18:43:00.000Z | 2021-12-22T14:47:39.000Z | tests/llvm/static/test_main_is_found/test_main_is_found.py | tanmaytirpankar/FPChecker | d3fe4bd9489c5705df58a67dbbc388ac1ebf56bf | [
"Apache-2.0"
] | 5 | 2020-07-27T18:15:36.000Z | 2021-11-01T18:43:34.000Z | #!/usr/bin/env python
import subprocess
import os
def setup_module(module):
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
os.chdir(THIS_DIR)
def teardown_module(module):
cmd = ["make clean"]
cmdOutput = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
def test_1():
cmd... | 22.5 | 82 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.129915 |
919312f26ed57e4c093335409a623694c54be188 | 877 | py | Python | regipy/exceptions.py | kamnon/regipy | 12d3be9da631dcc0d6fb342767e51ec4799141c6 | [
"MIT"
] | 190 | 2019-03-06T09:13:08.000Z | 2022-03-19T14:43:34.000Z | regipy/exceptions.py | kamnon/regipy | 12d3be9da631dcc0d6fb342767e51ec4799141c6 | [
"MIT"
] | 117 | 2019-05-15T12:22:46.000Z | 2022-03-30T10:43:03.000Z | regipy/exceptions.py | kamnon/regipy | 12d3be9da631dcc0d6fb342767e51ec4799141c6 | [
"MIT"
] | 37 | 2019-03-12T14:46:12.000Z | 2022-01-12T11:07:10.000Z | class RegipyException(Exception):
"""
This is the parent exception for all regipy exceptions
"""
pass
class RegipyGeneralException(RegipyException):
"""
General exception
"""
pass
class RegistryValueNotFoundException(RegipyException):
pass
class NoRegistrySubkeysException(Regipy... | 18.270833 | 75 | 0.741163 | 851 | 0.970353 | 0 | 0 | 0 | 0 | 0 | 0 | 274 | 0.312429 |
91936b7f0195e57ee35ddf84cdb73c2bef559977 | 745 | py | Python | Dynamic_Programming/1259.Integer Replacement/Solution_BFS.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 12 | 2019-05-04T04:21:27.000Z | 2022-03-02T07:06:57.000Z | Dynamic_Programming/1259.Integer Replacement/Solution_BFS.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 1 | 2019-07-24T18:43:53.000Z | 2019-07-24T18:43:53.000Z | Dynamic_Programming/1259.Integer Replacement/Solution_BFS.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 10 | 2019-07-01T04:03:04.000Z | 2022-03-09T03:57:37.000Z | from collections import deque
class Solution:
"""
@param n: a positive integer
@return: the minimum number of replacements
"""
def integerReplacement(self, n):
# Write your code here
steps = 0
if n == 1:
return steps
queue = deque([n])
while q... | 23.28125 | 47 | 0.436242 | 712 | 0.955705 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 0.154362 |
91941908fbc07382f07b7bc44926ab4220545f9d | 947 | py | Python | src/routes/web.py | enflo/weather-flask | c4d905e1f557b4c9b39d0a578fdbb6fefc839028 | [
"Apache-2.0"
] | null | null | null | src/routes/web.py | enflo/weather-flask | c4d905e1f557b4c9b39d0a578fdbb6fefc839028 | [
"Apache-2.0"
] | null | null | null | src/routes/web.py | enflo/weather-flask | c4d905e1f557b4c9b39d0a578fdbb6fefc839028 | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint, render_template
from gateways.models import getWeatherData
web = Blueprint("web", __name__, template_folder='templates')
@web.route("/", methods=['GET'])
def home():
items = getWeatherData.get_last_item()
cityName = items["city"]
return render_template("index.html",
... | 32.655172 | 61 | 0.564942 | 0 | 0 | 0 | 0 | 377 | 0.398099 | 0 | 0 | 478 | 0.504752 |
9195f3cdb36a82835721ebe4e4fc6cc7220eecc8 | 677 | py | Python | changes/buildsteps/lxc.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | changes/buildsteps/lxc.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | changes/buildsteps/lxc.py | bowlofstew/changes | ebd393520e0fdb07c240a8d4e8747281b6186e28 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from changes.buildsteps.default import DefaultBuildStep
class LXCBuildStep(DefaultBuildStep):
"""
Similar to the default build step, except that it runs the client using
the LXC adapter.
"""
def can_snapshot(self):
return True
def get_label(self... | 27.08 | 75 | 0.680945 | 578 | 0.853767 | 0 | 0 | 0 | 0 | 0 | 0 | 170 | 0.251108 |
91979003f9cb74dc9f591b8277facbe005dfd825 | 532 | py | Python | swapidemo1.py | anvytran-dev/mycode | 3753c19828f0ecc506a6450bb6b71b4a5d651e5f | [
"MIT"
] | null | null | null | swapidemo1.py | anvytran-dev/mycode | 3753c19828f0ecc506a6450bb6b71b4a5d651e5f | [
"MIT"
] | null | null | null | swapidemo1.py | anvytran-dev/mycode | 3753c19828f0ecc506a6450bb6b71b4a5d651e5f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Star Wars API HTTP response parsing"""
# requests is used to send HTTP requests (get it?)
import requests
URL= "https://swapi.dev/api/people/1"
def main():
"""sending GET request, checking response"""
# SWAPI response is stored in "resp" object
resp= requests.get(URL)
# wh... | 22.166667 | 52 | 0.654135 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 362 | 0.680451 |
9197f982af32fc988794515b093dd5bf984c98a5 | 4,132 | py | Python | src/biota_models/vegetation/model/constants_json_create.py | Deltares/NBSDynamics | 4710da529d85b588ea249f6e2b4f4cac132bb34f | [
"MIT"
] | 2 | 2022-01-14T05:02:04.000Z | 2022-03-02T10:42:59.000Z | src/biota_models/vegetation/model/constants_json_create.py | Deltares/NBSDynamics | 4710da529d85b588ea249f6e2b4f4cac132bb34f | [
"MIT"
] | 35 | 2021-11-01T08:59:02.000Z | 2021-11-19T16:47:17.000Z | src/biota_models/vegetation/model/constants_json_create.py | Deltares/NBSDynamics | 4710da529d85b588ea249f6e2b4f4cac132bb34f | [
"MIT"
] | 1 | 2022-03-16T07:11:00.000Z | 2022-03-16T07:11:00.000Z | import json
schema = {
"Spartina": {
"ColStart": "2000-04-01",
"ColEnd": "2000-05-31",
"random": 7,
"mud_colonization": [0.0, 0.0],
"fl_dr": 0.005,
"Maximum age": 20,
"Number LifeStages": 2,
"initial root length": 0.05,
"initial shoot length":... | 43.494737 | 76 | 0.547193 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,473 | 0.5985 |
9198600a03831a59503bb3d3f2827b284d0e1c16 | 2,316 | bzl | Python | format/format.bzl | harshad-deo/TorchVI | f66d1486201368c9906869477ba7ae254d2e7191 | [
"Apache-2.0"
] | null | null | null | format/format.bzl | harshad-deo/TorchVI | f66d1486201368c9906869477ba7ae254d2e7191 | [
"Apache-2.0"
] | null | null | null | format/format.bzl | harshad-deo/TorchVI | f66d1486201368c9906869477ba7ae254d2e7191 | [
"Apache-2.0"
] | null | null | null | def _replace_formatted(ctx, manifest, files):
out = ctx.actions.declare_file(ctx.label.name)
# this makes it easier to add variables
file_lines = [
"""#!/bin/bash -e
WORKSPACE_ROOT="${1:-$BUILD_WORKSPACE_DIRECTORY}" """,
"""RUNPATH="${TEST_SRCDIR-$0.runfiles}"/""" + ctx.workspace_name,
... | 30.473684 | 88 | 0.577288 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 687 | 0.296632 |
91993f87e0ff04f74f7a6f31b278e5b76bf7a8ba | 1,376 | py | Python | Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/2.Custom-User-Model/auth_demo/accounts/models.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 4 | 2017-10-10T14:00:40.000Z | 2021-01-27T14:08:26.000Z | Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/2.Custom-User-Model/auth_demo/accounts/models.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 115 | 2019-10-24T11:18:33.000Z | 2022-03-11T23:15:42.000Z | Stream-3/Full-Stack-Development/10.Custom-User-And-Email-Authentication/2.Custom-User-Model/auth_demo/accounts/models.py | GunnerJnr/_CodeInstitute | efba0984a3dc71558eef97724c85e274a712798c | [
"MIT"
] | 5 | 2017-09-22T21:42:39.000Z | 2020-02-07T02:18:11.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models
from django.utils import timezone
# Create your models here.
# Create our new user class
class AccountUserManager(UserManager):
def _create_user(self, usern... | 32 | 95 | 0.641715 | 1,123 | 0.816134 | 0 | 0 | 0 | 0 | 0 | 0 | 534 | 0.388081 |
919b5dc79a4db8bc0c773739c3eacec33d693967 | 11,973 | py | Python | histoGAN.py | mahmoudnafifi/HistoGAN | 50be1482638ace3ec85d733e849dec494ede155b | [
"MIT"
] | 169 | 2020-11-25T07:42:26.000Z | 2022-03-30T03:08:35.000Z | histoGAN.py | mahmoudnafifi/HistoGAN | 50be1482638ace3ec85d733e849dec494ede155b | [
"MIT"
] | 22 | 2020-12-22T13:14:24.000Z | 2022-03-31T08:41:26.000Z | histoGAN.py | mahmoudnafifi/HistoGAN | 50be1482638ace3ec85d733e849dec494ede155b | [
"MIT"
] | 19 | 2020-11-28T17:28:46.000Z | 2022-02-23T06:09:23.000Z | """
If you find this code useful, please cite our paper:
Mahmoud Afifi, Marcus A. Brubaker, and Michael S. Brown. "HistoGAN:
Controlling Colors of GAN-Generated and Real Images via Color Histograms."
In CVPR, 2021.
@inproceedings{afifi2021histogan,
title={Histo{GAN}: Controlling Colors of {GAN}-Generated and R... | 39.127451 | 80 | 0.647791 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,593 | 0.216571 |
919b5e557651de3e6e934fa6c4b16a3e517ceea9 | 501 | py | Python | apps/careeropportunity/migrations/0003_careeropportunity_deadline.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 32 | 2017-02-22T13:38:38.000Z | 2022-03-31T23:29:54.000Z | apps/careeropportunity/migrations/0003_careeropportunity_deadline.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 694 | 2017-02-15T23:09:52.000Z | 2022-03-31T23:16:07.000Z | apps/careeropportunity/migrations/0003_careeropportunity_deadline.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 35 | 2017-09-02T21:13:09.000Z | 2022-02-21T11:30:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-05 18:52
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("careeropportunity", "0002_careeropportunity_job_type")]
operations = [
migrations.AddFie... | 26.368421 | 87 | 0.670659 | 344 | 0.685259 | 0 | 0 | 0 | 0 | 0 | 0 | 167 | 0.332669 |
919c72f34a550015e3cadb40b602759ce1ee194d | 14,482 | py | Python | benchmark/python/ffi/benchmark_ffi.py | grygielski/incubator-mxnet | 45952e21a35e32a04b7607b121085973369a42db | [
"BSL-1.0",
"Apache-2.0"
] | 211 | 2016-06-06T08:32:36.000Z | 2021-07-03T16:50:16.000Z | benchmark/python/ffi/benchmark_ffi.py | grygielski/incubator-mxnet | 45952e21a35e32a04b7607b121085973369a42db | [
"BSL-1.0",
"Apache-2.0"
] | 42 | 2017-01-05T02:45:13.000Z | 2020-08-11T23:45:27.000Z | benchmark/python/ffi/benchmark_ffi.py | grygielski/incubator-mxnet | 45952e21a35e32a04b7607b121085973369a42db | [
"BSL-1.0",
"Apache-2.0"
] | 58 | 2016-10-27T07:37:08.000Z | 2021-07-03T16:50:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 51.90681 | 116 | 0.646596 | 543 | 0.037495 | 0 | 0 | 431 | 0.029761 | 0 | 0 | 4,060 | 0.280348 |
919e14a6393eda0c7e38c0fd3d5e470f7982030f | 11,038 | py | Python | first-floor.py | levabd/smart-climat-daemon | 8ff273eeb74fb03ea04fda11b0128fa13d35b500 | [
"MIT"
] | null | null | null | first-floor.py | levabd/smart-climat-daemon | 8ff273eeb74fb03ea04fda11b0128fa13d35b500 | [
"MIT"
] | 1 | 2021-06-02T03:55:13.000Z | 2021-06-02T03:55:13.000Z | first-floor.py | levabd/smart-climat-daemon | 8ff273eeb74fb03ea04fda11b0128fa13d35b500 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
import argparse
import re
import datetime
import paramiko
import requests
# cmd ['ssh', 'smart',
# 'mkdir -p /home/levabd/smart-home-temp-humidity-monitor;
# cat - > /home/levabd/smart-home-temp-humidity-monitor/lr.json']
from miio import chuangmi_plug
from btlewrap import availabl... | 37.80137 | 118 | 0.602102 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,693 | 0.334571 |
919e36250164a66af6592305ae454fa0dbde1d43 | 642 | py | Python | reservior_classification.py | Optimist-Prime/QML-for-MNIST-classification | 7513b3faa548166dba3df927a248e8c7f1ab2a15 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T12:51:47.000Z | 2020-02-04T12:51:47.000Z | reservior_classification.py | Optimist-Prime/QML-for-MNIST-classification | 7513b3faa548166dba3df927a248e8c7f1ab2a15 | [
"BSD-3-Clause"
] | null | null | null | reservior_classification.py | Optimist-Prime/QML-for-MNIST-classification | 7513b3faa548166dba3df927a248e8c7f1ab2a15 | [
"BSD-3-Clause"
] | null | null | null | import pickle
from sklearn.neural_network import MLPClassifier
train = pickle.load(open('train_pca_reservoir_output_200samples.pickle','rb'))
test = pickle.load(open('test_pca_reservoir_output_50samples.pickle','rb'))
train_num = 200
test_num = 50
mlp = MLPClassifier(hidden_layer_sizes=(2000,), max_iter=100, alpha=1... | 37.764706 | 78 | 0.700935 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 147 | 0.228972 |
919f4e67778a5a961b0e58f4deb0ff4d5a7ee8e6 | 4,099 | py | Python | util.py | delmarrerikaine/LPG-PCA | deb631ee2c4c88190ce4204fcbc0765ae5cd8f53 | [
"MIT"
] | 1 | 2021-05-07T01:00:18.000Z | 2021-05-07T01:00:18.000Z | util.py | delmarrerikaine/LPG-PCA | deb631ee2c4c88190ce4204fcbc0765ae5cd8f53 | [
"MIT"
] | null | null | null | util.py | delmarrerikaine/LPG-PCA | deb631ee2c4c88190ce4204fcbc0765ae5cd8f53 | [
"MIT"
] | 2 | 2019-06-29T16:30:32.000Z | 2020-11-18T17:40:47.000Z | import numpy as np
import pandas as pd
from skimage import io
import skimage.measure as measure
import os
from lpg_pca_impl import denoise
def getNoisedImage(originalImage, variance):
# return random_noise(originalImage, mode='gaussian', var=variance)
np.random.seed(42)
noise = np.random.normal(size=origi... | 36.598214 | 141 | 0.658941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 788 | 0.192242 |
91a0653094ec563d20865f6d3bbca729f2752582 | 3,178 | py | Python | ui/ui.py | kringen/wingnut | 73be4f8393720ff0932ab069543e5f2d2308296d | [
"MIT"
] | null | null | null | ui/ui.py | kringen/wingnut | 73be4f8393720ff0932ab069543e5f2d2308296d | [
"MIT"
] | null | null | null | ui/ui.py | kringen/wingnut | 73be4f8393720ff0932ab069543e5f2d2308296d | [
"MIT"
] | null | null | null | import redis
from rq import Queue, Connection
from flask import Flask, render_template, Blueprint, jsonify, request
import tasks
import rq_dashboard
from wingnut import Wingnut
app = Flask(
__name__,
template_folder="./templates",
static_folder="./static",
)
app.config.from_object(rq_dashb... | 29.425926 | 77 | 0.608559 | 0 | 0 | 0 | 0 | 2,686 | 0.845186 | 0 | 0 | 737 | 0.231907 |
91a50c39cf3d401ee6a7a290edb9d36a330b0540 | 42 | py | Python | pytaboola/__init__.py | Openmail/pytaboola | ed71b3b9c5fb2e4452d4b6d40aec1ff037dd5436 | [
"MIT"
] | null | null | null | pytaboola/__init__.py | Openmail/pytaboola | ed71b3b9c5fb2e4452d4b6d40aec1ff037dd5436 | [
"MIT"
] | 2 | 2020-04-27T23:41:57.000Z | 2020-07-30T20:48:59.000Z | pytaboola/__init__.py | Openmail/pytaboola | ed71b3b9c5fb2e4452d4b6d40aec1ff037dd5436 | [
"MIT"
] | null | null | null | from pytaboola.client import TaboolaClient | 42 | 42 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
91a63511fb79b5745ac6428aee3eedeaa5046fe6 | 1,410 | py | Python | omkar/code.py | omi28/ga-learner-dst-repo | 396c35ea56028717a96aed6ca771e39ebf68dc5b | [
"MIT"
] | null | null | null | omkar/code.py | omi28/ga-learner-dst-repo | 396c35ea56028717a96aed6ca771e39ebf68dc5b | [
"MIT"
] | null | null | null | omkar/code.py | omi28/ga-learner-dst-repo | 396c35ea56028717a96aed6ca771e39ebf68dc5b | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#New record
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
data.shape
cenus=np.concatenate((new_record,data),axis=0)
cenus.... | 20.434783 | 57 | 0.719858 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 146 | 0.103546 |
91a824d6a95f0e9a4a572ff289971a58109b3c3c | 3,887 | py | Python | test/present.py | jchampio/apache-websocket | 18ad4ae2fc99381b8d75785f492a479f789b322b | [
"Apache-2.0"
] | 8 | 2015-09-10T21:49:25.000Z | 2022-02-02T04:39:00.000Z | test/present.py | jchampio/apache-websocket | 18ad4ae2fc99381b8d75785f492a479f789b322b | [
"Apache-2.0"
] | 34 | 2015-09-10T21:40:09.000Z | 2020-09-04T22:16:08.000Z | test/present.py | jchampio/apache-websocket | 18ad4ae2fc99381b8d75785f492a479f789b322b | [
"Apache-2.0"
] | 5 | 2016-01-22T05:16:54.000Z | 2017-10-18T12:28:02.000Z | #! /usr/bin/env python
#
# Presents the results of an Autobahn TestSuite run in TAP format.
#
# Copyright 2015 Jacob Champion
#
# 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://ww... | 28.792593 | 84 | 0.623874 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,626 | 0.418317 |
91a977f44ca6b26789c3c66246a46fa0280ee2a7 | 1,143 | py | Python | softwarecollections/scls/migrations/0004_other_repos_default_values.py | WEBZCC/softwarecollections | efee5c3c276033d526a0cdba504d43deff71581e | [
"BSD-3-Clause"
] | 39 | 2016-12-24T02:57:55.000Z | 2022-02-15T09:29:43.000Z | softwarecollections/scls/migrations/0004_other_repos_default_values.py | WEBZCC/softwarecollections | efee5c3c276033d526a0cdba504d43deff71581e | [
"BSD-3-Clause"
] | 32 | 2016-11-21T15:05:07.000Z | 2021-12-06T11:52:32.000Z | softwarecollections/scls/migrations/0004_other_repos_default_values.py | WEBZCC/softwarecollections | efee5c3c276033d526a0cdba504d43deff71581e | [
"BSD-3-Clause"
] | 13 | 2016-12-14T10:42:22.000Z | 2022-01-01T20:35:15.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scls', '0003_other_repos'),
]
operations = [
migrations.AlterField(
model_name='otherrepo',
name='ar... | 32.657143 | 185 | 0.582677 | 1,034 | 0.904637 | 0 | 0 | 0 | 0 | 0 | 0 | 236 | 0.206474 |
91aa65150dc0f4a17f1e9ed16821f5753cc86fa6 | 389 | py | Python | python/Excel/enumerateCells.py | davidgjy/arch-lib | b4402b96d2540995a848e6c5f600b2d99847ded6 | [
"Apache-2.0"
] | null | null | null | python/Excel/enumerateCells.py | davidgjy/arch-lib | b4402b96d2540995a848e6c5f600b2d99847ded6 | [
"Apache-2.0"
] | null | null | null | python/Excel/enumerateCells.py | davidgjy/arch-lib | b4402b96d2540995a848e6c5f600b2d99847ded6 | [
"Apache-2.0"
] | null | null | null | import openpyxl
wb = openpyxl.load_workbook('example.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')
rows = sheet.get_highest_row()
cols = sheet.get_highest_column()
for i in range(1, rows + 1):
for j in range(1, cols + 1):
print('%s: %s' % (sheet.cell(row=i, column=j).coordinate, sheet.cell(row=i, column=j).... | 32.416667 | 96 | 0.59126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.197943 |
91ab6aa12f229c7b9ddab5414461949479dfe028 | 787 | py | Python | plugins/polio/migrations/0029_campaign_country.py | BLSQ/iaso-copy | 85fb17f408c15e8c2d730416d1312f58f8db39b7 | [
"MIT"
] | 29 | 2020-12-26T07:22:19.000Z | 2022-03-07T13:40:09.000Z | plugins/polio/migrations/0029_campaign_country.py | BLSQ/iaso-copy | 85fb17f408c15e8c2d730416d1312f58f8db39b7 | [
"MIT"
] | 150 | 2020-11-09T15:03:27.000Z | 2022-03-07T15:36:07.000Z | plugins/polio/migrations/0029_campaign_country.py | BLSQ/iaso | 95c8087c0182bdd576598eb8cd39c440e58e15d7 | [
"MIT"
] | 4 | 2020-11-09T10:38:13.000Z | 2021-10-04T09:42:47.000Z | # Generated by Django 3.1.13 on 2021-10-04 11:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("iaso", "0107_auto_20211001_1845"),
("polio", "0028_remove_campaign_budget_first_draft_submitted_at"),
]
op... | 28.107143 | 90 | 0.590851 | 660 | 0.838628 | 0 | 0 | 0 | 0 | 0 | 0 | 255 | 0.324015 |
91ac9d140e7247cc524f64941c877611ed2cbd70 | 6,257 | py | Python | CurrencyExchange.py | aarana14/CurrencyExchange | e3f35c1481acf19683a74a41509b1dd37ae48594 | [
"MIT"
] | null | null | null | CurrencyExchange.py | aarana14/CurrencyExchange | e3f35c1481acf19683a74a41509b1dd37ae48594 | [
"MIT"
] | null | null | null | CurrencyExchange.py | aarana14/CurrencyExchange | e3f35c1481acf19683a74a41509b1dd37ae48594 | [
"MIT"
] | null | null | null | #import external libraries used in code
import requests, json
import pycountry
print('Currency Exchange')
currencies = []
def findCurrency():
#Finds all avaliable currencies
allCurrency = (list(pycountry.currencies))
for x in allCurrency:
y = str(x)
y = y[18:21]
#Adds th... | 38.863354 | 189 | 0.61563 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,901 | 0.463641 |
91ad7c273462430b62373174e1161a8ff1416f63 | 715 | py | Python | atcoder/corp/codethxfes2014a_e.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/corp/codethxfes2014a_e.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/corp/codethxfes2014a_e.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | r, c, m = map(int, input().split())
n = int(input())
op = [list(map(lambda x: int(x) - 1, input().split())) for _ in range(n)]
board = [[0 for _ in range(c)] for _ in range(r)]
for ra, rb, ca, cb in op:
for j in range(ra, rb + 1):
for k in range(ca, cb + 1):
board[j][k] += 1
cnt = 0
for i in ra... | 25.535714 | 73 | 0.439161 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
91ad8a5fd94219e90c24839542dbfefd0cc9fc70 | 6,142 | py | Python | scripts/analyse_bse.py | QU-XIAO/yambopy | ff65a4f90c1bfefe642ebc61e490efe781709ff9 | [
"BSD-3-Clause"
] | 21 | 2016-04-07T20:53:29.000Z | 2021-05-14T08:06:02.000Z | scripts/analyse_bse.py | alexmoratalla/yambopy | 8ec0e1e18868ccaadb3eab36c55e6a47021e257d | [
"BSD-3-Clause"
] | 22 | 2016-06-14T22:29:47.000Z | 2021-09-16T15:36:26.000Z | scripts/analyse_bse.py | alexmoratalla/yambopy | 8ec0e1e18868ccaadb3eab36c55e6a47021e257d | [
"BSD-3-Clause"
] | 15 | 2016-06-14T18:40:57.000Z | 2021-08-07T13:17:43.000Z | # Copyright (C) 2018 Alexandre Morlet, Henrique Pereira Coutada Miranda
# All rights reserved.
#
# This file is part of yambopy
#
from __future__ import print_function
from builtins import range
from yambopy import *
from qepy import *
import json
import matplotlib.pyplot as plt
import numpy as np
import sys
import arg... | 36.559524 | 122 | 0.632693 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,995 | 0.487626 |
91ae1121ab522c5ec74869736cdca27ee08ca053 | 3,080 | py | Python | halmodule.py | richteer/pyfatafl | 1faddcf5d9eb36cbc6952b9a8e8bb899989f7112 | [
"MIT"
] | null | null | null | halmodule.py | richteer/pyfatafl | 1faddcf5d9eb36cbc6952b9a8e8bb899989f7112 | [
"MIT"
] | null | null | null | halmodule.py | richteer/pyfatafl | 1faddcf5d9eb36cbc6952b9a8e8bb899989f7112 | [
"MIT"
] | null | null | null | from module import XMPPModule
import halutils
import pyfatafl
class Game():
self.players = []
self.xmpp = None
self.b = None
self.turn = ""
self.mod = None
def __init__(self, mod, p1, p2):
self.players = [p1, p2]
self.mod = mod
self.xmpp = mod.xmpp
self.xmpp.sendMsg(p2, "You have been challenged to play... | 29.615385 | 147 | 0.656494 | 2,964 | 0.962338 | 0 | 0 | 0 | 0 | 0 | 0 | 1,178 | 0.382468 |
91aeb848169969b77dd6c9be3484be7a02c40a1b | 2,218 | py | Python | tools/acetz.py | arkhipenko/AceTime | bc6e6aa530e309b62a204b7574322ba013066b06 | [
"MIT"
] | 1 | 2021-02-23T06:17:36.000Z | 2021-02-23T06:17:36.000Z | tools/acetz.py | arkhipenko/AceTime | bc6e6aa530e309b62a204b7574322ba013066b06 | [
"MIT"
] | null | null | null | tools/acetz.py | arkhipenko/AceTime | bc6e6aa530e309b62a204b7574322ba013066b06 | [
"MIT"
] | null | null | null | from typing import cast, Optional
from datetime import datetime, tzinfo, timedelta
from zonedbpy import zone_infos
from zone_processor.zone_specifier import ZoneSpecifier
from zone_processor.inline_zone_info import ZoneInfo
__version__ = '1.1'
class acetz(tzinfo):
"""An implementation of datetime.tzinfo using th... | 34.65625 | 73 | 0.628945 | 1,753 | 0.790352 | 0 | 0 | 0 | 0 | 0 | 0 | 485 | 0.218665 |
91b2c92f668693110e6ccdfb6fa82e177d314e5d | 8,510 | py | Python | z2/part2/interactive/jm/random_fuzzy_arrows_1/554539540.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 1 | 2020-04-16T12:13:47.000Z | 2020-04-16T12:13:47.000Z | z2/part2/interactive/jm/random_fuzzy_arrows_1/554539540.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:50:15.000Z | 2020-05-19T14:58:30.000Z | z2/part2/interactive/jm/random_fuzzy_arrows_1/554539540.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:45:13.000Z | 2020-06-09T19:18:31.000Z | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 554539540
"""
"""
random actions, total chaos
"""
board = gamma_new(6, 8, 3, 17)
assert board i... | 30.722022 | 46 | 0.653114 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 568 | 0.066745 |
91b37c8672721c9195859e7e71caa5db1a857b4d | 25,928 | py | Python | examples/run_chemistry_parser.py | ZhuoyuWei/transformers | 16d0ebd55d17dd5095231566a0544ecebd56bc9c | [
"Apache-2.0"
] | null | null | null | examples/run_chemistry_parser.py | ZhuoyuWei/transformers | 16d0ebd55d17dd5095231566a0544ecebd56bc9c | [
"Apache-2.0"
] | null | null | null | examples/run_chemistry_parser.py | ZhuoyuWei/transformers | 16d0ebd55d17dd5095231566a0544ecebd56bc9c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The HuggingFace Inc. team.
# Copyright (c) 2019 The HuggingFace Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... | 34.432935 | 127 | 0.612234 | 1,780 | 0.068652 | 0 | 0 | 0 | 0 | 0 | 0 | 6,996 | 0.269824 |
91b41dc55c2835ad843b049f4f5251bad3abf07e | 676 | py | Python | envergo/geodata/management/commands/import_shapefiles.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | null | null | null | envergo/geodata/management/commands/import_shapefiles.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | 6 | 2021-07-12T14:33:18.000Z | 2022-02-14T10:36:09.000Z | envergo/geodata/management/commands/import_shapefiles.py | MTES-MCT/envergo | 8bb6e4ffa15a39edda51b39401db6cc12e73ad0a | [
"MIT"
] | null | null | null | from django.contrib.gis.gdal import DataSource
from django.contrib.gis.utils import LayerMapping
from django.core.management.base import BaseCommand
from envergo.geodata.models import Zone
class Command(BaseCommand):
help = "Importe des zones à partir de shapefiles."
def add_arguments(self, parser):
... | 32.190476 | 60 | 0.695266 | 484 | 0.714919 | 0 | 0 | 0 | 0 | 0 | 0 | 111 | 0.163959 |
91b47f9da5c47dfa6628ace04164ad0d1bc8a057 | 1,710 | py | Python | vimfiles/bundle/ultisnips/test/test_AnonymousExpansion.py | duanqiaobb/vim-for-java | 01b60e4494e65a73c9a9de00f50259d8a7c8d0bb | [
"MIT"
] | null | null | null | vimfiles/bundle/ultisnips/test/test_AnonymousExpansion.py | duanqiaobb/vim-for-java | 01b60e4494e65a73c9a9de00f50259d8a7c8d0bb | [
"MIT"
] | null | null | null | vimfiles/bundle/ultisnips/test/test_AnonymousExpansion.py | duanqiaobb/vim-for-java | 01b60e4494e65a73c9a9de00f50259d8a7c8d0bb | [
"MIT"
] | null | null | null | from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
# Anonymous Expansion {{{#
class _AnonBase(_VimTest):
args = ''
def _extra_options_pre_init(self, vim_config):
vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>'
% (EA, se... | 25.147059 | 77 | 0.615789 | 1,535 | 0.897661 | 0 | 0 | 0 | 0 | 0 | 0 | 631 | 0.369006 |
91b495763107bc2ceb225b3984a8b4ffae309299 | 2,914 | py | Python | data_converter/data_converter.py | jkchen2/JshBot-plugins | b5999fecf0df067e34673ff193dcfbf8c7e2fde2 | [
"MIT"
] | 1 | 2021-08-09T19:28:49.000Z | 2021-08-09T19:28:49.000Z | data_converter/data_converter.py | jkchen2/JshBot-plugins | b5999fecf0df067e34673ff193dcfbf8c7e2fde2 | [
"MIT"
] | null | null | null | data_converter/data_converter.py | jkchen2/JshBot-plugins | b5999fecf0df067e34673ff193dcfbf8c7e2fde2 | [
"MIT"
] | 2 | 2017-07-14T00:15:54.000Z | 2019-03-02T09:46:21.000Z | import discord
from jshbot import utilities, data, configurations, plugins, logger
from jshbot.exceptions import BotException, ConfiguredBotException
from jshbot.commands import (
Command, SubCommand, Shortcut, ArgTypes, Attachment, Arg, Opt, MessageTypes, Response)
__version__ = '0.1.0'
CBException = ConfiguredB... | 38.853333 | 96 | 0.576527 | 0 | 0 | 0 | 0 | 114 | 0.039121 | 207 | 0.071036 | 638 | 0.218943 |
91b5d5a9da8d21cc54215371e88cbf75203f4ad6 | 374 | py | Python | tut2.py | ankit98040/TKINTER-JIS | 8b650138bf8ab2449da83e910ee33c0caee69a8d | [
"Apache-2.0"
] | null | null | null | tut2.py | ankit98040/TKINTER-JIS | 8b650138bf8ab2449da83e910ee33c0caee69a8d | [
"Apache-2.0"
] | null | null | null | tut2.py | ankit98040/TKINTER-JIS | 8b650138bf8ab2449da83e910ee33c0caee69a8d | [
"Apache-2.0"
] | null | null | null | from tkinter import *
from PIL import Image, ImageTk
#python image library
#imagetk supports jpg image
a1 = Tk()
a1.geometry("455x244")
#for png image
#photo = PhotoImage(file="filename.png")
#a2 = Label(image = photo)
#a2.pack()
image = Image.open("PJXlVd.jpg")
photo = ImageTk.PhotoImage(image)
... | 17 | 41 | 0.671123 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 165 | 0.441176 |
91b62cc1816352d2c7a0ead7b1bf1eabb9a68df6 | 8,113 | py | Python | dataset.py | mintanwei/IPCLs-Net | 04937df683216a090c0749cc90ab7e517dbab0fd | [
"MIT"
] | null | null | null | dataset.py | mintanwei/IPCLs-Net | 04937df683216a090c0749cc90ab7e517dbab0fd | [
"MIT"
] | null | null | null | dataset.py | mintanwei/IPCLs-Net | 04937df683216a090c0749cc90ab7e517dbab0fd | [
"MIT"
] | null | null | null | import os
import torch
from PIL import Image
from read_csv import csv_to_label_and_bbx
import numpy as np
from torch.utils.data import Subset, random_split, ConcatDataset
class NBIDataset(object):
def __init__(self, root, transforms, nob3=False):
self.root = root
self.transforms = transforms
... | 32.322709 | 110 | 0.598053 | 6,209 | 0.765315 | 0 | 0 | 0 | 0 | 0 | 0 | 1,778 | 0.219154 |
91b7b2d421c1a0795b99655b4fa4a8c0503e4114 | 1,056 | py | Python | design_patterns/chapter5/mymath.py | FeliciaMJ/PythonLearningJourney | ae1bfac872ee29256e69df6e0e8e507321404cba | [
"Apache-2.0"
] | null | null | null | design_patterns/chapter5/mymath.py | FeliciaMJ/PythonLearningJourney | ae1bfac872ee29256e69df6e0e8e507321404cba | [
"Apache-2.0"
] | null | null | null | design_patterns/chapter5/mymath.py | FeliciaMJ/PythonLearningJourney | ae1bfac872ee29256e69df6e0e8e507321404cba | [
"Apache-2.0"
] | 2 | 2021-04-04T00:27:29.000Z | 2021-06-05T03:26:53.000Z | # coding: utf-8
import functools
def memoize(fn):
known = dict()
@functools.wraps(fn)
def memoizer(*args):
if args not in known:
known[args] = fn(*args)
return known[args]
return memoizer
@memoize
def nsum(n):
'''返回前n个数字的和'''
assert(n >= 0), 'n must be >= 0'
... | 25.142857 | 75 | 0.507576 | 0 | 0 | 0 | 0 | 450 | 0.410584 | 0 | 0 | 348 | 0.317518 |
91b7d7d61842cf27c4aaa82c80b40afa5304b3b0 | 27 | py | Python | transforms/__init__.py | yangyuke001/emotion-expression.shufflenetv2 | d70fd17871fb758eb4fc7d2f9df430cc7e44ad64 | [
"Apache-2.0"
] | 3 | 2019-11-29T01:29:58.000Z | 2020-09-16T12:48:49.000Z | transforms/__init__.py | yangyuke001/emotion-expression.shufflenetv2 | d70fd17871fb758eb4fc7d2f9df430cc7e44ad64 | [
"Apache-2.0"
] | null | null | null | transforms/__init__.py | yangyuke001/emotion-expression.shufflenetv2 | d70fd17871fb758eb4fc7d2f9df430cc7e44ad64 | [
"Apache-2.0"
] | null | null | null |
from .transforms import *
| 9 | 25 | 0.740741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
91b880c2b2d9577a02c8519251133c3cee61564c | 14,894 | py | Python | codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | 1 | 2021-06-18T14:52:03.000Z | 2021-06-18T14:52:03.000Z | codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | 1 | 2019-01-07T13:11:11.000Z | 2019-01-07T13:11:11.000Z | codes/elastoplasticity_spectralAnalysis/planeStress/slowWavePlaneStressSigDriven.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | null | null | null | # !\usr\bin\python
import numpy as np
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import scipy.optimize
from matplotlib import animation
from scipy.integrate import ode
import pdb
# Material parameters
rho = 7800.
E = 2.e11
nu = 0.3
mu = 0.5*E/(1.+nu)
kappa = E/(3.*(1.-2.*nu))
lamb = kappa-2.*mu/3... | 37.422111 | 216 | 0.589701 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,116 | 0.209212 |
91b88e3d926b20d74b8739d087b18e11fc2bf047 | 343 | py | Python | pyhsms/core/connectionstate.py | cherish-web/pyhsms | 83a88b8b45bf1aba30cb7572f44a02478009052b | [
"MIT"
] | 2 | 2021-05-01T12:02:12.000Z | 2021-05-03T14:37:27.000Z | pyhsms/core/connectionstate.py | cherish-web/pyhsms | 83a88b8b45bf1aba30cb7572f44a02478009052b | [
"MIT"
] | null | null | null | pyhsms/core/connectionstate.py | cherish-web/pyhsms | 83a88b8b45bf1aba30cb7572f44a02478009052b | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
#@Time : 2020/7/29 上午 09:49
#@Author : cherish_peng
#@Email : 1058386071@qq.com
#@File : connectionstate.py
#@Software : PyCharm
from enum import Enum
class ConnectionState(Enum):
'''
ConnectionState enum
'''
DisConnected = 0
Connecting=1
Connected=2
... | 21.4375 | 32 | 0.626822 | 150 | 0.432277 | 0 | 0 | 0 | 0 | 0 | 0 | 205 | 0.590778 |
91b96455218c552cfb88f8804f7f9440605930b5 | 84,787 | py | Python | lifelines/fitters/coxph_fitter.py | msanpe/lifelines | a73d441f6347332ca870bf2ec32eeeca410dc6de | [
"MIT"
] | null | null | null | lifelines/fitters/coxph_fitter.py | msanpe/lifelines | a73d441f6347332ca870bf2ec32eeeca410dc6de | [
"MIT"
] | null | null | null | lifelines/fitters/coxph_fitter.py | msanpe/lifelines | a73d441f6347332ca870bf2ec32eeeca410dc6de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
from datetime import datetime
import warnings
from textwrap import dedent, fill
import numpy as np
import pandas as pd
from numpy.linalg import norm, inv
from scipy.linalg import solve as spsolve, LinAlgError
from scipy.integrate import trapz
from scipy import stats
from lifelines.... | 40.374762 | 354 | 0.585868 | 83,610 | 0.985955 | 789 | 0.009304 | 13,847 | 0.163288 | 0 | 0 | 37,787 | 0.445596 |
91ba64e37706ae1e4223523b060a3928b5d8e678 | 393 | py | Python | nlp_server/config/test/test_config.py | asevans48/NLPServer | 6feb1d89748165f9efea40d0777d355044c48176 | [
"Apache-2.0"
] | null | null | null | nlp_server/config/test/test_config.py | asevans48/NLPServer | 6feb1d89748165f9efea40d0777d355044c48176 | [
"Apache-2.0"
] | null | null | null | nlp_server/config/test/test_config.py | asevans48/NLPServer | 6feb1d89748165f9efea40d0777d355044c48176 | [
"Apache-2.0"
] | null | null | null | """
Test configuration loading
@author aevans
"""
import os
from nlp_server.config import load_config
def test_load_config():
"""
Test loading a configuration
"""
current_dir = os.path.curdir
test_path = os.path.sep.join([current_dir, 'data', 'test_config.json'])
cfg = load_config.load_conf... | 18.714286 | 75 | 0.699746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 118 | 0.300254 |
91bc729480a0e69ec82630c25580e01aa1aa5937 | 4,469 | py | Python | frappe/utils/safe_exec.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | frappe/utils/safe_exec.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | frappe/utils/safe_exec.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null |
import os, json, inspect
import mimetypes
from html2text import html2text
from RestrictedPython import compile_restricted, safe_globals
import RestrictedPython.Guards
import frappe
import frappe.utils
import frappe.utils.data
from frappe.website.utils import (get_shade, get_toc, get_next_link)
from frappe.modules impo... | 29.401316 | 118 | 0.762587 | 58 | 0.012978 | 0 | 0 | 0 | 0 | 0 | 0 | 702 | 0.157082 |
91bccefcfa09a20e9fc27c2975179329c5876dd6 | 2,461 | py | Python | simplejson/ordered_dict.py | BarracudaPff/code-golf-data-pythpn | 42e8858c2ebc6a061012bcadb167d29cebb85c5e | [
"MIT"
] | null | null | null | simplejson/ordered_dict.py | BarracudaPff/code-golf-data-pythpn | 42e8858c2ebc6a061012bcadb167d29cebb85c5e | [
"MIT"
] | null | null | null | simplejson/ordered_dict.py | BarracudaPff/code-golf-data-pythpn | 42e8858c2ebc6a061012bcadb167d29cebb85c5e | [
"MIT"
] | null | null | null | """Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
try:
all
except NameError:
def all(seq):
for elem in seq:
if not elem:
return False
return True
class OrderedDict(dict, DictMixin):
def __init__(self, *args, **kwds):
if len(args) > 1:... | 26.180851 | 94 | 0.670053 | 2,232 | 0.906948 | 232 | 0.094271 | 118 | 0.047948 | 0 | 0 | 192 | 0.078017 |
91be6d919cdb079a9a7700432f62e3627d2ca47d | 286 | py | Python | Water.py | KRHS-GameProgramming-2015/Adlez | 8912da1ee4b3c7b105851dbcc00579ff0c3cf33e | [
"BSD-2-Clause"
] | null | null | null | Water.py | KRHS-GameProgramming-2015/Adlez | 8912da1ee4b3c7b105851dbcc00579ff0c3cf33e | [
"BSD-2-Clause"
] | 4 | 2016-04-01T15:12:31.000Z | 2016-04-18T15:05:29.000Z | Water.py | KRHS-GameProgramming-2015/Adlez | 8912da1ee4b3c7b105851dbcc00579ff0c3cf33e | [
"BSD-2-Clause"
] | null | null | null | from HardBlock import *
class Water(HardBlock):
def __init__(self, pos=[0,0], blockSize = 25):
image = "Block/Block Images/water.png"
HardBlock.__init__(self, image, pos, blockSize)
def update(*args):
pass
| 17.875 | 55 | 0.534965 | 214 | 0.748252 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0.104895 |
91be89ca5480384018cb3e20d95ea9abdcb4c1bb | 4,136 | py | Python | baselines/bc.py | bgalbraith/minerl-haiku-baselines | c33b14699af14c904394d9c4e30dee680a8718d6 | [
"Apache-2.0"
] | 2 | 2020-07-11T07:56:46.000Z | 2020-08-20T07:59:53.000Z | baselines/bc.py | bgalbraith/minerl-haiku-baselines | c33b14699af14c904394d9c4e30dee680a8718d6 | [
"Apache-2.0"
] | null | null | null | baselines/bc.py | bgalbraith/minerl-haiku-baselines | c33b14699af14c904394d9c4e30dee680a8718d6 | [
"Apache-2.0"
] | null | null | null | import dill
import haiku as hk
import jax
from jax.experimental import optix
import jax.numpy as jnp
from dataset import load_data
MINERL_ENV = 'MineRLTreechopVectorObf-v0'
PARAMS_FILENAME = 'bc_params_treechop.pkl'
class PovStack(hk.Module):
""" PovStack is a module for processing the point-of-view image data... | 30.411765 | 105 | 0.579787 | 2,124 | 0.51354 | 0 | 0 | 734 | 0.177466 | 0 | 0 | 947 | 0.228965 |
91c15e0720d4970bd1fb3bf3b4458b92fb250bec | 3,236 | py | Python | qiskit/circuit/library/templates/__init__.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | qiskit/circuit/library/templates/__init__.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 6 | 2021-01-17T17:56:08.000Z | 2021-04-01T12:40:21.000Z | qiskit/circuit/library/templates/__init__.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 48.298507 | 79 | 0.860939 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 724 | 0.223733 |
91c2124933101c4997c3e85497e979cf423b2846 | 10,418 | py | Python | Tests/test_ironmath.py | btddg28/ironpython | 8006238c19d08db5db9bada39d765143e631059e | [
"Apache-2.0"
] | null | null | null | Tests/test_ironmath.py | btddg28/ironpython | 8006238c19d08db5db9bada39d765143e631059e | [
"Apache-2.0"
] | null | null | null | Tests/test_ironmath.py | btddg28/ironpython | 8006238c19d08db5db9bada39d765143e631059e | [
"Apache-2.0"
] | null | null | null | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | 41.015748 | 241 | 0.656748 | 64 | 0.006143 | 0 | 0 | 0 | 0 | 0 | 0 | 969 | 0.093012 |
91c2c2561ea4fef57e7b95890c99ab69daf79a23 | 6,939 | py | Python | python/lib/viewer/gener_q_vs_w_for_df.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | python/lib/viewer/gener_q_vs_w_for_df.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | python/lib/viewer/gener_q_vs_w_for_df.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt, numpy as np, pandas as pd,os
from ..model import recall_powerlaw_fits_to_full_models
from .. import compute_power_rmse
from .bluf import *
from ..measure.powerlaw import *
from .gener_q_vs_w_for_result_folder import *
def q_vs_w_plotter_function_from_df(ax,df):
# npartitions=os.cp... | 39.651429 | 130 | 0.678484 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,504 | 0.360859 |
91c49a7dc1b6f619c4919335c93fb67b97477b88 | 7,917 | py | Python | decatt/model.py | achyudh/castor | d7a02ce03f2b71ef1fa490122dd4bbc8214b8b19 | [
"Apache-2.0"
] | 132 | 2017-04-02T12:31:55.000Z | 2019-03-09T07:53:29.000Z | decatt/model.py | sudipta90/castor | fa2f59535c71a0fb4586afbe543b81ba812c8630 | [
"Apache-2.0"
] | 111 | 2017-04-01T23:00:24.000Z | 2019-03-10T08:29:20.000Z | decatt/model.py | sudipta90/castor | fa2f59535c71a0fb4586afbe543b81ba812c8630 | [
"Apache-2.0"
] | 53 | 2017-04-06T01:17:18.000Z | 2019-02-27T03:10:35.000Z | import sys
import math
import numpy as np
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class DecAtt(nn.Module):
def __init__(self, num_units, num_classes, embedding_size, dropout, device=0,
training=True, p... | 46.298246 | 136 | 0.653909 | 7,737 | 0.977264 | 0 | 0 | 0 | 0 | 0 | 0 | 2,196 | 0.277378 |