hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0bd8eba2e360867ae5e0e40a00c03d3eecb7c920 | 170 | py | Python | main.py | caow2/ML-Project | 1d4bc2ed26780c787db0a64c2677a1ececc37e1d | [
"MIT"
] | null | null | null | main.py | caow2/ML-Project | 1d4bc2ed26780c787db0a64c2677a1ececc37e1d | [
"MIT"
] | null | null | null | main.py | caow2/ML-Project | 1d4bc2ed26780c787db0a64c2677a1ececc37e1d | [
"MIT"
] | null | null | null | import sqlite3
db_file = 'data/ATLDataBase.db'
#db_file = 'ATL&PHL_Data_9_17_18_to_9_22_18/PHLDataBase.db'
conn = sqlite3.connect(db_file)
c = conn.cursor()
c.close()
| 17 | 59 | 0.758824 |
42a45b4c1beb53a4a6ebb96bcdf2bead5d09f5e2 | 413 | py | Python | numba/tests/builtins/test_builtin_int.py | glycerine/numba | 4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635 | [
"BSD-2-Clause"
] | 1 | 2019-04-17T10:03:53.000Z | 2019-04-17T10:03:53.000Z | numba/tests/builtins/test_builtin_int.py | glycerine/numba | 4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635 | [
"BSD-2-Clause"
] | null | null | null | numba/tests/builtins/test_builtin_int.py | glycerine/numba | 4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635 | [
"BSD-2-Clause"
] | null | null | null | """
>>> int() == 0
True
>>> convert_int(2.5) == 2
True
>>> convert_to_int('FF', 16) == 255
True
"""
import sys
from numba import *
@autojit(backend='ast')
def empty_int():
x = float()
return x
@autojit(backend='ast')
def convert_int(x):
return int(x)
@autojit(backend='ast')
def convert_to_int(s, base):... | 14.241379 | 35 | 0.622276 |
b78ab0b133acea51380a04e9ed295fc4edf0fdc0 | 3,107 | py | Python | ucsmsdk/mometa/equipment/EquipmentPsuFsmTask.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/equipment/EquipmentPsuFsmTask.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/equipment/EquipmentPsuFsmTask.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for EquipmentPsuFsmTask ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class EquipmentPsuFsmTaskConsts:
COMPLETION_CANCELLED = "cancelled"
COMPLETION_COMPLETED = "complet... | 51.783333 | 249 | 0.650467 |
363c892f811052bf7c191734764d53c8ca22f178 | 6,942 | py | Python | tests/local/warehouse/metrics/test_missing_and_invalid_customizations.py | b1nslashsh/soda-sql | 927d19561d6315b6cbd84ada87d4953ac2e2717d | [
"Apache-2.0"
] | null | null | null | tests/local/warehouse/metrics/test_missing_and_invalid_customizations.py | b1nslashsh/soda-sql | 927d19561d6315b6cbd84ada87d4953ac2e2717d | [
"Apache-2.0"
] | 1 | 2021-02-23T20:47:40.000Z | 2021-03-06T09:03:48.000Z | tests/local/warehouse/metrics/test_missing_and_invalid_customizations.py | b1nslashsh/soda-sql | 927d19561d6315b6cbd84ada87d4953ac2e2717d | [
"Apache-2.0"
] | 1 | 2021-02-23T20:41:24.000Z | 2021-02-23T20:41:24.000Z | # Copyright 2020 Soda
# 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
#... | 35.968912 | 109 | 0.530539 |
f4f7eeab1ae46c26e791d1a6b640fa43bde23cda | 4,414 | py | Python | sdk/python/pulumi_aws/get_ami_ids.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_ami_ids.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/get_ami_ids.py | johnktims/pulumi-aws | c838bc79043f5376c66fc66275a1e012edd3ab7d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables
class GetAmiI... | 43.27451 | 229 | 0.673539 |
dc07fbc1d21cb1b3e30baeb8db6441de044ced39 | 3,387 | py | Python | python/paddle/distributed/launch/utils/nvsmi.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/distributed/launch/utils/nvsmi.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/distributed/launch/utils/nvsmi.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-09-24T11:23:36.000Z | 2021-09-24T11:23:36.000Z | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 28.462185 | 86 | 0.632713 |
4a36d3f26f3bd4d60cdfb02db4f31f9ee87695a4 | 62,377 | py | Python | lib/galaxy/visualization/data_providers/genome.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/visualization/data_providers/genome.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/visualization/data_providers/genome.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | """
Data providers for genome visualizations.
"""
import itertools
import math
import os
import random
import re
import sys
from galaxy import eggs
eggs.require('numpy') # noqa
eggs.require('bx-python') # noqa
from bx.interval_index_file import Indexes
from bx.bbi.bigbed_file import BigBedFile
from bx.bbi.bigwig_fi... | 36.627716 | 145 | 0.545377 |
33e1e3cb4e234e17a744ebb65b79e1fb3b91f4f4 | 25,413 | py | Python | clef15/text-alignment/pan15_text_alignment_evaluator_character_level.py | deltonvaz/pan-code | 7a1d11eab81d9b4111d3ba0fb7d7038ff7ebfa0a | [
"MIT"
] | null | null | null | clef15/text-alignment/pan15_text_alignment_evaluator_character_level.py | deltonvaz/pan-code | 7a1d11eab81d9b4111d3ba0fb7d7038ff7ebfa0a | [
"MIT"
] | null | null | null | clef15/text-alignment/pan15_text_alignment_evaluator_character_level.py | deltonvaz/pan-code | 7a1d11eab81d9b4111d3ba0fb7d7038ff7ebfa0a | [
"MIT"
] | null | null | null | #!/usr/bin/python2
# Copyright (C) 2009 webis.de. All rights reserved.
"""Plagiarism detection performance measures.
This module implements the measures recall, precision, and granularity
as described by the authors of [1]. The measures can be calculated
macro-averaged and micro-averaged with the respective func... | 43.740103 | 133 | 0.645024 |
6b5a8408f103ecb1afc0a81d03d2b8dd1d2e3846 | 485 | py | Python | test/silicon/3_wan/plot_bands.py | mir-group/BRAVE | 45a870946661d7d76fcca273036b3004f21a49bd | [
"MIT"
] | 8 | 2020-11-03T03:28:35.000Z | 2022-03-18T21:22:03.000Z | test/silicon/3_wan/plot_bands.py | mir-group/BRAVE | 45a870946661d7d76fcca273036b3004f21a49bd | [
"MIT"
] | 1 | 2021-02-28T08:41:21.000Z | 2021-02-28T08:41:21.000Z | test/silicon/3_wan/plot_bands.py | mir-group/BRAVE | 45a870946661d7d76fcca273036b3004f21a49bd | [
"MIT"
] | 1 | 2022-03-20T19:27:33.000Z | 2022-03-20T19:27:33.000Z | import brave
bnd = brave.Diagram()
bnd.read('internal', ['../../kpath/fcc.full.in'])
bnd.calc_kindex('density')
bnd.calc_kpoint()
bnd.read('wannier-out', ['silicon.win', 'silicon-bands.dat'])
bnd.nelec = 8.0
bnd.calc_efermi()
bnd.set_plot('energy')
bnd.plot.ylim = [[0, 12]]
bnd.plot.pagesize = [5.0, 3.75]
bnd.plot.not... | 32.333333 | 119 | 0.626804 |
28abe137f2ac997f67b62b6e77b76020a7f2c4cb | 4,450 | py | Python | backend/app/core/regressor.py | Laende/anleggsmaskin-salgsprisprekisjon | d1e448d9ee081ba055c3ac05c1b1883294f19c99 | [
"MIT"
] | null | null | null | backend/app/core/regressor.py | Laende/anleggsmaskin-salgsprisprekisjon | d1e448d9ee081ba055c3ac05c1b1883294f19c99 | [
"MIT"
] | null | null | null | backend/app/core/regressor.py | Laende/anleggsmaskin-salgsprisprekisjon | d1e448d9ee081ba055c3ac05c1b1883294f19c99 | [
"MIT"
] | null | null | null | from logging import getLogger
from pathlib import Path
from typing import List
import joblib
import numpy as np
import pandas as pd
from app.core.config import (get_feature_codes, get_features_list,
get_state_list)
from app.schemas.prediction import SalePricePredictionResult
from app.sche... | 38.034188 | 116 | 0.63618 |
e1dc7008e8a796fb78f1594b1d0972fd14d057c4 | 7,152 | py | Python | pycore/blocks.py | passlab/PlotNeuralNet | c8fff27fe2a7b839c01437d77363ac150d3c6d68 | [
"MIT"
] | null | null | null | pycore/blocks.py | passlab/PlotNeuralNet | c8fff27fe2a7b839c01437d77363ac150d3c6d68 | [
"MIT"
] | null | null | null | pycore/blocks.py | passlab/PlotNeuralNet | c8fff27fe2a7b839c01437d77363ac150d3c6d68 | [
"MIT"
] | null | null | null |
from .tikzeng import *
#define new block
def block_2ConvPool( name, botton, top, s_filer=256, n_filer=64, offset="(1,0,0)", size=(32,32,3.5), opacity=0.5 ):
return [
to_ConvConvRelu(
name="ccr_{}".format( name ),
s_filer=str(s_filer),
n_filer=(n_filer,n_filer),
offset=offset... | 30.827586 | 226 | 0.435263 |
e4ecaec849c9162d4324dcfffa751c45a2c130b0 | 973 | py | Python | LeetCode/running-sum-1d-array.py | amgad01/algorithms | 53eecf06e907cde806d4b78dc78fcd70d0271e3e | [
"MIT"
] | 1 | 2021-03-05T18:13:02.000Z | 2021-03-05T18:13:02.000Z | LeetCode/running-sum-1d-array.py | amgad01/algorithms | 53eecf06e907cde806d4b78dc78fcd70d0271e3e | [
"MIT"
] | null | null | null | LeetCode/running-sum-1d-array.py | amgad01/algorithms | 53eecf06e907cde806d4b78dc78fcd70d0271e3e | [
"MIT"
] | 1 | 2021-07-25T01:55:12.000Z | 2021-07-25T01:55:12.000Z | def running_sum(nums):
"""Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).
Return the running sum of nums.
Example 1: Input: nums = [1,2,3,4] Output: [1,3,6,10]
Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
Example 2: Inpu... | 37.423077 | 146 | 0.612539 |
45a6e241a0a4f280e45f68722b7f3dfe4000139b | 1,248 | py | Python | CEGO/testFunctions/C3DTLZ4.py | napa-jmm/CEGO | 172d511133a608ca5bf265d9ebd2937b8a171b3e | [
"MIT"
] | 6 | 2018-07-18T06:38:42.000Z | 2021-11-17T21:01:40.000Z | CEGO/testFunctions/C3DTLZ4.py | napa-jmm/CEGO | 172d511133a608ca5bf265d9ebd2937b8a171b3e | [
"MIT"
] | null | null | null | CEGO/testFunctions/C3DTLZ4.py | napa-jmm/CEGO | 172d511133a608ca5bf265d9ebd2937b8a171b3e | [
"MIT"
] | 6 | 2018-10-15T09:35:24.000Z | 2021-05-08T13:40:19.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 21 16:50:49 2018
@author: r.dewinter
"""
import numpy as np
def C3DTLZ4(x):
x = np.array(x)
gx = np.sum((x[1:]-0.5)**2)
f1 = (1+(gx))*np.cos(x[0]*np.pi/2)
f2 = (1+(gx))*np.sin(x[0]*np.pi/2)
c1 = (f1**2)/4 + f2**2 - 1
... | 26.553191 | 76 | 0.508013 |
8e8301e31b38aa9b4357fd4b86b20aedc11293ea | 974 | py | Python | src/robusta/core/model/services.py | robusta-dev/robusta | 5dadeb48724c37882759bcdd785e11f59a0afb09 | [
"MIT"
] | 273 | 2021-12-28T20:48:48.000Z | 2022-03-31T16:03:13.000Z | src/robusta/core/model/services.py | robusta-dev/robusta | 5dadeb48724c37882759bcdd785e11f59a0afb09 | [
"MIT"
] | 103 | 2022-01-10T11:45:47.000Z | 2022-03-31T16:31:11.000Z | src/robusta/core/model/services.py | robusta-dev/robusta | 5dadeb48724c37882759bcdd785e11f59a0afb09 | [
"MIT"
] | 35 | 2021-12-30T15:30:14.000Z | 2022-03-28T11:43:57.000Z | from pydantic import BaseModel
from typing import List, Dict
class ServiceInfo(BaseModel):
name: str
service_type: str
namespace: str
classification: str = "None"
deleted: bool = False
images: List[str]
labels: Dict[str, str]
def get_service_key(self) -> str:
return f"{self.na... | 31.419355 | 96 | 0.620123 |
bd953357e594b719257ffd4f4a09625d8716e9fe | 473 | py | Python | django_resto/settings.py | innoteq/django-resto | 2ea04dd116af882e62643d9f819c05d5a62389bd | [
"BSD-3-Clause"
] | 31 | 2015-01-14T14:01:37.000Z | 2020-12-12T18:39:50.000Z | django_resto/settings.py | innoteq/django-resto | 2ea04dd116af882e62643d9f819c05d5a62389bd | [
"BSD-3-Clause"
] | 4 | 2015-01-10T17:20:41.000Z | 2018-01-02T15:31:43.000Z | django_resto/settings.py | innoteq/django-resto | 2ea04dd116af882e62643d9f819c05d5a62389bd | [
"BSD-3-Clause"
] | 5 | 2015-01-10T04:39:38.000Z | 2018-10-12T06:42:33.000Z | """Default settings. Override them in the settings file of your project.
See the README for more information.
"""
from __future__ import unicode_literals
from django.conf import settings
def get_setting(name):
name = 'RESTO_%s' % name
# raise a KeyError if we have no such setting
default = globals()[na... | 18.92 | 72 | 0.742072 |
4da6735369d7ed529d11e1b16ec981856ad2ba96 | 29,541 | py | Python | sdk/python/pulumi_azure_native/machinelearningservices/v20200501preview/aci_service.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/v20200501preview/aci_service.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/machinelearningservices/v20200501preview/aci_service.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 48.99005 | 965 | 0.670424 |
80de6ff7ed7006f770eb158437c8fe3ff6fe08d2 | 1,912 | py | Python | delfin/alert_manager/alert_processor.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | delfin/alert_manager/alert_processor.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | 3 | 2020-05-23T03:24:56.000Z | 2020-06-06T02:24:27.000Z | delfin/alert_manager/alert_processor.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 36.769231 | 78 | 0.679393 |
886aa77bed2b2a5401469ce977fbfa53c8887d45 | 3,622 | py | Python | models/basic.py | wpfhtl/PSMNet | 337f8d9cd3ecfffe26395450e4363428179d6f30 | [
"MIT"
] | null | null | null | models/basic.py | wpfhtl/PSMNet | 337f8d9cd3ecfffe26395450e4363428179d6f30 | [
"MIT"
] | null | null | null | models/basic.py | wpfhtl/PSMNet | 337f8d9cd3ecfffe26395450e4363428179d6f30 | [
"MIT"
] | 1 | 2018-04-20T05:32:55.000Z | 2018-04-20T05:32:55.000Z | from __future__ import print_function
import torch
import torch.nn as nn
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import math
from submodule import *
class PSMNet(nn.Module):
def __init__(self, maxdisp, colormode):
super(PSMNet, self).__init__()
se... | 40.244444 | 194 | 0.509111 |
d05c9534affc297c7fa01543d6a14f5ec3bddcf6 | 3,571 | py | Python | main/catdog_test.py | xiaonanQua/experiment | 19925c9af5cffc73451dc7674bc3afce25abf772 | [
"MIT"
] | null | null | null | main/catdog_test.py | xiaonanQua/experiment | 19925c9af5cffc73451dc7674bc3afce25abf772 | [
"MIT"
] | null | null | null | main/catdog_test.py | xiaonanQua/experiment | 19925c9af5cffc73451dc7674bc3afce25abf772 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import torch
import torch.nn as nn
import torchvision.models as model
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
import torchvision.transforms as transforms
import time
from torch.utils.data import Dataset
from PIL import Image
import os
import torch.nn.... | 25.326241 | 92 | 0.628395 |
4481d4a34c212a8d376fcb4cd47f4f63acc160e8 | 4,514 | py | Python | src/mac/generate_mapping.py | hanya/mozc | 7e2420b6307ef2eb147fdf9b620cb8f1ebea0588 | [
"BSD-3-Clause"
] | 1,144 | 2015-04-23T16:18:45.000Z | 2022-03-29T19:37:33.000Z | src/mac/generate_mapping.py | kirameister/mozc | 18b2b32b4d3fe585d38134606773239781b6be82 | [
"BSD-3-Clause"
] | 291 | 2015-05-04T07:53:37.000Z | 2022-03-22T00:09:05.000Z | src/mac/generate_mapping.py | kirameister/mozc | 18b2b32b4d3fe585d38134606773239781b6be82 | [
"BSD-3-Clause"
] | 301 | 2015-05-03T00:07:18.000Z | 2022-03-21T10:48:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | 33.686567 | 79 | 0.696943 |
86e4621e9c79b5f83e2cf42b572d5292ff5f43ad | 16,738 | py | Python | app/engine/health_bar.py | ViolaBuddy/EscapeFromPlegia | 5228b42e8525b445854d742dccf85ca65b320d70 | [
"MIT"
] | null | null | null | app/engine/health_bar.py | ViolaBuddy/EscapeFromPlegia | 5228b42e8525b445854d742dccf85ca65b320d70 | [
"MIT"
] | null | null | null | app/engine/health_bar.py | ViolaBuddy/EscapeFromPlegia | 5228b42e8525b445854d742dccf85ca65b320d70 | [
"MIT"
] | null | null | null | import random
import app.utilities as utils
from app.constants import WINWIDTH, WINHEIGHT, TILEWIDTH, TILEHEIGHT, TILEX, TILEY
from app.engine.sprites import SPRITES
from app.engine.fonts import FONT
from app.engine.sound import SOUNDTHREAD
from app.engine import engine, combat_calcs, icons, equations, skill_system, i... | 40.235577 | 148 | 0.577668 |
a732bd83a09970e0573171e767890147a1b64b94 | 485 | py | Python | mla_game/apps/transcript/migrations/0023_auto_20171113_1841.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/apps/transcript/migrations/0023_auto_20171113_1841.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/apps/transcript/migrations/0023_auto_20171113_1841.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-13 18:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transcript', '0022_auto_20171103_1841'),
]
operations = [
migrations.AlterF... | 23.095238 | 57 | 0.643299 |
8d6d5a5fca1977767da574fa8b14b52724466356 | 1,676 | py | Python | userbot/modules/hentai.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2022-01-31T14:35:01.000Z | 2022-03-31T06:42:39.000Z | userbot/modules/hentai.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-03-19T15:54:46.000Z | 2022-03-19T15:54:46.000Z | userbot/modules/hentai.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 22 | 2022-01-29T20:29:35.000Z | 2022-03-31T06:42:41.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for filter commands """
from telethon import events
from telethon.errors.rpcerrorlist import YouBlo... | 33.52 | 78 | 0.652148 |
1e1172f4dd482cd6789ec231902e8fc979f0cd4f | 20,618 | py | Python | networks/vision_transformer.py | NoelShin/selfmask | 396e0a3636b29591f505b6711be45eabe292919a | [
"MIT"
] | 11 | 2022-03-24T02:45:33.000Z | 2022-03-30T02:53:33.000Z | networks/vision_transformer.py | NoelShin/selfmask | 396e0a3636b29591f505b6711be45eabe292919a | [
"MIT"
] | 2 | 2022-03-25T11:08:34.000Z | 2022-03-30T14:13:26.000Z | networks/vision_transformer.py | NoelShin/selfmask | 396e0a3636b29591f505b6711be45eabe292919a | [
"MIT"
] | 1 | 2022-03-30T02:53:35.000Z | 2022-03-30T02:53:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Mostly copy-paste from timm library.
https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
"""
from typing import Optional
import math
from functools import partial
import torch
import torch.nn as nn
... | 36.17193 | 124 | 0.57508 |
e176a37f55dbe09e5239a92eb90fa2f4aa557455 | 5,230 | py | Python | server_tools/device_server.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 1 | 2020-11-30T01:45:08.000Z | 2020-11-30T01:45:08.000Z | server_tools/device_server.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 8 | 2021-02-23T00:18:12.000Z | 2022-03-12T00:54:50.000Z | server_tools/device_server.py | krbjila/labrad_tools | 5c510cb35090807807bfe6bd910b9c35edce6fce | [
"MIT"
] | 1 | 2020-11-08T14:54:21.000Z | 2020-11-08T14:54:21.000Z | import re
import json
import types
import os
from twisted.internet.defer import returnValue, inlineCallbacks
from labrad.server import LabradServer, setting
from decorators import quickSetting
def underscore(name):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z])([A-Z])', r'\1_\2', s1)... | 35.100671 | 97 | 0.627916 |
221643fb5e94e107b26c17415ef42d4b8f2897a1 | 41,128 | py | Python | PlanheatMappingModule/PlanHeatDMM/src/worker.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 2 | 2020-04-07T03:43:33.000Z | 2021-03-23T13:17:42.000Z | PlanheatMappingModule/PlanHeatDMM/src/worker.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 1 | 2020-07-20T09:56:13.000Z | 2020-07-22T10:26:06.000Z | PlanheatMappingModule/PlanHeatDMM/src/worker.py | Planheat/Planheat-Tool | 9764fcb86d3898b232c4cc333dab75ebe41cd421 | [
"MIT"
] | 1 | 2020-07-20T09:40:15.000Z | 2020-07-20T09:40:15.000Z | # -*- coding: utf-8 -*-
"""
Process Thread
:author: Sergio Aparicio Vegas
:version: 0.1
:date: 10 Oct. 2017
"""
__docformat__ = "restructuredtext"
import sys
import os
import time
import subprocess
import gc
import platform
from json import dumps
from PyQt5 import QtGui,QtCore
from PyQt5.QtCore im... | 52.392357 | 218 | 0.597039 |
7701ead48e65a3fbaab532b2fc7bc9bd059aa6eb | 6,777 | py | Python | tests/cli/test_projects.py | veger/jexia-cli | d7652030292a0276659cc0710b2bf4861c8ba568 | [
"MIT"
] | 6 | 2020-02-03T11:02:29.000Z | 2020-04-02T19:16:13.000Z | tests/cli/test_projects.py | veger/jexia-cli | d7652030292a0276659cc0710b2bf4861c8ba568 | [
"MIT"
] | 3 | 2020-04-02T12:42:08.000Z | 2021-06-10T23:51:13.000Z | tests/cli/test_projects.py | veger/jexia-cli | d7652030292a0276659cc0710b2bf4861c8ba568 | [
"MIT"
] | 2 | 2020-02-05T09:05:32.000Z | 2020-12-04T13:22:48.000Z | import mock
import pytest
from jexia_cli.formatters import format_timestamp_to_utc
from tests.cli import run_cmd, SHELL_CONFIG
CREATED_AT = 1580208898
PROJECT_LIST_RESP = {
'accounts': [{
'account_owner_id': '3054b850-a1d9-4860-8b4e-2b63b7322907',
'plan_id': 'cbaeb217-aadf-41c3-87c9-8b8bb0a29969'... | 34.401015 | 78 | 0.649845 |
35d634568fbcfa5e6d4277017a67f008af3c9246 | 3,333 | py | Python | tests/test_helpers/test_acn/test_agent_record.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/test_helpers/test_acn/test_agent_record.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/test_helpers/test_acn/test_agent_record.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 34.360825 | 92 | 0.676568 |
678a7fe7e189a5e744c78f006156fe9521aadcdb | 55,069 | py | Python | REDSI_1160929_1161573/boost_1_67_0/tools/build/src/build/project.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | null | null | null | REDSI_1160929_1161573/boost_1_67_0/tools/build/src/build/project.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | null | null | null | REDSI_1160929_1161573/boost_1_67_0/tools/build/src/build/project.py | Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo | eb0f7ef64e188fe871f47c2ef9cdef36d8a66bc8 | [
"MIT"
] | 1 | 2019-03-08T11:06:22.000Z | 2019-03-08T11:06:22.000Z | # Status: ported.
# Base revision: 64488
# Copyright 2002, 2003 Dave Abrahams
# Copyright 2002, 2005, 2006 Rene Rivera
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/L... | 42.821928 | 104 | 0.597541 |
308e7fa94dfbec0143e4ac6db3352563bc7ffee6 | 11,661 | py | Python | mmdet/datasets/custom.py | Chenglin-Yang/LESA_detection | 3238bd9c6f3eb4a2a746837043cd9b3b56c77216 | [
"Apache-2.0"
] | 4 | 2021-07-18T08:09:09.000Z | 2022-01-06T06:19:00.000Z | mmdet/datasets/custom.py | Chenglin-Yang/LESA_detection | 3238bd9c6f3eb4a2a746837043cd9b3b56c77216 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/custom.py | Chenglin-Yang/LESA_detection | 3238bd9c6f3eb4a2a746837043cd9b3b56c77216 | [
"Apache-2.0"
] | 1 | 2022-01-06T06:18:53.000Z | 2022-01-06T06:18:53.000Z | import os.path as osp
import warnings
from collections import OrderedDict
import mmcv
import numpy as np
from mmcv.utils import print_log
from torch.utils.data import Dataset
from mmdet.core import eval_map, eval_recalls
from .builder import DATASETS
from .pipelines import Compose
@DATASETS.register_module()
class ... | 35.769939 | 79 | 0.566675 |
8dafd003b87856c4eba1b4a96e2cabd4a3602ca8 | 595 | py | Python | app/main.py | jmeisele/fastapi-ml-scaffolding | 605cbfc6a1bb4c3bb7cb3d379a4aee6f889d0e53 | [
"MIT"
] | 8 | 2020-07-22T16:35:18.000Z | 2021-11-07T02:54:30.000Z | app/main.py | jmeisele/fastapi-ml-scaffolding | 605cbfc6a1bb4c3bb7cb3d379a4aee6f889d0e53 | [
"MIT"
] | 1 | 2022-01-13T04:43:41.000Z | 2022-01-13T04:43:41.000Z | app/main.py | jmeisele/fastapi-ml-scaffolding | 605cbfc6a1bb4c3bb7cb3d379a4aee6f889d0e53 | [
"MIT"
] | 2 | 2021-07-16T21:41:15.000Z | 2022-01-24T23:31:34.000Z | from fastapi import FastAPI
from app.api.routes.router import api_router
from app.core.config import API_PREFIX, APP_NAME, APP_VERSION, IS_DEBUG
from app.core.event_handlers import start_app_handler, stop_app_handler
def get_app() -> FastAPI:
"""FastAPI app controller"""
fast_app = FastAPI(title=APP_NAME, ve... | 31.315789 | 75 | 0.786555 |
9e3645032fb9e969cb257a8b8ba592ed0c3214c4 | 1,750 | py | Python | Data Structure/Linked_List/Singly_Linked_List/Delete_Kth_Node_From_End.py | Hasindu5512/HacktoberFest-2020-Data-Structure-and-algorithm | 64ab102fd363fc47d2f22ba9f5a5a8130891efd4 | [
"MIT"
] | 5 | 2020-10-05T11:26:42.000Z | 2021-03-04T04:31:37.000Z | Data Structure/Linked_List/Singly_Linked_List/Delete_Kth_Node_From_End.py | Hasindu5512/HacktoberFest-2020-Data-Structure-and-algorithm | 64ab102fd363fc47d2f22ba9f5a5a8130891efd4 | [
"MIT"
] | 16 | 2020-10-05T04:56:32.000Z | 2020-10-21T21:04:07.000Z | Data Structure/Linked_List/Singly_Linked_List/Delete_Kth_Node_From_End.py | Hasindu5512/HacktoberFest-2020-Data-Structure-and-algorithm | 64ab102fd363fc47d2f22ba9f5a5a8130891efd4 | [
"MIT"
] | 45 | 2020-10-04T15:23:45.000Z | 2020-10-30T04:46:30.000Z | # Python3 program for Fibonacci search.
from bisect import bisect_left
# Returns index of x if present, else
# returns -1
def fibMonaccianSearch(arr, x, n):
# Initialize fibonacci numbers
fibMMm2 = 0 # (m-2)'th Fibonacci No.
fibMMm1 = 1 # (m-1)'th Fibonacci No.
fibM = fibMMm2 + fibMMm1 # m'th Fibo... | 26.119403 | 50 | 0.563429 |
660855b1a714823c84a6ef6602c59f9473fff684 | 8,156 | py | Python | mlmodels/model_tf/rl/21.neuro-evolution-agent.py | gitter-badger/mlmodels | f08cc9b6ec202d4ad25ecdda2f44487da387569d | [
"MIT"
] | 1 | 2022-03-11T07:57:48.000Z | 2022-03-11T07:57:48.000Z | mlmodels/model_tf/rl/21.neuro-evolution-agent.py | whitetiger1002/mlmodels | f70f1da7434e8855eed50adc67b49cc169f2ea24 | [
"MIT"
] | null | null | null | mlmodels/model_tf/rl/21.neuro-evolution-agent.py | whitetiger1002/mlmodels | f70f1da7434e8855eed50adc67b49cc169f2ea24 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import tensorflow as tf
sns.set()
# In[2]:
df = pd.read_csv("../dataset/GOOG-year.csv")
df.head()
# In[3]:
close = df.Close.values.tolist()
initial_money = 10000
window... | 30.432836 | 97 | 0.582761 |
490a9c6b53dfd836a8861646e415bfb04a48cb42 | 647 | py | Python | Collect/JRC/Occurrence.py | ali1100/wa | 700e5014533c45f38a245c3abdeacc537cb307bc | [
"Apache-2.0"
] | 16 | 2017-04-27T21:22:37.000Z | 2020-10-21T12:57:03.000Z | Collect/JRC/Occurrence.py | ali1100/wa | 700e5014533c45f38a245c3abdeacc537cb307bc | [
"Apache-2.0"
] | 1 | 2017-06-17T08:07:53.000Z | 2017-08-22T12:28:37.000Z | Collect/JRC/Occurrence.py | wateraccounting/wa | 29ed8e7eac732135678a5d171cd5e53a54c95313 | [
"Apache-2.0"
] | 19 | 2016-10-24T13:24:34.000Z | 2020-02-03T17:42:22.000Z | """
Authors: Tim Hessels
UNESCO-IHE 2017
Contact: t.hessels@unesco-ihe.org
Repository: https://github.com/wateraccounting/wa
Module: Collect/JRC
"""
import sys
from DataAccess import DownloadData
def main(Dir, latlim, lonlim, Waitbar = 1):
"""
This function downloads JRC water occurrence data for th... | 23.962963 | 87 | 0.678516 |
97fa1e8876afa7962b4bcd69e63da1517bfeff0f | 1,870 | py | Python | example/example.py | anyongjin/pylsd2 | dc1cfc7bccae0fe843c9729f386958a11b4b3b92 | [
"BSD-2-Clause"
] | 8 | 2021-07-28T16:09:01.000Z | 2022-03-07T01:34:50.000Z | example/example.py | anyongjin/pylsd2 | dc1cfc7bccae0fe843c9729f386958a11b4b3b92 | [
"BSD-2-Clause"
] | 1 | 2021-06-24T09:54:44.000Z | 2021-06-24T10:22:40.000Z | example/example.py | anyongjin/pylsd2 | dc1cfc7bccae0fe843c9729f386958a11b4b3b92 | [
"BSD-2-Clause"
] | 2 | 2021-06-24T08:55:25.000Z | 2021-09-30T07:52:41.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# File : example.py
# Author: anyongjin
# Date : 2021/6/16
import os
import numpy as np
from pylsd2 import LineSegmentDetection, LineSegmentDetectionED
def extract_lines(gray, extract_type='lsd'):
if extract_type == 'lsd':
lines = LineSegmentDetection(gray)
... | 29.68254 | 97 | 0.656684 |
70038e8840ccebaa0a9847b376feb571b003f3d2 | 3,566 | py | Python | sudoku_MC.py | zeryabmoussaoui/sudoku-optimization-solver | caeab796a1e231996a7e80ed6e074eaf92b3d10c | [
"Unlicense"
] | null | null | null | sudoku_MC.py | zeryabmoussaoui/sudoku-optimization-solver | caeab796a1e231996a7e80ed6e074eaf92b3d10c | [
"Unlicense"
] | null | null | null | sudoku_MC.py | zeryabmoussaoui/sudoku-optimization-solver | caeab796a1e231996a7e80ed6e074eaf92b3d10c | [
"Unlicense"
] | null | null | null | # Ref : https://www.lptmc.jussieu.fr/user/talbot/sudoku.html ( metropolis method)
import numpy as np
import math
import random
import matplotlib.pyplot as plt
# Algorithm Params
temp = 0.10;
ntrial = 1000000;
emin = 18;
zero = 0;
# Functions used to compute energy
def check(i, k, ncheck):
# dete... | 26.61194 | 82 | 0.530566 |
ee49653542796bb6cd29fd1eb265eb87ce9e4f80 | 602 | py | Python | vision_tile_query/config.py | eos-vision/tile-query | f6256ebb13c5c6f9beec9bb9a9f0cf0a85b23d0e | [
"MIT"
] | 1 | 2019-04-22T07:45:22.000Z | 2019-04-22T07:45:22.000Z | vision_tile_query/config.py | eos-vision/tile-query | f6256ebb13c5c6f9beec9bb9a9f0cf0a85b23d0e | [
"MIT"
] | null | null | null | vision_tile_query/config.py | eos-vision/tile-query | f6256ebb13c5c6f9beec9bb9a9f0cf0a85b23d0e | [
"MIT"
] | 2 | 2020-09-04T14:53:59.000Z | 2020-10-28T02:30:29.000Z | # Default SRID numbers
MERCATOR_SRID = 4326
WEB_MERCATOR_SRID = 3857
# MVT query settings
# 1% of tile width
RELATIVE_BUFFER_WIDTH = 0.01
# default tile extent value. See details https://postgis.net/docs/ST_AsMVT.html
DEFAULT_EXTENT = 4096
# 0.5% of tile area fow VM polygons simplification
SIMPLIFY_COEFFICIENT = 0.000... | 27.363636 | 79 | 0.774086 |
1ee2ef4b08955ddb53e14b604b2fc406dae5609e | 9,819 | py | Python | models/train_rels.py | ivalab/Scene_Graph_Parsing | 179b1653defe615de98165784ae3a527f822bf3a | [
"MIT"
] | null | null | null | models/train_rels.py | ivalab/Scene_Graph_Parsing | 179b1653defe615de98165784ae3a527f822bf3a | [
"MIT"
] | null | null | null | models/train_rels.py | ivalab/Scene_Graph_Parsing | 179b1653defe615de98165784ae3a527f822bf3a | [
"MIT"
] | null | null | null | """
Training script for scene graph detection. Integrated with my faster rcnn setup
"""
from dataloaders.georgia_tech import GTDataLoader, GT
import numpy as np
from torch import optim
import torch
import pandas as pd
import time
import os
from torch import nn
from config import ModelConfig, BOX_SCALE_GT, IM_SCALE_GT
... | 44.631818 | 130 | 0.642021 |
a3b19568d814cfd31a3d7a35df984d858abe0c42 | 389 | py | Python | lesson_02/02_02_a.py | amindmobile/geekbrains-python-002 | 4bc2f7af755d00e73ddc48f1138830cb78e87034 | [
"MIT"
] | null | null | null | lesson_02/02_02_a.py | amindmobile/geekbrains-python-002 | 4bc2f7af755d00e73ddc48f1138830cb78e87034 | [
"MIT"
] | null | null | null | lesson_02/02_02_a.py | amindmobile/geekbrains-python-002 | 4bc2f7af755d00e73ddc48f1138830cb78e87034 | [
"MIT"
] | null | null | null | # на курсе этому не учили, но мы-то знаааем.. ;)
from itertools import zip_longest
# Мутно, но иначе чистый инпут принимает просто строку и она потом итерируется посимвольно
user_list = list(map(int, input('Введите числа через пробел: ').split()))
nl = []
for a, b in zip_longest(user_list[::2], user_list[1::2]):
... | 27.785714 | 91 | 0.670951 |
a40998857d9f4a6479c064e5dd65dee7df01da1c | 358 | py | Python | Leetcode/0338. Counting Bits.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | 1 | 2021-07-15T18:40:26.000Z | 2021-07-15T18:40:26.000Z | Leetcode/0338. Counting Bits.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | Leetcode/0338. Counting Bits.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | class Solution:
def countBits(self, n: int) -> list[int]:
res = []
for i in range(n + 1):
res.append(bin(i).count("1"))
return res
class Solution:
def countBits(self, n: int) -> list[int]:
res = [0] * (n + 1)
for x in range(1, n + 1):
res[x] = re... | 23.866667 | 45 | 0.458101 |
27db1b1598307857f582ab00faa76d45e9980fda | 2,760 | py | Python | district42_exp_types/uuid_str/_uuid_str_validator.py | nikitanovosibirsk/district42-exp-types | e36e43da62f32d58d4b14c65afa16856dc8849e1 | [
"Apache-2.0"
] | null | null | null | district42_exp_types/uuid_str/_uuid_str_validator.py | nikitanovosibirsk/district42-exp-types | e36e43da62f32d58d4b14c65afa16856dc8849e1 | [
"Apache-2.0"
] | 2 | 2021-08-01T05:02:21.000Z | 2021-08-01T10:06:28.000Z | district42_exp_types/uuid_str/_uuid_str_validator.py | nikitanovosibirsk/district42-exp-types | e36e43da62f32d58d4b14c65afa16856dc8849e1 | [
"Apache-2.0"
] | null | null | null | from typing import Any, cast
from uuid import UUID
from niltype import Nil, Nilable
from th import PathHolder
from valera import Formatter, ValidationResult, Validator
from valera.errors import TypeValidationError, ValidationError, ValueValidationError
from ._uuid_str_schema import UUIDStrSchema
__all__ = ("UUIDStrV... | 38.333333 | 91 | 0.654348 |
6ef2845703855fa225335b7b68afaa9c7d3a592e | 206 | py | Python | example/eulerproject/problem1.py | Xe/code | d970038329f7c4e4f0ee9dcd1b345741dd0fcc51 | [
"Zlib"
] | 7 | 2015-03-26T07:35:06.000Z | 2021-12-09T00:03:33.000Z | example/eulerproject/problem1.py | Xe/code | d970038329f7c4e4f0ee9dcd1b345741dd0fcc51 | [
"Zlib"
] | null | null | null | example/eulerproject/problem1.py | Xe/code | d970038329f7c4e4f0ee9dcd1b345741dd0fcc51 | [
"Zlib"
] | 1 | 2020-11-03T22:59:31.000Z | 2020-11-03T22:59:31.000Z | #!/usr/bin/python
numbers = [range(1000), range(1000)]
final = filter(lambda x: x % 3 == 0, numbers[0])
final.extend(filter(lambda x: x % 5 == 0, numbers[1]))
print reduce((lambda x,y: x+y), set(final))
| 22.888889 | 54 | 0.631068 |
2df0c2578f25884d980bf46c51747169770e2b3f | 32,657 | py | Python | logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py | theacodes/google-cloud-python | 57dafcb78540e12c82f7ca0fc77d75edeb269390 | [
"Apache-2.0"
] | 1 | 2020-10-25T04:39:41.000Z | 2020-10-25T04:39:41.000Z | logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py | theacodes/google-cloud-python | 57dafcb78540e12c82f7ca0fc77d75edeb269390 | [
"Apache-2.0"
] | 4 | 2018-11-13T22:15:36.000Z | 2018-12-07T18:31:38.000Z | logging/google/cloud/logging_v2/gapic/logging_service_v2_client.py | theacodes/google-cloud-python | 57dafcb78540e12c82f7ca0fc77d75edeb269390 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 46.45377 | 155 | 0.594788 |
598e1f7b629f8dcacb33d96e26760d22cff36cee | 1,783 | py | Python | versiongrid/db/base.py | rsnyman/versiongrid | 0870f320f2b53f1071282692816fcbba1f9a0346 | [
"MIT"
] | null | null | null | versiongrid/db/base.py | rsnyman/versiongrid | 0870f320f2b53f1071282692816fcbba1f9a0346 | [
"MIT"
] | null | null | null | versiongrid/db/base.py | rsnyman/versiongrid | 0870f320f2b53f1071282692816fcbba1f9a0346 | [
"MIT"
] | null | null | null | from uuid import UUID
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import UUID as PostgresUUID
from sqlalchemy.types import CHAR
from sqlalchemy.types import TypeDecorator
db = SQLAlchemy()
Model = db.Model
Boolean = db.Boolean
Column = db.Column
DateTime = db.DateTime
Float = db.Float... | 27.015152 | 96 | 0.649467 |
25f8d9fd0c6d587b21b656f149495e4e707044de | 28,004 | py | Python | plugin/tensorboard_plugin_profile/profile_plugin.py | Saiprasad16/profiler | 00499416f250acca6c73dd7f191e24ee142c2bef | [
"Apache-2.0"
] | 1 | 2021-05-10T10:47:15.000Z | 2021-05-10T10:47:15.000Z | plugin/tensorboard_plugin_profile/profile_plugin.py | Saiprasad16/profiler | 00499416f250acca6c73dd7f191e24ee142c2bef | [
"Apache-2.0"
] | null | null | null | plugin/tensorboard_plugin_profile/profile_plugin.py | Saiprasad16/profiler | 00499416f250acca6c73dd7f191e24ee142c2bef | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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... | 36.558747 | 108 | 0.672368 |
b85655eed9df524c80f97cdcfd06cc48ca6f1c0e | 606 | py | Python | advent/day03/day03_test.py | benjackwhite/adventofcode2017 | ce29e625cbe11fd5f36cff6b36a879c6a3955581 | [
"MIT"
] | null | null | null | advent/day03/day03_test.py | benjackwhite/adventofcode2017 | ce29e625cbe11fd5f36cff6b36a879c6a3955581 | [
"MIT"
] | null | null | null | advent/day03/day03_test.py | benjackwhite/adventofcode2017 | ce29e625cbe11fd5f36cff6b36a879c6a3955581 | [
"MIT"
] | null | null | null | from day03 import calculate_distance, calculate_next_large_value
target = 325489
def test_calculate_distance():
assert calculate_distance(1) == 0
assert calculate_distance(12) == 3
assert calculate_distance(23) == 2
assert calculate_distance(1024) == 31
assert calculate_distance(target) == 552
... | 28.857143 | 64 | 0.759076 |
beaf0c39c4b5ae53960e92b9908f9547c1abe742 | 4,834 | py | Python | learning/graph2vec/corpus_parser.py | RiS3-Lab/FICS- | 82c8abef52ca943946b7e82a16998cf67f1d2049 | [
"Apache-2.0"
] | 37 | 2020-12-04T09:15:50.000Z | 2022-03-28T13:33:29.000Z | learning/graph2vec/corpus_parser.py | RiS3-Lab/FICS- | 82c8abef52ca943946b7e82a16998cf67f1d2049 | [
"Apache-2.0"
] | 7 | 2020-12-03T08:14:31.000Z | 2021-11-24T14:14:03.000Z | learning/graph2vec/corpus_parser.py | RiS3-Lab/FICS- | 82c8abef52ca943946b7e82a16998cf67f1d2049 | [
"Apache-2.0"
] | 19 | 2020-12-04T08:43:31.000Z | 2022-03-28T13:33:27.000Z | import numpy as np
import logging
from collections import Counter
from random import shuffle
import numpy as np
from utils import get_files
class Corpus(object):
def __init__(self, fnames=None, extn='WL2', max_files=0):
assert fnames != None, "please specify the corpus folder"
self.fnames = fnam... | 43.54955 | 137 | 0.672735 |
d6ba9d41d36cd22f3fbe7696457900a00bbeaaab | 1,198 | py | Python | app/core/events.py | tuilagio/project1_be | 8b3760a9d4255d71b91f9a8013ac7d8117513191 | [
"MIT"
] | null | null | null | app/core/events.py | tuilagio/project1_be | 8b3760a9d4255d71b91f9a8013ac7d8117513191 | [
"MIT"
] | null | null | null | app/core/events.py | tuilagio/project1_be | 8b3760a9d4255d71b91f9a8013ac7d8117513191 | [
"MIT"
] | null | null | null | from typing import Callable
from fastapi import FastAPI
from loguru import logger
from app.db.events import close_db_connection, connect_to_db
from app.core.config import settings
from O365 import Account, MSGraphProtocol
CLIENT_ID = '3a9eef7d-ab34-45f1-a9fd-3780564d7a2e'
SECRET_ID = '<your secret id>'
SECRET_VALUE... | 27.227273 | 71 | 0.714524 |
8518aba8fba41aef96c552965bf816e732bc183d | 3,790 | py | Python | MIT/ps4.py | mrouhi13/my-mit-python-practice | f3b29418576fec54d3f9f55155aa8f2096ad974a | [
"MIT"
] | null | null | null | MIT/ps4.py | mrouhi13/my-mit-python-practice | f3b29418576fec54d3f9f55155aa8f2096ad974a | [
"MIT"
] | null | null | null | MIT/ps4.py | mrouhi13/my-mit-python-practice | f3b29418576fec54d3f9f55155aa8f2096ad974a | [
"MIT"
] | null | null | null | # Problem Set 4
# Name:
# Collaborators:
# Time:
#
# Problem 1
#
def nestEggFixed(salary, save, growthRate, years):
"""
- salary: the amount of money you make each year.
- save: the percent of your salary to save in the investment account each
year (an integer between 0 and 100).
- growthRate... | 31.583333 | 79 | 0.658311 |
d041291a6ee314b9154fa84097aaca98d711a1c6 | 5,301 | py | Python | raspberrypi/files/home/pi/watchdog.py | groovenauts/SmartShoppingNavigator | 510dcea622d81fa40cafee3b30e5975be7712f54 | [
"MIT"
] | 31 | 2018-05-10T01:51:46.000Z | 2021-09-02T16:02:03.000Z | raspberrypi/files/home/pi/watchdog.py | groovenauts/SmartShoppingNavigator | 510dcea622d81fa40cafee3b30e5975be7712f54 | [
"MIT"
] | 18 | 2018-05-02T11:35:36.000Z | 2019-11-27T13:44:14.000Z | raspberrypi/files/home/pi/watchdog.py | groovenauts/SmartShoppingNavigator | 510dcea622d81fa40cafee3b30e5975be7712f54 | [
"MIT"
] | 14 | 2018-05-11T04:40:58.000Z | 2020-09-11T16:17:08.000Z | import sys
import time
import base64
import json
import datetime
import jwt
import requests
import picamera
def create_jwt(project_id, private_key_file, algorithm):
"""Creates a JWT (https://jwt.io) to establish an MQTT connection.
Args:
project_id: The cloud project ID this device belongs to
... | 38.413043 | 162 | 0.627806 |
11ec09bdbe6446924ac6ee3d0175f876e635821e | 1,266 | py | Python | tests/test_calc_batch_size.py | enpaul/peewee-plus | 8076d8cd292e3d7b0f8d0b79abdfa4e623b3bb45 | [
"MIT"
] | 1 | 2021-11-29T22:11:42.000Z | 2021-11-29T22:11:42.000Z | tests/test_calc_batch_size.py | enpaul/peewee-plus | 8076d8cd292e3d7b0f8d0b79abdfa4e623b3bb45 | [
"MIT"
] | null | null | null | tests/test_calc_batch_size.py | enpaul/peewee-plus | 8076d8cd292e3d7b0f8d0b79abdfa4e623b3bb45 | [
"MIT"
] | null | null | null | # pylint: disable=redefined-outer-name
# pylint: disable=missing-class-docstring
# pylint: disable=too-few-public-methods
# pylint: disable=unused-import
import peewee
import peewee_plus
from .fixtures import fakedb
def test_sqlite(fakedb):
"""Test the calculation of batch sizes on SQLite"""
class TestModel... | 27.521739 | 92 | 0.687204 |
feb99509e9f05999fa11b14a6dd79d8f5213e3f2 | 3,415 | py | Python | ritpytrading/orders.py | tjsavage/ritpytrading | ead3ec11951b24b74cd8031c490e5c1c19718e4d | [
"Apache-2.0"
] | null | null | null | ritpytrading/orders.py | tjsavage/ritpytrading | ead3ec11951b24b74cd8031c490e5c1c19718e4d | [
"Apache-2.0"
] | null | null | null | ritpytrading/orders.py | tjsavage/ritpytrading | ead3ec11951b24b74cd8031c490e5c1c19718e4d | [
"Apache-2.0"
] | null | null | null | '''
order return object attributes
param possible order attributes: JSON formatted
i.e. get_order_response( ses, url_end, param="order_id" )
{
"order_id": 1221,
"period": 1,
"tick": 10,
"trader_id": "trader49",
"ticker": "CRZY",
"type": "LIMIT",
"quantity": 100,
"action": "BUY",
"pri... | 34.15 | 82 | 0.648023 |
41dcf5700603ddc8f82c4fc9b14d035b982084b4 | 10,736 | py | Python | baselines/her/experiment/config.py | flowersteam/curious | 05f0ce053c3614688c256ec34b08060808e62d81 | [
"MIT"
] | 27 | 2019-05-30T16:45:34.000Z | 2022-03-31T06:22:07.000Z | baselines/her/experiment/config.py | flowersteam/curious | 05f0ce053c3614688c256ec34b08060808e62d81 | [
"MIT"
] | 1 | 2019-06-18T18:57:10.000Z | 2019-08-16T00:17:50.000Z | baselines/her/experiment/config.py | flowersteam/curious | 05f0ce053c3614688c256ec34b08060808e62d81 | [
"MIT"
] | 5 | 2019-08-11T23:29:53.000Z | 2021-02-24T14:11:58.000Z | import numpy as np
import gym
import gym_flowers
from baselines import logger
from baselines.her.ddpg import DDPG
from baselines.her.her import make_sample_her_transitions, make_sample_multi_task_her_transitions
from baselines.her.util import import_function
from baselines.her.replay_buffer import ReplayBuffer
DEFA... | 38.898551 | 126 | 0.655086 |
dd4062f2c72b3e52da3618078d5d55541688c8aa | 1,487 | py | Python | observations/r/macro.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | observations/r/macro.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | observations/r/macro.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def macro(path):
"""Macroeconomic Data
Selected macroeconomic indicato... | 28.056604 | 74 | 0.68729 |
3f1ee6ecc7b1530c7dbd481e290eddc7cec81af8 | 158,987 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_syslog_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_syslog_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_syslog_cfg.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | 50.424041 | 266 | 0.52498 |
2599b659a00a03060626c3dacf71789a4baa1878 | 2,072 | py | Python | fixture/group.py | rgurevych/ironpython_training | e6752699874cbcfb5db7962682b07c7a76bfcfc8 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | rgurevych/ironpython_training | e6752699874cbcfb5db7962682b07c7a76bfcfc8 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | rgurevych/ironpython_training | e6752699874cbcfb5db7962682b07c7a76bfcfc8 | [
"Apache-2.0"
] | null | null | null | import clr
import sys
import os.path
import time
project_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(project_dir, "TestStack.White.0.13.3\\lib\\net40\\"))
sys.path.append(os.path.join(project_dir, "Castle.Core.3.3.0\\lib\\net40-client\\"))
clr.AddReferenceByName("TestStack.White")
clr.... | 40.627451 | 110 | 0.785714 |
1906625496881413ffa4ac665c543099cab6fee8 | 23,258 | py | Python | catkin_tools/jobs/catkin.py | ruvu/catkin_tools | cbd9ffc497a1880026c88ce3b24d390f238d8835 | [
"Apache-2.0"
] | null | null | null | catkin_tools/jobs/catkin.py | ruvu/catkin_tools | cbd9ffc497a1880026c88ce3b24d390f238d8835 | [
"Apache-2.0"
] | null | null | null | catkin_tools/jobs/catkin.py | ruvu/catkin_tools | cbd9ffc497a1880026c88ce3b24d390f238d8835 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 35.671779 | 116 | 0.640038 |
8338449aaa0a3ef843f18411081b6bb836b92542 | 31,164 | py | Python | Lib/asyncio/proactor_events.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2017-12-11T08:20:15.000Z | 2022-03-08T09:35:04.000Z | Lib/asyncio/proactor_events.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2020-03-13T22:24:05.000Z | 2020-03-19T15:08:18.000Z | Lib/asyncio/proactor_events.py | chexca/cpython | cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa | [
"CNRI-Python-GPL-Compatible"
] | 5 | 2018-12-29T15:43:57.000Z | 2020-12-14T15:29:43.000Z | """Event loop using a proactor and related classes.
A proactor is a "notify-on-completion" multiplexer. Currently a
proactor is only implemented on Windows with IOCP.
"""
__all__ = 'BaseProactorEventLoop',
import io
import os
import socket
import warnings
import signal
import threading
import collections
from . im... | 36.577465 | 87 | 0.569054 |
0088e39753c85f3a93566693289c33cd78e72505 | 944 | py | Python | app.py | pltzr/devops-bosch-app | 5940ef317c7c9e6d05a37eafa429d0f32d6d1f52 | [
"MIT"
] | null | null | null | app.py | pltzr/devops-bosch-app | 5940ef317c7c9e6d05a37eafa429d0f32d6d1f52 | [
"MIT"
] | null | null | null | app.py | pltzr/devops-bosch-app | 5940ef317c7c9e6d05a37eafa429d0f32d6d1f52 | [
"MIT"
] | null | null | null | import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
import os
app = Flask(__name__)
# Here we are fetching the name of the model from an environment variable. In production,
# the model is stored in a Blob storage which is "mounted" to the App Service instance.
model_name = os.... | 29.5 | 93 | 0.715042 |
4e429877fdf24eb54a9520d835536c47bd5ce3eb | 5,940 | py | Python | test/torchaudio_unittest/backend/sox_io/torchscript_test.py | majabojarska/audio | 765fde0873ee52be9c1db1fdc7fddedb721f4d0c | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/backend/sox_io/torchscript_test.py | majabojarska/audio | 765fde0873ee52be9c1db1fdc7fddedb721f4d0c | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/backend/sox_io/torchscript_test.py | majabojarska/audio | 765fde0873ee52be9c1db1fdc7fddedb721f4d0c | [
"BSD-2-Clause"
] | null | null | null | import itertools
from typing import Optional
import torch
import torchaudio
from parameterized import parameterized
from torchaudio_unittest.common_utils import (
TempDirMixin,
TorchaudioTestCase,
skipIfNoExec,
skipIfNoExtension,
get_wav_data,
save_wav,
load_wav,
sox_utils,
)
from .com... | 38.076923 | 107 | 0.691077 |
b0efbbcdd16f6901beded3da95826e5e70307dad | 6,971 | py | Python | tests/test_bbclib_assets_v2.py | ks91/py-bbclib | 67bf402445cb44f99cdbd3a1efde8ec0515815d9 | [
"Apache-2.0"
] | null | null | null | tests/test_bbclib_assets_v2.py | ks91/py-bbclib | 67bf402445cb44f99cdbd3a1efde8ec0515815d9 | [
"Apache-2.0"
] | 8 | 2019-07-10T00:58:53.000Z | 2021-08-25T04:57:06.000Z | tests/test_bbclib_assets_v2.py | ks91/py-bbclib | 67bf402445cb44f99cdbd3a1efde8ec0515815d9 | [
"Apache-2.0"
] | 3 | 2019-07-09T14:45:51.000Z | 2021-08-04T09:58:27.000Z | # -*- coding: utf-8 -*-
import binascii
import sys
sys.path.extend(["../"])
import bbclib
from bbclib import BBcTransaction, BBcRelation, KeyPair, BBcAssetRaw, BBcAssetHash, configure_id_length_all
ID_LEN = 32
configure_id_length_all(ID_LEN)
user_id = bbclib.get_new_id("user_id_test1")[:ID_LEN]
user_id2 = bbclib.get_... | 44.401274 | 132 | 0.702482 |
e3837a8033216d187e554f5a9f8e501979350467 | 9,075 | py | Python | 2_deep_codes/3_Siamese_triplet/Evaluate_embedding_space.py | bghojogh/Quantile-Quantile-Embedding | 5daff878a838f6dbeb04cc0b15da2ad66ab9796c | [
"MIT"
] | 1 | 2020-09-19T17:50:50.000Z | 2020-09-19T17:50:50.000Z | 2_deep_codes/3_Siamese_triplet/Evaluate_embedding_space.py | bghojogh/Quantile-Quantile-Embedding | 5daff878a838f6dbeb04cc0b15da2ad66ab9796c | [
"MIT"
] | null | null | null | 2_deep_codes/3_Siamese_triplet/Evaluate_embedding_space.py | bghojogh/Quantile-Quantile-Embedding | 5daff878a838f6dbeb04cc0b15da2ad66ab9796c | [
"MIT"
] | null | null | null |
import tensorflow as tf
import os
import numpy as np
import umap
import matplotlib.pyplot as plt
import dataset_characteristics
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
import pickle
import itertools
class Evaluate_emb... | 49.054054 | 162 | 0.654545 |
0c7a65cfca9772a60e5af9785e5e4f9d1c361645 | 26,654 | py | Python | gluon/cache.py | btreecat/web2py | 7ec50c25b2eced11af8bd2d17f7fce41cd7d8a10 | [
"BSD-3-Clause"
] | null | null | null | gluon/cache.py | btreecat/web2py | 7ec50c25b2eced11af8bd2d17f7fce41cd7d8a10 | [
"BSD-3-Clause"
] | null | null | null | gluon/cache.py | btreecat/web2py | 7ec50c25b2eced11af8bd2d17f7fce41cd7d8a10 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Basic caching classes and methods
---------------------------------
- Cache - The generic caching ob... | 34.979003 | 139 | 0.569258 |
40009c0ce7cb5ebcbc9a0d3585c2a87f11a471af | 1,134 | py | Python | RecoTauTag/HLTProducers/python/TauRegionalPixelSeedGenerator_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoTauTag/HLTProducers/python/TauRegionalPixelSeedGenerator_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoTauTag/HLTProducers/python/TauRegionalPixelSeedGenerator_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
tauRegionalPixelSeedGenerator = cms.EDProducer("SeedGeneratorFromRegionHitsEDProducer",
OrderedHitsFactoryPSet = cms.PSet(
ComponentName = cms.string('StandardHitPairGenerator'),
SeedingLayers = cms.InputTag('PixelLayerPairs')
),
SeedComparitorPSet =... | 36.580645 | 87 | 0.636684 |
25ce218b60778f89f1a8ca8993737ceddebc15b8 | 19,658 | py | Python | v7/sphinx_roles/sphinx_roles.py | pluser/nikola_plugins | 2a95cc21d996e856b24c151d577939de41a65e6c | [
"MIT"
] | null | null | null | v7/sphinx_roles/sphinx_roles.py | pluser/nikola_plugins | 2a95cc21d996e856b24c151d577939de41a65e6c | [
"MIT"
] | null | null | null | v7/sphinx_roles/sphinx_roles.py | pluser/nikola_plugins | 2a95cc21d996e856b24c151d577939de41a65e6c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# 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 t... | 36.403704 | 136 | 0.623766 |
7eb7abe4f157c7098877b75a9d3d720d3ac9d90b | 2,578 | py | Python | skl2onnx/algebra/type_helper.py | ogrisel/sklearn-onnx | 0afbe295aa3f1abbcea60f582faac31d16bd3ab0 | [
"Apache-2.0"
] | 1 | 2021-06-11T22:08:57.000Z | 2021-06-11T22:08:57.000Z | skl2onnx/algebra/type_helper.py | ogrisel/sklearn-onnx | 0afbe295aa3f1abbcea60f582faac31d16bd3ab0 | [
"Apache-2.0"
] | null | null | null | skl2onnx/algebra/type_helper.py | ogrisel/sklearn-onnx | 0afbe295aa3f1abbcea60f582faac31d16bd3ab0 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
import numpy as np
from scipy.sparse import coo_matrix
from ..proto import TensorProto, ValueInfoProto
from ..common._topology import Variable
from ..common.data_types import (
_guess_numpy_type,
_guess_type_proto,
BooleanTensorType,
DataType,
DoubleType,
D... | 33.051282 | 69 | 0.650504 |
f3d0e56e8261686883d1f93f3814ac41caeb08e8 | 6,725 | py | Python | gpgLabs/EM/FEM3loop.py | AlainPlattner/gpgLabs | 2423f0f2a845a5e44304da5e683881c65a9e4792 | [
"MIT"
] | null | null | null | gpgLabs/EM/FEM3loop.py | AlainPlattner/gpgLabs | 2423f0f2a845a5e44304da5e683881c65a9e4792 | [
"MIT"
] | null | null | null | gpgLabs/EM/FEM3loop.py | AlainPlattner/gpgLabs | 2423f0f2a845a5e44304da5e683881c65a9e4792 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import scipy.io
import warnings
warnings.filterwarnings('ignore')
from ipywidgets import interactive, IntSlider, widget, FloatText, FloatSlider, Checkbox
def mind(x,y,z,dincl,ddecl,x0,y0,z0,aincl,adecl):
x = np.array(x, dtype=float)
y = np.array(y, dtype=f... | 28.862661 | 139 | 0.581115 |
832d92d854d28c97d98d7e79994fbd6c92939c90 | 814 | py | Python | yatube/yatube/urls.py | annrud/post_publishing_platform | c065799203c0800ce05d038f3491fb6184b5cbc7 | [
"MIT"
] | 1 | 2021-11-09T09:40:37.000Z | 2021-11-09T09:40:37.000Z | yatube/yatube/urls.py | annrud/post_publishing_platform | c065799203c0800ce05d038f3491fb6184b5cbc7 | [
"MIT"
] | null | null | null | yatube/yatube/urls.py | annrud/post_publishing_platform | c065799203c0800ce05d038f3491fb6184b5cbc7 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
handler404 = 'posts.views.page_not_found'
handler500 = 'posts.views.server_error'
urlpatterns = [
path('auth/', include('users.urls')),
path('auth/', include('djan... | 33.916667 | 69 | 0.681818 |
a580ff97f41ceaf8a427f21c1385fd26dfa4d308 | 8,987 | py | Python | chiplotter.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 2 | 2018-10-08T04:59:38.000Z | 2021-01-19T08:10:04.000Z | chiplotter.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 1 | 2021-07-20T16:42:43.000Z | 2021-07-20T16:42:43.000Z | chiplotter.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 1 | 2018-07-31T14:36:24.000Z | 2018-07-31T14:36:24.000Z | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter, MaxNLocator
'''
This handy program turns your ELC output file party into something more useful.
--> Makes a plot of chi^2 vs. fit parameters from a markovELC / geneticELC run
(... | 46.807292 | 126 | 0.687326 |
7b659ab8e3e537a7500d660ae695fbff9d7922af | 1,362 | py | Python | interpolate_map_traffic.py | frongk/sa-air | 4def5f7734a73e6be03ad842e9eb15275c063ab1 | [
"MIT"
] | null | null | null | interpolate_map_traffic.py | frongk/sa-air | 4def5f7734a73e6be03ad842e9eb15275c063ab1 | [
"MIT"
] | null | null | null | interpolate_map_traffic.py | frongk/sa-air | 4def5f7734a73e6be03ad842e9eb15275c063ab1 | [
"MIT"
] | null | null | null | import pandas
import pickle
from tqdm import tqdm
INTERPOLATION_MAPPING_FILE = 'mapping_coordinates/traffic_map_sa_100.pkl'
DATA_FILE = 'data/traffic/traffic_data.csv'
GRID_FILE = 'data/interpolation_grid_100.csv'
GRID_INDEX = ['Index']
DATA_FIELDS = ['Volume', 'Occupancy', 'Speed']
DATA_INDEX = ['AssetNum']
# time... | 29.608696 | 99 | 0.76138 |
c9ca343323239ef3b9dedcd8e17cb5ca6e578d0a | 7,388 | py | Python | core/core50_inc_finetuning.py | akashgokul/core50 | 4afc491db32c3c58e515e5f6d2bd0425b76aedb9 | [
"CC-BY-4.0"
] | 103 | 2017-05-11T03:54:58.000Z | 2022-03-14T03:14:32.000Z | core/core50_inc_finetuning.py | akashgokul/core50 | 4afc491db32c3c58e515e5f6d2bd0425b76aedb9 | [
"CC-BY-4.0"
] | 5 | 2018-11-19T09:59:38.000Z | 2022-03-15T11:19:38.000Z | core/core50_inc_finetuning.py | akashgokul/core50 | 4afc491db32c3c58e515e5f6d2bd0425b76aedb9 | [
"CC-BY-4.0"
] | 27 | 2017-08-14T13:16:37.000Z | 2022-02-23T13:34:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2017. Vincenzo Lomonaco. All rights reserved. #
# See the accompanying LICENSE file for terms. #
# ... | 35.349282 | 80 | 0.563617 |
927a3943588dcafd0b1cc437b548c33a92bf9376 | 2,598 | py | Python | examples/texture/receiver.py | jlai/Python-SpoutGL | 01003424b9e6d6a07b346698aae1508853409a45 | [
"BSD-3-Clause"
] | 5 | 2021-12-30T15:03:52.000Z | 2022-03-08T14:34:39.000Z | examples/texture/receiver.py | jlai/Python-SpoutGL | 01003424b9e6d6a07b346698aae1508853409a45 | [
"BSD-3-Clause"
] | 1 | 2021-12-08T01:41:17.000Z | 2021-12-08T01:41:17.000Z | examples/texture/receiver.py | jlai/Python-SpoutGL | 01003424b9e6d6a07b346698aae1508853409a45 | [
"BSD-3-Clause"
] | 1 | 2021-11-24T23:12:49.000Z | 2021-11-24T23:12:49.000Z | import SpoutGL
import pygame
from OpenGL.GL import *
DISPLAY_WIDTH = 800
DISPLAY_HEIGHT = 600
SENDER_NAME = "SpoutGL-texture-test"
def setProjection(width, height):
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, width, height, 0, 1, -1)
glMatrixMode(GL_MODELVIEW)
def drawSquare(width, hei... | 26.783505 | 75 | 0.680523 |
4a48ad23cddfa21b6765717dad6ea9da9a7a1a3b | 1,790 | py | Python | contrib/stack/topsStack/plotBursts_reference_secondaries.py | vincentschut/isce2 | 1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c | [
"ECL-2.0",
"Apache-2.0"
] | 1,133 | 2022-01-07T21:24:57.000Z | 2022-01-07T21:33:08.000Z | contrib/stack/topsStack/plotBursts_reference_secondaries.py | vincentschut/isce2 | 1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c | [
"ECL-2.0",
"Apache-2.0"
] | 276 | 2019-02-10T07:18:28.000Z | 2022-03-31T21:45:55.000Z | contrib/stack/topsStack/plotBursts_reference_secondaries.py | vincentschut/isce2 | 1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c | [
"ECL-2.0",
"Apache-2.0"
] | 235 | 2019-02-10T05:00:53.000Z | 2022-03-18T07:37:24.000Z | #!/usr/bin/env python3
#
# Author: David Bekaert
# Copyright 2018
import os
import glob
import sys
import argparse
def createParser():
'''
Create command line parser.
'''
parser = argparse.ArgumentParser(description='Generate all kml files for the reference and secondary slc')
parser.add_arg... | 25.942029 | 110 | 0.604469 |
e72b712207a337cf52cc892447d203e2e642176f | 16,011 | py | Python | log_casp_act/model_176.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_act/model_176.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_act/model_176.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C... | 84.268421 | 614 | 0.812254 |
5952f0e24032f8847a088d92547663f4bee710ad | 9,087 | py | Python | python/hsfs/core/feature_group_api.py | robzor92/feature-store-api | d1a7c52d9996e2b0d0d42fbee1d687575796d339 | [
"Apache-2.0"
] | null | null | null | python/hsfs/core/feature_group_api.py | robzor92/feature-store-api | d1a7c52d9996e2b0d0d42fbee1d687575796d339 | [
"Apache-2.0"
] | null | null | null | python/hsfs/core/feature_group_api.py | robzor92/feature-store-api | d1a7c52d9996e2b0d0d42fbee1d687575796d339 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2020 Logical Clocks AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.290566 | 116 | 0.608121 |
1c783afe42f30f97bfc5d152af4ac63f2c86b6a4 | 3,601 | py | Python | dataset.py | UMBCvision/Contextual-Adversarial-Patches | 602fd267c2562f45ba65d10edb856a1144b8ca5f | [
"MIT"
] | 33 | 2020-04-22T18:35:54.000Z | 2022-02-09T06:41:02.000Z | dataset.py | UMBCvision/Contextual-Adversarial-Patches | 602fd267c2562f45ba65d10edb856a1144b8ca5f | [
"MIT"
] | 3 | 2020-06-22T11:58:33.000Z | 2021-09-07T00:44:57.000Z | dataset.py | UMBCvision/Contextual-Adversarial-Patches | 602fd267c2562f45ba65d10edb856a1144b8ca5f | [
"MIT"
] | 6 | 2020-07-07T07:22:42.000Z | 2022-02-09T06:41:04.000Z | #!/usr/bin/python
# encoding: utf-8
import os
import random
import torch
import numpy as np
from torch.utils.data import Dataset
from PIL import Image
from utils import read_truths_args, read_truths
from image import *
import pdb
# WARNING: for physical world attack
class listDataset(Dataset):
def __init__(sel... | 33.971698 | 164 | 0.549292 |
1d28c04aec93ee44b93a4796be781d894b46bf4c | 1,172 | bzl | Python | maistra/vendor/proxy_wasm_cpp_host/bazel/variables.bzl | knm3000/proxy | f2bb57b7294aea2cb344824785be42849d7d63c9 | [
"Apache-2.0"
] | 3 | 2020-11-30T15:35:37.000Z | 2022-01-06T14:17:18.000Z | maistra/vendor/proxy_wasm_cpp_host/bazel/variables.bzl | knm3000/proxy | f2bb57b7294aea2cb344824785be42849d7d63c9 | [
"Apache-2.0"
] | 54 | 2020-06-23T17:34:04.000Z | 2022-03-31T02:04:06.000Z | maistra/vendor/proxy_wasm_cpp_host/bazel/variables.bzl | knm3000/proxy | f2bb57b7294aea2cb344824785be42849d7d63c9 | [
"Apache-2.0"
] | 12 | 2020-07-14T23:59:57.000Z | 2022-03-22T09:59:18.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 27.255814 | 74 | 0.620307 |
ec15f73268120324bc423abf76d765a3c3918ba9 | 9,024 | py | Python | taxdata/cps/finalprep.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 12 | 2019-02-07T14:06:28.000Z | 2021-12-04T19:19:50.000Z | taxdata/cps/finalprep.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 230 | 2015-10-20T18:38:10.000Z | 2018-12-05T16:04:04.000Z | taxdata/cps/finalprep.py | jdebacker/taxdata | c32d401a10a6c8f6e889d87c6cc72fd4338017b2 | [
"CC0-1.0"
] | 19 | 2015-12-21T18:25:11.000Z | 2018-11-10T16:53:38.000Z | """
Clean up the CPS file and make it ready for Tax-Calculator
"""
import numpy as np
import pandas as pd
import copy
from pathlib import Path
from .helpers import CUR_PATH
from .constants import USEABLE_VARS
ADJ_TARGETS = pd.read_csv(Path(CUR_PATH, "adjustment_targets.csv"))
def drop_vars(data):
"""
Return... | 31.333333 | 80 | 0.587101 |
9065f6b06aea01e08b03cc155662b760da206344 | 2,559 | py | Python | riscv-none-gcc/8.2.0-2.2-20190521-0004/riscv-none-embed/lib/rv32imaf/ilp32f/libstdc++.a-gdb.py | balanceTWK/GD32VF103C-START | 606bf274c3d30e4f498982eaa21947e067875792 | [
"Apache-2.0"
] | 5 | 2019-10-21T09:05:38.000Z | 2022-02-01T04:23:29.000Z | riscv-none-gcc/8.2.0-2.2-20190521-0004/riscv-none-embed/lib/rv32imaf/ilp32f/libstdc++.a-gdb.py | balanceTWK/GD32VF103C-START | 606bf274c3d30e4f498982eaa21947e067875792 | [
"Apache-2.0"
] | null | null | null | riscv-none-gcc/8.2.0-2.2-20190521-0004/riscv-none-embed/lib/rv32imaf/ilp32f/libstdc++.a-gdb.py | balanceTWK/GD32VF103C-START | 606bf274c3d30e4f498982eaa21947e067875792 | [
"Apache-2.0"
] | 3 | 2019-10-22T09:45:34.000Z | 2020-05-09T12:56:30.000Z | # -*- python -*-
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | 41.274194 | 125 | 0.724893 |
a13cccb2aa154e290b4c42909cb47e441dcd2625 | 18,099 | py | Python | classes.py | PlanTL-SANIDAD/MEDDOCAN-Evaluation-Script | 843152c475e7118171028badd16f6342c5560e0f | [
"MIT"
] | null | null | null | classes.py | PlanTL-SANIDAD/MEDDOCAN-Evaluation-Script | 843152c475e7118171028badd16f6342c5560e0f | [
"MIT"
] | null | null | null | classes.py | PlanTL-SANIDAD/MEDDOCAN-Evaluation-Script | 843152c475e7118171028badd16f6342c5560e0f | [
"MIT"
] | null | null | null | import os
from tags import PHITag
from xml.etree import ElementTree
class Annotation(object):
def __init__(self, file_name=None, root="root"):
self.doc_id = ''
self.sys_id = ''
self.text = None
self.num_sentences = None
self.root = root
self.sensitive_spans = []
... | 31.259067 | 107 | 0.513012 |
744bf599b43629f30763f92f76315f4c19e53451 | 464 | py | Python | inheritance/exercise/project_need_for_speed/test.py | ivan-yosifov88/python_oop | 82b210e427cb80dbab3b9a5c3fceab431ee60164 | [
"MIT"
] | 1 | 2021-05-21T20:28:55.000Z | 2021-05-21T20:28:55.000Z | inheritance/exercise/project_need_for_speed/test.py | ivan-yosifov88/python_oop | 82b210e427cb80dbab3b9a5c3fceab431ee60164 | [
"MIT"
] | null | null | null | inheritance/exercise/project_need_for_speed/test.py | ivan-yosifov88/python_oop | 82b210e427cb80dbab3b9a5c3fceab431ee60164 | [
"MIT"
] | null | null | null | from project_need_for_speed.family_car import FamilyCar
from project_need_for_speed.vehicle import Vehicle
vehicle = Vehicle(50, 150)
print(Vehicle.DEFAULT_FUEL_CONSUMPTION)
print(vehicle.fuel)
print(vehicle.horse_power)
print(vehicle.fuel_consumption)
vehicle.drive(100)
print(vehicle.fuel)
family_car = FamilyCar(150,... | 27.294118 | 55 | 0.838362 |
abb3d1683099db0eee0147fc2d972069068fdf02 | 1,062 | py | Python | scrapcore/validator_config.py | lantip/SerpScrap | b7de07b8ca826bcd941ef89455147c79ed1764bd | [
"MIT"
] | 199 | 2017-04-02T00:43:26.000Z | 2022-03-21T09:10:08.000Z | scrapcore/validator_config.py | lantip/SerpScrap | b7de07b8ca826bcd941ef89455147c79ed1764bd | [
"MIT"
] | 49 | 2017-04-11T15:03:14.000Z | 2022-03-08T18:41:21.000Z | scrapcore/validator_config.py | lantip/SerpScrap | b7de07b8ca826bcd941ef89455147c79ed1764bd | [
"MIT"
] | 65 | 2017-05-21T04:03:31.000Z | 2022-03-23T09:11:41.000Z | # -*- coding: utf-8 -*-
from scrapcore.tools import ConfigurationError as Error
class ValidatorConfig():
def validate(self, config):
if not isinstance(config, dict):
raise Error('config is not a dict')
if config.get('num_results_per_page') > 100:
raise Error('num_results... | 37.928571 | 87 | 0.627119 |
3b1e23159f009a4648f2a992ec9bf4208e78909e | 69 | py | Python | binrelay/__init__.py | nathanjackson/binrelay | 20420e58e7188723916e7b69cdfad8642dd36134 | [
"MIT"
] | 4 | 2019-09-06T11:55:10.000Z | 2021-09-03T11:37:22.000Z | binrelay/__init__.py | nathanjackson/binrelay | 20420e58e7188723916e7b69cdfad8642dd36134 | [
"MIT"
] | null | null | null | binrelay/__init__.py | nathanjackson/binrelay | 20420e58e7188723916e7b69cdfad8642dd36134 | [
"MIT"
] | null | null | null | from .tep import *
from .utils import *
from .race_analysis import *
| 17.25 | 28 | 0.73913 |
91576b2be5d991a435d2f84c1d8b92a4a6657a81 | 1,342 | py | Python | clustering.py | guipaiva/K-means | 90f1fe2896e945b173fc7788b7cf4c47feb58a99 | [
"MIT"
] | null | null | null | clustering.py | guipaiva/K-means | 90f1fe2896e945b173fc7788b7cf4c47feb58a99 | [
"MIT"
] | null | null | null | clustering.py | guipaiva/K-means | 90f1fe2896e945b173fc7788b7cf4c47feb58a99 | [
"MIT"
] | null | null | null | import numpy as np
from numpy import linalg as la
from read import *
#Calcula a norma (distancia euclidiana) entre dois arrays
#axis = 1 significa que será utilizado o eixo horizontal para cálculo, considerando elementos de mesma linha
def distance(a,b, ax = 1):
return la.norm((a-b),axis = ax)
#inicia a lista de dis... | 28.553191 | 108 | 0.742921 |
8b3e6cd9aa8cd6344238677acefe6d82a047b07c | 3,418 | py | Python | app/app/settings.py | nagasaichandra/recipe-app-api | 67ac05687b9ac2b6726d02b6f615566712f2c75a | [
"MIT"
] | null | null | null | app/app/settings.py | nagasaichandra/recipe-app-api | 67ac05687b9ac2b6726d02b6f615566712f2c75a | [
"MIT"
] | null | null | null | app/app/settings.py | nagasaichandra/recipe-app-api | 67ac05687b9ac2b6726d02b6f615566712f2c75a | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib imp... | 25.893939 | 91 | 0.694851 |
a77b204691c378e4ffe2fdd08bd1529782d6a1cf | 19,696 | py | Python | exps/NAS-Bench-201/statistics.py | EM-AutoML/AutoDL-Projects | 8ff416fe5d6cb1b310b885fe376e6f2790fbda14 | [
"MIT"
] | null | null | null | exps/NAS-Bench-201/statistics.py | EM-AutoML/AutoDL-Projects | 8ff416fe5d6cb1b310b885fe376e6f2790fbda14 | [
"MIT"
] | null | null | null | exps/NAS-Bench-201/statistics.py | EM-AutoML/AutoDL-Projects | 8ff416fe5d6cb1b310b885fe376e6f2790fbda14 | [
"MIT"
] | null | null | null | #####################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019.08 #
#####################################################
import os, sys, time, argparse, collections
from copy import deepcopy
import torch
import torch.nn as nn
from pathlib import Path
from collections import defa... | 66.540541 | 232 | 0.701615 |
32b39b0725e1e0e115d097c18b63af2b780c0ccd | 333 | py | Python | project/asylum/management/commands/generate_all.py | jssmk/asylum | 004b05939784b86ba559968a7cdcedf248edb01f | [
"MIT"
] | 1 | 2017-04-08T21:31:37.000Z | 2017-04-08T21:31:37.000Z | project/asylum/management/commands/generate_all.py | jssmk/asylum | 004b05939784b86ba559968a7cdcedf248edb01f | [
"MIT"
] | 9 | 2016-01-23T22:40:26.000Z | 2021-09-13T17:44:11.000Z | project/asylum/management/commands/generate_all.py | jssmk/asylum | 004b05939784b86ba559968a7cdcedf248edb01f | [
"MIT"
] | 1 | 2017-04-08T22:13:42.000Z | 2017-04-08T22:13:42.000Z | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from asylum.tests.fixtures.full import generate_all
class Command(BaseCommand):
help = 'Generates full set of test data'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
ge... | 22.2 | 65 | 0.693694 |
744cc94c179c6ab0a795865193e59b39ae081e7c | 8,493 | py | Python | backbone/GhostNet.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | backbone/GhostNet.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | backbone/GhostNet.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Jun Wang
@date: 20210121
@contact: jun21wangustc@gmail.com
"""
# based on:
# https://github.com/huawei-noah/ghostnet/blob/master/ghostnet_pytorch/ghostnet.py
# 2020.06.09-Changed for building GhostNet
# Huawei Technologies Co., Ltd. <foss@huawei.com>
"""
Creates a GhostNet Model as defined in... | 34.108434 | 115 | 0.568115 |
9d68783df9be16528f599c9aac1a828e21508baf | 1,049 | py | Python | setup.py | sfreund-DLR/fatpack | aa0d0570d69bf7f8cc5cb70b53a3fdb2357ed82a | [
"ISC"
] | 67 | 2019-03-19T11:17:36.000Z | 2022-03-11T22:20:42.000Z | setup.py | sfreund-DLR/fatpack | aa0d0570d69bf7f8cc5cb70b53a3fdb2357ed82a | [
"ISC"
] | 10 | 2019-03-18T09:40:59.000Z | 2022-03-08T20:26:34.000Z | setup.py | sfreund-DLR/fatpack | aa0d0570d69bf7f8cc5cb70b53a3fdb2357ed82a | [
"ISC"
] | 14 | 2019-11-25T16:49:30.000Z | 2022-02-18T21:21:04.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
# Parse the version from the module.
with open('fatpack/__init__.py') as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')
version = ve... | 29.971429 | 56 | 0.621544 |
16bd552e48ff35ef0a8d23ab555de9c2f92bf78a | 243 | py | Python | examples/mytestcode.py | PeihongKe/PythonExcel | 12a4ed9d8578b090870e488525b31cb9aa0a15e3 | [
"MIT",
"Unlicense"
] | null | null | null | examples/mytestcode.py | PeihongKe/PythonExcel | 12a4ed9d8578b090870e488525b31cb9aa0a15e3 | [
"MIT",
"Unlicense"
] | null | null | null | examples/mytestcode.py | PeihongKe/PythonExcel | 12a4ed9d8578b090870e488525b31cb9aa0a15e3 | [
"MIT",
"Unlicense"
] | null | null | null |
import pyxll
from pyxll import xl_func
@xl_func("int x, int x: int")
def addTwoNumbersByDavidKe(x, y):
"""returns the sum of a range of floats"""
return x + y
@xl_func("int x: int")
def echoByDavidKe(x):
""" """
return x
| 14.294118 | 46 | 0.62963 |
cb2887152787f4349078540eebc6f29bfc97d852 | 2,254 | py | Python | dydx_alerts/event_trigger.py | maxholloway/dydx-alerts | d480edf1c96a6330122eb62b15fb0e5a610d38ba | [
"MIT"
] | 3 | 2022-03-07T04:55:16.000Z | 2022-03-17T18:35:59.000Z | dydx_alerts/event_trigger.py | maxholloway/dydx-alerts | d480edf1c96a6330122eb62b15fb0e5a610d38ba | [
"MIT"
] | null | null | null | dydx_alerts/event_trigger.py | maxholloway/dydx-alerts | d480edf1c96a6330122eb62b15fb0e5a610d38ba | [
"MIT"
] | null | null | null | from typing import Dict
from constants import EventTriggerTypes, COLLATERAL_REQUIREMENTS
def get_message_generator(event_trigger_config):
"""
Given the event trigger config, return the function that can be used to produce a message.
event_trigger_config: a dict object that corresponds to the
`e... | 40.25 | 220 | 0.704969 |
74c45ecc2a6330f38302699fdc4cd93dc881eacb | 870 | py | Python | storm/n_inversoes.py | italo-batista/problems-solving | f83ad34f0abebd52925c4020635556f20743ba06 | [
"MIT"
] | null | null | null | storm/n_inversoes.py | italo-batista/problems-solving | f83ad34f0abebd52925c4020635556f20743ba06 | [
"MIT"
] | null | null | null | storm/n_inversoes.py | italo-batista/problems-solving | f83ad34f0abebd52925c4020635556f20743ba06 | [
"MIT"
] | null | null | null | def count(array):
if len(array) == 1:
return 0
else:
mid = len(array)//2
left = array[:mid]
right = array[mid:]
x = count(left)
y = count(right)
z = count_split(left, right)
return z + x + y
def count_split(left, right):
i = 0
j = 0
... | 17.755102 | 43 | 0.410345 |
08d41463b52c65e4a8559bfaf4b011e9191bb70a | 13,923 | py | Python | client/src/game_instance.py | kshshkim/2021-2-OSSProj-OTS-7 | d46d56c42de1b9e445b084a627d440f158588088 | [
"MIT"
] | 7 | 2021-11-05T07:23:27.000Z | 2022-01-04T04:13:39.000Z | client/src/game_instance.py | kshshkim/2021-2-OSSProj-OTS-7 | d46d56c42de1b9e445b084a627d440f158588088 | [
"MIT"
] | 21 | 2021-10-31T17:30:37.000Z | 2021-11-30T07:39:00.000Z | client/src/game_instance.py | kshshkim/2021-2-OSSProj-OTS-7 | d46d56c42de1b9e445b084a627d440f158588088 | [
"MIT"
] | 2 | 2021-11-02T13:42:30.000Z | 2021-11-08T08:20:54.000Z | import pygame
from collections import deque
from .components.board import Board
import copy
from random import randint, choice
from .components.mino import Mino
from .consts.custom_events import CUSTOM_EVENTS
from .consts import timer_consts as tv
def new_mino():
return Mino(shape_index=randint(0, 6))
def post_... | 33.071259 | 107 | 0.560871 |
d3714f4e219544b312bf28765e01102c51f7cf66 | 869 | py | Python | examples/main.py | rifqidewangga/zephyr-haf | a645a7cc5bf58cb76a0b671fbd6c6388413a9d30 | [
"MIT"
] | null | null | null | examples/main.py | rifqidewangga/zephyr-haf | a645a7cc5bf58cb76a0b671fbd6c6388413a9d30 | [
"MIT"
] | null | null | null | examples/main.py | rifqidewangga/zephyr-haf | a645a7cc5bf58cb76a0b671fbd6c6388413a9d30 | [
"MIT"
] | null | null | null | import sys
from zephyr import Zephyr
import zephyr
def main():
env_temperature: float = zephyr.c_to_kelvin(20.0)
env_pressure: float = 1024.0 # hPa
if len(sys.argv) == 3:
env_pressure = float(sys.argv[1])
env_temperature = zephyr.c_to_kelvin(float(sys.argv[2]))
sensor = None
tr... | 24.138889 | 82 | 0.576525 |
bc5a753e8a76b4593507bcdc98bcd09db6c297e3 | 748 | py | Python | handsonml_setup.py | Jnewgeek/handson-ml | 8fa44a394604d097d03687737bcaef2af001f542 | [
"Apache-2.0"
] | null | null | null | handsonml_setup.py | Jnewgeek/handson-ml | 8fa44a394604d097d03687737bcaef2af001f542 | [
"Apache-2.0"
] | null | null | null | handsonml_setup.py | Jnewgeek/handson-ml | 8fa44a394604d097d03687737bcaef2af001f542 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 8 13:42:25 2019
@author: Administrator
setup.py
"""
from __future__ import division,print_function,unicode_literals
import os
import numpy as np
np.random.seed(42)
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rc("axes",labelsize=14)
mpl.rc("xtick",l... | 20.777778 | 73 | 0.733957 |
13a0474e0fa30147051729c3884f32fc0e315a0c | 9,200 | py | Python | qvi/core/vi.py | amirdib/quantized-variational-inference | 50c6bf3511bdb0bca48573a845580c1f10b8ba8f | [
"MIT"
] | null | null | null | qvi/core/vi.py | amirdib/quantized-variational-inference | 50c6bf3511bdb0bca48573a845580c1f10b8ba8f | [
"MIT"
] | null | null | null | qvi/core/vi.py | amirdib/quantized-variational-inference | 50c6bf3511bdb0bca48573a845580c1f10b8ba8f | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow_probability as tfp
from tensorflow_probability import bijectors as tfb
import tensorflow as tf
from tensorflow_probability.python.vi import csiszar_divergence
tfd = tfp.distributions
from functools import partial
import matplotlib.pyplot as plt
from tensorflow_probability.python.int... | 36.078431 | 123 | 0.624674 |
f9b485989d2d8e8b72c6d86ea28a900fde3640de | 4,369 | py | Python | twitchtest/spiders/rn_twitchchannelinfo_spider.py | chao-shi-git/scrapy_ttools | 13a34e3bdee135c3f5513d94161a36491eb4905b | [
"MIT"
] | null | null | null | twitchtest/spiders/rn_twitchchannelinfo_spider.py | chao-shi-git/scrapy_ttools | 13a34e3bdee135c3f5513d94161a36491eb4905b | [
"MIT"
] | 1 | 2019-03-18T04:27:40.000Z | 2021-05-27T08:05:23.000Z | twitchtest/spiders/rn_twitchchannelinfo_spider.py | chao-shi-git/scrapy_ttools | 13a34e3bdee135c3f5513d94161a36491eb4905b | [
"MIT"
] | null | null | null | import scrapy
import pandas as pd
from twitchtest.items import TwitchChannelInfoItem
# channel subfolder paths have been scraped from the twitchtest_spider, and saved in a csv file
# here we read in the csv file, assemble the full urls, and loop over them
class TwitchChannelInfoUrlsPrep():
def __init__(self):
... | 37.34188 | 114 | 0.677272 |
d0ded2388215cbabe89571edc8eb67c193cf7083 | 10,960 | py | Python | python/qidoc/sphinx_project.py | vbarbaresi/qibuild | eab6b815fe0af49ea5c41ccddcd0dff2363410e1 | [
"BSD-3-Clause"
] | null | null | null | python/qidoc/sphinx_project.py | vbarbaresi/qibuild | eab6b815fe0af49ea5c41ccddcd0dff2363410e1 | [
"BSD-3-Clause"
] | null | null | null | python/qidoc/sphinx_project.py | vbarbaresi/qibuild | eab6b815fe0af49ea5c41ccddcd0dff2363410e1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYING file.
import os
import sys
from qisys import ui
import qisys.archive
import qisys.sh
import qidoc.project
class SphinxProject(qidoc.project.DocProject):
... | 36.533333 | 105 | 0.584307 |
3ff58fe302c8646f3ae170569ef62ff00cd37e20 | 3,094 | py | Python | .history/Missions_to_Mars/scrape_mars_20200809084044.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | .history/Missions_to_Mars/scrape_mars_20200809084044.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | null | null | null | .history/Missions_to_Mars/scrape_mars_20200809084044.py | ermiasgelaye/web-scraping-challenge | f99c3436dfb0169595c46dae7733d90e21385cc6 | [
"ADSL"
] | 2 | 2020-11-02T08:12:16.000Z | 2021-05-17T21:45:42.000Z | from splinter import Browser
from bs4 import BeautifulSoup
import pandas as pd
import time
import re
# This is for debugging
def savetofile(contents):
file = open('_temporary.txt',"w",encoding="utf-8")
file.write(contents)
file.close()
def scrape():
executable_path = {"executable_path": "chromedrive... | 26.672414 | 101 | 0.652877 |
348b8e072509ce02e44953f7acf24e7362f75f56 | 12,386 | py | Python | sdk/python/pulumi_azure_native/security/security_contact.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/security/security_contact.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/security/security_contact.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 48.382813 | 429 | 0.687308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.