hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46b0958ace251e5b1da9ac4af71518f3076fe34f | 3,791 | py | Python | Matrix_visualisation.py | NLESC-JCER/sparse_solver | 59c44108f807034b740af7b5470788d40a2f962d | [
"Apache-2.0"
] | null | null | null | Matrix_visualisation.py | NLESC-JCER/sparse_solver | 59c44108f807034b740af7b5470788d40a2f962d | [
"Apache-2.0"
] | null | null | null | Matrix_visualisation.py | NLESC-JCER/sparse_solver | 59c44108f807034b740af7b5470788d40a2f962d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
# In[3]:
import matplotlib.pyplot as plt
from os import listdir
from os.path import isfile, join
# In[4]:
import scipy.io as scp
get_ipython().run_line_magic('matplotlib', 'inline')
plt.rcParams['figure.figsize'] = [14, 14]
# In[28]:
path... | 8.596372 | 63 | 0.543656 |
3c7c3d5243247a54c2e8d6a1ecaaec5d4134309e | 107,581 | py | Python | qcodes/instrument_drivers/ZI/ZIUHFLI.py | ThorvaldLarsen/Qcodes | 230881f7a4b5378c504c6e52c964a211191bde2e | [
"MIT"
] | null | null | null | qcodes/instrument_drivers/ZI/ZIUHFLI.py | ThorvaldLarsen/Qcodes | 230881f7a4b5378c504c6e52c964a211191bde2e | [
"MIT"
] | null | null | null | qcodes/instrument_drivers/ZI/ZIUHFLI.py | ThorvaldLarsen/Qcodes | 230881f7a4b5378c504c6e52c964a211191bde2e | [
"MIT"
] | 1 | 2020-04-24T01:15:44.000Z | 2020-04-24T01:15:44.000Z | import math
import time
import logging
import numpy as np
from functools import partial
from math import sqrt
from typing import Callable, List, Union, cast, Optional, Sequence, Dict
from qcodes.utils.helpers import create_on_off_val_mapping
try:
import zhinst.utils
except ImportError:
raise ImportError('''C... | 46.132504 | 106 | 0.457135 |
8c2e679b6bcb8ad58d8f5d93b70cbc469b39b243 | 2,566 | py | Python | examples/int8/training/vgg16/export_ckpt.py | svenchilton/Torch-TensorRT | 95d2b6e003a0392fe08ce49520f015c230d4c750 | [
"BSD-3-Clause"
] | 944 | 2020-03-13T22:50:32.000Z | 2021-11-09T05:39:28.000Z | examples/int8/training/vgg16/export_ckpt.py | svenchilton/Torch-TensorRT | 95d2b6e003a0392fe08ce49520f015c230d4c750 | [
"BSD-3-Clause"
] | 434 | 2020-03-18T03:00:29.000Z | 2021-11-09T00:26:36.000Z | examples/int8/training/vgg16/export_ckpt.py | svenchilton/Torch-TensorRT | 95d2b6e003a0392fe08ce49520f015c230d4c750 | [
"BSD-3-Clause"
] | 106 | 2020-03-18T02:20:21.000Z | 2021-11-08T18:58:58.000Z | import argparse
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from vgg16 import vgg16
def test(model, dataloader, crit):
global writer
global classes
total =... | 32.075 | 111 | 0.632112 |
cb67d0887a6263cbb0584e500a5bd2e6c98edb5e | 435 | py | Python | cogs/fun/bunger.py | Tofucookie/LoadXBare-Bot | 835f9d308e037880cb0ef1172a3e139d120a76ca | [
"MIT"
] | null | null | null | cogs/fun/bunger.py | Tofucookie/LoadXBare-Bot | 835f9d308e037880cb0ef1172a3e139d120a76ca | [
"MIT"
] | null | null | null | cogs/fun/bunger.py | Tofucookie/LoadXBare-Bot | 835f9d308e037880cb0ef1172a3e139d120a76ca | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from cogs.cog_settings import embed_color
class Bunger(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def bunger(self, ctx):
embed = discord.Embed(color=embed_color)
embed.set_image(url='ht... | 25.588235 | 62 | 0.664368 |
39cf8ef42d0af6c05c6278ce47e6f257a691c564 | 2,822 | py | Python | demo/sphere/sphere_numpy.py | icemiliang/pyvot | 61a37c0ac35d9ac4b35a1ac77613404e2ea7d263 | [
"MIT"
] | 37 | 2018-11-29T06:52:54.000Z | 2022-02-25T01:12:33.000Z | demo/sphere/sphere_numpy.py | icemiliang/pyvot | 61a37c0ac35d9ac4b35a1ac77613404e2ea7d263 | [
"MIT"
] | 6 | 2018-11-30T16:59:01.000Z | 2021-01-27T05:38:23.000Z | demo/sphere/sphere_numpy.py | icemiliang/pyvot | 61a37c0ac35d9ac4b35a1ac77613404e2ea7d263 | [
"MIT"
] | 8 | 2018-11-30T04:15:01.000Z | 2020-11-16T15:29:20.000Z | # PyVot Python Variational Optimal Transportation
# Author: Liang Mi <icemiliang@gmail.com>
# Date: April 28th 2020
# Licence: MIT
import os
import sys
import numpy as np
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from ... | 31.010989 | 116 | 0.580085 |
25fc9b71e4cadcb426d976438522546ade7ccf56 | 6,241 | py | Python | Method/SimulatedAnnealingAlgorithm.py | KampfWut/meta_heuristic_algorithm | 6506c533696b2148233968b98c0af43554a6acd4 | [
"MIT"
] | null | null | null | Method/SimulatedAnnealingAlgorithm.py | KampfWut/meta_heuristic_algorithm | 6506c533696b2148233968b98c0af43554a6acd4 | [
"MIT"
] | null | null | null | Method/SimulatedAnnealingAlgorithm.py | KampfWut/meta_heuristic_algorithm | 6506c533696b2148233968b98c0af43554a6acd4 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
"""
author: Apeiria
contact: apeiriaStar@outlook.com
file: SimulatedAnnealingAlgorithm.py
function: Simulated Annealing Algorithm correlation
"""
# ---------------------------------- import --------------------------------- #
import time
import math
import random
from Method.Ge... | 38.054878 | 93 | 0.533408 |
148e86d8f324cb0bec680f97ed71bba928aa1987 | 8,160 | py | Python | pyserver/item/grac/groupy_base.py | lbouma/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 15 | 2015-05-06T05:11:48.000Z | 2021-12-03T14:56:58.000Z | pyserver/item/grac/groupy_base.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | null | null | null | pyserver/item/grac/groupy_base.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 8 | 2015-05-06T05:11:36.000Z | 2020-11-04T05:11:22.000Z | # Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import conf
import g
from grax.access_infer import Access_Infer
from grax.access_style import Access_Style
from grax.access_level import Access_Level
from grax.access_scope import Access_Scope
from gwis.exce... | 32.50996 | 79 | 0.599632 |
29fe53120eb968031deb9fcd44e4779b7ce4932c | 667 | py | Python | app/manage.py | khazelton/django-tdd-docker | 970846fbcdda9176d47f1f6ec4dd045d779e679d | [
"Apache-2.0"
] | null | null | null | app/manage.py | khazelton/django-tdd-docker | 970846fbcdda9176d47f1f6ec4dd045d779e679d | [
"Apache-2.0"
] | null | null | null | app/manage.py | khazelton/django-tdd-docker | 970846fbcdda9176d47f1f6ec4dd045d779e679d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drf_project.settings')
try:
from django.core.management import execute_from_command_line
except ... | 29 | 75 | 0.68066 |
9db59b5444a11be793ac6088120ea5c5709fb397 | 1,087 | py | Python | moi/menu/templatetags/menu_tag.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | null | null | null | moi/menu/templatetags/menu_tag.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | 33 | 2015-05-06T00:47:20.000Z | 2016-11-08T21:13:44.000Z | moi/menu/templatetags/menu_tag.py | Ecotrust/F2S-MOI | aeb38942d6539c50f252ea3ff6fbff07aabc5088 | [
"Apache-2.0"
] | null | null | null | from django import template
from django.template.loader import get_template
from wagtail.wagtailimages.models import Image
from menu.models import Menu, MainFooterText, SecondaryFooterText
from home.models import HomePage
register = template.Library()
def logo():
image = Image.objects.filter(tags__name__in=["na... | 25.27907 | 67 | 0.718491 |
d106604d431826ec90afb2b49260cba5b5ea3d62 | 5,190 | py | Python | paddlenlp/datasets/vqa2.py | chenkangyang/PaddleNLP | 0d4a8a80c8c20d774db207fae214509be402d149 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/vqa2.py | chenkangyang/PaddleNLP | 0d4a8a80c8c20d774db207fae214509be402d149 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/vqa2.py | chenkangyang/PaddleNLP | 0d4a8a80c8c20d774db207fae214509be402d149 | [
"Apache-2.0"
] | null | null | null | import collections
import numpy as np
import os
from paddle.dataset.common import md5file
from paddle.utils.download import get_path_from_url
from paddlenlp.utils.env import DATA_HOME
from . import DatasetBuilder
__all__ = ['VQA2']
class VQA2(DatasetBuilder):
URL_ANNO = "https://bj.bcebos.com/v1/ai-studio-onlin... | 40.866142 | 182 | 0.592486 |
5bdd59068a7e4ecec45fba7e5c8c0b43e58d2e6f | 3,280 | py | Python | app/http/controllers/game/gametree.py | cothan/chinese-chess | f896efda7da2b448ffaa1e92ac04397014bde24a | [
"MIT"
] | null | null | null | app/http/controllers/game/gametree.py | cothan/chinese-chess | f896efda7da2b448ffaa1e92ac04397014bde24a | [
"MIT"
] | null | null | null | app/http/controllers/game/gametree.py | cothan/chinese-chess | f896efda7da2b448ffaa1e92ac04397014bde24a | [
"MIT"
] | null | null | null | from app.http.controllers.game.pieces import *
from app.http.controllers.game.state_representation import *
from random import shuffle
class GameTree(object):
'''
Class is used to find the best move based on a game tree search with
alpha beta pruning. It must be initialized as Gametree(gamestate,depth)
... | 36.853933 | 120 | 0.568598 |
ae68df19b430c210adb321d25901dad57703a1b0 | 624 | py | Python | func/python/mat_mul.py | mfournial/Faasm | f6c48b8b38b78c1b14a7b5557f3bccad9d4424ae | [
"Apache-2.0"
] | 1 | 2020-04-21T07:33:42.000Z | 2020-04-21T07:33:42.000Z | func/python/mat_mul.py | mfournial/Faasm | f6c48b8b38b78c1b14a7b5557f3bccad9d4424ae | [
"Apache-2.0"
] | 4 | 2020-02-03T18:54:32.000Z | 2020-05-13T18:28:28.000Z | func/python/mat_mul.py | mfournial/Faasm | f6c48b8b38b78c1b14a7b5557f3bccad9d4424ae | [
"Apache-2.0"
] | null | null | null | import pyfaasm.matrix as mat
from pyfaasm.core import get_input, set_output
# Note - slight hack here as PyFaasm matrix multiplication expects top-level
# functions of the names in the matrix module
def divide_and_conquer():
print("Kicking off divide and conquer")
mat.divide_and_conquer()
output = "Matri... | 26 | 76 | 0.758013 |
35ba1c8c663a63d64fceeac1328852fc689bd12f | 6,985 | py | Python | client/commands/tests/servers_test.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | 1 | 2022-02-10T10:51:32.000Z | 2022-02-10T10:51:32.000Z | client/commands/tests/servers_test.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | null | null | null | client/commands/tests/servers_test.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import socketserver
import tempfile
from pathlib import Path
import testslide
from ...tests import setup
from ..servers import... | 31.32287 | 87 | 0.379814 |
8706c8b71f1a316d968fa8c200a7463be2fc5cc0 | 3,501 | py | Python | examples/dfp/v201505/inventory_service/get_ad_unit_hierarchy.py | wbrp/googleads-python-lib | c0f8ce6c4acfe88ce8f913a4f0e0e92b548e1022 | [
"Apache-2.0"
] | 1 | 2020-05-23T11:32:32.000Z | 2020-05-23T11:32:32.000Z | examples/dfp/v201505/inventory_service/get_ad_unit_hierarchy.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201505/inventory_service/get_ad_unit_hierarchy.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | 2 | 2018-04-20T02:16:33.000Z | 2020-11-12T20:58:54.000Z | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 30.181034 | 78 | 0.716938 |
207e4e634c51bb9485cd3bb1db0086c339520090 | 5,170 | py | Python | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | ZiBuDo/MyCareer | 41a686f199e5e88ff4d863c54304b8128bd87580 | [
"CC0-1.0"
] | null | null | null | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | ZiBuDo/MyCareer | 41a686f199e5e88ff4d863c54304b8128bd87580 | [
"CC0-1.0"
] | null | null | null | examples/neighbors/plot_approximate_nearest_neighbors_hyperparameters.py | ZiBuDo/MyCareer | 41a686f199e5e88ff4d863c54304b8128bd87580 | [
"CC0-1.0"
] | null | null | null | """
=================================================
Hyper-parameters of Approximate Nearest Neighbors
=================================================
This example demonstrates the behaviour of the
accuracy of the nearest neighbor queries of Locality Sensitive Hashing
Forest as the number of candidates and the numb... | 38.87218 | 79 | 0.667698 |
0859a67556428086f158f8e51729fc76b843fd20 | 17,480 | py | Python | detectron2/modeling/box_regression.py | tu-nv/detectron2 | 7394ed4eb6a5088ce25772e4a35c78de63c3d1a3 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/box_regression.py | tu-nv/detectron2 | 7394ed4eb6a5088ce25772e4a35c78de63c3d1a3 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/box_regression.py | tu-nv/detectron2 | 7394ed4eb6a5088ce25772e4a35c78de63c3d1a3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import math
from typing import List, Tuple, Union
import torch
from fvcore.nn import giou_loss, smooth_l1_loss
from torch.nn import functional as F
from detectron2.layers import cat, ciou_loss, diou_loss, cdiou_loss, aiou_loss
from detectron2.structures import Boxes
... | 41.818182 | 109 | 0.59754 |
bcab99371d4ef107a6dad688a306480d2c99ce7e | 5,363 | py | Python | data/data_gen_pong.py | Adaptive-RL/AdaRL-code | 493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f | [
"MIT"
] | 8 | 2022-03-15T04:24:03.000Z | 2022-03-18T08:33:22.000Z | data/data_gen_pong.py | Adaptive-RL/AdaRL-code | 493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f | [
"MIT"
] | 1 | 2022-03-17T07:17:03.000Z | 2022-03-20T06:23:12.000Z | data/data_gen_pong.py | Adaptive-RL/AdaRL-code | 493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f | [
"MIT"
] | 1 | 2022-03-18T06:08:37.000Z | 2022-03-18T06:08:37.000Z | import cv2
import numpy as np
import os
import argparse
import sys
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), '.')))
import gym
import gym_pong
MAX_FRAMES = 1000
MAX_TRIALS = 10000
# 15 is the length of bar
L = 15 / 2
parser = argparse.ArgumentParser()
parser.add_argument('-name', type=str, required=... | 39.433824 | 128 | 0.551184 |
b677fe8829d2b9b19ff32e2c285d77e847c25abd | 11,440 | py | Python | Python Backend/diarization/build/lib/s4d/segmentation.py | AdityaK1211/Final_Year_Project_SCET | 1a6092e1345dad473375ada787fb5cb00ee7515f | [
"MIT"
] | 1 | 2022-02-15T02:49:22.000Z | 2022-02-15T02:49:22.000Z | Python Backend/diarization/build/lib/s4d/segmentation.py | AdityaK1211/Final_Year_Project_SCET | 1a6092e1345dad473375ada787fb5cb00ee7515f | [
"MIT"
] | null | null | null | Python Backend/diarization/build/lib/s4d/segmentation.py | AdityaK1211/Final_Year_Project_SCET | 1a6092e1345dad473375ada787fb5cb00ee7515f | [
"MIT"
] | 2 | 2021-07-11T12:42:43.000Z | 2022-02-15T02:49:24.000Z | __author__ = 'meignier'
import logging
from s4d.diar import Diar
import numpy as np
import pandas as pd
from s4d.clustering.hac_bic import GaussFull
from s4d.clustering.hac_utils import bic_square_root
import copy
import scipy
def sanity_check(cep, show, cluster='init'):
"""
Removes equal MFCC of *cep* and r... | 36.31746 | 96 | 0.64493 |
1b359de4ec86305f9844d48bcde5ac86d4da6a61 | 2,684 | py | Python | parser/common/exception.py | spzala/tosca-parser | ebd3214d9bf7f86cf8341f95c3d3185dd8e43c0c | [
"Apache-2.0"
] | null | null | null | parser/common/exception.py | spzala/tosca-parser | ebd3214d9bf7f86cf8341f95c3d3185dd8e43c0c | [
"Apache-2.0"
] | null | null | null | parser/common/exception.py | spzala/tosca-parser | ebd3214d9bf7f86cf8341f95c3d3185dd8e43c0c | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 27.670103 | 78 | 0.679583 |
d3dbb0501ebcaa39cc66faf1e33de4d0a0c1b62a | 1,806 | py | Python | sila_cetoni/core/sila/core_service/generated/systemstatusprovider/systemstatusprovider_base.py | CETONI-Software/sila_cetoni_core | 01395abc6e434d66ba2da56c90c81d3ecb805113 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:40:00.000Z | 2022-03-08T13:40:00.000Z | sila_cetoni/core/sila/core_service/generated/systemstatusprovider/systemstatusprovider_base.py | CETONI-Software/sila_cetoni_core | 01395abc6e434d66ba2da56c90c81d3ecb805113 | [
"BSD-3-Clause"
] | null | null | null | sila_cetoni/core/sila/core_service/generated/systemstatusprovider/systemstatusprovider_base.py | CETONI-Software/sila_cetoni_core | 01395abc6e434d66ba2da56c90c81d3ecb805113 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from abc import ABC
from queue import Queue
from typing import Any, Dict
from sila2.framework import FullyQualifiedIdentifier
from sila2.server import FeatureImplementationBase
class SystemStatusProviderBase(FeatureImplementationBase, ABC):
_SystemState_producer_queue: Queue[... | 45.15 | 377 | 0.735327 |
f4d24e5227f10fba5a340dbf3402ff15c8d5a311 | 10,323 | py | Python | salt/modules/cryptdev.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | salt/modules/cryptdev.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | salt/modules/cryptdev.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
Salt module to manage Unix cryptsetup jobs and the crypttab file
.. versionadded:: 2018.3.0
"""
# Import python libraries
import logging
import os
import re
# Import salt libraries
import salt.utils.files
import salt.utils.platform
import salt.utils.stringutils
from salt.exceptions import CommandExecutionError
... | 29.078873 | 87 | 0.584326 |
f3218339d860a3e4a5fe84d06da1e74eb59f9734 | 19,776 | py | Python | fsdet/engine/defaults.py | chouxianyu/TFA | 8802aeb66fbc3a5081fa3dfb2830ca517718afe1 | [
"Apache-2.0"
] | null | null | null | fsdet/engine/defaults.py | chouxianyu/TFA | 8802aeb66fbc3a5081fa3dfb2830ca517718afe1 | [
"Apache-2.0"
] | null | null | null | fsdet/engine/defaults.py | chouxianyu/TFA | 8802aeb66fbc3a5081fa3dfb2830ca517718afe1 | [
"Apache-2.0"
] | null | null | null | """
This file contains components with some default boilerplate logic user may need
in training / testing. They will not work for everyone, but many users may find them useful.
The behavior of functions/classes in this file is subject to change,
since they are meant to represent the "common default behavior" people ne... | 33.405405 | 98 | 0.621056 |
0ee9d4ef6cb5b46e4ec54a859dffb94547acbb5b | 3,775 | py | Python | deepbond/stats.py | mtreviso/deepbondd | 0f412496eff000ba09de7d4ee5ccfa63f5ad4ab6 | [
"MIT"
] | 15 | 2019-05-26T05:04:23.000Z | 2022-03-23T22:35:28.000Z | deepbond/stats.py | mtreviso/deepbondd | 0f412496eff000ba09de7d4ee5ccfa63f5ad4ab6 | [
"MIT"
] | null | null | null | deepbond/stats.py | mtreviso/deepbondd | 0f412496eff000ba09de7d4ee5ccfa63f5ad4ab6 | [
"MIT"
] | 2 | 2019-11-27T13:19:59.000Z | 2020-01-27T11:23:28.000Z | import numpy as np
from sklearn.metrics import precision_recall_fscore_support, matthews_corrcoef
from deepbond import constants
from deepbond.models.utils import unroll, unmask
class BestValueEpoch:
def __init__(self, value, epoch):
self.value = value
self.epoch = epoch
class Stats(object):
... | 31.991525 | 78 | 0.621192 |
fbd80c8a97c7d31e90bfe88938e61e0d76c8ae39 | 2,867 | py | Python | shipstation_integration/items.py | ParsimonyGit/shipstation_integration | c83a75225b75a9c4cd172bfc0ab809c2dba7003a | [
"MIT"
] | 8 | 2021-01-15T17:20:11.000Z | 2022-01-13T06:55:35.000Z | shipstation_integration/items.py | mohsinalimat/shipstation_integration | de3c29fa70f9b34dfd123da54a051ef3b78acd64 | [
"MIT"
] | 39 | 2021-01-21T11:11:59.000Z | 2022-03-22T12:12:21.000Z | shipstation_integration/items.py | mohsinalimat/shipstation_integration | de3c29fa70f9b34dfd123da54a051ef3b78acd64 | [
"MIT"
] | 7 | 2021-01-18T09:43:27.000Z | 2021-07-29T00:59:44.000Z | from typing import TYPE_CHECKING, Optional, Union
from shipstation.models import ShipStationItem, ShipStationOrderItem
import frappe
from frappe.utils import flt
if TYPE_CHECKING:
from shipstation_integration.shipstation_integration.doctype.shipstation_store.shipstation_store import (
ShipstationStore,
)
from s... | 30.5 | 112 | 0.731078 |
84cc56133bb3b0271752d6852e0c6fb95c84056e | 202 | py | Python | data_parse.py | arfc/mlmc | 15add7ffaa6f586b76c20a5a66bb9e702a9ae5fd | [
"BSD-3-Clause"
] | 5 | 2017-09-07T14:33:19.000Z | 2020-02-04T21:25:41.000Z | data_parse.py | arfc/mlmc | 15add7ffaa6f586b76c20a5a66bb9e702a9ae5fd | [
"BSD-3-Clause"
] | 9 | 2017-08-28T18:54:21.000Z | 2018-05-31T17:26:37.000Z | data_parse.py | arfc/mlmc | 15add7ffaa6f586b76c20a5a66bb9e702a9ae5fd | [
"BSD-3-Clause"
] | 1 | 2018-03-18T23:29:51.000Z | 2018-03-18T23:29:51.000Z | import h5py
filename = 'summary.h5'
f = h5py.File(filename, 'r')
# List all groups
print("Keys: %s" % f.keys())
a_group_key = list(f.keys())[0]
# Get the data
data = list(f[a_group_key])
print(data)
| 15.538462 | 31 | 0.658416 |
66a3c5eb8be64e2b3adc6dbc0b395b0530a194b8 | 969 | py | Python | dissect/traits/gen_params.py | dufkan/DiSSECT | 834755f106fefff2475bd247c414aa6d13ec0851 | [
"MIT"
] | 7 | 2021-06-09T12:46:43.000Z | 2022-02-17T00:46:08.000Z | dissect/traits/gen_params.py | dufkan/DiSSECT | 834755f106fefff2475bd247c414aa6d13ec0851 | [
"MIT"
] | null | null | null | dissect/traits/gen_params.py | dufkan/DiSSECT | 834755f106fefff2475bd247c414aa6d13ec0851 | [
"MIT"
] | 2 | 2021-06-14T17:08:56.000Z | 2021-07-25T21:59:12.000Z | #!/usr/bin/env python3
import json
from pathlib import Path
from dissect.definitions import TRAIT_PATH
def read_default(path):
with open(Path(path), "r") as f:
return json.load(f)
def write_file(name, path, to_write, message):
with open(path, "w") as f:
json.dump(to_write, f)
print(mes... | 26.189189 | 80 | 0.621259 |
21ee29b9a97d327bbc451302bdb21646894d35da | 1,367 | py | Python | improviser-client/improviser_client/api/backing_tracks/get_backing_track_wizard_resource_list.py | acidjunk/improviser-api-client | f4c9ad69f2cbb0ac677cf49115f0f541035160da | [
"MIT"
] | null | null | null | improviser-client/improviser_client/api/backing_tracks/get_backing_track_wizard_resource_list.py | acidjunk/improviser-api-client | f4c9ad69f2cbb0ac677cf49115f0f541035160da | [
"MIT"
] | null | null | null | improviser-client/improviser_client/api/backing_tracks/get_backing_track_wizard_resource_list.py | acidjunk/improviser-api-client | f4c9ad69f2cbb0ac677cf49115f0f541035160da | [
"MIT"
] | null | null | null | from typing import Any, Dict
import httpx
from ...client import Client
from ...types import Response
def _get_kwargs(
*,
client: Client,
exercise_id: str,
) -> Dict[str, Any]:
url = "{}/v1/backing-tracks/for/{exercise_id}".format(client.base_url, exercise_id=exercise_id)
headers: Dict[str, Any]... | 20.402985 | 99 | 0.629846 |
8ec3c1f11add9ae4aa3299525bd45daf763575cf | 11,004 | py | Python | main.py | dinesh-GDK/StyleTx | 967226df969d094894f3066e009020ef35ed2f48 | [
"MIT"
] | null | null | null | main.py | dinesh-GDK/StyleTx | 967226df969d094894f3066e009020ef35ed2f48 | [
"MIT"
] | null | null | null | main.py | dinesh-GDK/StyleTx | 967226df969d094894f3066e009020ef35ed2f48 | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import filedialog
import PIL
from PIL import ImageTk
from functools import partial
from StyleTransfer import *
universal = {'color_back': '#87C7B9', 'color_btn': '#34A88E'}
class Frame(tk.Tk):
'''Wrapper GUI for Style Transfer(StyleTx)'''
def __init__(self):
# init... | 42.651163 | 142 | 0.589331 |
c971f78b063827236b4d9b5d7663e5c1407c09dd | 371,764 | py | Python | libcloud/compute/constants.py | gig-tech/libcloud | 3c7f83f64ee72252a14ddc1e1f8cac4474a0be4b | [
"Apache-2.0"
] | null | null | null | libcloud/compute/constants.py | gig-tech/libcloud | 3c7f83f64ee72252a14ddc1e1f8cac4474a0be4b | [
"Apache-2.0"
] | null | null | null | libcloud/compute/constants.py | gig-tech/libcloud | 3c7f83f64ee72252a14ddc1e1f8cac4474a0be4b | [
"Apache-2.0"
] | null | null | null | # File generated by script - DO NOT EDIT manually
# 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 Licens... | 33.477172 | 111 | 0.460077 |
b44b4ed5bf5e205cee4642f2771af2a2aadd6b62 | 6,837 | py | Python | corehq/apps/api/tests/utils.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/apps/api/tests/utils.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/api/tests/utils.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
from django.test import TestCase
from django.urls import reverse
from django.utils.http import urlencode
from django_prbac.models import Role
from corehq.apps.accounting.models import (
BillingAccount,
DefaultProductPlan,
SoftwarePlanEdition,
Subscription,
)
from c... | 37.565934 | 117 | 0.638438 |
5eca0ca5997942e4c325137075d62e6386bdfb37 | 151 | py | Python | src/pyinterp/backends/__init__.py | CNES/pangeo-pyinterp | 5f75f62a6c681db89c5aa8c74e43fc04a77418c3 | [
"BSD-3-Clause"
] | 67 | 2019-07-09T09:10:22.000Z | 2022-03-01T09:46:35.000Z | src/pyinterp/backends/__init__.py | CNES/pangeo-pyinterp | 5f75f62a6c681db89c5aa8c74e43fc04a77418c3 | [
"BSD-3-Clause"
] | 8 | 2019-07-15T13:54:31.000Z | 2021-06-28T05:06:34.000Z | src/pyinterp/tests/core/__init__.py | CNES/pangeo-pyinterp | 5f75f62a6c681db89c5aa8c74e43fc04a77418c3 | [
"BSD-3-Clause"
] | 7 | 2019-07-15T17:28:16.000Z | 2022-01-19T19:43:47.000Z | # Copyright (c) 2021 CNES
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
| 30.2 | 63 | 0.741722 |
1c45e1cfb9f789049e129d5f970c555b0f0ffd3c | 15,669 | py | Python | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | import logging
from collections import defaultdict, deque
from math import log2
from time import time
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from .comm.addressing import get_address_host
from .core import CommClosedError
from .diagnostics.p... | 34.286652 | 88 | 0.521029 |
c88c46e8ba61019cab0e76ae96a2fc79e6817167 | 2,535 | py | Python | animal.py | coder-to-code/Python-Developer-Assignment- | beb37235294eebc0866978e9ede752f672099b3a | [
"MIT"
] | null | null | null | animal.py | coder-to-code/Python-Developer-Assignment- | beb37235294eebc0866978e9ede752f672099b3a | [
"MIT"
] | null | null | null | animal.py | coder-to-code/Python-Developer-Assignment- | beb37235294eebc0866978e9ede752f672099b3a | [
"MIT"
] | null | null | null | class Animal:
"""Animal class."""
def __init__(self, genus, species):
self.kingdom = 'Animalia'
self.study = 'Zoology'
self.genus = genus
self.species = species
class Vertibrate(Animal):
"""Veribrate subclass of Animal"""
def __init__(self, genus, species):
... | 31.296296 | 55 | 0.645759 |
f2bca9838730dbdc6d26d3875aae9eab1c34ccb1 | 794 | py | Python | apps/export/tasks.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | 1 | 2019-12-12T15:38:42.000Z | 2019-12-12T15:38:42.000Z | apps/export/tasks.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | apps/export/tasks.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | import celery
from django.core.cache import cache
from django.utils import translation
from core.logic.error_reporting import email_if_fails
from export.models import FlexibleDataExport
@celery.shared_task
@email_if_fails
def process_flexible_export_task(export_id: int):
export = FlexibleDataExport.objects.get(p... | 34.521739 | 78 | 0.740554 |
3e4b05038b883b98d5c2439ae243558ca196f6ff | 9,168 | py | Python | holiday_bot/commands.py | gytdau/pto-thingy | d7c0ef109591d2d0c155f8f728ffbbd9123cb863 | [
"MIT"
] | 1 | 2020-05-02T16:41:38.000Z | 2020-05-02T16:41:38.000Z | holiday_bot/commands.py | gytdau/holiday-thingy | d7c0ef109591d2d0c155f8f728ffbbd9123cb863 | [
"MIT"
] | null | null | null | holiday_bot/commands.py | gytdau/holiday-thingy | d7c0ef109591d2d0c155f8f728ffbbd9123cb863 | [
"MIT"
] | null | null | null | from datetime import *
from dateutil.parser import parse # This parser just makes a guess at what format it is in.
# It could be better for stability to supply the format in advance.
import json, re, pdb
from holiday_bot import google_calendar
undo_queue = {}
def failure(message):
message.reply("Sorry, I didn't c... | 36.525896 | 168 | 0.641361 |
930f8e6ca21dee6739560a38901a57fa57964e95 | 6,503 | py | Python | packaging/create_msi.py | physimals/quantiphyse-cest | b5b298ae75e03da1cd2ea060d906c2a19d2e13aa | [
"Apache-2.0"
] | 2 | 2019-03-03T13:35:36.000Z | 2020-12-27T18:48:18.000Z | packaging/create_msi.py | physimals/quantiphyse-cest | b5b298ae75e03da1cd2ea060d906c2a19d2e13aa | [
"Apache-2.0"
] | 4 | 2019-02-06T11:20:15.000Z | 2020-04-06T11:18:56.000Z | packaging/create_msi.py | physimals/quantiphyse-cest | b5b298ae75e03da1cd2ea060d906c2a19d2e13aa | [
"Apache-2.0"
] | 1 | 2019-04-15T17:24:56.000Z | 2019-04-15T17:24:56.000Z | """
Create an MSI package using the WIX toolset
We adopt the rule of 'one file per component' as suggested although this requires thousands
of components. Generation of GUIDs is accomplished by using the Python UUID library to generate
the ID based on a hash of the file path. This should ensure that the GUIDs are spe... | 37.80814 | 116 | 0.632477 |
567ce3b50e52a22ccc5db47fcc54eb4eb6868f96 | 642 | py | Python | hwt/serializer/generic/portMap.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | hwt/serializer/generic/portMap.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | hwt/serializer/generic/portMap.py | mgielda/hwt | e6c699fb154f93ac03523bfe40a3d4fc1912d28b | [
"MIT"
] | null | null | null | from hwt.hdl.constants import DIRECTION
from hwt.doc_markers import internal
class PortMap():
def __init__(self, signal, portItem):
self.sig = signal
self.portItem = portItem
@internal
@classmethod
def fromPortItem(cls, portItem):
d = portItem.direction
if d == DIRECTI... | 23.777778 | 73 | 0.599688 |
f06b0207327cd083ccb2593f735ed3ff382cfe67 | 10,968 | py | Python | preitx_fsp_invoice_renderer/invoice.py | felix-gohla/pretix-fsp-invoice-renderer | 75beef9fcb56dcd38049aeb8e75d689effe8ae5b | [
"Apache-2.0"
] | null | null | null | preitx_fsp_invoice_renderer/invoice.py | felix-gohla/pretix-fsp-invoice-renderer | 75beef9fcb56dcd38049aeb8e75d689effe8ae5b | [
"Apache-2.0"
] | null | null | null | preitx_fsp_invoice_renderer/invoice.py | felix-gohla/pretix-fsp-invoice-renderer | 75beef9fcb56dcd38049aeb8e75d689effe8ae5b | [
"Apache-2.0"
] | null | null | null | from pretix.base.invoice import *
from django.db.models import Count
from itertools import groupby
class FSPInvoiceRenderer(ClassicInvoiceRenderer):
identifier = 'fsp'
verbose_name = 'FSP Rechnungserzeuger'
def _get_story(self, doc):
has_taxes = any(il.tax_value for il in self.invoice.lines.all())
... | 41.862595 | 124 | 0.50155 |
31d7a02744c3f832ee0da5809df454ca1bf8819c | 770 | py | Python | main.py | uehara1414/uehara-slack-bot | 047ecd57bc47b12c2278d46b141af8b2a5ec79f9 | [
"MIT"
] | 1 | 2017-05-02T03:52:55.000Z | 2017-05-02T03:52:55.000Z | main.py | uehara1414/uehara-slack-bot | 047ecd57bc47b12c2278d46b141af8b2a5ec79f9 | [
"MIT"
] | null | null | null | main.py | uehara1414/uehara-slack-bot | 047ecd57bc47b12c2278d46b141af8b2a5ec79f9 | [
"MIT"
] | null | null | null | import json
import os
import sys
from slacksocket import SlackSocket
SLACK_API_KEY = os.environ["SLACK_API_KEY"]
s = SlackSocket(SLACK_API_KEY)
def mainloop():
for event in s.events():
obj = json.loads(event.json)
if not obj["type"] == "message":
continue
user = obj["user... | 18.333333 | 60 | 0.55974 |
d64e87c808e0963997d1452361a3d065a9142dbd | 2,631 | py | Python | csrank/dataset_reader/objectranking/rcv_dataset_reader.py | kiudee/cs-ranking | 47cf648fa286c37b9214bbad1926004d4d7d9796 | [
"Apache-2.0"
] | 65 | 2018-02-12T13:18:13.000Z | 2021-12-18T12:01:51.000Z | csrank/dataset_reader/objectranking/rcv_dataset_reader.py | kiudee/cs-ranking | 47cf648fa286c37b9214bbad1926004d4d7d9796 | [
"Apache-2.0"
] | 189 | 2018-02-13T10:11:55.000Z | 2022-03-12T16:36:23.000Z | csrank/dataset_reader/objectranking/rcv_dataset_reader.py | kiudee/cs-ranking | 47cf648fa286c37b9214bbad1926004d4d7d9796 | [
"Apache-2.0"
] | 19 | 2018-03-08T15:39:31.000Z | 2020-11-18T12:46:36.000Z | import logging
import os
from joblib import load
import numpy as np
from sklearn.model_selection import ShuffleSplit
from sklearn.preprocessing import StandardScaler
from sklearn.utils import check_random_state
from csrank.constants import OBJECT_RANKING
from ..dataset_reader import DatasetReader
logger = logging.ge... | 30.952941 | 84 | 0.624857 |
0e39476396c40f442a3cf60d84fdb662286d4c6a | 6,102 | py | Python | bin/03-image-join.py | csp-inc/fluvius | 8eb8c3caee2b98720ae17bef384302d6fa88c828 | [
"Apache-2.0"
] | null | null | null | bin/03-image-join.py | csp-inc/fluvius | 8eb8c3caee2b98720ae17bef384302d6fa88c828 | [
"Apache-2.0"
] | 3 | 2022-02-24T15:07:42.000Z | 2022-02-25T23:59:31.000Z | bin/03-image-join.py | csp-inc/fluvius | 8eb8c3caee2b98720ae17bef384302d6fa88c828 | [
"Apache-2.0"
] | 2 | 2022-03-17T19:59:33.000Z | 2022-03-17T20:00:41.000Z | ### Environment setup
import sys, os
sys.path.append('/content')
from src.fluvius import WaterData
import fsspec
import pandas as pd
import argparse
import shutil
from src.defaults import args_info
import faulthandler
faulthandler.enable()
# Set the environment variable PC_SDK_SUBSCRIPTION_KEY, or set it here.
# The ... | 40.410596 | 171 | 0.634546 |
dfbdca07aad2ebb1239c297711676178cff15ad2 | 3,277 | py | Python | turterra/dependencies/modeller/move_best_models.py | BTheDragonMaster/turterra | 2498397e930fb1e384fb39a2e5ef4b2c42636ce7 | [
"MIT"
] | null | null | null | turterra/dependencies/modeller/move_best_models.py | BTheDragonMaster/turterra | 2498397e930fb1e384fb39a2e5ef4b2c42636ce7 | [
"MIT"
] | null | null | null | turterra/dependencies/modeller/move_best_models.py | BTheDragonMaster/turterra | 2498397e930fb1e384fb39a2e5ef4b2c42636ce7 | [
"MIT"
] | null | null | null | from sys import argv
from pathlib import Path
import os
import numpy as np
from shutil import copyfile
def get_file_parts(input_filename):
"""
Gets directory path, name, and extension from a filename
Parameters
----------
input_filename
Returns
-------
(path, name, extension)
"""
... | 34.494737 | 121 | 0.577052 |
94ee1efa67765adea027db951bb6d0fc2ad50698 | 6,960 | py | Python | Voicelab/toolkits/Voicelab/MeasureVocalTractEstimatesNode.py | KorewaLidesu/VoiceLab | afae638b94fd6bb52d6269122636a6f125651f13 | [
"MIT"
] | null | null | null | Voicelab/toolkits/Voicelab/MeasureVocalTractEstimatesNode.py | KorewaLidesu/VoiceLab | afae638b94fd6bb52d6269122636a6f125651f13 | [
"MIT"
] | null | null | null | Voicelab/toolkits/Voicelab/MeasureVocalTractEstimatesNode.py | KorewaLidesu/VoiceLab | afae638b94fd6bb52d6269122636a6f125651f13 | [
"MIT"
] | null | null | null | from Voicelab.pipeline.Node import Node
from parselmouth.praat import call
from Voicelab.toolkits.Voicelab.VoicelabNode import VoicelabNode
from Voicelab.toolkits.Voicelab.MeasureFormantNode import MeasureFormantNode
from Voicelab.toolkits.Voicelab.MeasureFormantPositionsNode import MeasureFormantPositionsNode
import ... | 36.825397 | 110 | 0.482184 |
b756839748a158d7dd5e4dfa21e3a9d94b0dd5df | 35,371 | py | Python | Lib/test/test_regrtest.py | Themblo/cpython | cd7e9c1b67d3d07ee03e0a79af2791c19031cecb | [
"PSF-2.0"
] | 5 | 2019-05-06T12:47:11.000Z | 2021-11-05T09:05:09.000Z | Lib/test/test_regrtest.py | Themblo/cpython | cd7e9c1b67d3d07ee03e0a79af2791c19031cecb | [
"PSF-2.0"
] | null | null | null | Lib/test/test_regrtest.py | Themblo/cpython | cd7e9c1b67d3d07ee03e0a79af2791c19031cecb | [
"PSF-2.0"
] | 4 | 2018-08-07T23:05:19.000Z | 2021-01-12T03:20:02.000Z | """
Tests of regrtest.py.
Note: test_regrtest cannot be run twice in parallel.
"""
import contextlib
import faulthandler
import io
import os.path
import platform
import re
import subprocess
import sys
import sysconfig
import tempfile
import textwrap
import unittest
from test import libregrtest
from test import suppor... | 36.998954 | 105 | 0.55537 |
8c7707617505535622489e4bb821e2d73cc33f83 | 11,792 | py | Python | python-3.4.4.amd64/Lib/shlex.py | CSnap/photogate | 208272ef39f4e86f40d431da2ca523e21701f789 | [
"CC0-1.0"
] | null | null | null | python-3.4.4.amd64/Lib/shlex.py | CSnap/photogate | 208272ef39f4e86f40d431da2ca523e21701f789 | [
"CC0-1.0"
] | null | null | null | python-3.4.4.amd64/Lib/shlex.py | CSnap/photogate | 208272ef39f4e86f40d431da2ca523e21701f789 | [
"CC0-1.0"
] | null | null | null | """A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), string arguments, and
# i... | 38.410423 | 77 | 0.483887 |
6f85599c1543ae184d941f3e24ba21ca847ac1f9 | 723 | py | Python | expenses/views.py | ksarthak4ever/Django-Bill_Splitting | 59ee546f9e034dfd21effa30629b75e42b07da92 | [
"MIT"
] | null | null | null | expenses/views.py | ksarthak4ever/Django-Bill_Splitting | 59ee546f9e034dfd21effa30629b75e42b07da92 | [
"MIT"
] | null | null | null | expenses/views.py | ksarthak4ever/Django-Bill_Splitting | 59ee546f9e034dfd21effa30629b75e42b07da92 | [
"MIT"
] | 1 | 2021-10-07T16:17:02.000Z | 2021-10-07T16:17:02.000Z | from django.shortcuts import render, get_object_or_404
from . models import Salary,Category,Expense
def salary_month(request): # view to select which month's expenses you wanna see
salary_list = Salary.objects.all()
return render(request, 'salary-list.html', {'salary_list': salary_list})
def expense_detail(reques... | 45.1875 | 133 | 0.784232 |
428dee09d56d3fcf56003273042b85e812772747 | 21,915 | py | Python | salt/fileserver/hgfs.py | elblivion/salt | d7e6d3663265e643fc72d9675301df4d69905448 | [
"Apache-2.0"
] | 1 | 2018-05-25T04:16:16.000Z | 2018-05-25T04:16:16.000Z | salt/fileserver/hgfs.py | elblivion/salt | d7e6d3663265e643fc72d9675301df4d69905448 | [
"Apache-2.0"
] | null | null | null | salt/fileserver/hgfs.py | elblivion/salt | d7e6d3663265e643fc72d9675301df4d69905448 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The backed for the mercurial based file server system.
After enabling this backend, branches, bookmarks, and tags in a remote
mercurial repository are exposed to salt as different environments. This
feature is managed by the :conf_master:`fileserver_backend` option in the salt
master config... | 33.054299 | 79 | 0.55948 |
c3909b2f2dc9e293b6f3c1df50d57af030bb53a4 | 8,538 | py | Python | Lib/site-packages/astroid/exceptions.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/astroid/exceptions.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/astroid/exceptions.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
"""this module contains exceptions used in the astroid library
"""
from typing import TYPE_... | 29.139932 | 92 | 0.696065 |
efce1748302b623aa19e7c533f29c14f11bc30a0 | 2,614 | py | Python | fairness-benchmark/src/fairness_benchmark/transforms.py | feedzai/fairbench | 49ac63bc0d1cf2240c1889f652a9a100241fecb9 | [
"MIT"
] | 4 | 2021-09-05T11:20:52.000Z | 2021-11-08T08:38:46.000Z | fairness-benchmark/src/fairness_benchmark/transforms.py | feedzai/fairbench | 49ac63bc0d1cf2240c1889f652a9a100241fecb9 | [
"MIT"
] | null | null | null | fairness-benchmark/src/fairness_benchmark/transforms.py | feedzai/fairbench | 49ac63bc0d1cf2240c1889f652a9a100241fecb9 | [
"MIT"
] | 1 | 2021-09-06T04:17:59.000Z | 2021-09-06T04:17:59.000Z | import pandas as pd
from math import log10, floor
from typing import Any, Union
from fairness_benchmark import verifications
class GenericTransform:
def apply(self, data: pd.DataFrame) -> pd.DataFrame:
pass
class AbsoluteTransform(GenericTransform):
def __init__(self, column: str):
verif... | 30.045977 | 102 | 0.692808 |
97d225e7c853a9714e23ff52542932f6babfa85e | 2,787 | py | Python | sdk/monitor/azure-monitor-query/tests/test_logs_client.py | squassina/azure-sdk-for-python | 7644fe5af772497d7c8993b9841784b34d44ed6a | [
"MIT"
] | 2 | 2021-01-15T18:30:53.000Z | 2021-09-07T18:31:31.000Z | sdk/monitor/azure-monitor-query/tests/test_logs_client.py | seankane-msft/azure-sdk-for-python | 7514e744dbf5cdf6c527e9afb11e529a948cfbc0 | [
"MIT"
] | null | null | null | sdk/monitor/azure-monitor-query/tests/test_logs_client.py | seankane-msft/azure-sdk-for-python | 7514e744dbf5cdf6c527e9afb11e529a948cfbc0 | [
"MIT"
] | null | null | null | import pytest
import os
from azure.identity import ClientSecretCredential
from azure.core.exceptions import HttpResponseError
from azure.monitor.query import LogsQueryClient, LogsQueryRequest
def _credential():
credential = ClientSecretCredential(
client_id = os.environ['AZURE_CLIENT_ID'],
client_... | 31.670455 | 104 | 0.685684 |
4a7ba073218e7f1f3e9bfe6c8efe35d17c593d1b | 1,514 | py | Python | uploads/core/views.py | Akchy/ISQIP-Hackathon | f2f2370529247e494f02988e5e1810040f4d3ff3 | [
"MIT"
] | 2 | 2021-06-08T18:26:04.000Z | 2021-08-07T16:58:50.000Z | uploads/core/views.py | Akchy/ISQIP-Hackathon | f2f2370529247e494f02988e5e1810040f4d3ff3 | [
"MIT"
] | 4 | 2020-02-12T02:58:27.000Z | 2021-06-10T22:42:43.000Z | uploads/core/views.py | Akchy/ISQIP-Hackathon | f2f2370529247e494f02988e5e1810040f4d3ff3 | [
"MIT"
] | 3 | 2019-07-12T09:10:01.000Z | 2019-07-12T10:33:14.000Z | from django.shortcuts import render, redirect
from django.conf import settings
from django.core.files.storage import FileSystemStorage
from uploads.core.models import Document
from uploads.core.forms import DocumentForm
def home(request):
documents = Document.objects.all()
return render(request, 'core/home.h... | 30.897959 | 72 | 0.675694 |
062a882b1f4c978fa10463b57026cccbfdc614cf | 13,870 | py | Python | 10_NWIS/NWIS retrieve site information.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | 10_NWIS/NWIS retrieve site information.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | 10_NWIS/NWIS retrieve site information.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python [conda env:bandit_38]
# language: python
# name: conda-env-bandi... | 33.583535 | 127 | 0.666907 |
4161a6e8c53642e15e79422499779f477ecb3422 | 3,220 | py | Python | tests/conftest.py | kostaleonard/mlops | 236d3499535d6294768c15336180217829fb2ee3 | [
"MIT"
] | 1 | 2021-11-26T21:41:00.000Z | 2021-11-26T21:41:00.000Z | tests/conftest.py | kostaleonard/mlops | 236d3499535d6294768c15336180217829fb2ee3 | [
"MIT"
] | 39 | 2021-11-18T20:01:34.000Z | 2022-03-26T17:59:07.000Z | tests/conftest.py | kostaleonard/mlops | 236d3499535d6294768c15336180217829fb2ee3 | [
"MIT"
] | null | null | null | """Contains test fixtures."""
# pylint: disable=no-name-in-module
import os
import pytest
import boto3
from moto import mock_s3
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layers import Dense
from mlops.dataset.versioned_dataset import VersionedDataset
from mlops.model.training_config i... | 30.377358 | 79 | 0.712733 |
c7a38bb28ebc8e7abdd3b41cd36ccfb562f185a6 | 3,349 | py | Python | reagent/training/parameters.py | kellielu/ReAgent | c538992672220453cdc95044def25c4e0691a8b0 | [
"BSD-3-Clause"
] | null | null | null | reagent/training/parameters.py | kellielu/ReAgent | c538992672220453cdc95044def25c4e0691a8b0 | [
"BSD-3-Clause"
] | null | null | null | reagent/training/parameters.py | kellielu/ReAgent | c538992672220453cdc95044def25c4e0691a8b0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
from reagent.core.configuration import make_config_class
from reagent.core.types import BaseDataClass
from .c51_trainer import C51Trainer
from .discrete_crr_trainer import DiscreteCRRTrainer
from .dqn_trainer import DQNTrai... | 20.93125 | 88 | 0.684981 |
a0a88998c68fb662cc5e03696569c80533894003 | 1,431 | py | Python | teclab/config.py | gregstarr/teclab | 4ba4136b6fe904820c5bfa6c05e9115c91f5b9bc | [
"MIT"
] | null | null | null | teclab/config.py | gregstarr/teclab | 4ba4136b6fe904820c5bfa6c05e9115c91f5b9bc | [
"MIT"
] | null | null | null | teclab/config.py | gregstarr/teclab | 4ba4136b6fe904820c5bfa6c05e9115c91f5b9bc | [
"MIT"
] | null | null | null | import os
import h5py
import json
import numpy as np
from teclab import utils
TEST = True
# set dataset directory
data_base_dir = "E:\\tec_data"
if TEST:
data_base_dir = os.path.join(data_base_dir, 'test')
data_file_pattern = "{year:04d}_{month:02d}_tec.h5"
data_file_name = os.path.join(data_base_dir, data_file_... | 24.672414 | 63 | 0.715584 |
5697ab19d91e580279a648c3287ef89f01f0f607 | 2,231 | py | Python | ann/matrix.py | manoloesparta/logicnet | 97c6ee9be9bce9060c9cc4b51d0344df246500f9 | [
"MIT"
] | 2 | 2020-07-15T01:41:41.000Z | 2020-12-10T03:19:40.000Z | ann/matrix.py | manoloesparta/logicnet | 97c6ee9be9bce9060c9cc4b51d0344df246500f9 | [
"MIT"
] | null | null | null | ann/matrix.py | manoloesparta/logicnet | 97c6ee9be9bce9060c9cc4b51d0344df246500f9 | [
"MIT"
] | null | null | null | from random import random
class Matrix:
def __init__(self, cols, rows, zeros=False):
self.cols = cols
self.rows = rows
self.shape = (cols, rows)
if zeros:
self.matrix = [[0 for _ in range(self.rows)] for _ in range(self.cols)]
else:
self.matrix = [[... | 26.879518 | 90 | 0.56701 |
85a28b60d0faf270cc5481db0e3cc2dcc4438221 | 13,887 | py | Python | .tox/scenario/lib/python2.7/site-packages/neutronclient/tests/unit/vpn/test_cli20_ipsec_site_connection.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/neutronclient/tests/unit/vpn/test_cli20_ipsec_site_connection.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/neutronclient/tests/unit/vpn/test_cli20_ipsec_site_connection.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | # (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | 42.081818 | 78 | 0.577879 |
c5ad8780db0f14cea9437d3ba8cb572c6083ee5b | 1,112 | py | Python | database/utils.py | erischon/p8_eri_schon | b64de7acad28463a39b40ce9d537ceec4227202b | [
"MIT"
] | null | null | null | database/utils.py | erischon/p8_eri_schon | b64de7acad28463a39b40ce9d537ceec4227202b | [
"MIT"
] | null | null | null | database/utils.py | erischon/p8_eri_schon | b64de7acad28463a39b40ce9d537ceec4227202b | [
"MIT"
] | 1 | 2021-04-27T04:07:03.000Z | 2021-04-27T04:07:03.000Z | from django.db import connection
from database.models import Product, Categorie, Prodcat, Brand, Prodbrand, Shop, Prodshop
class DBManage:
def __init__(self):
""" """
self.connection = connection.cursor()
def load_nutriscore(self):
""" I load the nutriscore and their id into the tabl... | 34.75 | 138 | 0.601619 |
ab410860cc81ca0e4f4cc8bc789688235d2ba83f | 2,721 | py | Python | nova/rc_fields.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | 1 | 2018-12-28T06:47:39.000Z | 2018-12-28T06:47:39.000Z | nova/rc_fields.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | null | null | null | nova/rc_fields.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 37.791667 | 78 | 0.711503 |
6629f070163640e7f1f2294956cdbb22cc3f5a90 | 5,147 | py | Python | pycorrector/transformers/models/bert_generation/tokenization_bert_generation.py | ParikhKadam/pycorrector | 771115538256126711888a48f8b359757500d345 | [
"Apache-2.0"
] | 1 | 2021-12-01T14:51:47.000Z | 2021-12-01T14:51:47.000Z | pycorrector/transformers/models/bert_generation/tokenization_bert_generation.py | ParikhKadam/pycorrector | 771115538256126711888a48f8b359757500d345 | [
"Apache-2.0"
] | null | null | null | pycorrector/transformers/models/bert_generation/tokenization_bert_generation.py | ParikhKadam/pycorrector | 771115538256126711888a48f8b359757500d345 | [
"Apache-2.0"
] | 1 | 2021-12-22T06:23:52.000Z | 2021-12-22T06:23:52.000Z | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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 re... | 37.297101 | 119 | 0.665242 |
de0c64ae560ba1046fc6d46ec5f5d5a815a0d6a0 | 2,241 | py | Python | lib/pymedphys/tests/monaco/test_delivery_from_tel.py | ethanio12345/pymedphys | cb34c992de8d442eced3385018a194364060092d | [
"Apache-2.0"
] | 2 | 2020-02-04T03:21:20.000Z | 2020-04-11T14:17:53.000Z | lib/pymedphys/tests/monaco/test_delivery_from_tel.py | ethanio12345/pymedphys | cb34c992de8d442eced3385018a194364060092d | [
"Apache-2.0"
] | null | null | null | lib/pymedphys/tests/monaco/test_delivery_from_tel.py | ethanio12345/pymedphys | cb34c992de8d442eced3385018a194364060092d | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019 Cancer Care Associates and Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable l... | 35.571429 | 85 | 0.717091 |
c8418bbe27b6894aac04dd0c0daaa31373f235ce | 1,805 | py | Python | tests/__init__.py | afuch05/mythril-classic | de562335a62703429e085de7088a3e543f84e94f | [
"MIT"
] | null | null | null | tests/__init__.py | afuch05/mythril-classic | de562335a62703429e085de7088a3e543f84e94f | [
"MIT"
] | null | null | null | tests/__init__.py | afuch05/mythril-classic | de562335a62703429e085de7088a3e543f84e94f | [
"MIT"
] | null | null | null | from pathlib import Path
from unittest import TestCase
import os
import shutil
TESTS_DIR = Path(__file__).parent
PROJECT_DIR = TESTS_DIR.parent
TESTDATA = TESTS_DIR / "testdata"
TESTDATA_INPUTS = TESTDATA / "inputs"
TESTDATA_INPUTS_CONTRACTS = TESTDATA / "input_contracts"
TESTDATA_OUTPUTS_EXPECTED = TESTDATA / "output... | 36.836735 | 100 | 0.706371 |
089ad0be2b0a135b09f19776de7092e3dab7c941 | 2,276 | py | Python | gui_digit_recognizer.py | SidsMav2000/Handwritten-Digit-Recognition | 81492cb49b4bed4631947e6ae6391f0bfebc9a2a | [
"Apache-2.0"
] | 2 | 2020-06-05T06:49:23.000Z | 2021-12-29T09:34:22.000Z | gui_digit_recognizer.py | SidsMav2000/Handwritten-Digit-Recognition | 81492cb49b4bed4631947e6ae6391f0bfebc9a2a | [
"Apache-2.0"
] | null | null | null | gui_digit_recognizer.py | SidsMav2000/Handwritten-Digit-Recognition | 81492cb49b4bed4631947e6ae6391f0bfebc9a2a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 8 12:43:12 2020
@author: Siddharth
"""
from keras.models import load_model
from tkinter import *
import tkinter as tk
import win32gui
from PIL import ImageGrab, Image
import numpy as np
model = load_model('mnist.h5')
def predict_digit(img):
#resiz... | 31.611111 | 104 | 0.590949 |
6f4d619c73030615f0c433d00239e27bb2d28014 | 696 | py | Python | setup.py | compliance-trestle/trestle-devops-demo | 81e5b6b3e8d4e5cfd8a3213f4d6abf67f1bc2a4e | [
"Apache-2.0"
] | null | null | null | setup.py | compliance-trestle/trestle-devops-demo | 81e5b6b3e8d4e5cfd8a3213f4d6abf67f1bc2a4e | [
"Apache-2.0"
] | null | null | null | setup.py | compliance-trestle/trestle-devops-demo | 81e5b6b3e8d4e5cfd8a3213f4d6abf67f1bc2a4e | [
"Apache-2.0"
] | null | null | null | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
#... | 33.142857 | 74 | 0.744253 |
f420750ea741333bb452d0d60b7e3eca749fa3f8 | 8,391 | py | Python | py/combine_dustmaps.py | jobovy/apogee-maps | 0316e95bdf9b85f3f4b758e8e67dc197d228288f | [
"BSD-3-Clause"
] | 1 | 2020-06-28T14:22:20.000Z | 2020-06-28T14:22:20.000Z | py/combine_dustmaps.py | jobovy/apogee-maps | 0316e95bdf9b85f3f4b758e8e67dc197d228288f | [
"BSD-3-Clause"
] | null | null | null | py/combine_dustmaps.py | jobovy/apogee-maps | 0316e95bdf9b85f3f4b758e8e67dc197d228288f | [
"BSD-3-Clause"
] | 3 | 2015-10-05T21:59:32.000Z | 2017-02-03T11:53:45.000Z | ###############################################################################
# combine_dustmaps.py: make a composite extinction map (Marshall,Green,Drimmel)
###############################################################################
import sys
import os, os.path
import pickle
import numpy
import h5py
import heal... | 45.112903 | 119 | 0.615064 |
c378b7b7c062627352f2a86528d7093633816192 | 25,311 | py | Python | tensorflow/python/keras/saving/saved_model/save_impl.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 27 | 2020-02-29T04:13:22.000Z | 2022-02-07T21:54:50.000Z | tensorflow/python/keras/saving/saved_model/save_impl.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 6 | 2022-01-15T07:17:47.000Z | 2022-02-14T15:28:22.000Z | tensorflow/python/keras/saving/saved_model/save_impl.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 10 | 2020-12-15T03:55:24.000Z | 2021-12-17T23:14:11.000Z | # Copyright 2018 The TensorFlow 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 applica... | 39.859843 | 111 | 0.732251 |
8a5ec7b5cf6429a07a39349bafddcfb641e540cf | 940 | py | Python | scripts/api_gen/cs_api/generator.py | TobiasKozel/VAE | 37df7698c560ab7e94d2e69b22166b72602f8860 | [
"MIT"
] | 1 | 2022-02-03T21:57:07.000Z | 2022-02-03T21:57:07.000Z | scripts/api_gen/cs_api/generator.py | TobiasKozel/VAE | 37df7698c560ab7e94d2e69b22166b72602f8860 | [
"MIT"
] | null | null | null | scripts/api_gen/cs_api/generator.py | TobiasKozel/VAE | 37df7698c560ab7e94d2e69b22166b72602f8860 | [
"MIT"
] | null | null | null | import os
import sys
from jinja2 import Template, Environment
sys.path.insert(1, os.path.join(sys.path[0], ".."))
from api_gen_util_vae import loadApiDescription
jinja_env = Environment(autoescape=False, optimized=False, trim_blocks=True, lstrip_blocks=True)
json_description = os.path.dirname(os.path.realpath(__file_... | 30.322581 | 96 | 0.757447 |
768e34f51e495dea2913e09b3d36c2f7d81d6a53 | 2,532 | py | Python | examples/launch_height_sagemaker.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 97 | 2021-11-18T17:14:30.000Z | 2022-03-29T00:33:12.000Z | examples/launch_height_sagemaker.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 54 | 2021-11-18T17:14:12.000Z | 2022-03-22T08:11:48.000Z | examples/launch_height_sagemaker.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2021-11-29T11:47:32.000Z | 2022-02-24T15:28:11.000Z | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 31.259259 | 104 | 0.681675 |
0579d1f18a41e291a14800318f5a40b58c77f4ff | 633 | py | Python | hogwarts/students/forms.py | rchurch4/guwc | f4b5a0f1cc72bb5852aebf84efdf941529e35388 | [
"MIT"
] | null | null | null | hogwarts/students/forms.py | rchurch4/guwc | f4b5a0f1cc72bb5852aebf84efdf941529e35388 | [
"MIT"
] | null | null | null | hogwarts/students/forms.py | rchurch4/guwc | f4b5a0f1cc72bb5852aebf84efdf941529e35388 | [
"MIT"
] | 1 | 2019-03-29T02:09:14.000Z | 2019-03-29T02:09:14.000Z | from django import forms
from .models import Student
from django.core.validators import MaxValueValidator, MinValueValidator
class StudentForm(forms.ModelForm):
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100)
house = forms.CharField(
max_length=2,
w... | 27.521739 | 71 | 0.655608 |
e3784f46d78f491d51ab696c377ae43299205b53 | 4,110 | py | Python | lldb/test/API/tools/lldb-server/TestGdbRemoteRegisterState.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/test/API/tools/lldb-server/TestGdbRemoteRegisterState.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/test/API/tools/lldb-server/TestGdbRemoteRegisterState.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase):
"""Test QSaveRegisterState/QRestoreRegisterState support."""
mydir = TestBase.compute_mydir(_... | 39.142857 | 103 | 0.701217 |
e16dd882dd0f2badfd11e3eb308e54fb3c10a7e7 | 354 | py | Python | template/constants.py | fcelsa/python-git | 3d3e39b9eb64349d3107eec0146f7a1213a53d33 | [
"MIT"
] | null | null | null | template/constants.py | fcelsa/python-git | 3d3e39b9eb64349d3107eec0146f7a1213a53d33 | [
"MIT"
] | null | null | null | template/constants.py | fcelsa/python-git | 3d3e39b9eb64349d3107eec0146f7a1213a53d33 | [
"MIT"
] | null | null | null | class Constants:
""" A class to hold constants for the application. """
PROJECT_NAME = 'name of the project'
VERSION = '1.0'
AUTHOR_GITHUB = 'fcelsa'
AUTHOR_FULL_NAME = 'Fabio Celsalonga'
DESCRIPTION = "constants definition example for template."
URL = 'https://github.com/fcelsa',
AUTHOR... | 35.4 | 62 | 0.677966 |
c8f873078d3df1fd6d5605f774a05ea68c90dbfa | 386 | py | Python | froide/georegion/migrations/0010_georegion_data.py | xenein/froide | 59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa | [
"MIT"
] | 198 | 2016-12-03T22:42:55.000Z | 2022-03-25T15:08:36.000Z | froide/georegion/migrations/0010_georegion_data.py | xenein/froide | 59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa | [
"MIT"
] | 264 | 2016-11-30T18:53:17.000Z | 2022-03-17T11:34:18.000Z | froide/georegion/migrations/0010_georegion_data.py | xenein/froide | 59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa | [
"MIT"
] | 42 | 2016-12-22T04:08:27.000Z | 2022-02-26T08:30:38.000Z | # Generated by Django 3.2.4 on 2021-08-12 07:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("georegion", "0009_auto_20190325_2040"),
]
operations = [
migrations.AddField(
model_name="georegion",
name="data",
... | 20.315789 | 49 | 0.598446 |
d3dfde72106cbebd848cfe7c8f1662f76c88f597 | 19,262 | py | Python | parser_pq.py | sauloal/py_ncbi_taxonomy | 6e2607e77945609d109f6f418dad0524543c76cf | [
"MIT"
] | null | null | null | parser_pq.py | sauloal/py_ncbi_taxonomy | 6e2607e77945609d109f6f418dad0524543c76cf | [
"MIT"
] | null | null | null | parser_pq.py | sauloal/py_ncbi_taxonomy | 6e2607e77945609d109f6f418dad0524543c76cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import re
import csv
import pickle
from collections import OrderedDict
import simplejson as json
import pandas as pd
import numpy as np
import scipy as sc
import fastparquet
from tqdm.auto import tqdm
from IPython.display import display
from tax import RANKS
... | 25.92463 | 140 | 0.641159 |
25318025f024e2e0e77ee0bf330063ff1ba5f7a0 | 494 | py | Python | spinup/user_config.py | EmpereurCC/Spinningup_uptodate | f93e7edf778237a0e79bfdb45f7529522bd34ed4 | [
"MIT"
] | null | null | null | spinup/user_config.py | EmpereurCC/Spinningup_uptodate | f93e7edf778237a0e79bfdb45f7529522bd34ed4 | [
"MIT"
] | 2 | 2019-06-18T14:12:26.000Z | 2019-06-18T14:55:10.000Z | spinup/user_config.py | EmpereurCC/Spinningup_uptodate | f93e7edf778237a0e79bfdb45f7529522bd34ed4 | [
"MIT"
] | 1 | 2019-06-11T15:07:59.000Z | 2019-06-11T15:07:59.000Z | import os
import os.path as osp
# Where experiment outputs are saved by default:
DEFAULT_DATA_DIR = osp.join(osp.abspath(osp.dirname(osp.dirname(__file__))),'data')
# Whether to automatically insert a date and time stamp into the names of
# save directories:
FORCE_DATESTAMP = False
# Whether GridSearch provides auto... | 30.875 | 83 | 0.799595 |
b72f243a4d03d1ec560cb2a818f620ed3ca2bd4b | 240 | py | Python | statics_pages/urls.py | xXcoronaXx/Dblog | 56ee1b8f6f74fabbe0e081921e6cff092661e8df | [
"MIT"
] | null | null | null | statics_pages/urls.py | xXcoronaXx/Dblog | 56ee1b8f6f74fabbe0e081921e6cff092661e8df | [
"MIT"
] | null | null | null | statics_pages/urls.py | xXcoronaXx/Dblog | 56ee1b8f6f74fabbe0e081921e6cff092661e8df | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
urlpatterns = [
url(r'^admin/(?P<slug>[\w\-]+)/', 'statics_pages.views.preview_page', name='preview_page'),
url(r'^(?P<slug>[\w\-]+)/', 'statics_pages.views.view_page', name='view_page'),
] | 40 | 95 | 0.65 |
7703d4e502b8d7ced98084de98010cf473cae385 | 821 | py | Python | 04_introduccion-al-computo-con-python/modulo_IV/clase01-tuplas.py | Aibique-Forks/articicial-inteligence-and-data-science | fbdc866e4e46060cbde5b887806bdfeac645838e | [
"MIT"
] | 30 | 2020-06-19T16:21:04.000Z | 2022-02-19T01:48:39.000Z | 04_introduccion-al-computo-con-python/modulo_IV/clase01-tuplas.py | Aibique-Forks/articicial-inteligence-and-data-science | fbdc866e4e46060cbde5b887806bdfeac645838e | [
"MIT"
] | 87 | 2021-02-12T04:42:13.000Z | 2021-09-20T04:25:29.000Z | 04_introduccion-al-computo-con-python/modulo_IV/clase01-tuplas.py | Aibique-Forks/articicial-inteligence-and-data-science | fbdc866e4e46060cbde5b887806bdfeac645838e | [
"MIT"
] | 11 | 2020-08-13T04:04:01.000Z | 2022-01-20T20:10:43.000Z | """
Tema: Tuplas.
Curso: Pensamiento computacional.
Plataforma: Platzi.
Profesor: David Aroesti.
Alumno: @edinsonrequena.
"""
my_tuple = ()
print(type(my_tuple))
my_tuple = (1, 'two', False)
print(my_tuple[0])
print(my_tuple[2])
my_tuple = (1)
print(type(my_tuple))
my_tuple = (1,)
print(type(my_tuple))
my_other_... | 16.755102 | 92 | 0.723508 |
fddf289af5b957906c852de68316609cbe7041bd | 22,308 | py | Python | ccmlib/common.py | vladzcloudius/scylla-ccm-1 | af383300d28b1a5d650ec4d62d2fa713d8be5916 | [
"Apache-2.0"
] | null | null | null | ccmlib/common.py | vladzcloudius/scylla-ccm-1 | af383300d28b1a5d650ec4d62d2fa713d8be5916 | [
"Apache-2.0"
] | null | null | null | ccmlib/common.py | vladzcloudius/scylla-ccm-1 | af383300d28b1a5d650ec4d62d2fa713d8be5916 | [
"Apache-2.0"
] | null | null | null | #
# Cassandra Cluster Management lib
#
import fnmatch
import os
import platform
import re
import shutil
import socket
import stat
import subprocess
import sys
import time
import yaml
from six import print_
BIN_DIR = "bin"
CASSANDRA_CONF_DIR = "conf"
DSE_CASSANDRA_CONF_DIR = "resources/cassandra/conf"
OPSCENTER_CONF_... | 34.479134 | 165 | 0.62946 |
c19d360fc3755b6c79ddb2cf3a3edeadd13e7686 | 1,203 | py | Python | services/search_service.py | empatwi/empatwi-api | da17da4b952c37f4d2a592ef66dc2a842ea73a29 | [
"MIT"
] | null | null | null | services/search_service.py | empatwi/empatwi-api | da17da4b952c37f4d2a592ef66dc2a842ea73a29 | [
"MIT"
] | null | null | null | services/search_service.py | empatwi/empatwi-api | da17da4b952c37f4d2a592ef66dc2a842ea73a29 | [
"MIT"
] | 1 | 2021-11-22T19:23:40.000Z | 2021-11-22T19:23:40.000Z | import time
from pandas import errors
from repositories.twitter.tweet_acquisition_repository import TweetAcquisitionRepository
from repositories.learning.preprocessing_repository import PreprocessingRepository
from repositories.learning.model_application_repository import ModelApplicationRepository
from repositories.mo... | 48.12 | 131 | 0.785536 |
c802af2903ba563c3607fe4eb24a42d936ed589b | 1,051 | py | Python | garage/misc/prog_bar_counter.py | shadiakiki1986/garage | 095bb5d25b32df1d44b47e99a78a9b01796941d9 | [
"MIT"
] | 3 | 2019-08-11T22:26:55.000Z | 2020-11-28T10:23:50.000Z | garage/misc/prog_bar_counter.py | shadiakiki1986/garage | 095bb5d25b32df1d44b47e99a78a9b01796941d9 | [
"MIT"
] | null | null | null | garage/misc/prog_bar_counter.py | shadiakiki1986/garage | 095bb5d25b32df1d44b47e99a78a9b01796941d9 | [
"MIT"
] | 2 | 2019-08-11T22:30:14.000Z | 2021-03-25T02:57:50.000Z | """A progress bar counter class."""
import pyprind
from garage.misc import logger
class ProgBarCounter:
"""Record progress in a bar counter format."""
def __init__(self, total_count):
"""Init function."""
self.total_count = total_count
self.max_progress = 1000000
self.cur_pro... | 30.028571 | 70 | 0.603235 |
574d123789274c017763caa6981c2fed89751032 | 19,576 | py | Python | turbogears/i18n/data/hi_IN.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | null | null | null | turbogears/i18n/data/hi_IN.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | 9 | 2015-01-27T19:13:56.000Z | 2019-03-29T14:44:31.000Z | turbogears/i18n/data/hi_IN.py | timmartin19/turbogears | b5420cb7e55757d418d8fadb512dbd7803c4279c | [
"MIT"
] | 13 | 2015-04-14T14:15:53.000Z | 2020-03-18T01:05:46.000Z | # Formatting configuration for locale hi_IN
languages={'gu': u'\u0917\u0941\u095b\u0930\u093e\u0924\u0940', 'gd': u'\u0938\u094d\u0915\u093e\u091f\u094d\u0938\u094d \u0917\u093e\u092f\u0947\u0932\u093f\u0915\u094d', 'ga': u'\u0906\u0908\u0930\u093f\u0936', 'gn': u'\u0917\u0941\u0906\u0930\u093e\u0928\u0940', 'gl': u'\... | 1,087.555556 | 9,972 | 0.721291 |
1677c4abb911e1d8b3d77d936906d6440f5afd44 | 2,182 | py | Python | gumroadclone/contrib/sites/migrations/0003_set_site_domain_and_name.py | emnaruto07/gumroadclone | 1dde628489f667b44d34c268e7c1f9cf78419175 | [
"MIT"
] | null | null | null | gumroadclone/contrib/sites/migrations/0003_set_site_domain_and_name.py | emnaruto07/gumroadclone | 1dde628489f667b44d34c268e7c1f9cf78419175 | [
"MIT"
] | null | null | null | gumroadclone/contrib/sites/migrations/0003_set_site_domain_and_name.py | emnaruto07/gumroadclone | 1dde628489f667b44d34c268e7c1f9cf78419175 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def _update_or_create_site_with_sequence(site_model, connection... | 34.09375 | 129 | 0.651237 |
6c48fe735f56f81ceab55fe927b6162559722d25 | 2,233 | py | Python | subscription_manager/events/_event_handlers/update_topic.py | eurocontrol-swim/subscription-manager | 95700334cb5d58957043c6c487b56b1dd6641ec0 | [
"BSD-3-Clause"
] | null | null | null | subscription_manager/events/_event_handlers/update_topic.py | eurocontrol-swim/subscription-manager | 95700334cb5d58957043c6c487b56b1dd6641ec0 | [
"BSD-3-Clause"
] | null | null | null | subscription_manager/events/_event_handlers/update_topic.py | eurocontrol-swim/subscription-manager | 95700334cb5d58957043c6c487b56b1dd6641ec0 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2019 EUROCONTROL
==========================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions an... | 46.520833 | 121 | 0.755934 |
6c2b98c151adf889945268bc7673d4ae4431b4f6 | 1,859 | py | Python | apps/index/migrations/0003_premiumindexblocks.py | asmuratbek/oobamarket | 1053976a13ea84b9aabfcbbcbcffd79549ce9538 | [
"MIT"
] | null | null | null | apps/index/migrations/0003_premiumindexblocks.py | asmuratbek/oobamarket | 1053976a13ea84b9aabfcbbcbcffd79549ce9538 | [
"MIT"
] | 7 | 2020-06-05T23:36:01.000Z | 2022-01-13T01:42:07.000Z | apps/index/migrations/0003_premiumindexblocks.py | asmuratbek/oobamarket | 1053976a13ea84b9aabfcbbcbcffd79549ce9538 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-19 05:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('index', '0002_auto_20171018_1027'),
]
operations = [
migrations.CreateModel... | 56.333333 | 566 | 0.651425 |
0f9937acfdf5ed07d534e8b6371a642fc7be31cd | 7,075 | py | Python | export_dsq.py | Eagle517/io_scene_dts | beca270013fc4d4b85160c92c4214a3aaafd8a86 | [
"MIT"
] | 3 | 2020-11-02T05:08:02.000Z | 2021-05-14T04:30:03.000Z | export_dsq.py | Eagle517/io_scene_dts | beca270013fc4d4b85160c92c4214a3aaafd8a86 | [
"MIT"
] | 1 | 2022-03-29T05:13:27.000Z | 2022-03-29T06:13:18.000Z | export_dsq.py | Eagle517/io_scene_dts | beca270013fc4d4b85160c92c4214a3aaafd8a86 | [
"MIT"
] | 3 | 2020-07-05T09:47:48.000Z | 2022-03-29T04:10:38.000Z | import bpy, sys
from math import sqrt, pi
from operator import attrgetter
from itertools import groupby
from .DsqFile import DsqFile
from .DtsTypes import *
from .util import fail, evaluate_all, find_reference, array_from_fcurves, \
array_from_fcurves_rotation, fcurves_keyframe_in_range, find_reference
from .share... | 35.732323 | 108 | 0.614841 |
f28d29cd5d9511cf5350978ec644d991a47082eb | 11,778 | py | Python | optuna/visualization/_contour.py | makkimaki/optuna | edafac6f3f45864bfad5f66bd1d81c46549a2f16 | [
"MIT"
] | 5 | 2019-09-27T13:59:09.000Z | 2022-03-12T02:50:16.000Z | optuna/visualization/_contour.py | toshihikoyanase/optuna | 10d1111f026d047ce42494b6f7c330a21c924c9c | [
"MIT"
] | 5 | 2019-11-25T09:36:46.000Z | 2020-04-22T04:49:25.000Z | optuna/visualization/_contour.py | toshihikoyanase/optuna | 10d1111f026d047ce42494b6f7c330a21c924c9c | [
"MIT"
] | 1 | 2019-10-03T00:09:41.000Z | 2019-10-03T00:09:41.000Z | import math
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from packaging import version
from optuna.logging import get_logger
from optuna.study import Study
from optuna.study._study_direction import StudyDirectio... | 37.629393 | 99 | 0.620818 |
ed7c7a06c6f6b0260bd20b5f23bf19a50a7fa358 | 1,212 | py | Python | anchor_coverage.py | Obs01ete/pytorch-detection | 4af02e232b38fd202bb348e9bbe7373c7eba165b | [
"MIT"
] | 11 | 2018-07-24T09:31:19.000Z | 2021-04-07T06:20:38.000Z | anchor_coverage.py | Obs01ete/pytorch-detection | 4af02e232b38fd202bb348e9bbe7373c7eba165b | [
"MIT"
] | null | null | null | anchor_coverage.py | Obs01ete/pytorch-detection | 4af02e232b38fd202bb348e9bbe7373c7eba165b | [
"MIT"
] | 1 | 2019-07-10T05:48:15.000Z | 2019-07-10T05:48:15.000Z | # Author: Dmitrii Khizbullin
# Builds a table of numbers of anchor boxes which cover each ground truth box
import numpy as np
class AnchorCoverage:
def __init__(self):
self.annotations = []
self.stats = []
def add_batch(self, annotations, stats):
self.annotations.extend(annotations)
... | 31.894737 | 88 | 0.60066 |
771851e37260c3fc7d070b0c57e0c4bce4fbb921 | 592 | py | Python | scripts/CulturalAndArtFacilities/libraries/manual_scripts/NS.py | JohnnyPolite/LODE | c81af23947b19d9609c50de461ee87a0f05aed64 | [
"MIT"
] | 21 | 2020-02-26T19:02:57.000Z | 2022-03-24T21:03:03.000Z | scripts/CulturalAndArtFacilities/libraries/manual_scripts/NS.py | JohnnyPolite/LODE | c81af23947b19d9609c50de461ee87a0f05aed64 | [
"MIT"
] | 2 | 2019-03-29T18:34:10.000Z | 2020-09-28T14:51:19.000Z | scripts/CulturalAndArtFacilities/libraries/manual_scripts/NS.py | JohnnyPolite/LODE | c81af23947b19d9609c50de461ee87a0f05aed64 | [
"MIT"
] | 13 | 2019-06-11T13:52:45.000Z | 2022-01-13T17:11:14.000Z | #This pre-processes NS libraries.
#we need to turn (lon,lat) into separate columns.
import pandas as pd
df=pd.read_csv('/home/csis/codes/OpenTabulate/Libraries/NS_Libraries.csv')
def strip_point(x):
t=x.strip('(')
t=t.rstrip(')')
# t=t.strip(' (')
print(t)
return t.split()
LONGS=[]
LATS=[]
for i in df.Loc... | 18.5 | 74 | 0.675676 |
4c276acbb458b732139f15598286f67577a55d62 | 228 | py | Python | setup.py | narain1/banshee | 1a37b64ef81b18d361cf258b3d1ae0fbf7f0ff62 | [
"MIT"
] | null | null | null | setup.py | narain1/banshee | 1a37b64ef81b18d361cf258b3d1ae0fbf7f0ff62 | [
"MIT"
] | null | null | null | setup.py | narain1/banshee | 1a37b64ef81b18d361cf258b3d1ae0fbf7f0ff62 | [
"MIT"
] | null | null | null | import os.path
import sys
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))
| 38 | 103 | 0.767544 |
dfc65ffdcccdd8720eb2a661d66bb7949f32fbd6 | 494 | py | Python | Simulated annealing/solver/local.py | XavierCL/elementary-school-solver | 2aef6f276d883bffbb9f456ace5778895078c66e | [
"MIT"
] | 3 | 2020-04-08T02:32:31.000Z | 2020-04-13T19:46:56.000Z | Simulated annealing/solver/local.py | XavierCL/elementary-school-solver | 2aef6f276d883bffbb9f456ace5778895078c66e | [
"MIT"
] | null | null | null | Simulated annealing/solver/local.py | XavierCL/elementary-school-solver | 2aef6f276d883bffbb9f456ace5778895078c66e | [
"MIT"
] | null | null | null | class Local:
def __init__(self, id, name, premise, allowedGroups, allowedSpecialists):
self.id = id
self.name = name
self.premise = premise
self.allowedGroups = allowedGroups
self.allowedSpecialists = allowedSpecialists
def toString(self):
return "Local#"... | 49.4 | 197 | 0.631579 |
80139248ed1b79bce4d36138c7159a4527380ebd | 16,363 | py | Python | bootstrap/p1.4/src/operations/operationsbase.py | idzikovskyi/df-on-k8s | 80e8047293882199d72441932209dc34c7c7d6e3 | [
"Apache-2.0"
] | 4 | 2021-04-06T01:29:12.000Z | 2022-02-06T16:59:20.000Z | bootstrap/p1.4/src/operations/operationsbase.py | idzikovskyi/df-on-k8s | 80e8047293882199d72441932209dc34c7c7d6e3 | [
"Apache-2.0"
] | 1 | 2022-02-28T22:13:04.000Z | 2022-02-28T22:13:04.000Z | bootstrap/p1.4/src/operations/operationsbase.py | idzikovskyi/df-on-k8s | 80e8047293882199d72441932209dc34c7c7d6e3 | [
"Apache-2.0"
] | 4 | 2021-04-27T17:07:27.000Z | 2022-03-08T17:39:08.000Z | import os
import base64
import tempfile
import time
from common.const import Constants
from common.file_utils import FileUtils
from common.yamlize import Yamlize
from common.mapr_logger.log import Log
from common.os_command import OSCommand
from common.mapr_exceptions.ex import NotFoundException
from shutil import cop... | 46.223164 | 107 | 0.660453 |
9a748b32d2d80e7513a589e7b39866604004347a | 4,375 | py | Python | discord/partial_emoji.py | ShareDVI/discord.py | 4ef0fb0d959b69d3b2cea87b0fc08310028e348f | [
"MIT"
] | 1 | 2020-05-08T14:12:58.000Z | 2020-05-08T14:12:58.000Z | discord/partial_emoji.py | ShareDVI/discord.py | 4ef0fb0d959b69d3b2cea87b0fc08310028e348f | [
"MIT"
] | null | null | null | discord/partial_emoji.py | ShareDVI/discord.py | 4ef0fb0d959b69d3b2cea87b0fc08310028e348f | [
"MIT"
] | 1 | 2020-11-06T15:34:53.000Z | 2020-11-06T15:34:53.000Z | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 30.809859 | 102 | 0.632686 |
d2773a09a4e8b40ecb8745f7807535bb7a65a92e | 91,130 | py | Python | neural_analysis.py | jagrayson/Neuro | 7e14ffbbc347f071fce1ff6865cf3fb336f944bd | [
"Apache-2.0"
] | 1 | 2021-11-14T15:47:05.000Z | 2021-11-14T15:47:05.000Z | neural_analysis.py | jagrayson/Neuro | 7e14ffbbc347f071fce1ff6865cf3fb336f944bd | [
"Apache-2.0"
] | null | null | null | neural_analysis.py | jagrayson/Neuro | 7e14ffbbc347f071fce1ff6865cf3fb336f944bd | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pickle
import contrib_to_behavior
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from sklearn import svm
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
plt.rcParams["font.family"] = "arial"
class neural_analysis:
... | 44.869522 | 193 | 0.577603 |
9aca7a499c60774a4a8e6e3ec5a1a26f35a6f6b6 | 477 | py | Python | src/products/migrations/0003_product_image.py | harishmani09/ecommerce1 | 053b76748c0a95d46ae219f40bd2c4ea69617eb4 | [
"bzip2-1.0.6"
] | null | null | null | src/products/migrations/0003_product_image.py | harishmani09/ecommerce1 | 053b76748c0a95d46ae219f40bd2c4ea69617eb4 | [
"bzip2-1.0.6"
] | null | null | null | src/products/migrations/0003_product_image.py | harishmani09/ecommerce1 | 053b76748c0a95d46ae219f40bd2c4ea69617eb4 | [
"bzip2-1.0.6"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-06-26 23:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_price'),
]
operations = [
migrations.AddField(
... | 22.714286 | 81 | 0.618449 |
b9d8a31677ef165e2bb25ac85ae273030327726d | 1,157 | py | Python | src/Client/VersionControlSystem/GetNewFile/Tools/getIndexFile.py | Sniper970119/MemoryAssistInPython | 434efd09edbda7919a3f754374add7f34912fab7 | [
"MIT"
] | 19 | 2019-02-11T01:39:32.000Z | 2022-03-05T05:14:34.000Z | src/Client/VersionControlSystem/GetNewFile/Tools/getIndexFile.py | Sniper970119/MemoryAssistInPython | 434efd09edbda7919a3f754374add7f34912fab7 | [
"MIT"
] | 1 | 2020-02-04T15:20:04.000Z | 2020-06-04T05:02:06.000Z | src/Client/VersionControlSystem/GetNewFile/Tools/getIndexFile.py | Sniper970119/MemoryAssistInPython | 434efd09edbda7919a3f754374add7f34912fab7 | [
"MIT"
] | 5 | 2019-04-20T07:23:25.000Z | 2021-03-24T03:13:01.000Z | # -*- coding:utf-8 -*-
from src.Client.Conf.config import *
class GetIndexFile():
def __init__(self, s):
self.s = s
def getFile(self):
fileinfo_size = struct.calcsize('128si2s')
buf = self.s.recv(fileinfo_size)
if buf:
filename, filesize, pw = struct.unpack('128si2... | 34.029412 | 110 | 0.54624 |
013110b84ced79adc3f7d023bd007f1a994d6548 | 1,330 | py | Python | training/encode.py | terpyPy/Train-GPT-2-And-Make-Datasets | 22f8f60c82ab7d0b7d50704c90d728810906f518 | [
"MIT"
] | 1 | 2021-03-24T06:13:58.000Z | 2021-03-24T06:13:58.000Z | training/encode.py | terpyPy/Train-GPT-2-And-Make-Datasets | 22f8f60c82ab7d0b7d50704c90d728810906f518 | [
"MIT"
] | null | null | null | training/encode.py | terpyPy/Train-GPT-2-And-Make-Datasets | 22f8f60c82ab7d0b7d50704c90d728810906f518 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Usage:
# PYTHONPATH=src ./encode.py <file|directory|glob> /path/to/output.npz
# PYTHONPATH=src ./train --dataset /path/to/output.npz
import argparse
import numpy as np
import encoder
from load_dataset import load_dataset
parser = argparse.ArgumentParser(
description='Pre-encode text fi... | 41.5625 | 162 | 0.742105 |
e634552a21a9f423aabe8767b8ef936366b17390 | 86,427 | py | Python | test/sql/test_selectable.py | AlbertDachiChen/sqlalchemy_1_3 | 7777bf9388bdd00bf659f6b42aa6b7648c915b88 | [
"MIT"
] | null | null | null | test/sql/test_selectable.py | AlbertDachiChen/sqlalchemy_1_3 | 7777bf9388bdd00bf659f6b42aa6b7648c915b88 | [
"MIT"
] | null | null | null | test/sql/test_selectable.py | AlbertDachiChen/sqlalchemy_1_3 | 7777bf9388bdd00bf659f6b42aa6b7648c915b88 | [
"MIT"
] | null | null | null | """Test various algorithmic properties of selectables."""
from sqlalchemy_1_3 import alias
from sqlalchemy_1_3 import and_
from sqlalchemy_1_3 import bindparam
from sqlalchemy_1_3 import Boolean
from sqlalchemy_1_3 import cast
from sqlalchemy_1_3 import Column
from sqlalchemy_1_3 import exc
from sqlalchemy_1_3 import ... | 32.503573 | 79 | 0.544297 |
39dfb85a9814dde9b64b4641d4d098c91965dac4 | 10,612 | py | Python | vxsandbox/resources/http.py | praekeltfoundation/vumi-sandbox | 1e2dfca8325ce98e52fe32a072749fe4cf7f448d | [
"BSD-3-Clause"
] | 1 | 2021-05-26T08:38:28.000Z | 2021-05-26T08:38:28.000Z | vxsandbox/resources/http.py | praekelt/vumi-sandbox | 1e2dfca8325ce98e52fe32a072749fe4cf7f448d | [
"BSD-3-Clause"
] | 24 | 2015-03-04T08:33:12.000Z | 2016-08-18T07:57:12.000Z | vxsandbox/resources/http.py | praekeltfoundation/vumi-sandbox | 1e2dfca8325ce98e52fe32a072749fe4cf7f448d | [
"BSD-3-Clause"
] | null | null | null | # -*- test-case-name: vxsandbox.resources.tests.test_http -*-
"""An HTTP client resource for Vumi's application sandbox."""
import base64
import operator
from StringIO import StringIO
from twisted.internet import reactor
from twisted.internet.defer import succeed, maybeDeferred
from twisted.web.client import WebClie... | 34.679739 | 79 | 0.60752 |
805240a3fa3d933c7bcb93c7f82f85b9327a2ac8 | 570 | py | Python | 01-HelloSpark/app_lib/logger.py | msdotnetclr/spark_training | d7d6e43ce7da415c13ca6ef90e2224ba4d49cac8 | [
"MIT"
] | null | null | null | 01-HelloSpark/app_lib/logger.py | msdotnetclr/spark_training | d7d6e43ce7da415c13ca6ef90e2224ba4d49cac8 | [
"MIT"
] | null | null | null | 01-HelloSpark/app_lib/logger.py | msdotnetclr/spark_training | d7d6e43ce7da415c13ca6ef90e2224ba4d49cac8 | [
"MIT"
] | null | null | null | class Log4j(object):
def __init__(self, spark):
root_class = "learning.spark.examples"
conf = spark.sparkContext.getConf()
app_name = conf.get("spark.app.name")
log4j = spark._jvm.org.apache.log4j
self.logger = log4j.LogManager.getLogger(root_class + "." + app_name)
def ... | 30 | 77 | 0.635088 |
dfb73841a72e5d555d5256b0f10a1cd729fdbf8d | 11,715 | py | Python | main.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | 6 | 2021-09-01T13:30:47.000Z | 2022-03-11T07:12:02.000Z | main.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | null | null | null | main.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import json
import logging
import argparse
import torch
import sys
from source.inputter.corpus import KnowledgeCorpus
from source.model.seq2seq import Seq2Seq
from source.model.seq2seq_b import Seq2Seq_B
from source.model.seq2seq_e import Seq2Seq_E
from source.mo... | 49.016736 | 112 | 0.661801 |
fc6f0b9d15c7ebd31fcee4df48cb4a9ef56b0a21 | 39,154 | py | Python | gmma/mixture/_gaussian_mixture.py | ccp137/GMMA | 5f484198e58d787a03fd949451e3824b4f4ffe5c | [
"MIT"
] | null | null | null | gmma/mixture/_gaussian_mixture.py | ccp137/GMMA | 5f484198e58d787a03fd949451e3824b4f4ffe5c | [
"MIT"
] | null | null | null | gmma/mixture/_gaussian_mixture.py | ccp137/GMMA | 5f484198e58d787a03fd949451e3824b4f4ffe5c | [
"MIT"
] | null | null | null | """Gaussian Mixture Model."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import linalg, optimize
from ._base import BaseMixture, _check_shape
from ..utils import check_array
from ..utils.extmath impo... | 38.998008 | 136 | 0.606068 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.